GPS sensor

Development & General Chat for the superb openxvario project.

Moderator: rainer

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

Re: GPS sensor

Post by mstrens »

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 »

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: 467
Joined: Fri Aug 02, 2013 6:55 pm
Country: Germany
Location: Freinsheim RP

Re: GPS sensor

Post by Carbo »

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: 905
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: GPS sensor

Post by kalle123 »

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 »

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 407 times

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

Re: GPS sensor

Post by mstrens »

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 »

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: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GPS sensor

Post by mstrens »

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 »

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: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GPS sensor

Post by mstrens »

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 »

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 365 times
devil
Posts: 16
Joined: Fri Mar 24, 2017 11:29 am
Country: Germany
Location: Hessen / Büdingen

Re: GPS sensor

Post by devil »

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: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GPS sensor

Post by mstrens »

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: 16
Joined: Fri Mar 24, 2017 11:29 am
Country: Germany
Location: Hessen / Büdingen

Re: GPS sensor

Post by devil »

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  
Hoangluu
Posts: 35
Joined: Wed Oct 12, 2016 6:40 am
Country: Vietnam
Location: Binh Duong

Re: GPS sensor

Post by Hoangluu »

Hi,
I have built an openXsensor with N32+GPS sensor, It works perfectly.
Recently I build another for my friend use NZ GPS but it is not work as it should.
The blue led on GPS module flashes but no GPS data received.
I tried with OP GPS module but it is not work too.
The GPS i bought from Taobao (http://sea.taobao.com/item/en/521911....101.86.iJxCHL)

I am not sure the openXsensor only work with N32+GPS or work with all of GPS module?
Thank you for your help.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GPS sensor

Post by mstrens »

I can't open the link.
oXs should work with gps module if the chip is a ublox neo6M (or neo7M, neo8M).
Still oXs expect that the chip is configure to start up with a standard configuration (e.g. UART 9600 bd,..).
At power up oXs sent some code to the gps chip in order to force the gps to use a specific oXs configuration.

It could be that your module has a preloaded configuration which avoid oXs start up config to be loaded at startup.

On the web site of ublox, you can find a program that allows to connect the gps to a PC via a USB/serial (FTDI).
Using this program, I expect it is possible to look and perhaps to change the start up config of the gps module.
You can look at the datasheet of the ublox neo7M chip to see what is the standard default config.
Hoangluu
Posts: 35
Joined: Wed Oct 12, 2016 6:40 am
Country: Vietnam
Location: Binh Duong

Re: GPS sensor

Post by Hoangluu »

Thank you, mstrens.
Attached picture is 3 type of GPS module that I have tested (only N32+ GPS worked)
The GPS is worked with U-center via FTDI adptor.
Attachments
TB1De_7JpXXXXaxXVXXXXXXXXXX_!!0-item_pic.jpg_600x600.jpg
McFly2000
Posts: 10
Joined: Fri Mar 17, 2017 7:15 pm
Country: -

Re: GPS sensor

Post by McFly2000 »

Hoangluu wrote: Mon Oct 30, 2017 7:53 am The GPS is worked with U-center via FTDI adptor.


Can you also change the settings with u-center? I have a ublox7 too which does not work with oXs. It seems that this gps only send the coordinates but changing the settings (e.g. baudrate) is not possible. That's why it does not work with oXs.
Hoangluu
Posts: 35
Joined: Wed Oct 12, 2016 6:40 am
Country: Vietnam
Location: Binh Duong

Re: GPS sensor

Post by Hoangluu »

McFly2000 wrote: Tue Oct 31, 2017 9:28 am
Hoangluu wrote: Mon Oct 30, 2017 7:53 am The GPS is worked with U-center via FTDI adptor.


Can you also change the settings with u-center? I have a ublox7 too which does not work with oXs. It seems that this gps only send the coordinates but changing the settings (e.g. baudrate) is not possible. That's why it does not work with oXs.
I can not change the setting with U-center, so i think this is a problem.
McFly2000
Posts: 10
Joined: Fri Mar 17, 2017 7:15 pm
Country: -

Re: GPS sensor

Post by McFly2000 »

Here is a picture of my two GPS.
gps.jpg




The left one works well and the right one has the declared problem. Both are the NZ-GPS Version.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GPS sensor

Post by mstrens »

It looks like the rigth one has a battery that keep the config.
Perhaps you can try to remove the battery. Perhpas that without battery it will go back to default confix of a ublox neo7m
McFly2000
Posts: 10
Joined: Fri Mar 17, 2017 7:15 pm
Country: -

Re: GPS sensor

Post by McFly2000 »

Now I tried it without the battery but it does not change anything. The gps send the coordinates at 9600baud and send commands to the gps it not possible. These ublox7 are likely to be sold with a broken RX line.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GPS sensor

Post by mstrens »

If Rx line is broken on those modules, then oXs will not work except if it is possible to save a specific config into the GPS module (using U-center) and if this config can be reused by the GPS at statup.
If you can't change the setup of the gps with U-center, it will not work.
devil
Posts: 16
Joined: Fri Mar 24, 2017 11:29 am
Country: Germany
Location: Hessen / Büdingen

Re: GPS sensor

Post by devil »

I think it is a module in which nothing can be written in the Eprom.
there are several of them I also have a M8N where the config is fixed.
But also some where you can write normally in the config, even firmware updates.
Hoangluu
Posts: 35
Joined: Wed Oct 12, 2016 6:40 am
Country: Vietnam
Location: Binh Duong

Re: GPS sensor

Post by Hoangluu »

McFly2000 wrote: Tue Oct 31, 2017 11:37 am Now I tried it without the battery but it does not change anything. The gps send the coordinates at 9600baud and send commands to the gps it not possible. These ublox7 are likely to be sold with a broken RX line.
Hi McFly2000,
I have tried to open shield cover on GPS module and discovered that one resistor on Rx line was not connected.
After added this resistor (33ohm, same with the resistor on Tx line), the GPS module work now.
Pls see attached picture, the resistor that I added in red rectangle.
Attachments
Ublox7 PCB.jpg
Carbo
Posts: 467
Joined: Fri Aug 02, 2013 6:55 pm
Country: Germany
Location: Freinsheim RP

Re: GPS sensor

Post by Carbo »

Good catch!
McFly2000
Posts: 10
Joined: Fri Mar 17, 2017 7:15 pm
Country: -

Re: GPS sensor

Post by McFly2000 »

Thanks great job :)
I have also opened the cover and there is no resistor on the rx-line. Unfortunately I do not have this tiny resistor, but I will get one.
Hoangluu
Posts: 35
Joined: Wed Oct 12, 2016 6:40 am
Country: Vietnam
Location: Binh Duong

Re: GPS sensor

Post by Hoangluu »

McFly2000 wrote: Wed Nov 01, 2017 8:35 am Thanks great job :)
I have also opened the cover and there is no resistor on the rx-line. Unfortunately I do not have this tiny resistor, but I will get one.
I think you can shorted this resistor, I will work. ;)
User avatar
ddano007
Posts: 41
Joined: Thu Nov 13, 2014 8:40 pm
Country: Slovakia
Contact:

Re: GPS sensor

Post by ddano007 »

A few photos of my GPS & vario at the end of an article (web is in Slovak). I use Beitian BN-880 from BG, and works fine. Great thanks.

Post Reply

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