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.

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

Postby EOSBandi » Sun Aug 05, 2012 2:14 pm

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 ?)
User avatar
EOSBandi
 
Posts: 766
Joined: Sun Jun 19, 2011 11:32 am
Location: Budapest, Hungary

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

Postby carlonb » Sun Aug 05, 2012 3:31 pm

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
carlonb
 
Posts: 174
Joined: Sun Apr 03, 2011 6:29 pm

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

Postby brettwal » Sun Aug 05, 2012 6:45 pm

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!
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

Postby jy0933 » Sun Aug 05, 2012 10:43 pm

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
jy0933
 
Posts: 180
Joined: Wed Jun 27, 2012 4:24 pm

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

Postby IceWind » Mon Aug 06, 2012 12:55 am

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
IceWind
 
Posts: 104
Joined: Fri Mar 25, 2011 2:11 am

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

Postby dramida » Mon Aug 06, 2012 10:54 am

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
User avatar
dramida
 
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest

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

Postby Woppit » Tue Aug 07, 2012 11:09 am

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
Woppit
 
Posts: 22
Joined: Tue Jul 17, 2012 11:47 pm

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

Postby dramida » Tue Aug 07, 2012 2:09 pm

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)
User avatar
dramida
 
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest

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

Postby Woppit » Tue Aug 07, 2012 4:10 pm

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
Woppit
 
Posts: 22
Joined: Tue Jul 17, 2012 11:47 pm

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

Postby quadwalker » Wed Aug 08, 2012 8:29 pm

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]
User avatar
quadwalker
 
Posts: 18
Joined: Wed Aug 08, 2012 8:21 pm
Location: IdF

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

Postby dramida » Wed Aug 08, 2012 9:13 pm

@quadwalker:
Hi, i had the same problem as you and i found that EosBandi already coded an init function for Crius GPS on Mega Boards. Here it is : viewtopic.php?f=8&t=2166#p20097

First of all i don't think Neo6M gps can work at 10 Hz refresh.
Secondly, i prefer to work on Bandi's code because is straight forward. But since you have to restart the board and wait a lot to have GPS signal OK shown by flashing leds (red and green simultaneously) i think that the GPS init code has some bugs in it.
User avatar
dramida
 
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest

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

Postby quadwalker » Wed Aug 08, 2012 10:00 pm

HI Dramida

THanks. I didn't figure out that an attachment was available in the EosBandi post. His code is pretty nice
From my side, using 115200b and 10hz seems to be working. I can see working well in u-center but also when inside the FC my red and green led are flashing pretty well and in the MWGui I can see my position on the map
If ever, I will switch to 5hz

At the momnt I don't really flew so much with that new FC just received recently
User avatar
quadwalker
 
Posts: 18
Joined: Wed Aug 08, 2012 8:21 pm
Location: IdF

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

Postby dramida » Wed Aug 08, 2012 10:07 pm

I am not a programmer and i like neat and easy to understand code. Your GPS is working at first boot? I have to unplug the battery after a few minutes and replug it to work.
If you could improve Bandi's code, would have more sense for me. Thank you.
User avatar
dramida
 
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest

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

Postby quadwalker » Wed Aug 08, 2012 10:17 pm

I think that it can work at the fisrt boot. I need more time to test since my code was working until tonight :-) From what I read, working at first boot is due to joining together pins 13 & 14
I will keep you informed but normally nothing very fundametaly different from Bani's code except he ensured to filter only the necesssary messages. His init code is nice as well to be able to work whatever the default speed your GSP is configured
User avatar
quadwalker
 
Posts: 18
Joined: Wed Aug 08, 2012 8:21 pm
Location: IdF

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

Postby crashlander » Thu Aug 09, 2012 7:41 am

UBLOX NEO 6 configuration with soldering pins 13,14 and 15 (together) + code that was submitted to _shared by Alexinparis works from r1014 up without problems (from first boot):
viewtopic.php?f=8&t=2166&start=10#p20105

Regards
Andrej
crashlander
 
Posts: 500
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

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

Postby quadwalker » Thu Aug 09, 2012 9:13 am

Hi Dramida

I made a test this morning to see the result on the fisrt plug. After 2/3min I got my GPS active. Red and green leds were "dancing" pretty well :-)
FYI I have soldered only pins 13&14 together

I need to learn now how to use the POSHOLD. When flying and switch on the POSHOLD, is the quadcopter supposed to maintain itself its position?
In my case if it was having an ascending or descending behavior, it is continuing to go up or down even after switching the POSHOLD!!! I probably misunderstood something :-(
User avatar
quadwalker
 
Posts: 18
Joined: Wed Aug 08, 2012 8:21 pm
Location: IdF

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

Postby quadwalker » Thu Aug 09, 2012 9:16 am

Hi Andrej

Yes I saw that thanks to dramida. I was missing the GPS.zip attchment. Anyway, it was funny to test by myself and learned how all that stuff is working. GPS is a real magic box :-)
cheers
User avatar
quadwalker
 
Posts: 18
Joined: Wed Aug 08, 2012 8:21 pm
Location: IdF

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

Postby crashlander » Thu Aug 09, 2012 10:58 am

quadwalker wrote:Hi Andrej

Yes I saw that thanks to dramida. I was missing the GPS.zip attchment. Anyway, it was funny to test by myself and learned how all that stuff is working. GPS is a real magic box :-)
cheers

GPS.zip is EOSBandi's approach to NEO6 and it works with original 2.1 (not dev. _shared) and without any soldering to GPS. But I have not tested it myself.
crashlander
 
Posts: 500
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

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

Postby crashlander » Thu Aug 09, 2012 11:01 am

quadwalker wrote:Hi Dramida
....
In my case if it was having an ascending or descending behavior, it is continuing to go up or down even after switching the POSHOLD!!! I probably misunderstood something :-(


POS. HOLD. will hold geographical position of your multi and not altitude. For that you need properly tuned ALT. HOLD that is independent from GPS functionality.
crashlander
 
Posts: 500
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

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

Postby quadwalker » Thu Aug 09, 2012 1:09 pm

crashlander wrote:
quadwalker wrote:Hi Dramida
....
In my case if it was having an ascending or descending behavior, it is continuing to go up or down even after switching the POSHOLD!!! I probably misunderstood something :-(


POS. HOLD. will hold geographical position of your multi and not altitude. For that you need properly tuned ALT. HOLD that is independent from GPS functionality.


ah great. thank you for pointing out this detail. I am going to test this at the end of this day
User avatar
quadwalker
 
Posts: 18
Joined: Wed Aug 08, 2012 8:21 pm
Location: IdF

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

Postby pm1 » Fri Aug 10, 2012 10:45 am

quadwalker wrote:HI Dramida
From my side, using 115200b and 10hz seems to be working.


I can confirm that. I have measured the time between consecutive reading and put that to a debug variable, it's about 100 ms...
pm1
 
Posts: 136
Joined: Sun Jan 22, 2012 7:26 pm

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

Postby quadwalker » Fri Aug 10, 2012 10:47 am

For those who would like to test using UBLOX Neo 6m at 115200/10hz, here the GPS.ino attachment file modified
As my Neo 6m gps seems supporting this rate, let's have a try from you side if you wish

The GPS.ino was modified to scan 115200 as well during the the GPS init phase to setup the binary mode if ever your GPS should be in that default speed

I think it is also fixing a bug in the scan loop to setup the binay mode. The loop is looking one element behind the end of the baudrates array. Only 4 elements in the array and then 0 to 4 is too much.
Code: Select all
const unsigned long baudrates[5] = {9600U, 19200U, 38400U, 57600U};
...
for (uint8_t i=0; i<5; i++) {


If you prefer to keep using the actual GPS.ino, it will be better to replace 5 by 4 or again better by sizeof(baudrates)
Code: Select all
for (uint8_t i=0; i<sizeof(baudrates); i++) {


Using the new GPS.ino, you will have to add a new define statement GPS_RATE in config.h in the GPS section.
Code: Select all
#define GPS_BAUD   115200   //can be 57600 or 115200
#define GPS_RATE   100        //can be 100ms for 10Hz or 200ms for 5hz
 


Hope that wil help and will be working from your side
have fun
Attachments
GPS.zip
few modifications in the UBLOX_init function
(14.17 KiB) Downloaded 136 times
User avatar
quadwalker
 
Posts: 18
Joined: Wed Aug 08, 2012 8:21 pm
Location: IdF

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

Postby brettwal » Fri Aug 10, 2012 1:26 pm

EDIT: Although the module will run at 115,200 5Hz or 10Hz, this code is NOT properly initializing the module. If I revert back to EOSBandi's GPS.ino it intializes fine.


Looks like it works for the Ublox LEA-6 module on the Crius Extend board as well.

Don't forget to change the SBAS setup in GPS.ino for you area of the world. Also remember, that altitude is set to centimeters, not meters in this version.
Last edited by brettwal on Mon Aug 13, 2012 2:41 am, edited 1 time 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

Postby quadwalker » Fri Aug 10, 2012 2:05 pm

brettwal wrote:Looks like it works for the Ublox LEA-6 module on the Crius Extend board as well.

Don't forget to change the SBAS setup in GPS.ino for you area of the world. Also remember, that altitude is set to centimeters, not meters in this version.


Great if it is becoming more and more "Generic"
Correct for the SBAS. I am going to have a look to setup for froggyland in my case :-)

Will have a look to the ALT unit as well. Perhaps also because I found that POSHOLD is not very very efficient on my first tests?????

Anyother issue. When althold is switched on, I can have my throttle too much sensitive. In other words moving the throttle stick just a litlle and my quad is going up or down too much. When althold is back to off, this become more smooth
Any suggestion to investigate on that issue?
Oops perhaps the ALT unit effect in fact???????
User avatar
quadwalker
 
Posts: 18
Joined: Wed Aug 08, 2012 8:21 pm
Location: IdF

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

Postby nhadrian » Fri Aug 10, 2012 2:53 pm

Hi quadwalker,

EDIT.: I tested with my LEA-6H in my Crius ext. board, looks like it's not working... :( nothing serial from GPS. Changing back to 58600 it works.

For ALT hold sensitivity, change this value in config.h:
#define ALT_HOLD_THROTTLE_NEUTRAL_ZONE 20
I'm using my copter with 80 value instead of 20.....

But be careful, once you'll reach the neutral zone with the stick, it'll became as sensitive as now!!! It's because of the current ALT hold code behaviour. I posted a solution in another topic for compensating angle in LEVEL/ALT hold. For better alt hold behaviour you should try if you would like.

BR
Adrian

PS.: GPS altitude is not used for any purposes in the MWI.
nhadrian
 
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

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

Postby quadwalker » Fri Aug 10, 2012 7:20 pm

nhadrian wrote:EDIT.: I tested with my LEA-6H in my Crius ext. board, looks like it's not working... :( nothing serial from GPS. Changing back to 58600 it works.

For ALT hold sensitivity, change this value in config.h:
#define ALT_HOLD_THROTTLE_NEUTRAL_ZONE 20
I'm using my copter with 80 value instead of 20.....


HI nhadrian

Thanks for the information regarding ALT_HOLD_THROTTLE. I am going to test this
Sorry about LEA-6H not working at 115200bd. NEO-6M is able to do!!!
Perhaps it could be possible to setup autamticaly regarding the receiver version? We can get the hardware version using the MON-VER UBX message :geek:
Yes I got the information that GPS alt is not used. But for the position if unit is cm rather than meter than can have an impact to analyse. My quad is really moving in a large bow when POSHOLD is on!!!

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

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

Postby nhadrian » Fri Aug 10, 2012 7:35 pm

you mean it mooves up-down too much when poshold is active not only alt hold?
nhadrian
 
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

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

Postby IceWind » Fri Aug 10, 2012 7:56 pm

quadwalker wrote:For those who would like to test using UBLOX Neo 6m at 115200/10hz, here the GPS.ino attachment file modified
As my Neo 6m gps seems supporting this rate, let's have a try from you side if you wish

The GPS.ino was modified to scan 115200 as well during the the GPS init phase to setup the binary mode if ever your GPS should be in that default speed

I think it is also fixing a bug in the scan loop to setup the binay mode. The loop is looking one element behind the end of the baudrates array. Only 4 elements in the array and then 0 to 4 is too much.
Code: Select all
const unsigned long baudrates[5] = {9600U, 19200U, 38400U, 57600U};
...
for (uint8_t i=0; i<5; i++) {


If you prefer to keep using the actual GPS.ino, it will be better to replace 5 by 4 or again better by sizeof(baudrates)
Code: Select all
for (uint8_t i=0; i<sizeof(baudrates); i++) {


Using the new GPS.ino, you will have to add a new define statement GPS_RATE in config.h in the GPS section.
Code: Select all
#define GPS_BAUD   115200   //can be 57600 or 115200
#define GPS_RATE   100        //can be 100ms for 10Hz or 200ms for 5hz
 


Hope that wil help and will be working from your side
have fun


Are you using this and have the ublox with the pins 13,14 and 15 soldered?
I changed the I2C sketch to perform the same and so far the only remaining issue is the damm GPS not starting at first try.
User avatar
IceWind
 
Posts: 104
Joined: Fri Mar 25, 2011 2:11 am

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

Postby quadwalker » Fri Aug 10, 2012 7:59 pm

nhadrian wrote:you mean it mooves up-down too much when poshold is active not only alt hold?


I mean even horizontaly. The quad is realy moving 5m in any direction from the position I'm switching on POSHOLD
User avatar
quadwalker
 
Posts: 18
Joined: Wed Aug 08, 2012 8:21 pm
Location: IdF

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

Postby dramida » Fri Aug 10, 2012 8:02 pm

It seems that serial GPS is not so-well supported as I2C navi GPS.
Today i had hard times trying to make ublox gps neo 6m working. the leds were flashing but the GUI arrow did not flash.
I even tried MT3329 gps and this one worked sporadically as if it worked 1 second and then shutted off and after another 5 seconds worked again...and off again...
My last hope is to try I2C navi board, even it seems to be over my shoulder as i use a mega board with 3 spare serial ports.
User avatar
dramida
 
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest

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

Postby quadwalker » Fri Aug 10, 2012 8:12 pm

Are you using this and have the ublox with the pins 13,14 and 15 soldered?
I changed the I2C sketch to perform the same and so far the only remaining issue is the damm GPS not starting at first try.


Hi iceWind.
I only have pins 13 & 14 soldered together. Pin 15 remains unchanged. My GPS is a Neo 6m from rctimer
User avatar
quadwalker
 
Posts: 18
Joined: Wed Aug 08, 2012 8:21 pm
Location: IdF

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

Postby IceWind » Fri Aug 10, 2012 8:38 pm

quadwalker wrote:
Are you using this and have the ublox with the pins 13,14 and 15 soldered?
I changed the I2C sketch to perform the same and so far the only remaining issue is the damm GPS not starting at first try.


Hi iceWind.
I only have pins 13 & 14 soldered together. Pin 15 remains unchanged. My GPS is a Neo 6m from rctimer


Thanks. I'll give it a try
User avatar
IceWind
 
Posts: 104
Joined: Fri Mar 25, 2011 2:11 am

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

Postby brettwal » Fri Aug 10, 2012 9:42 pm

dramida wrote:It seems that serial GPS is not so-well supported as I2C navi GPS.
Today i had hard times trying to make ublox gps neo 6m working. the leds were flashing but the GUI arrow did not flash.
I even tried MT3329 gps and this one worked sporadically as if it worked 1 second and then shutted off and after another 5 seconds worked again...and off again...
My last hope is to try I2C navi board, even it seems to be over my shoulder as i use a mega board with 3 spare serial ports.



Sounds like mis-matched baudrates.
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

Postby brettwal » Fri Aug 10, 2012 9:44 pm

nhadrian wrote:Hi quadwalker,

EDIT.: I tested with my LEA-6H in my Crius ext. board, looks like it's not working... :( nothing serial from GPS. Changing back to 58600 it works.

For ALT hold sensitivity, change this value in config.h:
#define ALT_HOLD_THROTTLE_NEUTRAL_ZONE 20
I'm using my copter with 80 value instead of 20.....

But be careful, once you'll reach the neutral zone with the stick, it'll became as sensitive as now!!! It's because of the current ALT hold code behaviour. I posted a solution in another topic for compensating angle in LEVEL/ALT hold. For better alt hold behaviour you should try if you would like.

BR
Adrian

PS.: GPS altitude is not used for any purposes in the MWI.



I have the Crius AIO and extend board with LEA-6 and its working for me. 57,600 10Hz or 5Hz & 115,200 10Hz or 5Hz It does take a good 20 seconds or so from boot for data to show in the GUI
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

Postby nhadrian » Sat Aug 11, 2012 4:33 am

brettwal wrote:
nhadrian wrote:Hi quadwalker,

EDIT.: I tested with my LEA-6H in my Crius ext. board, looks like it's not working... :( nothing serial from GPS. Changing back to 58600 it works.

For ALT hold sensitivity, change this value in config.h:
#define ALT_HOLD_THROTTLE_NEUTRAL_ZONE 20
I'm using my copter with 80 value instead of 20.....

But be careful, once you'll reach the neutral zone with the stick, it'll became as sensitive as now!!! It's because of the current ALT hold code behaviour. I posted a solution in another topic for compensating angle in LEVEL/ALT hold. For better alt hold behaviour you should try if you would like.

BR
Adrian

PS.: GPS altitude is not used for any purposes in the MWI.



I have the Crius AIO and extend board with LEA-6 and its working for me. 57,600 10Hz or 5Hz & 115,200 10Hz or 5Hz It does take a good 20 seconds or so from boot for data to show in the GUI


Your ext. board contains LEA-6H module too? really strange then... Do you have anything modified on your board? Soldering module pins, etc....?
nhadrian
 
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

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

Postby brettwal » Sat Aug 11, 2012 5:06 am

no mods, all stock
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

Postby Mac9 » Sat Aug 11, 2012 12:01 pm

Hi nhadrian and brettwal,
I have a Criu AIO Pro V1 with LEA-6H extender board and all seem sweetness and light, 6 to 8 satellites on my windowsill with the 25mm Antenna supplied and 7 to 9 with a Mouser 30mm unit. The WinGUI shows good fixes at both 57600 and 115200. 5Hz. I programmed the configuration with u-center, but I am unsure if my v2.1 modified GPS.h file is not forcing a 57600 baud rate, must check that. According to the data sheet the 6H has Flash storage for configuration settings page 10 parra 1.12.2 of the data sheet. However I have asked for clarification of this information as ESOBandi "The GPS guru" claims that no Ublox modules have non volatile storage for configuration. If the LEA-6H has such storage and the data sheet says it has then all the complications of soldering EPROMS, shorting out pins and downloading set up strings to the GPS module during Setup, are superfluous to anyone with a LEA-6H module and they fit so well on to the AIO Pro. The only down side being the extra cost.
Flying so far has not been so successful as I am having great difficulty in getting the Altitude hold correction stable, that means that I have been loath to commit to position hold or RTH without switching it quickly out as the quad jumps or dives. Practice and patience required and today is far too windy, that's been the story of the year where I live.

Regards

John
Mac9
 
Posts: 45
Joined: Thu Oct 20, 2011 2:47 pm

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

Postby dramida » Sat Aug 11, 2012 4:49 pm

What software version are you using in those working GPS Ublox setups? Right now are 3 software setups that claims they work in ublox GPS:

1-Alex made on R1014 the integration of Ublox neo 6M with binary 5Hz (you have to solder pins 13, 14, 15) viewtopic.php?f=8&t=2166&start=10#p20105
2-EosBandi did some code mods witch were not published in shared trunk.http://www.multiwii.com/forum/viewtopic.php?f=8&t=2166#p20097
3- Quadwalker did some straight forward coding and claims it works at 10Hz refresh http://www.multiwii.com/forum/viewtopic.php?f=8&t=2166&start=40#p20569

The only method i tried was 2-by Bandy and i had serious trouble: In NMEA mode with an MT3329 GPS- disaster struck! it works sporadicly. If Ublox neo6m used, it works sporadicly, also leds are flasking, the GUI dosen't show data. Also some time works, some times, it dosen't. And i presume the missing #endif statament from Bandi's code is after SerialOpen function.
Last edited by dramida on Sat Aug 11, 2012 5:50 pm, edited 1 time in total.
User avatar
dramida
 
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest

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

Postby crashlander » Sat Aug 11, 2012 5:43 pm

dramida wrote:What software version are you using in those working GPS Ublox setups? Right now are 3 software setups that claims they work in ublox GPS:
...
The only method i tried was 1-by Bandy and i had serious trouble: .

You probably meant 2 (from your order)....
I'm using 1. (Alexinparis, + 13,14,15 pins together) and it works flawlessly with NEO6 (http://www.goodluckbuy.com/rabbit-gps-r ... oller.html) on Crius AIO.

Regards.
crashlander
 
Posts: 500
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

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

Postby brettwal » Sat Aug 11, 2012 11:06 pm

@dramidia

On my serial setup(AIO Pro and Extend Board w/ LEA-6) I am using Bandi's new GPS.ino and associated mods. Aslo tried quadwalkers mods and they work for me as well.

My i2c setup (NEO-6) I am not able to find a complete solution without soldering pins yet. As long as the NEO-6 has config from U-Center (uploading Bandi's config.txt) it works great but, it does not keep this config for long.
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

Postby Mac9 » Sun Aug 12, 2012 10:47 am

Hi,
I have CRIUS AIO Pro V1 with extender board containing the Ublox LEA-6H. I reflashed the LEA-6H using u-centre with the latest firmware I think it was 7.01from the Ublox website, using u-centre to configure the unit to 57600 5Hz and saved the configuration to flash. I am using EOSBandi's unpublished mods, which may or may not be reconfiguring I will try and check that today as its far too windy for me to try and sort out my Laval and alt hold problems, all seems OK, using WinGUI to check I have a steady 6 to 9 satellites depending on which antenna I use.

Regards

John

OK
Some tests done. Down loaded v2.1 unmodified, not used before, LEA 6H still same configuration 57600 5 Hz, checked using u-centre twice. WinGUI reports 6/7 satellites this could be change in cloud cover can not see how MultiWii soft ware can effect number of satellites found, unless the parsing of the NMEA messages radially changes. Wind is dropping I may try and fly in back garden, only about 3 by 4 meters so no GPS and see if Alt Hold and Level are improved. All seems to suggest that LEA 6H does its stuff regardless of minor changes to MultiWii software. Hope I am correct cause I have just ordered another one from RC Timer.
Have you noticed that this hobby is 80% Hope, 10% exasperation, 5% expectation and 5% ?
Mac9
 
Posts: 45
Joined: Thu Oct 20, 2011 2:47 pm

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

Postby flipflop » Mon Aug 13, 2012 1:13 am

How in the world do you get the R1014 changes into MW2.1???
flipflop
 
Posts: 1
Joined: Sun Jul 15, 2012 12:04 pm

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

Postby dramida » Mon Aug 13, 2012 10:00 am

Download 15 files as "save as" option on "view raw file" link. Here is the index: http://code.google.com/p/multiwii/sourc ... Wii_shared
Put the files in one folder and that's it.
User avatar
dramida
 
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest

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

Postby quadwalker » Thu Aug 16, 2012 1:27 pm

Hello

When PosHold and AltHold are activated, do you have your position well kept?
In my case, my quad is flying slowly to the left, mostly 5 or 10m from the position I activivated then he is coming back to the position wanted but staring again going back to the left and backward as well. After 2/3, the way to come back to the wanted position is done more and more in an acrobatic way

Do you have the same behavior?
Did I miss to activate something? what are the falg I may want to enable for POSHold feature?????

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

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

Postby dramida » Sat Aug 18, 2012 10:49 pm

I found that at first power up after a period of innactivity, Ublox neo 6M gps from Rctimer sends an error message instead of data and halts. This error message is related to low voltage of backup memory cell battery.
That's why it is better to power the board, wait for a couple of seconds, unplug and immediately plug the battery again. For me is working this method every time.
User avatar
dramida
 
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest

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

Postby scanman » Sun Aug 19, 2012 6:04 pm

dramida wrote:I found that at first power up after a period of innactivity, Ublox neo 6M gps from Rctimer sends an error message instead of data and halts. This error message is related to low voltage of backup memory cell battery.
That's why it is better to power the board, wait for a couple of seconds, unplug and immediately plug the battery again. For me is working this method every time.


I am finding the same problem, i tried to send a warmboot command to the gps by modifying the EOSBandi code on the i2Cnav, but it didnt help. I think i must put an external power switch to automatically power off/on the gps afew seconds after boot.
scanman
 
Posts: 67
Joined: Thu Jun 21, 2012 9:26 am
Location: Durban, South Africa

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

Postby pm1 » Mon Aug 20, 2012 7:51 pm

quadwalker wrote:Hello

When PosHold and AltHold are activated, do you have your position well kept?
In my case, my quad is flying slowly to the left, mostly 5 or 10m from the position I activivated then he is coming back to the position wanted but staring again going back to the left and backward as well. After 2/3, the way to come back to the wanted position is done more and more in an acrobatic way

Do you have the same behavior?
Did I miss to activate something? what are the falg I may want to enable for POSHold feature?????

thanks

I found, the PID configuration is very sensible. I checked all of the PID code seperately and found out, that the parameter are a bit curious. I changed the code a bit, and I now have a constant position effectively without visible movement of the quad. At the long term (minutes) the quad moves due to the errors of the GPS. I do not know, how the code works for slow GPS, but with ublox binary at 10 Hz it's fine.

I think, I will do some tests again, and will show then the code here...
pm1
 
Posts: 136
Joined: Sun Jan 22, 2012 7:26 pm

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

Postby dramida » Mon Aug 20, 2012 11:22 pm

Have you used IMU data in position hold error function? In this way the copter would react even at the slightest lateral acceleration.(DJI does this way)
User avatar
dramida
 
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest

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

Postby pm1 » Tue Aug 21, 2012 9:10 pm

dramida wrote:Have you used IMU data in position hold error function? In this way the copter would react even at the slightest lateral acceleration.(DJI does this way)


No, it was not neccessary. I tried exactly this for altiude hold, but it didn`t work. With the integration I got so such an drift, that it was worse than before.
pm1
 
Posts: 136
Joined: Sun Jan 22, 2012 7:26 pm

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

Postby dramida » Tue Aug 21, 2012 11:13 pm

pm1 wrote:
dramida wrote:Have you used IMU data in position hold error function? In this way the copter would react even at the slightest lateral acceleration.(DJI does this way)


No, it was not neccessary. I tried exactly this for altiude hold, but it didn`t work. With the integration I got so such an drift, that it was worse than before.

You have to consider that fusioning barometer with accelerometer data is a challenge, you can't just add the two errors togheter and expect to work. The Acc data is oriented on short term response, and the baro data is usable over an longer period.
For me it looks as the same algorythm between giro and acc witch calculate the horizon (on a different time scale): Giro is responsable for short term movements and accelerometer takes over the long term position. ( i know that from miss-aligning the sensors in config.h :))
User avatar
dramida
 
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest

Next

Return to Software development

Who is online

Users browsing this forum: Google Adsense [Bot], happul3 and 4 guests