GPS integration

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
zerosignal
Posts: 3
Joined: Sat Jan 19, 2013 11:14 am

Re: GPS integration

Post by zerosignal »

vineetaquarius wrote:hi all this is the first time i am posting some thing on this forum , pardon me if i am over ruling this forum rule
guys please help

i have been trying to make gps works now , with different baud setting , but no luck yet

please advise what to edit

gps connections

gnd - gnd
vcc - 5 volts
gps rx - aip pro v2.0 tx2
gps tx - rx2

board

aio pro v 2.0

http://www.rctimer.com/index.php?gOo...5&productname=

gps

u-Blox CN-06 GPS Receiver V2.0

http://www.rctimer.com/index.php?gOo...3&productname=


software

multiwii 2.1


now what is the correct baud rate and wiring please some body let me know who have got it worked

do i need ubox and ftdi also ? , i read some where that there is no need to set this gps as it is already configured.

ps : i am using v2 for both board and gps

please any body


I've got a similar issue with almost identical hardware. Set the GPS module via FTDI to 115200 and 10Hz, works fine with ucenter and gets a lock right away. When i plug into multiwiiconf, i can see the compass edge blinking indicating GPS frames are being received but it never acheives a lock when plugged into the copter. None of the GPS indicators in the GUI get any values. No blinking LEDS on FC either

Anyone have some pointers as to whats going on here? Im stumped!

Hardware is good and wiring seems ok as compass blinking but no lock ever. GPS module has had config saved to EEPROM and definately retains settings across power cycles as plug back into ucenter and get a fix right away.

Any pointers greatly appreciated!

Katch
Posts: 280
Joined: Thu Aug 04, 2011 1:44 pm

Re: GPS integration

Post by Katch »

*yawn - stretch*

hey ho - just about time for me to come out of hibernation, dust of my LiPos and get flying again.

I'm a little out of touch with the GPS development but wanted to see what people think of this GPS module that has popped up on GLB;

http://www.goodluckbuy.com/ublox-6m-gps ... style.html

Image

Image

Looks like a good'un as it has a built in EEPROM and I love how easy it will be to mount.

I'm planning on stripping back one of my MEGA based FCs and using a standalone compass BoB and try and find somewhere to mount it that is well away from interference.

User avatar
dramida
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest
Contact:

Re: GPS integration

Post by dramida »

I was thinking buying this GPS( Ublox neo6M with eeprom) with this convenient shape but it costs 36 $ with the same electronics than 21$ from HK:
http://www.hobbyking.com/hobbyking/stor ... odule.html

thebgrian
Posts: 47
Joined: Sun Mar 27, 2011 4:46 am

Re: GPS integration

Post by thebgrian »

I have some problems also getting my MTK gps from Navigatron v1 to work with Multiwii on AIO. I have the GPS module disconnected from the 328 chip and using it like a pure serial GPS. All the flashes work fine when tested with the Mini GPS tool. Tried DIY Drones v.1.6 and 1.9. Using TeraTerm I can connect and get data stream at 38400 speed. The data is in the following format:
$GPGGA,182044.600,330x.xxxx,N,0965x.xxxx,W,1,7,1.09,173.8,M,-24.1,M,,*6C
$GPGSA,A,3,21,18,15,29,22,26,09,,,,,,2.02,1.09,1.70*04
$GPRMC,182044.600,A,330x.xxxx,N,0965x.xxxx,W,0.00,138.85,190113,,,A*7A
$GPVTG,138.85,T,,M,0.00,N,0.00,K,A*3A

The x-es are numbers actually.

In config.h I have Serial 2 set for 38400, GPS serial port 2 and GPS speed 38400 (which I believe doesn't matter, since we are not sending any params to the GPS module).
I have only Tx from GPS connected. For GPS protocol selected is MTK_BINARY19 and the GPS module is flashed with the ver 1.9.
Also tested with MegapirateNG on the same board and the GPS works and shows 3D fix, so the hardware looks fine.
I ran out of ideas what is wrong other than somehow the MultiWii doesn't understand the data sent from the GPS. Can somebody with similar setup give me a hint what is wrong?

User avatar
EOSBandi
Posts: 802
Joined: Sun Jun 19, 2011 11:32 am
Location: Budapest, Hungary
Contact:

Re: GPS integration

Post by EOSBandi »

thebgrian wrote:I have some problems also getting my MTK gps from Navigatron v1 to work with Multiwii on AIO. I have the GPS module disconnected from the 328 chip and using it like a pure serial GPS. All the flashes work fine when tested with the Mini GPS tool. Tried DIY Drones v.1.6 and 1.9. Using TeraTerm I can connect and get data stream at 38400 speed. The data is in the following format:
$GPGGA,182044.600,330x.xxxx,N,0965x.xxxx,W,1,7,1.09,173.8,M,-24.1,M,,*6C
$GPGSA,A,3,21,18,15,29,22,26,09,,,,,,2.02,1.09,1.70*04
$GPRMC,182044.600,A,330x.xxxx,N,0965x.xxxx,W,0.00,138.85,190113,,,A*7A
$GPVTG,138.85,T,,M,0.00,N,0.00,K,A*3A

The x-es are numbers actually.

In config.h I have Serial 2 set for 38400, GPS serial port 2 and GPS speed 38400 (which I believe doesn't matter, since we are not sending any params to the GPS module).
I have only Tx from GPS connected.
For GPS protocol selected is MTK_BINARY19 and the GPS module is flashed with the ver 1.9.
Also tested with MegapirateNG on the same board and the GPS works and shows 3D fix, so the hardware looks fine.
I ran out of ideas what is wrong other than somehow the MultiWii doesn't understand the data sent from the GPS. Can somebody with similar setup give me a hint what is wrong?

Wrong, the code initialise the GPS module, you need two way communication....

thebgrian
Posts: 47
Joined: Sun Mar 27, 2011 4:46 am

Re: GPS integration

Post by thebgrian »

Thank you, EOSBandi
Do I need to change the speed settings for Serial and GPS? Tried adding the other serial connection, but still no luck.
I did it according to the instructions at conf.h

/* GPS using a SERIAL port
only available on MEGA boards (this might be possible on 328 based boards in the future)
if enabled, define here the Arduino Serial port number and the UART speed
note: only the RX PIN is used, the GPS is not configured by multiwii
the GPS must be configured to output GGA and RMC NMEA sentences (which is generally the default conf for most GPS devices)
at least 5Hz update rate. uncomment the first line to select the GPS serial port of the arduino */

zerosignal
Posts: 3
Joined: Sat Jan 19, 2013 11:14 am

Re: GPS integration

Post by zerosignal »

Noticed in the current dev version there ia now a #define UBLOX param in config.h - could this now be why the AIO pro is not acheiving a GPS fix? Im currently running stock 2.1 where no such option exists.

Is it worth flashing current dev or is something else causing my GPS headaches?

vineetaquarius
Posts: 14
Joined: Fri Jan 18, 2013 7:25 pm

Re: GPS integration

Post by vineetaquarius »

zerosignal wrote:
vineetaquarius wrote:hi all this is the first time i am posting some thing on this forum , pardon me if i am over ruling this forum rule
guys please help

i have been trying to make gps works now , with different baud setting , but no luck yet

please advise what to edit

gps connections

gnd - gnd
vcc - 5 volts
gps rx - aip pro v2.0 tx2
gps tx - rx2

board

aio pro v 2.0

http://www.rctimer.com/index.php?gOo...5&productname=

gps

u-Blox CN-06 GPS Receiver V2.0

http://www.rctimer.com/index.php?gOo...3&productname=


software

multiwii 2.1


now what is the correct baud rate and wiring please some body let me know who have got it worked

do i need ubox and ftdi also ? , i read some where that there is no need to set this gps as it is already configured.

ps : i am using v2 for both board and gps

please any body


I've got a similar issue with almost identical hardware. Set the GPS module via FTDI to 115200 and 10Hz, works fine with ucenter and gets a lock right away. When i plug into multiwiiconf, i can see the compass edge blinking indicating GPS frames are being received but it never acheives a lock when plugged into the copter. None of the GPS indicators in the GUI get any values. No blinking LEDS on FC either

Anyone have some pointers as to whats going on here? Im stumped!

Hardware is good and wiring seems ok as compass blinking but no lock ever. GPS module has had config saved to EEPROM and definately retains settings across power cycles as plug back into ucenter and get a fix right away.

Any pointers greatly appreciated!


thankyou zerosignal ,ordered ftdi
also
can you check above my connections are ok for gps

did your problem solved .?

Mark_K
Posts: 22
Joined: Tue Oct 09, 2012 7:26 pm

Re: GPS integration

Post by Mark_K »

The RcTimer u-blox GPS that you bought defaults to 9600 baud. the GPS config options need to be set to 9600.

I use the updated GPS code that EOSBandi wrote for 2.1 (Found on this forum). That code will connect at 9600 but then change the baud rate to 57600 with a 5Hz update.

Also make sure you're wired correctly. (Default Rctimer wiring is wrong for some boards)

Vcc -> 5v, Gnd -> Gnd, Tx -> Rx, Rx -> Tx

zerosignal
Posts: 3
Joined: Sat Jan 19, 2013 11:14 am

Re: GPS integration

Post by zerosignal »

Vineetaquarius,
I think you're wired correctly. My wiring is the same using serial tx2/rx2. I think my problem is down to my version of multiwii perhaps. Im seeing the flashing compass in GUI but never pick up any sats or a fix. Using the wingui i can log out the GPS data to a file. Everything is 0 so i'm not sure multiwii is parsing the data from the GPS. With ucenter i get a lock in a couple of seconds even in my house

Will let you know how i get on. Good luck!

vineetaquarius
Posts: 14
Joined: Fri Jan 18, 2013 7:25 pm

Re: GPS integration

Post by vineetaquarius »

Mark_K wrote:The RcTimer u-blox GPS that you bought defaults to 9600 baud. the GPS config options need to be set to 9600.

I use the updated GPS code that EOSBandi wrote for 2.1 (Found on this forum). That code will connect at 9600 but then change the baud rate to 57600 with a 5Hz update.

Also make sure you're wired correctly. (Default Rctimer wiring is wrong for some boards)

Vcc -> 5v, Gnd -> Gnd, Tx -> Rx, Rx -> Tx



thanks mark

ok i have wired the same way you are telling rc to tx and tx to rx , but you see if you connect it to i2c port then you will have 1rx 1tx, 2rx 2tx, 3rx 3tx , which way to go , currently i have connected to gps rx to tx1 and gps tx to rx1 . is that right ?

second thing can you give me a link for the multiwii code 2.1 from eosbandi which you are talking about , or can you send to my mail vineet.aquarius@gmail.com , that would be very great full of you

vineetaquarius
Posts: 14
Joined: Fri Jan 18, 2013 7:25 pm

Re: GPS integration

Post by vineetaquarius »

zerosignal wrote:Vineetaquarius,
I think you're wired correctly. My wiring is the same using serial tx2/rx2. I think my problem is down to my version of multiwii perhaps. Im seeing the flashing compass in GUI but never pick up any sats or a fix. Using the wingui i can log out the GPS data to a file. Everything is 0 so i'm not sure multiwii is parsing the data from the GPS. With ucenter i get a lock in a couple of seconds even in my house

Will let you know how i get on. Good luck!




see the above post of mark

he is saying something about a version which is working fine , i am waiting for the link of that version , you should also try that , i think it is probably some thing with the multii wii version

good luck

thebgrian
Posts: 47
Joined: Sun Mar 27, 2011 4:46 am

Re: GPS integration

Post by thebgrian »

EOSBandi wrote:
thebgrian wrote:I have some problems also getting my MTK gps from Navigatron v1 to work with Multiwii on AIO. I have the GPS module disconnected from the 328 chip and using it like a pure serial GPS. All the flashes work fine when tested with the Mini GPS tool. Tried DIY Drones v.1.6 and 1.9. Using TeraTerm I can connect and get data stream at 38400 speed. The data is in the following format:
$GPGGA,182044.600,330x.xxxx,N,0965x.xxxx,W,1,7,1.09,173.8,M,-24.1,M,,*6C
$GPGSA,A,3,21,18,15,29,22,26,09,,,,,,2.02,1.09,1.70*04
$GPRMC,182044.600,A,330x.xxxx,N,0965x.xxxx,W,0.00,138.85,190113,,,A*7A
$GPVTG,138.85,T,,M,0.00,N,0.00,K,A*3A

The x-es are numbers actually.

In config.h I have Serial 2 set for 38400, GPS serial port 2 and GPS speed 38400 (which I believe doesn't matter, since we are not sending any params to the GPS module).
I have only Tx from GPS connected.
For GPS protocol selected is MTK_BINARY19 and the GPS module is flashed with the ver 1.9.
Also tested with MegapirateNG on the same board and the GPS works and shows 3D fix, so the hardware looks fine.
I ran out of ideas what is wrong other than somehow the MultiWii doesn't understand the data sent from the GPS. Can somebody with similar setup give me a hint what is wrong?

Wrong, the code initialise the GPS module, you need two way communication....

Got it finally. It is simple as expected. To have my GPS initialize I had to enable not only #define MTK_BINARY19 but also #define INIT_MTK_GPS. Pretty obvious right? :) So here are my GPS related settings for MTK ver 1.9 (it should be the same for 1.6) for AIO from Hobbyking/Crius:


#define SERIAL2_COM_SPEED 38400

#define GPS_SERIAL 2 // should be 2 for flyduino v2. It's the serial port number on arduino MEGA
#define GPS_BAUD 38400
#define MTK_BINARY19
#define INIT_MTK_GPS // initialize MTK GPS for using selected speed, 5Hz update rate and GGA & RMC sentence or binary settings

Mark_K
Posts: 22
Joined: Tue Oct 09, 2012 7:26 pm

Re: GPS integration

Post by Mark_K »

vineetaquarius wrote:ok i have wired the same way you are telling rc to tx and tx to rx , but you see if you connect it to i2c port then you will have 1rx 1tx, 2rx 2tx, 3rx 3tx , which way to go , currently i have connected to gps rx to tx1 and gps tx to rx1 . is that right ?

second thing can you give me a link for the multiwii code 2.1 from eosbandi which you are talking about , or can you send to my mail vineet.aquarius@gmail.com , that would be very great full of you


Mine is connected to serial port 2 so GPS_TX->RX2, GPS_RX->TX2 and I have these defines in my config.h in the GPS section
:
#define GPS_SERIAL 2 // should be 2 for flyduino v2. It's the serial port number on arduino MEGA
#define GPS_BAUD 57600 // It's starts as 9600 baud but then it is changed during initialization
#define GPS_RATE 200 //200ms for 5hz
#define UBLOX

And under GPS filtering I commented out the line below and added the next line after it:
// #define GPS_FILTERING // add a 5 element moving average filter to GPS coordinates, helps eliminate gps noise but adds latency comment out to disable
#define GPS_LEAD_FILTER

This is the thread where I got my revised gps.ino file. I used the modified bug fixed version of gps.ino by quadwalker on page 7:
http://www.multiwii.com/forum/viewtopic.php?f=8&t=2166&hilit=ublox


Oh, and the above assumes you are using Multiwii 2.1

User avatar
ezio
Posts: 827
Joined: Sun Apr 01, 2012 11:03 pm
Location: Paris
Contact:

Re: GPS integration

Post by ezio »

Hi
Do I have to disable #define GPS_LEAD_FILTER in multiwii conf when I use i2c GPS ? In the newest version of i2c GPS there is GPS_LEAD_FILTER already.

Bart

vineetaquarius
Posts: 14
Joined: Fri Jan 18, 2013 7:25 pm

Re: GPS integration

Post by vineetaquarius »

Mark_K wrote:
vineetaquarius wrote:ok i have wired the same way you are telling rc to tx and tx to rx , but you see if you connect it to i2c port then you will have 1rx 1tx, 2rx 2tx, 3rx 3tx , which way to go , currently i have connected to gps rx to tx1 and gps tx to rx1 . is that right ?

second thing can you give me a link for the multiwii code 2.1 from eosbandi which you are talking about , or can you send to my mail vineet.aquarius@gmail.com , that would be very great full of you


Mine is connected to serial port 2 so GPS_TX->RX2, GPS_RX->TX2 and I have these defines in my config.h in the GPS section
:
#define GPS_SERIAL 2 // should be 2 for flyduino v2. It's the serial port number on arduino MEGA
#define GPS_BAUD 57600 // It's starts as 9600 baud but then it is changed during initialization
#define GPS_RATE 200 //200ms for 5hz
#define UBLOX

And under GPS filtering I commented out the line below and added the next line after it:
// #define GPS_FILTERING // add a 5 element moving average filter to GPS coordinates, helps eliminate gps noise but adds latency comment out to disable
#define GPS_LEAD_FILTER

This is the thread where I got my revised gps.ino file. I used the modified bug fixed version of gps.ino by quadwalker on page 7:
http://www.multiwii.com/forum/viewtopic.php?f=8&t=2166&hilit=ublox


Oh, and the above assumes you are using Multiwii 2.1




thankyou for that all

but i need a gps settings for multiwii 2.1 i am using ublox 6 gps which has 9600 bud rate as default

Mark_K
Posts: 22
Joined: Tue Oct 09, 2012 7:26 pm

Re: GPS integration

Post by Mark_K »

Correct. The above code works with the default 9600 baud rate. On each initialization, it changes the GPS speed from 9600 baud to 57600 baud (and the update rate to 5 hertz).

vineetaquarius
Posts: 14
Joined: Fri Jan 18, 2013 7:25 pm

Re: GPS integration

Post by vineetaquarius »

Mark_K wrote:Correct. The above code works with the default 9600 baud rate. On each initialization, it changes the GPS speed from 9600 baud to 57600 baud (and the update rate to 5 hertz).



i cannot find this code in config.h

#define GPS_RATE 200 //200ms for 5hz


should i write it like that only below baud rate .

Mark_K
Posts: 22
Joined: Tue Oct 09, 2012 7:26 pm

Re: GPS integration

Post by Mark_K »

vineetaquarius wrote:i cannot find this code in config.h

#define GPS_RATE 200 //200ms for 5hz


should i write it like that only below baud rate .


Yes. This is assuming that you are using quadwalker's gps.ino file.

vineetaquarius
Posts: 14
Joined: Fri Jan 18, 2013 7:25 pm

Re: GPS integration

Post by vineetaquarius »

Mark_K wrote:
vineetaquarius wrote:i cannot find this code in config.h

#define GPS_RATE 200 //200ms for 5hz


should i write it like that only below baud rate .


Yes. This is assuming that you are using quadwalker's gps.ino file.



i am using multiwi 2 .1 aiop files i think

Mark_K
Posts: 22
Joined: Tue Oct 09, 2012 7:26 pm

Re: GPS integration

Post by Mark_K »

You need to use the gps.ino file found in the above thread that I linked. Ideally quadwalker's version.

vineetaquarius
Posts: 14
Joined: Fri Jan 18, 2013 7:25 pm

Re: GPS integration

Post by vineetaquarius »

Mark_K wrote:You need to use the gps.ino file found in the above thread that I linked. Ideally quadwalker's version.



ok mark now i got it

i went to your thread and i found an attached gps.ino file (the post was from mr osibandi) ,
i did not read the whole thread as the things were bouncing over my head



now i have to do these things correct me if i am wrong

replace the gps.ino file older one found in MultiWii_2_1_AIOP and then
i have to edit under config.h or default.h this code


#define GPS_SERIAL 2 // should be 2 for flyduino v2. It's the serial port number on arduino MEGA
#define GPS_BAUD 57600 // It's starts as 9600 baud but then it is changed during initialization
#define GPS_RATE 200 //200ms for 5hz
#define UBLOX


upload it on my board

connect the gps with i2c tx2 ,rx2

done

ps; i know it is noob type thing but actually learning where goes what

Mark_K
Posts: 22
Joined: Tue Oct 09, 2012 7:26 pm

Re: GPS integration

Post by Mark_K »

I would have used the gps file on page 7 from quadwalker.. But the one you grabbed should be okay.

It looks good. Good luck.

vineetaquarius
Posts: 14
Joined: Fri Jan 18, 2013 7:25 pm

Re: GPS integration

Post by vineetaquarius »

Mark_K wrote:I would have used the gps file on page 7 from quadwalker.. But the one you grabbed should be okay.

It looks good. Good luck.


ok mark nothing happened, i used both ,even from the page seven (gps.ino file)

please see this video and let me know if i am doing everything right or wrong,also i am sitting in a room which has a room over i know gps donot work here but will it show some signs of connection done with the board ?

you will get to know when you will see video probably

software installation

http://www.youtube.com/watch?v=FbqjvIDT ... e=youtu.be


lights on aio pro please check are they working properly or not

http://www.youtube.com/watch?v=G6vBm0Ft ... e=youtu.be


please help

User avatar
EOSBandi
Posts: 802
Joined: Sun Jun 19, 2011 11:32 am
Location: Budapest, Hungary
Contact:

Re: GPS integration

Post by EOSBandi »

Please forget that old patched gps.ino.... download the latest dev and try that....

Mark_K
Posts: 22
Joined: Tue Oct 09, 2012 7:26 pm

Re: GPS integration

Post by Mark_K »

Okay, this is my fault. I was assuming you were using a normal serial port and not an i2c port. I missed that important detail.

So my above instructions won't work. :oops:

I'm not familiar with connecting a gps to your i2c port. You may (I don't really know) need this board:
http://rctimer.com/index.php?gOo=goods_details.dwt&goodsid=762&productname=

From a quick google, you may also need to load ucenter software and buy a FTDI <-> usb interface cable so ucenter can permanently set the GPS baudrate to 115200 (RCTimer says this is required)

Sorry about misleading you.

vineetaquarius
Posts: 14
Joined: Fri Jan 18, 2013 7:25 pm

Re: GPS integration

Post by vineetaquarius »

EOSBandi wrote:Please forget that old patched gps.ino.... download the latest dev and try that....



hello mr eosbandi

as you can see i do not know where i can get this new dev
could you give me a link

also
my setup it

aio pro v2
ublox 6 gps connecting fromi2c

please tell me do i have to play with ublox software also for gps working or
is there is any file which i can just put on my aio pro via ardino and connect gps ,then it starts working

please tell me

Mark_K
Posts: 22
Joined: Tue Oct 09, 2012 7:26 pm

Re: GPS integration

Post by Mark_K »

EOSBandi -

On your above recommendation, I upgraded my multiwii software from 2.1 to the current development version. I noticed that the gps.ino file is configured for Europe and EGNOS. I updated the U-BLOX config code to support US and WAAS. I basically commented out the EGNOS line and added the equivalent WAAS line.

Code: Select all

//     0xB5,0x62,0x06,0x16,0x08,0x00,0x03,0x07,0x03,0x00,0x51,0x08,0x00,0x00,0x8A,0x41,   //set SBAS to EGNOS
     0xB5,0x62,0x06,0x16,0x08,0x00,0x01,0x07,0x03,0x00,0x00,0xA0,0x04,0x00,0xD3,0xBD,   //set SBAS to WAAS (PRN 138,135,133)


I'm pretty sure the above is correct.

User avatar
EOSBandi
Posts: 802
Joined: Sun Jun 19, 2011 11:32 am
Location: Budapest, Hungary
Contact:

GPS integration

Post by EOSBandi »

Mark_K wrote:EOSBandi -

On your above recommendation, I upgraded my multiwii software from 2.1 to the current development version. I noticed that the gps.ino file is configured for Europe and EGNOS. I updated the U-BLOX config code to support US and WAAS. I basically commented out the EGNOS line and added the equivalent WAAS line.

Code: Select all

//     0xB5,0x62,0x06,0x16,0x08,0x00,0x03,0x07,0x03,0x00,0x51,0x08,0x00,0x00,0x8A,0x41,   //set SBAS to EGNOS
     0xB5,0x62,0x06,0x16,0x08,0x00,0x01,0x07,0x03,0x00,0x00,0xA0,0x04,0x00,0xD3,0xBD,   //set SBAS to WAAS (PRN 138,135,133)


I'm pretty sure the above is correct.

yes it is correct.

User avatar
EOSBandi
Posts: 802
Joined: Sun Jun 19, 2011 11:32 am
Location: Budapest, Hungary
Contact:

GPS integration

Post by EOSBandi »

vineetaquarius wrote:
EOSBandi wrote:Please forget that old patched gps.ino.... download the latest dev and try that....



hello mr eosbandi

as you can see i do not know where i can get this new dev
could you give me a link

also
my setup it

aio pro v2
ublox 6 gps connecting fromi2c

please tell me do i have to play with ublox software also for gps working or
is there is any file which i can just put on my aio pro via ardino and connect gps ,then it starts working

please tell me

exactly whch gps do u have? could you send a link ?

vineetaquarius
Posts: 14
Joined: Fri Jan 18, 2013 7:25 pm

Re: GPS integration

Post by vineetaquarius »

EOSBandi wrote:
vineetaquarius wrote:
EOSBandi wrote:Please forget that old patched gps.ino.... download the latest dev and try that....



hello mr eosbandi

as you can see i do not know where i can get this new dev
could you give me a link

also
my setup it

aio pro v2
ublox 6 gps connecting fromi2c

please tell me do i have to play with ublox software also for gps working or
is there is any file which i can just put on my aio pro via ardino and connect gps ,then it starts working

please tell me

exactly whch gps do u have? could you send a link ?


here is my hardware

board
http://www.rctimer.com/index.php?gOo=go ... oductname=

gps

http://www.rctimer.com/index.php?gOo=go ... oductname=

bt
http://www.rctimer.com/index.php?gOo=go ... oductname=

Mark_K
Posts: 22
Joined: Tue Oct 09, 2012 7:26 pm

Re: GPS integration

Post by Mark_K »

Vin, I watched your video again, you do have the gps connect to your serial ports. (Not the i2c port) That's good! The video is too blurry to tell how it's wired. You obviously have vcc and gnd wired correctly (gps green light). I can't tell if the tx, rx ports are hooked right.

I would take it outside and let it see the sky for 15 min. With the version you loaded, it should have 1 led that is fast blinking (5hz blink) if it finds the sats and gets a lock.
Last edited by Mark_K on Sat Jan 26, 2013 8:11 pm, edited 1 time in total.

Mark_K
Posts: 22
Joined: Tue Oct 09, 2012 7:26 pm

Re: GPS integration

Post by Mark_K »

Oh and majoo reminded me I forgot to tell you this: (Add the red lines to multiwii.ino right after the #if defined (GPS_SERIAL)...)

Remember, this procedure is only valid for Multiwii 2.1. The development code version of Multiwii is setup up differently.

EOSBandi wrote:Plus add the initialisation to the main file multiwii.ino:

#if defined(GPS_SERIAL)

#if defined(UBLOX)
UBLOX_init();
delay(200);
#endif

#if defined(MTK)
MTK_init();
delay(200);
#endif


SerialOpen(GPS_SERIAL,GPS_BAUD);

For UBLOX and MTK the GPS_BAUD must be 57600

vineetaquarius
Posts: 14
Joined: Fri Jan 18, 2013 7:25 pm

Re: GPS integration

Post by vineetaquarius »

Mark_K wrote:Oh and majoo reminded me I forgot to tell you this: (Add the red lines to multiwii.ino right after the #if defined (GPS_SERIAL)...)

Remember, this procedure is only valid for Multiwii 2.1. The development code version of Multiwii is setup up differently.

EOSBandi wrote:Plus add the initialisation to the main file multiwii.ino:

#if defined(GPS_SERIAL)

#if defined(UBLOX)
UBLOX_init();
delay(200);
#endif

#if defined(MTK)
MTK_init();
delay(200);
#endif


SerialOpen(GPS_SERIAL,GPS_BAUD);

For UBLOX and MTK the GPS_BAUD must be 57600



in gps.ino i found this thing more than 4 times " #if defined(GPS_SERIAL)"

but only at one place there was some thing gps written under this header file so i just pasted that thing below that, i think that should be ok,

yes you are right i am not connecting it to i2c port , i did not notice that earlier , i was in a myth that i am using i2c


regarding connections

i did rx gps = tx2 aio pro
tx gps = rs2 aio pro

i will test it now for 15 minutes under open sky, let see what happen

i will also make a more good video for it today .

Mark_K
Posts: 22
Joined: Tue Oct 09, 2012 7:26 pm

Re: GPS integration

Post by Mark_K »

vineetaquarius wrote:in gps.ino i found this thing more than 4 times " #if defined(GPS_SERIAL)"


No, no, no...

The lines need to be put in the --> Multiwii.ino <-- (Or similarly named file) It's the one the sketch is named after..

vineetaquarius
Posts: 14
Joined: Fri Jan 18, 2013 7:25 pm

Re: GPS integration

Post by vineetaquarius »

ok mark

sorry i accidentally put the code in red color some where in gps.ino in palace of multiwii.ino

and you know what it started my gps and i can see the exact location on map, big red and big green lights are blinking very fast .

and today when i corrected my self i already found these code lines under "#if defined(GPS_SERIAL)" in multiwii.ino

and when i am deleting the red code lines from gps.ino ,then no gps

tell me what to do

Mark_K
Posts: 22
Joined: Tue Oct 09, 2012 7:26 pm

Re: GPS integration

Post by Mark_K »

I don't know. Sounds like you messed up modifying the code.

vineetaquarius
Posts: 14
Joined: Fri Jan 18, 2013 7:25 pm

Re: GPS integration

Post by vineetaquarius »

to run the gps we have to connect board to external power , can we connect it at same time with usb with external powered on boards to check the gps connection with the usb cable .

User avatar
JayBee
Posts: 12
Joined: Tue Mar 13, 2012 9:33 pm
Location: Bremerhaven (Germany)

Re: GPS integration

Post by JayBee »

EOSBandi wrote:Hi Folks,

i2c-gps-nav v2.2beta1 is just released for testing!
you can get it from : http://code.google.com/p/i2c-gps-nav/downloads/list

New features :
MTK Binary protocol 1.9 (from DIYDrones)
UBLOX init
MTK init
Lead predictive filtering (updated)
SONAR handling (See config.h for more info)

This is the first beta release, is sould work with MW 2.1 and recent devs BUT there will be some upcoming fixes which will impact data structures so the final I2C-V2.2 release will work only with MW 2.2 (or a TBD revision from SVN)

Disclaimer : Since I don't see a penny from third party manufacturers i2cgps board versions, i cannot provide support for such boards. The primary supported platform for I2C-GPS-NAV is a pure vanilia arduino mini or nano with direcly attached GPS and sonar modules.


Hello EOSBandi,

I have a little problem with the SONAR handling.
When my HC-SR04 module get no echo from the sending pulses (distance to high for example) there`s no timeout at the Echo pin (from 38 ms like it should be in original module data sheet).
So the echo pin stays high until the module will be (re)triggered.
The Sonar_update will be only send a new trigger signal if the Sonar_waiting_echo flag was cleared by a falling edge at the echo pin => a deadlock situation has occurred.
The easiest solution is to deactivate the Sonar_waiting_echo flag. So the blink_sonar_update, which calls the Sonar_update every 50 ms, will handle the timeout automatically.


JayBee

User avatar
EOSBandi
Posts: 802
Joined: Sun Jun 19, 2011 11:32 am
Location: Budapest, Hungary
Contact:

Re: GPS integration

Post by EOSBandi »

JayBee wrote:
EOSBandi wrote:Hi Folks,

i2c-gps-nav v2.2beta1 is just released for testing!
you can get it from : http://code.google.com/p/i2c-gps-nav/downloads/list

New features :
MTK Binary protocol 1.9 (from DIYDrones)
UBLOX init
MTK init
Lead predictive filtering (updated)
SONAR handling (See config.h for more info)

This is the first beta release, is sould work with MW 2.1 and recent devs BUT there will be some upcoming fixes which will impact data structures so the final I2C-V2.2 release will work only with MW 2.2 (or a TBD revision from SVN)

Disclaimer : Since I don't see a penny from third party manufacturers i2cgps board versions, i cannot provide support for such boards. The primary supported platform for I2C-GPS-NAV is a pure vanilia arduino mini or nano with direcly attached GPS and sonar modules.


Hello EOSBandi,

I have a little problem with the SONAR handling.
When my HC-SR04 module get no echo from the sending pulses (distance to high for example) there`s no timeout at the Echo pin (from 38 ms like it should be in original module data sheet).
So the echo pin stays high until the module will be (re)triggered.
The Sonar_update will be only send a new trigger signal if the Sonar_waiting_echo flag was cleared by a falling edge at the echo pin => a deadlock situation has occurred.
The easiest solution is to deactivate the Sonar_waiting_echo flag. So the blink_sonar_update, which calls the Sonar_update every 50 ms, will handle the timeout automatically.


JayBee


Thanks for catching it... will update the repo soon... but first I have to finish my cinestar 8 build... i suppose it will be the first MultiWii powered cinestar :D

User avatar
dramida
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest
Contact:

Re: GPS integration

Post by dramida »

:) i won't be so shure :) anyway it works great with 14 inch props and 320 KV motors
Last edited by dramida on Wed Jan 30, 2013 11:22 pm, edited 1 time in total.

User avatar
EOSBandi
Posts: 802
Joined: Sun Jun 19, 2011 11:32 am
Location: Budapest, Hungary
Contact:

Re: GPS integration

Post by EOSBandi »

dramida wrote::) i won't be so shure :)

then i would say, in Hungary... :d

User avatar
Crashpilot1000
Posts: 631
Joined: Tue Apr 03, 2012 7:38 pm

Re: GPS integration

Post by Crashpilot1000 »

Thanks for catching it... will update the repo soon... but first I have to finish my cinestar 8 build... i suppose it will be the first MultiWii powered cinestar :D

Hi, Eos!
Why not, at least mwii is more relieable than most other platforms. You will have no fly-aways :) .
Right now I am doing some serious copy/paste action with your current mwii gps code (http://code.google.com/p/multiwii/sourc ... 321&r=1321) and the naze32/baseflight soft :). By doing this i stumbled across a few things.
- The GPS_calc_nav_rate function now deals with unsigned int16 (before: GPS_calc_nav_rate(int16_t max_speed); now: GPS_calc_nav_rate(uint16_t max_speed)) but the "speed" variable in the main gps loop is still a signed int16. Is that correct or a possible source of problems?
- The naze could do "double" floats, do you have a part of your gps code in mind, wich could benefit from that?

Cheers

Kraut Rob

User avatar
EOSBandi
Posts: 802
Joined: Sun Jun 19, 2011 11:32 am
Location: Budapest, Hungary
Contact:

Re: GPS integration

Post by EOSBandi »

Crashpilot1000 wrote:
Thanks for catching it... will update the repo soon... but first I have to finish my cinestar 8 build... i suppose it will be the first MultiWii powered cinestar :D

Hi, Eos!
Why not, at least mwii is more relieable than most other platforms. You will have no fly-aways :) .
Right now I am doing some serious copy/paste action with your current mwii gps code (http://code.google.com/p/multiwii/sourc ... 321&r=1321) and the naze32/baseflight soft :). By doing this i stumbled across a few things.
- The GPS_calc_nav_rate function now deals with unsigned int16 (before: GPS_calc_nav_rate(int16_t max_speed); now: GPS_calc_nav_rate(uint16_t max_speed)) but the "speed" variable in the main gps loop is still a signed int16. Is that correct or a possible source of problems?
- The naze could do "double" floats, do you have a part of your gps code in mind, wich could benefit from that?

Cheers

Kraut Rob

The speed in this case is the desired speed, which could be only positive, so uint is OK, and mixing int and uint does not cause any harm, however it is more professional if we clean this up :D
EOS

User avatar
JayBee
Posts: 12
Joined: Tue Mar 13, 2012 9:33 pm
Location: Bremerhaven (Germany)

Re: GPS integration

Post by JayBee »

Hi EOSBandi,

at the moment I try to integrate the i2c-gps-nav project with a GTop PA6B module.
During integration I have found two problems:

1.
For the first step I want to use the nmea mode for the MTK Chip, means I use the defines NMEA and INIT_MTK_GPS.
But the system never got a new dataset because the it found no gps3dfix.
For a gps3dfix a GPGSA_FRAME is necessary but inside the GPS_SerialInit() function you will find the following initialization:

Code: Select all

...
#elif defined(INIT_MTK_GPS)                            // MTK GPS setup
...
      #if defined(NMEA)
        Serial.write(MTK_SET_NMEA_SENTENCES); // only GGA and RMC sentence
      #endif     
...
#endif

With this initialization the gps module only sends CGA and RMC frames.
After I delete this initialization, the i2c-gps-nav module works correctly.

2.
The status led has the following blink codes:
Timeout: blinking with 0.5 Hz
gps3dfix found: three blink pulses every second
gps2dfix found: two blink pulses every second
no fix found: one blink pulse every second

But the timeout mode will be leaved only if the lastframe_time value was be updated within the last five seconds.
That's the problem, the lastframe_time will be only updated after founding a gps3dfix with at least five satellites.
I think the update should be placed before asking for the gps3dfix:

Code: Select all

...
       lastframe_time = millis();
       if ((i2c_dataset.status.gps3dfix == 1) && i2c_dataset.status.numsats >= 5) {
...


So you are able to see all four blink codes :D .


JayBee

User avatar
Crashpilot1000
Posts: 631
Joined: Tue Apr 03, 2012 7:38 pm

Re: GPS integration

Post by Crashpilot1000 »

Hi, i need some help understanding the gps code!
In this part of the gps.ino the distance and bearing between 2 GPS points is calculated:

Code: Select all

////////////////////////////////////////////////////////////////////////////////////
// Get distance between two points in cm
// Get bearing from pos1 to pos2, returns an 1deg = 100 precision
void GPS_distance_cm_bearing(int32_t* lat1, int32_t* lon1, int32_t* lat2, int32_t* lon2,uint32_t* dist, int32_t* bearing) {
  float dLat = *lat2 - *lat1;                                    // difference of latitude in 1/10 000 000 degrees
  float dLon = (float)(*lon2 - *lon1) * GPS_scaleLonDown;
  *dist = sqrt(sq(dLat) + sq(dLon)) * 1.113195;
 
  *bearing = 9000.0f + atan2(-dLat, dLon) * 5729.57795f;      //Convert the output redians to 100xdeg
  if (*bearing < 0) *bearing += 36000;
}

The distance/Pythagoras thing might be ok (1.113195f should be 1.11194940f according to this: http://www.movable-type.co.uk/scripts/latlong.html it should be the average earth radius pi/180 * 637100078,5/ 10^7) but I am lost with the bearing. atan2 is fed with pure gps difference in degrees*10^7 and puts out rad, it is then converted back to degree by PI/180. Than a magic +90 degree comes in to play to correct things (i omitted the *100 factor in my description). My poor brain can not assimilate this. Could the whole stuff be done in rads, perhaps the +90 deg wouldn't be necessary as well? Please help me!

Greetings
Kraut Rob

alexia
Posts: 85
Joined: Sun Jun 17, 2012 10:23 pm
Contact:

Re: GPS integration

Post by alexia »

i neeed you help
this thread is so big so it s difficult to find everything..
i have crius aio pro and crius v2 gps
i am going to upload latest dev

http://code.google.com/p/multiwii/downl ... p&can=2&q=

could you help me to comment the right thing for my gps
does i need to change my baud rate?
i hope you could help me

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: GPS integration

Post by scrat »

alexia wrote:i neeed you help
this thread is so big so it s difficult to find everything..
i have crius aio pro and crius v2 gps
i am going to upload latest dev

http://code.google.com/p/multiwii/downl ... p&can=2&q=

could you help me to comment the right thing for my gps
does i need to change my baud rate?
i hope you could help me


Try this post: viewtopic.php?f=8&t=2166&start=130

alexia
Posts: 85
Joined: Sun Jun 17, 2012 10:23 pm
Contact:

Re: GPS integration

Post by alexia »

thanks a lot scrat

gabe
Posts: 5
Joined: Fri Jun 29, 2012 10:27 pm

Re: GPS integration

Post by gabe »

Hi guys,

Im using this i2c GPS board with NMEA protocol:
http://www.drotek.fr/shop/fr/88-i2c-gps-pa6c-llc.html

Would it be more efficient to use it with MTK binary 19 protocol?
This GPS board is based on PA6C chip. Can I update it with the Dec 28th 2012 firmware?
http://code.google.com/p/i2c-gps-nav/downloads/detail?name=AXN1.51_2776_3329_384.1151100.5_v19.bin&can=2&q=

It seems this firmware is built for PA6B chipset.
I haven't found a firmware update tutorial. O you have an idea where I could find the procedure?

Many thanks!

Post Reply