New RCtimer GPS Ublox Neo 6M fails to perform on Mega boards

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
User avatar
dramida
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest
Contact:

New RCtimer GPS Ublox Neo 6M fails to perform on Mega boards

Post by dramida »

I was very impressed about accuracy of ublox neo 6 gps

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

But i am dissapointed about the fact that GPS looses its configuration almost immediately after shutting down. Also the ublox configurator is hard to understand in how produce the desired configuration file. (I personally prefer nmea standard as i can use the same gps to Remzibi osd)

Conclusion: Multiwii needs a function at startup witch should configure the Ublox neo6m gps to a working config (i prefer 5Hz, NMEA, 38400 baud)

User avatar
brettwal
Posts: 93
Joined: Mon Jun 18, 2012 4:51 pm
Location: Louisiana

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by brettwal »

dramida wrote:I was very impressed about accuracy of ublox neo 6 gps

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

But i am dissapointed about the fact that GPS looses its configuration almost immediately after shutting down. Also the ublox configurator is hard to understand in how produce the desired configuration file. (I personally prefer nmea standard as i can use the same gps to Remzibi osd)

Conclusion: Multiwii needs a function at startup witch should configure the Ublox neo6m gps to a working config (i prefer 5Hz, NMEA, 38400 baud)



This can be done. In the GPS.ino you can have it configure the GPS module. Just add the needed commands.

User avatar
TermicOne
Posts: 15
Joined: Wed Jul 04, 2012 9:13 pm
Location: Italy - Milan

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by TermicOne »

dramida wrote:I was very impressed about accuracy of ublox neo 6 gps

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

But i am dissapointed about the fact that GPS looses its configuration almost immediately after shutting down. Also the ublox configurator is hard to understand in how produce the desired configuration file. (I personally prefer nmea standard as i can use the same gps to Remzibi osd)

Conclusion: Multiwii needs a function at startup witch should configure the Ublox neo6m gps to a working config (i prefer 5Hz, NMEA, 38400 baud)


My experience with this GPS is that you need to configure it at start of flying sessions. After this initial config GPS remains configured for some hours ... at list for the whole afternoon. Usually I configure it at home before going to the field and no need to configure it again till next session.

Anyway this config every session is frustrating...if we can get some suggestion in order to have it configured from MultiWii should be great...of course in that case we need to connect also the TX pin from board (now it uses only RX pin)

Luciano

carlonb
Posts: 210
Joined: Sun Apr 03, 2011 6:29 pm

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by carlonb »

I agree with dramida and Luciano, I have the same problem with Mediatek serial GPS from Flytron, by default is 9600 bps, 1Hz and more than needed two NMEA string.
The solution is the possibility to send (with TX line of course) a custom serial string (that everione can create) to the needed GPS in setup routine in MWii sketch.
The developpers can provide in MWii setup a generic buffer/container in order that everyone can fillup with the nedded GPS setup string.
Thanks, ciao a tutti, Carlo

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

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by Alexinparis »

Hi
I'm working on this now because I have also one GPS from RC timer ;)

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

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by copterrichie »

Alexinparis wrote:Hi
I'm working on this now because I have also one GPS from RC timer ;)


Good, I will get one of these. :)

carlonb
Posts: 210
Joined: Sun Apr 03, 2011 6:29 pm

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by carlonb »

Alexinparis wrote:Hi
I'm working on this now because I have also one GPS from RC timer ;)

Thanks a lot Alex, many user as me are waiting for this :mrgreen:
Great job. :D
Ciao, Carlo

nhadrian
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by nhadrian »

Alexinparis wrote:Hi
I'm working on this now because I have also one GPS from RC timer ;)


Hi Alexinparis,

+1 here, I'm waiting for your solution on RCTimer UBLOX GPS...!

BR
Adrian

Ps.: perhaps you should contact EOSBandi, for Ublox serial parser, it works great on hix I2C_GPS code. It would be grat to use the RCTimer GPS with binary communication, but on serial port.

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

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by EOSBandi »

OK, here is a first version : I dont commit it into shared yet, since it is based on a 2.1 Gps.ino and still uses classes.
Just replace the Gps.ino and add the follwing lines to config.h gps part

Code: Select all

    //#define NMEA
    #define UBLOX
   // #define MTK

   #define GPS_LEAD_FILTER

//#define GPS_FILTERING
//#define NAV_SLEW_RATE              30

Plus add the initialisation to the multiwii.ino setup()

Code: Select all

  
#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
Attachments
GPS.zip
(13.96 KiB) Downloaded 2350 times

User avatar
Jonit
Posts: 37
Joined: Sat May 12, 2012 10:12 pm
Location: Slovakia

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by Jonit »

Thank you EOSBandi !
now we need to figure out how on each startup configure Ublox module so it can work in binary protocol and at 5 Hz. So we don't need to make hardware modification.

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

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by EOSBandi »

Jonit wrote:Thank you EOSBandi !
now we need to figure out how on each startup configure Ublox module so it can work in binary protocol and at 5 Hz. So we don't need to make hardware modification.

The code above does the configuration of UBLOX for 5Hz, Binary and EGNOS :D

User avatar
Jonit
Posts: 37
Joined: Sat May 12, 2012 10:12 pm
Location: Slovakia

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by Jonit »

EOSBandi wrote:The code above does the configuration of UBLOX for 5Hz, Binary and EGNOS :D

really ?! :D that's awesome!!! thank you!! must try it ASAP :D

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

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by Alexinparis »

Hi,

I've also committed something in _shared branch based on my yesterday work, which is based on I2C code.
EOS, feel free to mod it as yours goes a little bit more further.

This is how I see the use of UBLOX devices:
1) to avoid messing with the quality of attached batteries, or additional EEPROM, I find this mod very useful:
viewtopic.php?f=8&t=649&start=1230#p19682
in accordance to http://www.universalair.co.uk/sites/def ... asheet.pdf page 10. If we ground CFG_COM1 and CFG_COM0 (pins 14 and 15) we already get 57600 baud and UBLOX binary data at startup so we only need to change refresh rate to 5Hz (page 6 states that as maximum) (as in viewtopic.php?f=8&t=2124#p19570) and we don't need external EEPROM!?


This mod is very easy to do as the 3 PINs 13,14,15 are gathered on the same side.

2) now we have always a 57600 baud conf, with the binary protocol always enabled. 57600 is more than enough to support the messages we want.

3) configure multiwii to use 57600 baud on the serial port of your choice, and use UBLOX protocol
#define GPS_SERIAL 2
#define GPS_BAUD 57600
#define UBLOX

The needed init sequences to activate messages are coded in multiwii when the UBLOX protocol is chosen.

This way, you can use easily the cheap RCtimer GPS. No need to care about a GPS config loss.

User avatar
brettwal
Posts: 93
Joined: Mon Jun 18, 2012 4:51 pm
Location: Louisiana

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by brettwal »

The code above does the configuration of UBLOX for 5Hz, Binary and EGNOS :D[/quote]


Is WAAS enable as well?

nhadrian
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by nhadrian »

EOSBandi wrote:OK, here is a first version : I dont commit it into shared yet, since it is based on a 2.1 Gps.ino and still uses classes.
Just replace the Gps.ino and add the follwing lines to config.h gps part

Code: Select all

    //#define NMEA
    #define UBLOX
   // #define MTK


For UBLOX and MTK the GPS_BAUD must be 57600
......


I confirm, it works, at least on my desktop (I hope I'll test in air soon...)!

Many thanks to EOSBandi!!!!

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

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by EOSBandi »

brettwal wrote:The code above does the configuration of UBLOX for 5Hz, Binary and EGNOS :D



Is WAAS enable as well?[/quote]

it has to be changed to waas, but the defines are there, will add docs tonight.

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

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by dramida »

Thank you for support. Please put a NMEA version as well because some OSD's use this standard and are feed directly from multiwii gps.

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

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by EOSBandi »

dramida wrote:Thank you for support. Please put a NMEA version as well because some OSD's use this standard and are feed directly from multiwii gps.


I will, but keep in mind that nmea has a quite big performance hit on poshold....

carlonb
Posts: 210
Joined: Sun Apr 03, 2011 6:29 pm

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by carlonb »

dramida wrote:Thank you for support. Please put a NMEA version as well because some OSD's use this standard and are feed directly from multiwii gps.

Thanks for this emprovement, but I need a clarification about changing defaults on Flytron Mediatek NMEA GPS:
If I change the default serial speed of GPS from 9600 bps to 57600 bps by MWii setup, after switch GPS off the next switch On and with the GPS back-up capacitor fully charged, the setup can comunicate again or not with GPS as Mwii setup code try to change the defaults with baud rate of 9600 bps ?

I hope my question is clear enough
Thank ciao, Carlo

User avatar
Jonit
Posts: 37
Joined: Sat May 12, 2012 10:12 pm
Location: Slovakia

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by Jonit »

what am I doing wrong? I replaced the Gps.ino with EOSBandi one, then i added this few lines to config.h file and then added the initialisation to the multiwii.ino setup(). Baudrate is set to 57600. But after powering on, the Ublox module doesn't change its settings... still running on 9600 baud, 1Hz and NMEA. Maybe I am missing something... any advices?

PS: I am using Crius SE.
Attachments
multiwii.jpg
config.jpg

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

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by dramida »

Both rx and tx line of gps have to be wired to serial port 2.

User avatar
Jonit
Posts: 37
Joined: Sat May 12, 2012 10:12 pm
Location: Slovakia

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by Jonit »

dramida wrote:Both rx and tx line of gps have to be wired to serial port 2.

I have all 4 wires (VCC, GND, TX, RX) connected. But I am using serial port 0 because i have Crius SE not Crius AIO.

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

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by EOSBandi »

Jonit wrote:
dramida wrote:Both rx and tx line of gps have to be wired to serial port 2.

I have all 4 wires (VCC, GND, TX, RX) connected. But I am using serial port 0 because i have Crius SE not Crius AIO.


Forget it, it is very likely that you ran out of sram memory..the code is for Mega boards... with Crius SE (and other Atmega328 based boards) it is NOT recommended to use a serial GPS. Get a I2CGPS board, you will not regret it.....

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

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by EOSBandi »

Alexinparis wrote:Hi,

I've also committed something in _shared branch based on my yesterday work, which is based on I2C code.
EOS, feel free to mod it as yours goes a little bit more further.

This is how I see the use of UBLOX devices:
1) to avoid messing with the quality of attached batteries, or additional EEPROM, I find this mod very useful:
viewtopic.php?f=8&t=649&start=1230#p19682
in accordance to http://www.universalair.co.uk/sites/def ... asheet.pdf page 10. If we ground CFG_COM1 and CFG_COM0 (pins 14 and 15) we already get 57600 baud and UBLOX binary data at startup so we only need to change refresh rate to 5Hz (page 6 states that as maximum) (as in viewtopic.php?f=8&t=2124#p19570) and we don't need external EEPROM!?


This mod is very easy to do as the 3 PINs 13,14,15 are gathered on the same side.

2) now we have always a 57600 baud conf, with the binary protocol always enabled. 57600 is more than enough to support the messages we want.

3) configure multiwii to use 57600 baud on the serial port of your choice, and use UBLOX protocol
#define GPS_SERIAL 2
#define GPS_BAUD 57600
#define UBLOX

The needed init sequences to activate messages are coded in multiwii when the UBLOX protocol is chosen.

This way, you can use easily the cheap RCtimer GPS. No need to care about a GPS config loss.



using config pins have some gains, but not so much...
according to the datasheet, cfg1+cfg2 indeed enables ubx output at 57600bps, but some critical messages are missing... no POSLLH and no VELNED, but some unneccessary messages are enabled (SVINFO, CLOCK, INF, MON-EXPECT and AID-ALPSERV) so we have to send additional config commands to disable these and enable the needed ones. So I think it's better to start with an unknown state and set it accordingly. (The code I posted will probe from 9600 to 57600, set it to binary and disables all unneccessary messages...)
The other problem is that I can imagine that people start tampering with the gps module pins with their big 220Volt (110V) soldering irons... instant death to the module...

The only drawback that the current implementation definitely for Mega only, it uses too much flash and sram for an AtMega....

User avatar
Jonit
Posts: 37
Joined: Sat May 12, 2012 10:12 pm
Location: Slovakia

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by Jonit »

EOSBandi wrote:
Forget it, it is very likely that you ran out of sram memory..the code is for Mega boards... with Crius SE (and other Atmega328 based boards) it is NOT recommended to use a serial GPS. Get a I2CGPS board, you will not regret it.....

OK, thanks for explanation. Time to buy some I2C module ;)

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by crashlander »

EOSBandi wrote:using config pins have some gains, but not so much...
(The code I posted will probe from 9600 to 57600, set it to binary and disables all unneccessary messages...)

Question: Will your code properly initialize also modules with pin 13,14,15 mod (57600, ubx)? Or do I have to undo that mod. to use your code?
I presume yes but just to be sure.

User avatar
brettwal
Posts: 93
Joined: Mon Jun 18, 2012 4:51 pm
Location: Louisiana

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by brettwal »

2 Questions:

1. Any update on how to enable WAAS?

In GPS.ino at the end, Do I change

// ask for the messages we parse to be sent on every navigation solution
UBLOX_configure_message_rate(CLASS_NAV, MSG_POSLLH, 1);
UBLOX_configure_message_rate(CLASS_NAV, MSG_STATUS, 1);
UBLOX_configure_message_rate(CLASS_NAV, MSG_SOL, 1);
UBLOX_configure_message_rate(CLASS_NAV, MSG_VELNED, 1);
UBLOX_configure_sbas(SBAS_EGNOS);

to this?

// ask for the messages we parse to be sent on every navigation solution
UBLOX_configure_message_rate(CLASS_NAV, MSG_POSLLH, 1);
UBLOX_configure_message_rate(CLASS_NAV, MSG_STATUS, 1);
UBLOX_configure_message_rate(CLASS_NAV, MSG_SOL, 1);
UBLOX_configure_message_rate(CLASS_NAV, MSG_VELNED, 1);
UBLOX_configure_sbas(SBAS_WAAS);





2. I have the CRIUS AIO Pro and the new EXTEND Board w/ LEA-6H. Without documentaion on the Extend board, I do not know what its default config is. I also have no way of connecting it to Ucenter. Anyone have any docs on the extend board?

I have GPS data in the MWC GUI but, the altitude is off from 2000' to 4000'! :shock:
LAT & LONG are correct.

I'm using EOS's GPS.INO and other code snipets from earlier in this thread.


UPDATE: Still have altitude errors. Tried POS HOLD on quad with Extend board and new GPS.ino. WAY worse than same quad with Ublox connected to i2c module.
Last edited by brettwal on Sat Aug 04, 2012 3:49 am, edited 1 time in total.

User avatar
TermicOne
Posts: 15
Joined: Wed Jul 04, 2012 9:13 pm
Location: Italy - Milan

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by TermicOne »

EOSBandi wrote:
Jonit wrote:Thank you EOSBandi !
now we need to figure out how on each startup configure Ublox module so it can work in binary protocol and at 5 Hz. So we don't need to make hardware modification.

The code above does the configuration of UBLOX for 5Hz, Binary and EGNOS :D


great job EOSBandi! ...but I do not understand if your code need to have GPS already at 57600 or if it tries different speed in order to configure GPS to 57600 even if it is at 9600.
Today I tried your code but I was not able to have GPS working unless I configure it to 57600. If you are so kind to confirm that your code tries different speed I'll try again looking what's wrong in my config. Thanks again for your great and kind support!

Luciano

dr.tom
Posts: 141
Joined: Fri Mar 30, 2012 4:46 pm
Location: Croatia
Contact:

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by dr.tom »

it sure tries different speeds because my AIO+gps (rctimer) works with Bandi's code even withouth GPS battery!
(removed it to test the eeprom mod, but it didn't remember settings with it, so I just desoldered eeprom and then Bandi's code came right in time to test it)

User avatar
TermicOne
Posts: 15
Joined: Wed Jul 04, 2012 9:13 pm
Location: Italy - Milan

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by TermicOne »

dr.tom wrote:it sure tries different speeds because my AIO+gps (rctimer) works with Bandi's code even withouth GPS battery!
(removed it to test the eeprom mod, but it didn't remember settings with it, so I just desoldered eeprom and then Bandi's code came right in time to test it)


Thank you Tom...tried again this evening and, at list with GUI, EOS code seems working well! Atfer configuration with EOS code GPS works fine with MultiWii but u-center is not working anymore...you can see the frames but u-center is not showing sats and other info that was showing before...no problem as it seems to work with multiwii!! Tomorrow I will test it in flight!

Thanks again EOSBandi for your code!

Luciano

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by crashlander »

TermicOne wrote: but u-center is not working anymore...you can see the frames but u-center is not showing sats and other info that was showing before...no problem as it seems to work with multi...
Luciano


Yep U-Center seems to fully understand only NMEA and since default is UBX+NMEA+somethingeles U-Center shows satelites + additional info and when you disable NMEA U-Center shows only position but no satellites.

Andrej

User avatar
TermicOne
Posts: 15
Joined: Wed Jul 04, 2012 9:13 pm
Location: Italy - Milan

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by TermicOne »

crashlander wrote:Yep U-Center seems to fully understand only NMEA and since default is UBX+NMEA+somethingeles U-Center shows satelites + additional info and when you disable NMEA U-Center shows only position but no satellites.

Andrej


Thank you Andrej!

This morning I tested GPS with u-center and I verified that in the night it has lost the configuration and was reset to NMEA, 1Hz, 9600bps.

Powered MultiWii (2 times as always for activating GPS) and GPS has been reconfigured to UBLX binary, 5Hz and 57600bps!

Tested quad outdoor. GPS fix in few seconds. Tested GPS HOLD and GPS RTH and they work great!!! I'm still impressed looking at my quad flying itself!!

I'd like to thank again Alexinparis, EOSBAndi and all the developers of this great sw.....NAZA is going to wait some more time!!! :D

Luciano

User avatar
brettwal
Posts: 93
Joined: Mon Jun 18, 2012 4:51 pm
Location: Louisiana

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by brettwal »

Anyone test the new GPS.ino with a SERIAL connected UBLOX? Looks like an error in ALTITUDE calculations. i2C Ublox works fine.

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

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by dramida »

I soldered the 13, 14 and 15 terminals together and i applied EosBandi's GPS initialisation code with Ublox binary viewtopic.php?f=8&t=2166#p20097
The good news is that the software works and gps is configured at startup
Two issues:
1-Also i had 8 sats in GUI, there were no visual sign of 3D fix on controller, no led were flashing or whatsoever
2- On GUI GPS altitude is way out of scale, it shows 11000m or so...

Now i am going outside to test it on flight.

And one more thing, if NMEA is selected, no setup procedure is initiated...

Last Edit: The led's are not flashing every time. I was seeing 8 satelites on GUI but the leds were not flashing. After reboot the leds start flashing regulary.

After all trouble i had (#endif missing at the end of bandi's code), i am starting to understand the meaning and causality of arduino stataments :idea:

User avatar
brettwal
Posts: 93
Joined: Mon Jun 18, 2012 4:51 pm
Location: Louisiana

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by brettwal »

dramida wrote:I soldered the 13, 14 and 15 terminals together and i applied EosBandi's GPS initialisation code with Ublox binary viewtopic.php?f=8&t=2166#p20097
The good news is that the software works and gps is configured at startup
Two issues:
1-Also i had 8 sats in GUI, there were no visual sign of 3D fix on controller, no led were flashing or whatsoever
2- On GUI GPS altitude is way out of scale, it shows 11000m or so...

Now i am going outside to test it on flight.

And one more thing, if NMEA is selected, no setup procedure is initiated...

Last Edit: The led's are not flashing every time. I was seeing 8 satelites on GUI but the leds were not flashing. After reboot the leds start flashing regulary.



The code will initialize the module properly w/o soldering the pins together.

There is no code in this one to run the Ublox in NMEA mode, only MTK modules.

Altitude is WAY off. I cannot find the calculation error in the code.

I too, have the LED issues.


What result did the missing #endif have?

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

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by dramida »

After a few night flights in parking lot with SERIAL RCtimer Ublox 6m GPS and Crius AIO Mega Board, i observed an improvement in gps pos hold. Also gps acuracy wonders around 2-4 meters or so around the start point, the movement is smooth, less chaotic and more and more periods of time the copter is staying in the same spot.
My next experiment will be to modify the GPS antenna with an 2.5 cm patch antenna and then to home build an standard half wave patch antenna on 1575Mhz and mount it above the copter.
Any links for a DIY? I found only one http://www.express-builder.com/docs/gpsant/
Other ideeas are wellcome.

@brettwal: Every "if" statament must be closed with an "Endif" placed after all the code executed in case of a true statament or else you got the error "if statament not closed"
Last edited by dramida on Sun Aug 05, 2012 1:28 am, edited 2 times in total.

User avatar
brettwal
Posts: 93
Joined: Mon Jun 18, 2012 4:51 pm
Location: Louisiana

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by brettwal »

@ dramida Ahh, I thought you saw something besides a compile error. My code compiled fine. You have serial attached GPS or i2c attached?

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

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by EOSBandi »

Altitude error is know, it is in cm instead of meters. I'll needed it for checking alt precision.... I'll change it back to meters when I push the code to shared.... but if it bothers you then just change this :

In line 1449 :

Code: Select all

GPS_altitude     = _buffer.posllh.altitude_msl / 10;      //alt in cm 

replace it with

Code: Select all

GPS_altitude     = _buffer.posllh.altitude_msl / 1000;      //alt in meters

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

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by EOSBandi »

dramida wrote:After a few night flights in parking lot with SERIAL RCtimer Ublox 6m GPS and Crius AIO Mega Board, i observed an improvement in gps pos hold. Also gps acuracy wonders around 2-4 meters or so around the start point, the movement is smooth, less chaotic and more and more periods of time the copter is staying in the same spot.
My next experiment will be to modify the GPS antenna with an 2.5 cm patch antenna and then to home build an standard half wave patch antenna on 1575Mhz and mount it above the copter.
Any links for a DIY? I found only one http://www.express-builder.com/docs/gpsant/
Other ideeas are wellcome.

You will need active antenna for the module. The antenna you linked is a passive one.... so you will have to add an LNA to this to make it work... also active antenna designs also contains a bandpass filter to cancel out out-of-the-band noise, and all parts have to be properly impedance matched... So unless you are experienced with over Ghz radio comms and has a proper equipment (spectrum analyser, SWR meter for Ghz band, etc...) it is just shooting in the dark....

carlonb
Posts: 210
Joined: Sun Apr 03, 2011 6:29 pm

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by carlonb »

Hi EOSBandi,
I'm so confused, I have this serial GPS http://www.flytron.com/osd-headtrackers/15-simpleosd-gps-module.html and I tried your gps.ino module (adding also the few line in setup loop) on MWii 2.1 sketch.
Setted it to MTK, added TX serial line (I'm using RX1,TX1 pins of Mega board) but no GPS data on GUI.
My question: Is this GPS usable with your sketch mods?
I already test this with official MWii 2.1 release with NMEA and set comm to 9600 baud, but still no gps data.

What I'm missing ? Note : This GPS unit works OK with my DIY OSD with default 9600baud.
Thanks, Carlo

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

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by EOSBandi »

carlonb wrote:Hi EOSBandi,
I'm so confused, I have this serial GPS http://www.flytron.com/osd-headtrackers/15-simpleosd-gps-module.html and I tried your gps.ino module (adding also the few line in setup loop) on MWii 2.1 sketch.
Setted it to MTK, added TX serial line (I'm using RX1,TX1 pins of Mega board) but no GPS data on GUI.
My question: Is this GPS usable with your sketch mods?
I already test this with official MWii 2.1 release with NMEA and set comm to 9600 baud, but still no gps data.

What I'm missing ? Note : This GPS unit works OK with my DIY OSD with default 9600baud.
Thanks, Carlo


MTK binary protocol requires a special firmware on the GPS module...
either AXN 1.30 or AXN 1.51

Are you crossed the serial data lines ? (tx-rx rx-tx ?)

carlonb
Posts: 210
Joined: Sun Apr 03, 2011 6:29 pm

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by carlonb »

EOSBandi wrote:
carlonb wrote:Hi EOSBandi,
I'm so confused, I have this serial GPS http://www.flytron.com/osd-headtrackers/15-simpleosd-gps-module.html and I tried your gps.ino module (adding also the few line in setup loop) on MWii 2.1 sketch.
Setted it to MTK, added TX serial line (I'm using RX1,TX1 pins of Mega board) but no GPS data on GUI.
My question: Is this GPS usable with your sketch mods?
I already test this with official MWii 2.1 release with NMEA and set comm to 9600 baud, but still no gps data.

What I'm missing ? Note : This GPS unit works OK with my DIY OSD with default 9600baud.
Thanks, Carlo


MTK binary protocol requires a special firmware on the GPS module...
either AXN 1.30 or AXN 1.51

Are you crossed the serial data lines ? (tx-rx rx-tx ?)


Hi EOS, yes of course I did tx-rx crossing.
I tested my gps unit with arduino USB-serial at 9600 baud with Window Hyperterminal and it run good.
Now I have a tool from "Global Top Tecnology" you suggested and relate F/W AXN 1.51xxxxxx.
If I update with this F/W, what about the new default as comm speed, refresh rate and std NMEA strings? I need to know as I use it also with my OSD.

Thank very much, Carlo

Edit : I verifyed the GPS F/W with Minigps and show AXN 1.30....? is it strange ?
Bye

User avatar
brettwal
Posts: 93
Joined: Mon Jun 18, 2012 4:51 pm
Location: Louisiana

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by brettwal »

EOSBandi wrote:Altitude error is know, it is in cm instead of meters. I'll needed it for checking alt precision.... I'll change it back to meters when I push the code to shared.... but if it bothers you then just change this :

In line 1449 :

Code: Select all

GPS_altitude     = _buffer.posllh.altitude_msl / 10;      //alt in cm 

replace it with

Code: Select all

GPS_altitude     = _buffer.posllh.altitude_msl / 1000;      //alt in meters



I had actually found this and changed it but, the Altitude error is still much more than my i2c UBlox setup.

i2c is UBlox NEO-6 with 25x25 antenna
Serial is UBlox LEA-6 with 25x25 antenna

both tested in same location


Alos, would it break any other calculations if I converted to U.S. Feet instead of meters?

Thanks!

jy0933
Posts: 180
Joined: Wed Jun 27, 2012 4:24 pm

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by jy0933 »

altho i have read thru the entire thread for several times.. i'm still confused

is there a code to insert into mwc to config gps chip to nmea, 5hz, 57600baud when power is plugged in?
the gps i have is serial ublox-neo-6m, at default 1hz, 9600..... fc is mega2560....
fc is working with the gps already. but i feel like to make it better to 5hz and 57600baud
( i heard this gps can be set up to 10hz... is that possible?)


thanks

User avatar
IceWind
Posts: 115
Joined: Fri Mar 25, 2011 2:11 am
Contact:

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by IceWind »

Does the soldering of the pins 13/14/... is needed to get the GPS to boot at first try?

So far the main issue for me hasn't been the fact of loosing the settings but rather the fact that it doesn't start/work at first try.
Sometimes I need to power it off a few times until I get it to work. When it works it get's the 3D fix right away.

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

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by dramida »

EOSBandi wrote:
dramida wrote:After a few night flights in parking lot with SERIAL RCtimer Ublox 6m GPS and Crius AIO Mega Board, i observed an improvement in gps pos hold. Also gps acuracy wonders around 2-4 meters or so around the start point, the movement is smooth, less chaotic and more and more periods of time the copter is staying in the same spot.
My next experiment will be to modify the GPS antenna with an 2.5 cm patch antenna and then to home build an standard half wave patch antenna on 1575Mhz and mount it above the copter.
Any links for a DIY? I found only one http://www.express-builder.com/docs/gpsant/
Other ideeas are wellcome.

You will need active antenna for the module. The antenna you linked is a passive one.... so you will have to add an LNA to this to make it work... also active antenna designs also contains a bandpass filter to cancel out out-of-the-band noise, and all parts have to be properly impedance matched... So unless you are experienced with over Ghz radio comms and has a proper equipment (spectrum analyser, SWR meter for Ghz band, etc...) it is just shooting in the dark....



The LNA and band pass filter is built in gps receiver chipset. Can you see any power line output twoards gps patch antenna to power LNA? ANd impedance match is meet as this desigh has 50 ohm impedance.
Anyway, your latest gps.ino works like a charm. With standard RCTimer ublox 6M GPS receiver, it holds position within 2 m radius, and even if it drifts, it wonders very smooth. See sample video below http://www.youtube.com/watch?v=ORQ30NBwB-M
One issue, i observed that not all the time the GPS led is flashing on controller, sometimes it needs a reboot. Also i wold like to have a setup procedure for NMEA standard. I'll keep you informed about results with full size gps patch.
/Mihai

Woppit
Posts: 22
Joined: Tue Jul 17, 2012 11:47 pm

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by Woppit »

Hi All,I have a strange problem, been running multiwii v2.1 with the Neo 6 at 115K with no problems (apart from the power cycling and the odd config refresh)
So I thought I would give the following a go(bottom of page). I loaded all the bits in with the new gps.ino, compiled and had the missing endif pop up. I added an endif after this bit of code.

SerialOpen(GPS_SERIAL,GPS_BAUD);

not sure if it's the right place but it seemed to do the trick! recompiled and loaded the code and it all fired up fine, tested it through the config and had good gps
and all looked ok. But when I powered the craft from the flight pack the ESC'S don't finish initialization so when I arm the board the motors wont start. I have tried
loading the code several times and the same result? all works but ESC's don't finish there initialization tones?
Any ideas?

Thanks
Woppit

EOSBandi wrote:OK, here is a first version : I dont commit it into shared yet, since it is based on a 2.1 Gps.ino and still uses classes.
Just replace the Gps.ino and add the follwing lines to config.h gps part

Code: Select all

    //#define NMEA
    #define UBLOX
   // #define MTK

   #define GPS_LEAD_FILTER

//#define GPS_FILTERING
//#define NAV_SLEW_RATE              30

Plus add the initialisation to the multiwii.ino setup()

Code: Select all

  
#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

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

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by dramida »

You have to wait a few more seconds befor trying to arm the copter because initialisation routine of GPS takes a few seconds. Anyway the code works sporadicaly, some times the gps stautus leds don't flash even we have a 3d fix and pos hold dosen't work either in this situation.(binary RCtimer ublox neo 6M GPS on serial 2)

Woppit
Posts: 22
Joined: Tue Jul 17, 2012 11:47 pm

Re: New RCtimer GPS Ublox Neo 6M fails to perform on Mega bo

Post by Woppit »

Don't think it's that because I had it on the bench GPS running for ten mins and an 8 sat lock, plugged in the flight pack with it still on the pc the ESC's start to beep but don't finish? the board arms and disarms and the GPS LED's are flashing but the ESC's just don't give the final init tone? tried it in the garden to and same thing it's very odd, if I comment out the GPS in config.h it all works again, uncomment GPS and the ESC's don't fully arm? it must be something I have done as it works for others! unless the endif I had to put in is in the wrong place? I'll go have another play!
Thanks
Woppit

User avatar
quadwalker
Posts: 18
Joined: Wed Aug 08, 2012 8:21 pm
Location: IdF

MW 2.1 + FC CRIUS AIOP + CRIUS GPS neo 6m

Post by quadwalker »

Hello

I have Crius GPS and FC AIOP and I've made the nice modification by soldering on the GPS the pins 13&14 together

This is working like a charm. Starting from default 38400baud and setting 115400baud/10hz from the MW 2.1 software modified. So no more problem due to the lack of power for the battery not working so well

Here the piece of code to modifiy in Multiwii_2_1.ino. This is a little "harded" coded by using Serial2 from "HardwareSerial" component since I've connected my GPS on the serial #2 port. The code here after is the full section to init the GPS_SERIAL

In order to have your sktech compiling with Arduino 1.0.1, you will need to comment some part of code in HardwareSerial.cpp. I think it is necessary since those macro are probably alredy defined somewhere in the mwc sketech
hardwareSerial.cpp is located in "arduino-1.0.1\hardware\arduino\cores\arduino"

Then you can flash this version on your CRIUS AIOP FC and your CRIUS GPS should be fine now

hope that will help folk!


-------------------------------------------- modifcations in multiwii_2_1 -----------------------------------------------

Code: Select all

#if defined(GPS_SERIAL)

[COLOR="Red"]    /*****
    //debut suppression BR
    SerialOpen(GPS_SERIAL,GPS_BAUD); 
    delay(400);
    //fin suppression BR
    ******/[/COLOR]
     
[COLOR="DarkGreen"]    //debut ajout BR
    //ouverture de la connexion en 38400 baud
    //programmation par trames UBX du GPS en 115200 baud et 10hz
    //puis reouverture de la connexion en 115200
    delay(1000);
   
    Serial2.begin(38400);
    delay(500);
   
    byte gps10hz[] = {0xB5,0x62,0x06,0x08,0x06,0x00,0x64,0x00,0x01,0x00,0x01,0x00,0x7A,0x12};
    Serial2.write(gps10hz,sizeof(gps10hz));
 
    /****
    byte gps5hz[] = {0xB5,0x62,0x06,0x08,0x06,0x00,0xC8,0x00,0x01,0x00,0x01,0x00,0xDE,0x6A};   
    Serial2.write(gps5hz,sizeof(gps5hz));
    *****/
   
    byte baudrate115200[] = {0xB5,0x62,0x06,0x00,0x14,0x00,0x01,0x00,0x00,0x00,0xD0,0x08,0x00,0x00,0x00,0xC2,0x01,0x00,0x07,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0xC4,0x96};
    Serial2.write(baudrate115200,sizeof(baudrate115200));
    delay(500); //give the GPS receiver time to process
    Serial2.end();
   
    Serial2.begin(115200);
    delay(1000);
    //fin ajout BR [/COLOR]

    for(uint8_t i=0;i<=5;i++){
      GPS_NewData();
      LEDPIN_ON
      delay(20);
      LEDPIN_OFF
      delay(80);
    }
    if(!GPS_Present){
      SerialEnd(GPS_SERIAL);
      SerialOpen(0,SERIAL_COM_SPEED);
    }     
    #if !defined(GPS_PROMINI)
      GPS_Present = 1;
    #endif
    GPS_Enable = GPS_Present;   
  #endif


-------------------------------------------------- modifications in HardwareSerial.cpp

comment from line 88 to 160
and comment from line 178 to 218

Code: Select all

[COLOR="Red"]/**** start section commented
#if !defined(USART0_RX_vect) && defined(USART1_RX_vect)
// do nothing - on the 32u4 the first USART is USART1
#else
#if !defined(USART_RX_vect) && !defined(SIG_USART0_RECV) && \
    !defined(SIG_UART0_RECV) && !defined(USART0_RX_vect) && \
   !defined(SIG_UART_RECV)
  #error "Don't know what the Data Received vector is called for the first UART"
#else
  void serialEvent() __attribute__((weak));
  void serialEvent() {}
  #define serialEvent_implemented
#if defined(USART_RX_vect)
  SIGNAL(USART_RX_vect)
#elif defined(SIG_USART0_RECV)
  SIGNAL(SIG_USART0_RECV)
#elif defined(SIG_UART0_RECV)
  SIGNAL(SIG_UART0_RECV)
#elif defined(USART0_RX_vect)
  SIGNAL(USART0_RX_vect)
#elif defined(SIG_UART_RECV)
  SIGNAL(SIG_UART_RECV)
#endif
  {
  #if defined(UDR0)
    unsigned char c  =  UDR0;
  #elif defined(UDR)
    unsigned char c  =  UDR;
  #else
    #error UDR not defined
  #endif
    store_char(c, &rx_buffer);
  }
#endif
#endif

#if defined(USART1_RX_vect)
  void serialEvent1() __attribute__((weak));
  void serialEvent1() {}
  #define serialEvent1_implemented
  SIGNAL(USART1_RX_vect)
  {
    unsigned char c = UDR1;
    store_char(c, &rx_buffer1);
  }
#elif defined(SIG_USART1_RECV)
  #error SIG_USART1_RECV
#endif

#if defined(USART2_RX_vect) && defined(UDR2)
  void serialEvent2() __attribute__((weak));
  void serialEvent2() {}
  #define serialEvent2_implemented
  SIGNAL(USART2_RX_vect)
  {
    unsigned char c = UDR2;
    store_char(c, &rx_buffer2);
  }
#elif defined(SIG_USART2_RECV)
  #error SIG_USART2_RECV
#endif

#if defined(USART3_RX_vect) && defined(UDR3)
  void serialEvent3() __attribute__((weak));
  void serialEvent3() {}
  #define serialEvent3_implemented
  SIGNAL(USART3_RX_vect)
  {
    unsigned char c = UDR3;
    store_char(c, &rx_buffer3);
  }
#elif defined(SIG_USART3_RECV)
  #error SIG_USART3_RECV
#endif
end section commented ********/[/COLOR]
void serialEventRun(void)
{
#ifdef serialEvent_implemented
  if (Serial.available()) serialEvent();
#endif
#ifdef serialEvent1_implemented
  if (Serial1.available()) serialEvent1();
#endif
#ifdef serialEvent2_implemented
  if (Serial2.available()) serialEvent2();
#endif
#ifdef serialEvent3_implemented
  if (Serial3.available()) serialEvent3();
#endif
}

[COLOR="red"]/******** start section commented
#if !defined(USART0_UDRE_vect) && defined(USART1_UDRE_vect)
// do nothing - on the 32u4 the first USART is USART1
#else
#if !defined(UART0_UDRE_vect) && !defined(UART_UDRE_vect) && !defined(USART0_UDRE_vect) && !defined(USART_UDRE_vect)
  #error "Don't know what the Data Register Empty vector is called for the first UART"
#else
#if defined(UART0_UDRE_vect)
ISR(UART0_UDRE_vect)
#elif defined(UART_UDRE_vect)
ISR(UART_UDRE_vect)
#elif defined(USART0_UDRE_vect)
ISR(USART0_UDRE_vect)
#elif defined(USART_UDRE_vect)
ISR(USART_UDRE_vect)
#endif
{
  if (tx_buffer.head == tx_buffer.tail) {
   // Buffer empty, so disable interrupts
#if defined(UCSR0B)
    cbi(UCSR0B, UDRIE0);
#else
    cbi(UCSRB, UDRIE);
#endif
  }
  else {
    // There is more data in the output buffer. Send the next byte
    unsigned char c = tx_buffer.buffer[tx_buffer.tail];
    tx_buffer.tail = (tx_buffer.tail + 1) % SERIAL_BUFFER_SIZE;
   
  #if defined(UDR0)
    UDR0 = c;
  #elif defined(UDR)
    UDR = c;
  #else
    #error UDR not defined
  #endif
  }
}
#endif
#endif
end section commented *****/[/COLOR]

Post Reply