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
rbirdie001
Posts: 178
Joined: Fri Apr 01, 2011 10:32 pm
Location: Czech Republic, Prague

Re: GPS integration

Post by rbirdie001 »

Hi to all, especially EOSBandi,
few observations and questions after flashing r33.
I have tricopter with Crius SE board and I2C GPS (Mediatek 10Hz module on the arduino). Previously running MWC 2.0 and I2C GPS initial version (slightly modified to send GPS configuration strings) without problems.
I first flashed I2C module with the I2C version bundled with r33, just modified to my GPS (initial speed 38400, PMTK strings to 10Hz @ 115200), no change in it's config. This worked (at least on GUI) with MWC2.0, I got GPS fix blinking on FC and at least 4 SATS on GUI (just limited view from my balcony).
Then I flashed r33 into MWC FC (I'm not sure if I set everything OK in the config) and observed the following:
1) sensors values OK on the GUI, GPS box green like detected, but no GPS fix (could be limited view to sky, but I don't think so...) Will test tomorrow outside.
2) always I get 19 errors on I2C on the GUI - previously I got NEVER an error.
3) GUI application on my notebook (Win XP 32, with bluetooth) is starting very slowly (just empty white windows for the first 20 seconds after starting the application. (I had similar behaviour sometime in times of MWC1.6 and that was corrected by nuw rxtxserial.dll) Connection MWC to notebook via bluetooth.
Any ideas what to check? (Sorry, I'm not programmer, only an user... :) )
I'm attaching my config for the reference.
Big thanks to EOSBandi and all others for the big effort!!! :!:
Roman
EDIT: Bathroom idea at 1AM: I'm using twi library from the time of initial I2C GPS release some months ago - not upgraded now. Are there any recent changes? Will test to replace with r33 bundled version tomorrow.
Attachments
config.zip
My config fo r33. Is it correct?
(13.25 KiB) Downloaded 221 times
Last edited by rbirdie001 on Tue May 22, 2012 12:05 am, edited 2 times in total.

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: GPS integration

Post by Alexinparis »

Hi,
This thread is moving so fast, with a lot of improvements !
I think it's time to merge something :)
To ease things integrating the serial part: I would like to gather all "non shared" variables and functions into the GPS.pde file, including the PI & PID classes (in order to optimize them and get rid later of C++ style ;) )

Digging a little into the algorithm code:
- lat & lon speed is the result of a computation.
I noticed NMEA RMC frame has 2 interesting variables: GPS_speed and GPS ground course.
I don't know if it's the result of an internal averaging or if it's the result of direct GPS computation (using Doppler resultant)
But don't you think we could use them to have a more accurate lat & lon speed ?

I noticed also there is the Magnetic Variation variable in the RMC frame, witch is equivalent to the magnetic declination according to wiki.
We could maybe use it if available instead of defining a static declination.

frog32
Posts: 55
Joined: Sun Nov 20, 2011 9:39 pm

Re: GPS integration

Post by frog32 »

as far as i knew, the speed should be calculated with the doppler shift. because a gps already has to compensate the doppler to be able receive any signals. without compensating the doppler you only receive the satellites which are near the zenith because then the movement of the satellite would be tangential. i hope the things that i remember from my mobile communication study are not too outdated.

marc

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

Re: GPS integration

Post by EOSBandi »

Alexinparis wrote:Hi,
This thread is moving so fast, with a lot of improvements !
I think it's time to merge something :)
To ease things integrating the serial part: I would like to gather all "non shared" variables and functions into the GPS.pde file, including the PI & PID classes (in order to optimize them and get rid later of C++ style ;) )

Digging a little into the algorithm code:
- lat & lon speed is the result of a computation.
I noticed NMEA RMC frame has 2 interesting variables: GPS_speed and GPS ground course.
I don't know if it's the result of an internal averaging or if it's the result of direct GPS computation (using Doppler resultant)
But don't you think we could use them to have a more accurate lat & lon speed ?

I noticed also there is the Magnetic Variation variable in the RMC frame, witch is equivalent to the magnetic declination according to wiki.
We could maybe use it if available instead of defining a static declination.



As I know the GPS speed is a simple 2d calculation based on the lat and lon meassurements, and it's not really precise below 1m/s (this is same for gps-bearing). For the calculations we need x and y speed, and if gps speed is used to calculate x-y speed it's one sin and one cos instead of the couple of substractions and multiplications..

Magnetic variation is indeed part of the RMC frame, but only nautical gps units outputting it. Standard embedded modules are not populating this field...there is an algorithm to calculate it from lat/lon coordinates, but the memory footprint for that is aroung 3K, which is not affordable on small FC's

I agree on moving all non common variables and defines to the gps.ino file.

I really don't wan to start a debate about it, but is there any particular reason why shouldn't we use C++ libs? The PID and PI libraries are quite straigthforward, and using them has too basic advantages.
1. it makes code clearer and understandable, and more coding error prone.
2. They are easy to implement and change.

I would stick with those classes unless it's absolutely neccessary to "convert" them into C code.

Andras

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

Re: GPS integration

Post by Katch »

Does anyone happen to have a MT3329 115200 @ 10hz firmware file to hand?

I'm being guinea pig messing around with firmware on that cheap MT3329 I posted back a page or 2. So far managed to update it to DIYDrones 1.6 firmware (which they claim only works on their module lol) and a 10hz 38400 firmware intended for the FMP04 - both worked fine.

For ease of dev I'd like to load up a 115200 10hz firmware.

I'll add my notes to the flashing process thread in a minute.

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

Re: GPS integration

Post by EOSBandi »

rbirdie001 wrote:Hi to all, especially EOSBandi,
few observations and questions after flashing r33.
I have tricopter with Crius SE board and I2C GPS (Mediatek 10Hz module on the arduino). Previously running MWC 2.0 and I2C GPS initial version (slightly modified to send GPS configuration strings) without problems.
I first flashed I2C module with the I2C version bundled with r33, just modified to my GPS (initial speed 38400, PMTK strings to 10Hz @ 115200), no change in it's config. This worked (at least on GUI) with MWC2.0, I got GPS fix blinking on FC and at least 4 SATS on GUI (just limited view from my balcony).
Then I flashed r33 into MWC FC (I'm not sure if I set everything OK in the config) and observed the following:
1) sensors values OK on the GUI, GPS box green like detected, but no GPS fix (could be limited view to sky, but I don't think so...) Will test tomorrow outside.

Is the gray area arounf bearing indicator blinking on GUI ? If yes, then you ot NMEA frames but does not got fix... How is the status led on the arduino connected to the gps is blinking ?
2) always I get 19 errors on I2C on the GUI - previously I got NEVER an error.


If you added some delay at startup for setting GPS speed and update rate in the i2c_gps code, it's possible that the FC starts earlier and tries to set parameters on the i2c_gps... add the same amount of startup delay into multiwii code...(It seems I have to add OK status indicator and a i2c_gps_init function.....

3) GUI application on my notebook (Win XP 32, with bluetooth) is starting very slowly (just empty white windows for the first 20 seconds after starting the application. (I had similar behaviour sometime in times of MWC1.6 and that was corrected by nuw rxtxserial.dll) Connection MWC to notebook via bluetooth.


Well, I not really an expert with MultiWiiGUI, perhaps you can try recompile it on your own config... (also try to update JRE to the latest, if it's supported on XP)

Any ideas what to check? (Sorry, I'm not programmer, only an user... :) )
I'm attaching my config for the reference.
Big thanks to EOSBandi and all others for the big effort!!! :!:
Roman
EDIT: Bathroom idea at 1AM: I'm using twi library from the time of initial I2C GPS release some months ago - not upgraded now. Are there any recent changes? Will test to replace with r33 bundled version tomorrow.

TWI patch did not changed since initial I2C_GPS release.
Last edited by EOSBandi on Tue May 22, 2012 2:26 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 »

Katch wrote:Does anyone happen to have a MT3329 115200 @ 10hz firmware file to hand?

I'm being guinea pig messing around with firmware on that cheap MT3329 I posted back a page or 2. So far managed to update it to DIYDrones 1.6 firmware (which they claim only works on their module lol) and a 10hz 38400 firmware intended for the FMP04 - both worked fine.

For ease of dev I'd like to load up a 115200 10hz firmware.

I'll add my notes to the flashing process thread in a minute.

I just added it to the downloads section.... http://code.google.com/p/i2c-gps-nav/downloads/list

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

Re: GPS integration

Post by Katch »

EOSBandi wrote:
Katch wrote:Does anyone happen to have a MT3329 115200 @ 10hz firmware file to hand?

I'm being guinea pig messing around with firmware on that cheap MT3329 I posted back a page or 2. So far managed to update it to DIYDrones 1.6 firmware (which they claim only works on their module lol) and a 10hz 38400 firmware intended for the FMP04 - both worked fine.

For ease of dev I'd like to load up a 115200 10hz firmware.

I'll add my notes to the flashing process thread in a minute.

I just added it to the downloads section.... http://code.google.com/p/i2c-gps-nav/downloads/list


is the firmware confirmed coz there's a mislabelled 115200 5hz firmware floating around claiming to be 10hz

edit - confirmed

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

Re: GPS integration

Post by EOSBandi »

Flash it, then use MiniGPS to set your parameters (GPS frames, update rate, WaaS) and save them to the GPS flash memory (on the Test tab, press shift+ctrl+S to get additional tabs in MiniGPS tool) :D yo have 8 slots to save... Note that Waas could be used only with 5Hz update rate....

Tazzy
Posts: 75
Joined: Sun Jun 19, 2011 4:45 pm
Location: Sweden

Re: GPS integration

Post by Tazzy »

Wohoo r33 version suddenly works to fly after 10 tries and reflash , with my standard values and I2C GPS (Fmp04 flashed to 10Hz and 115200 on a arduino) but it is to gusty winds to try the gps functions right now.
So answer on my own question in this tree is: Yes it use almost the same pids ;)
I have found some strange behavior with the win java config tool and this r33 version, sometimes when i write to arduino it will stop responding i can reboot both the computer and the arduino without to get any connection again.
It activates and fly as it should, but i need to reflash it to get connection again.

Thanks all ppl that works with this wonderful project !!

// Tazz

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

Re: GPS integration

Post by Katch »

EOSBandi wrote:Flash it, then use MiniGPS to set your parameters (GPS frames, update rate, WaaS) and save them to the GPS flash memory (on the Test tab, press shift+ctrl+S to get additional tabs in MiniGPS tool) :D yo have 8 slots to save... Note that Waas could be used only with 5Hz update rate....



Just flashed the 10hz 115200 firmware you linked to on 2 devices. It is what it says it is.

I have updated a generic MT3329 breakout board and my Navigtron I2C GPS board. To update the Navigtron you have to upload a blank blink sketch to the arduino then connect a usb serial device to 5v gnd and Rx / TX (Rx/Tx must be crossed)

I used the Powerflash tool that DIYDrones provides rather than the Flashtool in the repo.

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

Re: GPS integration

Post by EOSBandi »

The tool in the repo is from the DIYdrones site :D
Blink sketch is a very good idea, i cut the traces from adruino to gps to allow flashing,.. but the blink sketch will do just fine :D

KeesvR
Posts: 194
Joined: Fri May 27, 2011 6:51 pm
Location: The Netherlands

Re: GPS integration

Post by KeesvR »

EOSBandi wrote:
KeesvR wrote:Hi EosBandi, could you include a text file with instructions. There have bin a lot of questions answered in this topic, but its not easy to find these back because this topic is growing fast.

As I read here you've made a lot of improvement, I hope I can find some time soon to test these things.

Thanks a lot for your hard work on this.


I'm working on the documentation, at this moment... stay tuned.


I should have known that :mrgreen:

Thanks a lot.

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

Re: GPS integration

Post by Katch »

EOSBandi wrote:The tool in the repo is from the DIYdrones site :D
Blink sketch is a very good idea, i cut the traces from adruino to gps to allow flashing,.. but the blink sketch will do just fine :D


Always able to find a hard way lol - the first time I flashed I soldered jumper wires directly onto the gps module not realising they were connected to the FTDI RX and Tx - sometimes I'm dim lol.

User avatar
Gaijin
Posts: 82
Joined: Sat Jan 14, 2012 8:00 am

Re: GPS integration

Post by Gaijin »

Katch wrote:
EOSBandi wrote:Flash it, then use MiniGPS to set your parameters (GPS frames, update rate, WaaS) and save them to the GPS flash memory (on the Test tab, press shift+ctrl+S to get additional tabs in MiniGPS tool) :D yo have 8 slots to save... Note that Waas could be used only with 5Hz update rate....



Just flashed the 10hz 115200 firmware you linked to on 2 devices. It is what it says it is.

I have updated a generic MT3329 breakout board and my Navigtron I2C GPS board. To update the Navigtron you have to upload a blank blink sketch to the arduino then connect a usb serial device to 5v gnd and Rx / TX (Rx/Tx must be crossed)

I used the Powerflash tool that DIYDrones provides rather than the Flashtool in the repo.


Wait a minute, what settings are my Navigatron at by default?

I assumed it was already set to output 10hz etc

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

Re: GPS integration

Post by EOSBandi »

Nay, it's 9600bps, 1hz....

didlawowo69
Posts: 38
Joined: Tue Oct 11, 2011 1:42 pm

Re: GPS integration

Post by didlawowo69 »

i have a arduino pro mini,
which GPS do you use to connect ? from diydrone ? i'm looking for a GPS with data logger, do you have any idea of where i can found that ?

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

Re: GPS integration

Post by Katch »

Gaijin wrote:
Katch wrote:
EOSBandi wrote:Flash it, then use MiniGPS to set your parameters (GPS frames, update rate, WaaS) and save them to the GPS flash memory (on the Test tab, press shift+ctrl+S to get additional tabs in MiniGPS tool) :D yo have 8 slots to save... Note that Waas could be used only with 5Hz update rate....



Just flashed the 10hz 115200 firmware you linked to on 2 devices. It is what it says it is.

I have updated a generic MT3329 breakout board and my Navigtron I2C GPS board. To update the Navigtron you have to upload a blank blink sketch to the arduino then connect a usb serial device to 5v gnd and Rx / TX (Rx/Tx must be crossed)

I used the Powerflash tool that DIYDrones provides rather than the Flashtool in the repo.


Wait a minute, what settings are my Navigatron at by default?

I assumed it was already set to output 10hz etc


Yeah 9600 @ 1hz unless its the newer v2 with tantalum cap instead of supercap; but the software on the arduino (the i2c gps sketch) sets it to 10hz 115200 when you power the board.

Quad FRITZ
Posts: 44
Joined: Wed Apr 25, 2012 11:21 pm

Re: GPS integration

Post by Quad FRITZ »

Hi-

Just to get this straight- when I use the newest I2C version of the SW for the multiwii and connect a Navigatron GPS board with the old FW it will be initialized for 10Hz anyways- so no need for FW change on the Navigatron board?

Thank you for all the hard work and especially to you, EOSbandi!!!

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

Re: GPS integration

Post by EOSBandi »

Quad FRITZ wrote:Hi-

Just to get this straight- when I use the newest I2C version of the SW for the multiwii and connect a Navigatron GPS board with the old FW it will be initialized for 10Hz anyways- so no need for FW change on the Navigatron board?

Thank you for all the hard work and especially to you, EOSbandi!!!


Nope, the latest version of i2c-gps-nav software (r33 at this moment) DOES NOT CHANGE ANY settings of your GPS receiver. it assumes that your GPS is preset to 115200 bps, 10Hz. If your GPS module has different startup settings, you have to enter the init strings to the code.... I choose this because I experienced some weird issues with different GPS modules, some of them did not accept commands, and the result was not deterministic. So It’s recommended to upgrade your GPS receiver’s firmware to the latest one (it’s 1.5 for PM6B modules) and set default parameters in the module itself, don’t rely on on-the-fly configurations.

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

Re: GPS integration

Post by Katch »

yeah sorry I should have said the stock i2c gps code that Melih was shipping them with.

Sharkcopter
Posts: 21
Joined: Fri Feb 24, 2012 3:12 pm

Re: GPS integration

Post by Sharkcopter »

Hi
@ EosBandi thanks for your efforts.

Yesterday I bought a Navigatron V2 and I realized that it defaults is 10 hz 115200 bps.
I understand that i have no change anything, is this correct ?

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

Re: GPS integration

Post by EOSBandi »

Sharkcopter wrote:Hi
@ EosBandi thanks for your efforts.

Yesterday I bought a Navigatron V2 and I realized that it defaults is 10 hz 115200 bps.
I understand that i have no change anything, is this correct ?


Correct

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: GPS integration

Post by copterrichie »

Sharkcopter wrote:Hi
@ EosBandi thanks for your efforts.

Yesterday I bought a Navigatron V2 and I realized that it defaults is 10 hz 115200 bps.
I understand that i have no change anything, is this correct ?


Care to share a link where you purchased your Navigtron?

Thank you.

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

Re: GPS integration

Post by EOSBandi »

Hi Guys,
I just uploaded the documentation to the repository. You can find it here : http://code.google.com/p/i2c-gps-nav/downloads/list
Since English is not my native language, and I did not had any formal education for English, there are perhaps some errors. I would appriciate if a native English speaker helps me in proofreading.
Regards,
EOSBandi

User avatar
Bledi
Posts: 187
Joined: Sat Sep 10, 2011 6:36 pm

Re: GPS integration

Post by Bledi »

EXCELLENT tutorial thanks a lot !

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

Re: GPS integration

Post by Katch »

EOSBandi wrote:Hi Guys,
I just uploaded the documentation to the repository. You can find it here : http://code.google.com/p/i2c-gps-nav/downloads/list
Since English is not my native language, and I did not had any formal education for English, there are perhaps some errors. I would appriciate if a native English speaker helps me in proofreading.
Regards,
EOSBandi


I just happen to be an English teacher - I'll go over it and send you any changes.

EDIT do you have it in an easily editable format - .doc etc?

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

Re: GPS integration

Post by EOSBandi »

Katch wrote:
EOSBandi wrote:Hi Guys,
I just uploaded the documentation to the repository. You can find it here : http://code.google.com/p/i2c-gps-nav/downloads/list
Since English is not my native language, and I did not had any formal education for English, there are perhaps some errors. I would appriciate if a native English speaker helps me in proofreading.
Regards,
EOSBandi


I just happen to be an English teacher - I'll go over it and send you any changes.

EDIT do you have it in an easily editable format - .doc etc?


That would be terrific :). I uploaded in doc format to the repo. http://code.google.com/p/i2c-gps-nav/downloads/list
Thanks in advance,
EOSBandi

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

Re: GPS integration

Post by Katch »

off to the gym will do it tonight.

LuFa
Posts: 160
Joined: Fri Jan 27, 2012 7:56 pm

Re: GPS integration

Post by LuFa »

Hi EosBandi ,

Can you make a list wich thinks i have to add where in the normal Multiwii Code for the r33 GPS Version ?

Thanks

User avatar
Gaijin
Posts: 82
Joined: Sat Jan 14, 2012 8:00 am

Re: GPS integration

Post by Gaijin »

Disaster, Can you break down the update flashing sequence for the navigatron for me particularly which file is the download agent and which the ROM, all I get after flashing a blank blink sketch is a fail from powerflash using the FTDI connector to program as per the Guide in EOS Bandi's archive, Isn't and FTDI a USB to serial bridge?.

How else can I update, I have a USBAsp instead, but I confess that I really don't want to have to cut any lines or understand the difference in programmers, I hoped to avoid the really deep electronics stuff by getting a pre made I2C GPS unit.

Any help gratefully received.

N.B I'll proof read the user guide very soon, it's at least one way I can contribute
Last edited by Gaijin on Wed May 23, 2012 6:16 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 »

LuFa wrote:Hi EosBandi ,

Can you make a list wich thinks i have to add where in the normal Multiwii Code for the r33 GPS Version ?

Thanks

A working 20120504 dev MultiWii code is included with the r33. There will be one more release which will incorporates 20120522dev release and some preparation for integration into the main dev trunk...

Sharkcopter
Posts: 21
Joined: Fri Feb 24, 2012 3:12 pm

Re: GPS integration

Post by Sharkcopter »

copterrichie wrote:
Sharkcopter wrote:Hi
@ EosBandi thanks for your efforts.

Yesterday I bought a Navigatron V2 and I realized that it defaults is 10 hz 115200 bps.
I understand that i have no change anything, is this correct ?


Care to share a link where you purchased your Navigtron?

Thank you.


Right from Flytron, yesterday was in stock http://www.flytron.com/sensors/180-i2c- ... thers.html

User avatar
Gaijin
Posts: 82
Joined: Sat Jan 14, 2012 8:00 am

Re: GPS integration

Post by Gaijin »

This is the message I get from Powerflash when I try to update the firmware, when you say cross the Tx & RX lines, do I need to make an adaptor cable between my FTDI and the navigatron crossing these two lines?

[Flash Download]
Fail!!(Download) BROM_CMD_START_FAIL
[Finish]
Take(6) secs to test.

I've read your doc and It's very concise and informative, I have made 1 or 2 small spelling and grammar changes, but nothing significant.

Located Here: http://www.filedropper.com/positionholdandrthfunctionsformultiwii

LuFa
Posts: 160
Joined: Fri Jan 27, 2012 7:56 pm

Re: GPS integration

Post by LuFa »

Hi EosBandi ,

is the Moving average filter only in use with Serial Gps ?
because i havent found the setup for i2c gps .

Thanks

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

Re: GPS integration

Post by EOSBandi »

It works for i2c-gps too. When defined in MultiWii config.h it sets the I2C_NAV_FLAG_GPS_FILTER bit in the I2C_GPS_NAV_FLAGS register.

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

Re: GPS integration

Post by EOSBandi »

Gaijin wrote:This is the message I get from Powerflash when I try to update the firmware, when you say cross the Tx & RX lines, do I need to make an adaptor cable between my FTDI and the navigatron crossing these two lines?

[Flash Download]
Fail!!(Download) BROM_CMD_START_FAIL
[Finish]
Take(6) secs to test.


You have to cross link. If you plug the FTDI directly to the Navigatron, yu will program the atmega on the board, to program the gps the TX and RX must be crossed. (FTDI TX->NavigatronRX, FTDI RX->Navigatron TX, plus GND and VCC). You can check the connection with the MiniGPS.

I've read your doc and It's very concise and informative, I have made 1 or 2 small spelling and grammar changes, but nothing significant.
Located Here: http://www.filedropper.com/positionholdandrthfunctionsformultiwii

Thanks,
EOSBandi

Melilla
Posts: 2
Joined: Thu Apr 26, 2012 1:09 pm

Re: GPS integration

Post by Melilla »

EOSbandi Hi, forgive my ignorance, and mounted the r33, but the engines do not work, but if I connect the ftdi and battery if they work
which can be
with the version multiwii dev 20120504, does not happen
http://youtu.be/QczzsIycVzM

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

Re: GPS integration

Post by Katch »

Here you go EOSBandi;

http://db.tt/VZ8Tox7t

For someone with no formal English training that's pretty amazing - not many changes or corrections.

I did add one thing to the section about things that indicate a GPS lock;

Code: Select all

When setting up your Transmitter and assigning switches to GPS navigation functions (RTH POS Hold) the function will light up green only when you have a 3D GPS lock.


I was scratching my head wondering why my Tx wasn't working until I realised the functions can only turn on in the GUI when 3d locked.

matteo3e5
Posts: 8
Joined: Thu May 24, 2012 6:34 am

Navigatron I2C GPS Integration

Post by matteo3e5 »

Hi EOSBandi, congratulation for your incredible work.

I have the Navigatron I2C GPS (GTPA010) v1 from Flytron.
I have a quadcopter with MultiWii_dev_20120504, what must be done to integrate the gps ?!
I read your tutorial but I am a little bit lost.

Reading the tutorial, It seems that changes are required for the comunication parameters, the gps default params are 1hz 9600baud and they must be modified to 10hz 115200baud.
Now the crucial question, can I use the standard MultiWii_dev_20120504 with #define I2C_GPS in the config.h file or I must use a customised version ?!
Second key question, do I have to flash the Navigatron i2c gps with a new/specific firmware version or re-flash is not required and the standard Navigatron firmware is ok for MultiWii_dev_20120504 I2C_GPS ?!

thank you in advance
Marco

User avatar
Gaijin
Posts: 82
Joined: Sat Jan 14, 2012 8:00 am

Re: Navigatron I2C GPS Integration

Post by Gaijin »

matteo3e5 wrote:Hi EOSBandi, congratulation for your incredible work.

I have the Navigatron I2C GPS (GTPA010) v1 from Flytron.
I have a quadcopter with MultiWii_dev_20120504, what must be done to integrate the gps ?!
I read your tutorial but I am a little bit lost.

Reading the tutorial, It seems that changes are required for the comunication parameters, the gps default params are 1hz 9600baud and they must be modified to 10hz 115200baud.
Now the crucial question, can I use the standard MultiWii_dev_20120504 with #define I2C_GPS in the config.h file or I must use a customised version ?!
Second key question, do I have to flash the Navigatron i2c gps with a new/specific firmware version or re-flash is not required and the standard Navigatron firmware is ok for MultiWii_dev_20120504 I2C_GPS ?!

thank you in advance
Marco


Hi, I was having the same isssue, but I believe I now understand.

You can use the standard I2C Gps sketch IF you have updated the parameters of the GPS Module on a V1 Navigatron, to do this, you will need to make an adapter cable that crosses the Tx / Rx lines of your FTDI, re-flash as per the guide in the archive and change the settings with MiniGPS, It's easier than it sounds, I can guarantee this works as I have just done it :D

Or you can use the modified I2C Gps sketch from the Flytron site, this will work but have 2 potential disadvantages:

1) It forces the module to change settings on the fly, I believe this can go wrong on occasion
2) this may not always be as current as EosBandi's latest release although I think it's there at the moment

EosBandi,

I've just noticed an error in the guide, where you say
Once you have a new firmware, you can use the MiniGPS program from the update package to test your module, and you can set default parameters (Just press Shift+ctrl+S to display additional tabs). Make sure that your GPS receivers default settings are match with the expected settings above.


The Actual key combination is CTRL+ALT+S.

Also where you list the need for it to output GGA, GSA and RMC frames, it would be helpful to know whether it is worth turning off the unused frames plus what do the 1 to 10 variable next to them signify?

Finally, I need to add that there is no blue 3Dfix light on the V1, 3d fix is indicated by the led going out

Anyway, excellent work, thanks very much

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

Re: GPS integration

Post by Katch »

EOSBandi you are a genius!

I can't begin to explain how good this code is now!

Just flew 2 packs on my MEGA w/serial GPS. I can park my quad 200m away at about 40m altitude and engage POS Hold wait for my timer to go 10 minutes later (can hear my Lipo alarm from that distance!) Flick RTH and watch my quad spin round and scoot back to me literally stopping overhead and turning back to face its armed heading.

A real achievement - really great.

The only thing I find during tests is that you have to have your throttle just right to get a good hold - too high when engaging POS Hold and you gain altitude too low and you lose it. But as long as you are in that sweet spot hover when you engage it is rock solid now. I'd go so far as to say it holds tighter than the Arducopter vids I've seen.

****

Am I right in saying that this current code doesn't use Baro data at all? Might be nice if we could code a Baro free Alt Hold using GPS data but allowing you to fly around at a fixed altitude.

@Alex

If you read this - this dev is definitely prime time ready. I hope you can include it in 2.1 when it's released.

warthox
Posts: 65
Joined: Sat Jan 29, 2011 10:05 pm

Re: GPS integration

Post by warthox »

can somebody please post working gps pids so i have a starting point?
tried gps first time yesterday. it did something but i dont got it tuned well.
thanks in advance.

Wayne
Posts: 86
Joined: Sun Jul 31, 2011 10:44 pm

Re: GPS integration

Post by Wayne »

Very, Very Nice EOSBandi!
Thank you for all your hard work and what may be the best documented MultiWii feature ever!
I can see that it is now time to put my MEGA quad back together.

User avatar
Bledi
Posts: 187
Joined: Sat Sep 10, 2011 6:36 pm

Re: GPS integration

Post by Bledi »

warthox wrote:can somebody please post working gps pids so i have a starting point?
tried gps first time yesterday. it did something but i dont got it tuned well.
thanks in advance.

On the previous page you have a good tutorial for beginners

matteo3e5
Posts: 8
Joined: Thu May 24, 2012 6:34 am

Re: Navigatron I2C GPS Integration

Post by matteo3e5 »

You can use the standard I2C Gps sketch IF you have updated the parameters of the GPS Module on a V1 Navigatron, to do this, you will need to make an adapter cable that crosses the Tx / Rx lines of your FTDI, re-flash as per the guide in the archive and change the settings with MiniGPS, It's easier than it sounds, I can guarantee this works as I have just done it :D


thank you for the info.
let me see if I got correctly

Navigatron v1 doesn't work if connected as it is on an i2c bus of a multiwii multicopter, therefore I have to re-flash it with the standard EOSBandi I2C GPS sketch and update the parameters of the gps Module on my v1 Navigatron using MiniGPS tool. As soon as these steps are completed Navigatron v1 works if connected on an i2c bus of a multiwii multicopter
Am I correct ?
Where can I download MiniGPS for windows ?!
thanks

User avatar
Gaijin
Posts: 82
Joined: Sat Jan 14, 2012 8:00 am

Re: GPS integration

Post by Gaijin »

There is a link to the GPS update package a few pages back, also you need to upload a blank blink sketch before you update the Navigatron, you can find this in sketches>example in Arduino

Eos, I'm right when I say that the magnetometer needs to be activated for GPS to work, wouldn't it be worth adding a bypass to the code to turn this on when GPS functions are used.

I flew a number of packs today and I'm impressed, pos hold needs some tuning but It's definitely working now, thanks

Y.Mita
Posts: 46
Joined: Thu Sep 15, 2011 11:25 pm

Re: GPS integration

Post by Y.Mita »

Gaijin wrote:Eos, I'm right when I say that the magnetometer needs to be activated for GPS to work, wouldn't it be worth adding a bypass to the code to turn this on when GPS functions are used.


I'm turn on MAG by selecting same AUX with RTH or PH.
like AUX3 HIGH switch on GPS HOME with MAG and BARO and LEVEL together, AUX3 LOW switch on GPS HOLD with MAG and BARO and LEVEL.
Ofcourse, good to add bypass for beginer.

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

Re: GPS integration

Post by Katch »

warthox wrote:can somebody please post working gps pids so i have a starting point?
tried gps first time yesterday. it did something but i dont got it tuned well.
thanks in advance.


Hey Warthox,

I'm using default everything in r33.

Hardware is 500mm Bluesky Sport Quad / KDA 20-28m / Plush 18a / 8x45 props

You need to make 100% certain your Mag is perfectly calibrated and that Headfree works perfectly - if the Mag gets interference when you hit WOT you'll have issues with the GPS code. Also test on a windless day - the wind makes a real difference to how well or otherwise it holds.

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

Re: Navigatron I2C GPS Integration

Post by Katch »

matteo3e5 wrote:thank you for the info.
let me see if I got correctly

Navigatron v1 doesn't work if connected as it is on an i2c bus of a multiwii multicopter, therefore I have to re-flash it with the standard EOSBandi I2C GPS sketch and update the parameters of the gps Module on my v1 Navigatron using MiniGPS tool. As soon as these steps are completed Navigatron v1 works if connected on an i2c bus of a multiwii multicopter
Am I correct ?
Where can I download MiniGPS for windows ?!
thanks


There are 2 'firmwares' one is the sketch on the Arduino that is soldered on to your navigtron - there is also a firmware flashed inside the actual GPS module itself.

You would be best updating the firmware on the GPS module itself. The firmware is in the same repo as the current code.

You will need to first flash the Arduino on the navigtron with a Blink sketch (in examples in your arduino software folder)

Once done you need to find a way to cross the rx and tx of your ftdi and then you can flash the GPS module following the guide using Powerflash - it will be on its default baud 9600

After you have flashed the GPS module you can put the rx and tx back to normal and flash the arduino on soldered on the navigtron with the r33 i2c gps sketch.

Post Reply