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: 755
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: 153
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: 91
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

PreviousNext

Return to Software development

Who is online

Users browsing this forum: -ralf-, Google [Bot], Google Adsense [Bot], mattster98 and 6 guests