GPS sensor

Development & General Chat for the superb openxvario project.

Moderator: rainer

mstrens
Posts: 1066
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GPS sensor

Post by mstrens » Sat Feb 18, 2017 8:48 am

There is some discussion already here:
https://www.rcgroups.com/forums/showthr ... curate-GPS

RightRudder
Posts: 241
Joined: Tue Jan 15, 2013 9:41 pm
Country: -

Re: GPS sensor

Post by RightRudder » Sat Feb 18, 2017 12:41 pm

The thing that attracted me was the fact that the RTK processing is done right on the GPS. Others have done it with raspberry pi talking to a receiver that can output carrier phase information and you can do it that way for less money but it gets a bit bulky for a model aircraft.

Carbo
Posts: 249
Joined: Fri Aug 02, 2013 6:55 pm
Country: -

Re: GPS sensor

Post by Carbo » Sun Apr 09, 2017 3:14 pm

My onboard GPS needed often a long period of time until it had a GPS fix, yesterday it did not work for 35 min. After a hint from another user i tried to shield the GPS from RX. Indeed it fixed within 20s. The STM32F103 cpu frequency 72MHz shall be the culprit?

My final solution is a pcb connected to RX GND between RX and GPS. The GPS fix is now always reached within 30s.
GSP_shield.jpg
GPS_Shield.jpg

User avatar
kalle123
Posts: 686
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: GPS sensor

Post by kalle123 » Thu Apr 20, 2017 3:55 pm

oXs GPS under MPX M-Link with FrSky converter on Taranis.

Tested today. Working fine.

oXs #1 with MS5611, ACS712 and voltage divider for Lipo voltage
oXs #2 for ublox Neo7M

See some pics here -> http://www.rc-network.de/forum/showthre ... ost4309441

COURSE and BEARING instead of NMEA coordinates is a thing, you have to get used to ;)

br KH

arseni
Posts: 9
Joined: Sat Sep 21, 2013 7:33 pm
Country: -

GPS as the only sensor

Post by arseni » Sat Jul 01, 2017 8:23 am

I'm waiting for the pressure sensor and trying to make GPS work with oXs as the only sensor.

I'm using version 8.02 and pretty much default config except a few changes:
1. In oXs_config.h Uncommented this line:

Code: Select all

#define GPS_INSTALLED
Set serial pin to 4 (it was 2 in original file)

Code: Select all

#define PIN_SERIALTX      4
2. in oXs_gps.cpp uncommented this line:

Code: Select all

#define DEBUGPARSEGPS
and

Code: Select all

#define DEBUGSIMULATEGPS
Protocol in config is set like this:

Code: Select all

#define PROTOCOL  FRSKY_SPORT
When I connect pin D4 to X8R smart port and try discovering new sensors - I'm only getting "Cels" besides standard RSSI and Rx Voltage.
W/o Pin D4 connected - I'm not getting "Cels" on sensor discovery.
So it looks like something is getting into the smart port, but not GPS data.

Here is what debug output looks like:

Code: Select all

openXsensor starting..
 milli=0
freeRam=681
Enter setup voltage
Reference voltage:1100
Voltage:1 , pin=2 , offset=0  , mVoltPerStep=20.77
Voltage:2 , pin=3 , offset=0  , mVoltPerStep=6.46
Voltage:3 , pin=1 , offset=0  , mVoltPerStep=8.24
Voltage:4 , pin=8 , offset=0  , mVoltPerStep=3.21
Voltage:5 , pin=8 , offset=0  , mVoltPerStep=11.83
Voltage:6 , pin=8 , offset=0  , mVoltPerStep=220.00
End of GPS setup
FRSky Output Module: TX Pin=4
Sport protocol= 1
ADS1115 sensor I2C Addr=48
Set up Ads1115 done. I2C Error code= 32
 milli=2109
End of general set up
Gps fix: 0 long: -811512400 lat: 488625580 alt: 300000
Gps spd 3d: 1788 2d: 1788 course: 0
Gps fix: 0 long: -811512400 lat: 488625580 alt: 300000
Gps spd 3d: 1788 2d: 1788 course: 0
Gps fix: 0 long: -811512400 lat: 488625580 alt: 300000
Gps spd 3d: 1788 2d: 1788 course: 0
Gps fix: 0 long: -811512400 lat: 488625580 alt: 300000
Gps spd 3d: 1788 2d: 1788 course: 0
Gps fix: 0 long: -811512400 lat: 488625580 alt: 300000
Gps spd 3d: 1788 2d: 1788 course: 0
Gps fix: 0 long: -811512400 lat: 488625580 alt: 300000
Gps spd 3d: 1788 2d: 1788 course: 0
Gps fix: 0 long: -811512400 lat: 488625580 alt: 300000
Gps spd 3d: 1788 2d: 1788 course: 0
Gps fix: 0 long: -811512400 lat: 488625580 alt: 300000
Gps spd 3d: 1788 2d: 1788 course: 0
At 2610 Cnt = 216 mVolt 0 = 578
At 2611 Cnt = 216 mVolt 1 = 750
At 2614 Cnt = 216 mVolt 2 = 255
Gps fix: 0 long: -811512400 lat: 488625580 alt: 300000
Gps spd 3d: 1788 2d: 1788 course: 0
Gps fix: 0 long: -811512400 lat: 488625580 alt: 300000
Gps spd 3d: 1788 2d: 1788 course: 0
Gps fix: 0 long: -811512400 lat: 488625580 alt: 300000
Gps spd 3d: 1788 2d: 1788 course: 0
Gps fix: 0 long: -811512400 lat: 488625580 alt: 300000
Gps spd 3d: 1788 2d: 1788 course: 0
Gps fix: 0 long: -811512400 lat: 488625580 alt: 300000
Gps spd 3d: 1788 2d: 1788 course: 0
Gps fix: 0 long: -811512400 lat: 488625580 alt: 300000
Gps spd 3d: 1788 2d: 1788 course: 0
Gps fix: 0 long: -811512400 lat: 488625580 alt: 300000
Gps spd 3d: 1788 2d: 1788 course: 0
Gps fix: 0 long: -811512400 lat: 488625580 alt: 300000
Gps spd 3d: 1788 2d: 1788 course: 0
At 3120 Cnt = 216 mVolt 0 = 543
At 3121 Cnt = 216 mVolt 1 = 801
At 3122 Cnt = 216 mVolt 2 = 228
Gps fix: 0 long: -811512400 lat: 488625580 alt: 300000
Gps spd 3d: 1788 2d: 1788 course: 0
Gps fix: 0 long: -811512400 lat: 488625580 alt: 300000
Is having baro sensor essential for making GPS work? Or am I doing something wrong?

As on pictures below - I'm powering the whole setup from Micro USB side of the Nano ( in order to read debug output )
Getting similar results powering it from X8R side with red wire connected to 'vin' with USB disconnected.

Thank you!
IMG_4987.JPG
IMG_4988.JPG
oXs_config.h
(15.62 KiB) Downloaded 11 times


mstrens
Posts: 1066
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GPS sensor

Post by mstrens » Sat Jul 01, 2017 1:56 pm

oXs can send GPS data even if there is no baro sensor.
In your config, you should keep this line as comment (as you are not using an ADS1115.
#define ADS_MEASURE A0_TO_GND , A1_TO_GND , A2_TO_GND , ADS_OFF

I suggest that you also try keeping the debug line as comment (#define DEBUG).

Please note that oXs send GPS data only when the GPS has a fix. It can take several minutes (mainly if GPS is not outdoor.
On some GPS board, there is a led that will blink when GPS got a fix.
Did you wait long enough to get it?

arseni
Posts: 9
Joined: Sat Sep 21, 2013 7:33 pm
Country: -

Re: GPS sensor

Post by arseni » Sat Jul 01, 2017 5:05 pm

Thank you for the info! I'll try with ADS_MEASURE line commented

regarding GPS fix:
My GPS has LED indicator, so I can see when it gets 3D Fix. Even with 3D fix the GPS sensor was still not discoverable, although I was getting coordinates in debug output.

However, I did the most resent test in GPS simulation mode - without any GPS receiver connected.
I've uncommented this line to enable that:

Code: Select all

#define DEBUGSIMULATEGPS
According to debug output, It looks like it simulates a good fix.

Main question for now: For troubleshooting - Is that a good idea to use GPS simulation mode, or should I better try with Physical GPS sensor?

mstrens
Posts: 1066
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GPS sensor

Post by mstrens » Sat Jul 01, 2017 5:36 pm

I had a short look at the code and I think that you have to try with a physical GPS sensor.
I expect that the buffer use in simulation does not contain the data that will simulate a fix.

arseni
Posts: 9
Joined: Sat Sep 21, 2013 7:33 pm
Country: -

Re: GPS sensor

Post by arseni » Sat Jul 01, 2017 6:01 pm

Thanks! I'll try and update as soon as possible. I'm away from home right now, so it might take a couple days.

I have one question regarding physical GPS:
I can configure it and save it's settings. I have disabled NMEA messages and only left Ublox. And also set baud rate to 38400. I was getting coordinates in debug output, but maybe something was still missing in gps packets.

I'll try with 9600 so that oXs will configure gps module per it's needs. I think not using 9600 at startup could cause my problem. Anyways - will report here when I get back to my device.

mstrens
Posts: 1066
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GPS sensor

Post by mstrens » Sat Jul 01, 2017 6:14 pm

At start up, oXs send a set of commands to GPS in order to force some wel defined configuration.
It assumes that after reset the GPS uses the default setup (in order to accept the commands beng sent by oXs).
I had to do it in this way because my first GPS board had a bad eeprom.

I would recomend to keep it this way.
I do not see an advantage of changing the default setup of GPS (except that it could save a few bytes in oXs code).

arseni
Posts: 9
Joined: Sat Sep 21, 2013 7:33 pm
Country: -

Re: GPS sensor

Post by arseni » Wed Jul 05, 2017 7:15 am

Thank You!
It now works with GPS receiver set in u-center to 9600/ublox+nmea.
Also disabled debug output and commented this line per your suggestion:

Code: Select all

#define ADS_MEASURE A0_TO_GND , A1_TO_GND , A2_TO_GND , ADS_OFF 
Can't wait for my baro sensor to arrive.
Attachments
oXs_config.h
(15.62 KiB) Downloaded 7 times

devil
Posts: 6
Joined: Fri Mar 24, 2017 11:29 am
Country: Germany

Re: GPS sensor

Post by devil » Tue Aug 15, 2017 9:54 am

Hello,

Is it possible to write the config GNSS with OXS into the GPS module?

Problem:
I have an M8N that loses its config after a few hours.

Then missing with always about 10-12 satellites
Attachments
Unbenannt.JPG

mstrens
Posts: 1066
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GPS sensor

Post by mstrens » Tue Aug 15, 2017 10:38 am

oXs supposes that GPS module uses the default config and, at power on, oXs load always the config it needs.
It is possible to add some parameters to the config parameters that oXs load in the gps.
The current parameters are in the file oXs_gps.cpp at folowing lines
const static uint8_t initGps1[] PROGMEM = {
0xB5,0x62,0x06,0x01,0x08,0x00,0x01,0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x13,0xBE, // activate NAV-POSLLH message
0xB5,0x62,0x06,0x01,0x08,0x00,0x01,0x06,0x00,0x01,0x00,0x00,0x00,0x00,0x17,0xDA, // NAV-SOL
0xB5,0x62,0x06,0x01,0x08,0x00,0x01,0x12,0x00,0x01,0x00,0x00,0x00,0x00,0x23,0x2E, // NAV-VELNED
// 0xB5,0x62,0x06,0x08,0x06,0x00,0xE8,0x03,0x01,0x00,0x01,0x00,0x01,0x39, // NAV-RATE for 1 hz
0xB5,0x62,0x06,0x08,0x06,0x00,0xC8,0x00,0x01,0x00,0x01,0x00,0xDE,0x6A, // NAV-RATE for 5 hz
// 0xB5,0x62,0x06,0x08,0x06,0x00,0x64,0x00,0x01,0x00,0x01,0x00,0x7A,0x12, // NAV-RATE for 10 hz
0xB5,0x62,0x06,0x00,0x14,0x00,0x01,0x00,0x00,0x00,0xD0,0x08,0x00,0x00,0x00,0x96, // CFG-PRT : Set port to output only UBX (so deactivate NMEA msg) and set baud = 38400.
0x00,0x00,0x07,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x91,0x84 // rest of CFG_PRT command

I presume that the most difficult is to identify the set of values to be added.
If I remember wel, the current set of values have been found using the configurator provided by ublox and analysing the set of bytes being send on the Tx/Rx line while sending some configuration message.

devil
Posts: 6
Joined: Fri Mar 24, 2017 11:29 am
Country: Germany

Re: GPS sensor

Post by devil » Wed Aug 16, 2017 6:19 pm

The Gps works so far with OXS.
It forgets however after a couple hours that I have Galileo and IMES switched on.

What code do I have to add in the GPS.CPP?

This is the current code from me.

Code: Select all

// send config commands to GPS at 9600 bds (default baud rate)
void OXS_GPS::setupGps( ) {
      const static uint8_t initGps1[] PROGMEM = { 
        0xB5,0x62,0x06,0x01,0x08,0x00,0x01,0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x13,0xBE, // activate NAV-POSLLH message
        0xB5,0x62,0x06,0x01,0x08,0x00,0x01,0x06,0x00,0x01,0x00,0x00,0x00,0x00,0x17,0xDA, //        NAV-SOL
        0xB5,0x62,0x06,0x01,0x08,0x00,0x01,0x12,0x00,0x01,0x00,0x00,0x00,0x00,0x23,0x2E, //        NAV-VELNED
//        0xB5,0x62,0x06,0x08,0x06,0x00,0xE8,0x03,0x01,0x00,0x01,0x00,0x01,0x39,  // NAV-RATE for 1 hz
        0xB5,0x62,0x06,0x08,0x06,0x00,0xC8,0x00,0x01,0x00,0x01,0x00,0xDE,0x6A, // NAV-RATE for 5 hz
//        0xB5,0x62,0x06,0x08,0x06,0x00,0x64,0x00,0x01,0x00,0x01,0x00,0x7A,0x12, // NAV-RATE for 10 hz
        0xB5,0x62,0x06,0x00,0x14,0x00,0x01,0x00,0x00,0x00,0xD0,0x08,0x00,0x00,0x00,0x96, //        CFG-PRT : Set port to output only UBX (so deactivate NMEA msg) and set baud = 38400.
                            0x00,0x00,0x07,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x91,0x84  //                 rest of CFG_PRT command                            
      }  ;   
      uint8_t initGpsIdx = 0 ;
  SOFT_TX_PORT |= (1<<SOFT_TX_BIT);   // put 1 in output port
  SOFT_TX_DDR |= (1<<SOFT_TX_BIT);    // set port as output
  delay(1000) ; // wait to be sure that GPS has started
  while (initGpsIdx < sizeof( initGps1)) {
//    Serial.println( pgm_read_byte_near(initGps1 + initGpsIdx ), HEX) ;    
    gps_putchar( pgm_read_byte_near(initGps1 + initGpsIdx++ ), MICROSECONDS_PER_BIT_9600) ; // Send initialisation command
    delay(10) ;
  }
  delay(100) ;
#ifdef DEBUG
  Serial.println(F("End of GPS setup")) ;
#endif  

Post Reply

Return to “OpenXVario - an open source vario supported by the open source firmwares!!”

Who is online

Users browsing this forum: Google Adsense [Bot] and 2 guests