Go Down

Topic: Configuration of a GPS UBlox NEO 7M (Read 9099 times) previous topic - next topic

McBane

Hi all,

I have a short question regarding my GY-GPSV3-NEO 7M sensorboard which I use with UART:

Is it or how is it possible to configure a ublox GPS? E.g.:
 - Set a different baud rate
 - Set the sample rate/output rate of the NMEA strings
 - other setting like which satellites to use (GPS/GLONASS)

I tried to read the datasheet and the receiver documentation but this seems to be over my head :-/

Thanks and all the best
Tim

-dev

Quote
Is it or how is it possible to configure a ublox GPS? E.g.:
 - Set a different baud rate
Send a proprietary NMEA message, CONFIG, described in Section 25.1: "$PUBX,41,1,3,3,baudrate,0*CS".  You need to fill in the baudrate number and calculate the CS from someplace like here.

In NeoGPS, you would just call

  gps.send_P( F("$PUBX,41,1,2,2,baudrate,0") );

...and it would calculate and send the correct checksum for you.

Quote
- Set the sample rate/output rate of the NMEA strings
This requires sending a UBX binary message, described in Section 35.8.3.  You'll have to make an array of bytes to send, something like this:

Code: [Select]
static uint8_t cfg_msg[] = { 0xb5, 0x62, 0x06, 0x01, 0x03, 0x00, cls_id, msg_id, 0x01, ck_a, ck_b };
You would fill in IDs (like 0xF0, 0x07 for GST) and calculate the two bytes of checksum.

I think you could use the ublox ucenter program to figure out what bytes to send, or to configure your device and save it as a permanent setting.

Quote
- other setting like which satellites to use (GPS/GLONASS)
Again, this requires a binary UBX packet, CFG-GNSS, Section 35.4.2.  As above, you may be able to form by hand, in a static array, or use the ucenter app.

Cheers,
/dev
Really, I used to be /dev.  :(

McBane

#2
Oct 11, 2015, 05:08 pm Last Edit: Oct 11, 2015, 11:00 pm by McBane
Hi /dev once again :),

and again here: Thank you so much!

I googled a bit and as I understood I can connect the GPS via an UART-to-USB converter to the pc and use uCenter for configuration of the device?! The configuration does not get lost when the device is power off, correct?!

What I don't understand:
When I configure it to use GPS and GLONASS satellites it will use them automatically in its position calculation?

Regarding the problem of "doing too much inbetween and possibly using the quite time" discussed in the other post:
After some reading this is a really difficulty for me. In my project I would need kind of a regular sample rate (around 10Hz). I can live with a GPS update e.g. only twice a second (writing 5 times the same value). But waiting/rely on the GPS driven update rate feels not so good at the moment ;).

Do you know if there is an alternative GPS board where I can trigger when the GPS is sending the information? Because I read in datasheet that there is something similar to I2C availabe for the ublox neo 7m.

Thanks and cheers
Tim

-dev

#3
Oct 12, 2015, 01:29 am Last Edit: Oct 12, 2015, 01:33 am by /dev
Quote
The configuration does not get lost when the device is power off, correct?!
Yes.  See the spec:

Quote from: 8.1 Configuration Concept
The Current Configuration can be made permanent (stored in a non-volatile memory) by saving it to the "Permanent Configuration". This is done by...
Quote
When I configure it to use GPS and GLONASS satellites it will use them automatically in its position calculation?
If you don't do anything, it will use GPS and GLONASS.  If you want to use GPS only or GLONASS only, you must configure it:

Quote from: 3 GNSS Configuration
the UBX-CFG-GNSS message ... allows the user to specify which GNSS signals should be processed along with limits on how many tracking channels should be allocated to each GNSS.
"GNSS" is the generic term for a satellite navigation system; GPS and GLONASS are two specific satellite systems.

Quote
In my project I would need kind of a regular sample rate (around 10Hz). I can live with a GPS update e.g. only twice a second (writing 5 times the same value). But waiting/relying on the GPS driven update rate feels not so good at the moment.
This is a difficult concept for many people, so let me make sure you understand some things related to what you just said.


1.  NeoGPS can quickly parse the GPS data, so you will have plenty of time to do "other things".  NeoGPS will use less than 1ms/sentence, regardless of update rate or baud rate.

2.  The ublox transmits data in bursts, 1 burst every second.  If you configure it to send 5 different sentences, it will send 5 sentences every second.  It sends the sentences one after another until they're all sent, then it goes quiet until the next 1-second interval.  If each sentence is about 80 bytes, it will send 400 bytes every second.  If the baudrate is 9600, it takes (400*11)/9600 seconds to send the 400 bytes, about 450ms.  Then it doesn't send anything for the remaining 550ms.

But for a 10Hz update rate, it will try to send 400 bytes every 100ms.  But it takes 450ms to send that many bytes, so... you must either reduce the number of sentences it sends, or increase the baudrate to 38400 or higher.

If you configure it to send only one sentence, 80 bytes would take 91ms, leaving a 9ms quiet time.

If you configure the baud to 115200, 400 bytes would take 38ms, leaving a 62ms quiet time.  One sentence would take 8ms, leaving a 92ms quiet time.

3.  The input buffers are only 64 bytes deep.  If you don't call serial.read() soon enough, you will start losing bytes.  At 115200, 64 bytes takes 6ms.  If you don't call serial.read() every 6ms, you will lose data.

There are two things to consider for your cycle: your most time-consuming operations, and the operations you need to perform frequently.

1) If the most time-consuming operations take longer than the input buffer overflow time (6ms), they can only be performed during the quiet time.  Obviously, they must take less than the quiet time + 6ms, or you'll lose data at the start of the next batch of sentences.

2) The operations you need to perform frequently (e.g., at 10Hz) must not take longer than 6ms.  These can take place while the ublox is sending bytes.  If this is an expensive calculation, you may be able to break it up into several smaller calculations.  Then you can call serial.read() in between the steps to avoid input buffer overflow.

In your case, you don't have to "wait/rely" on the GPS quiet time to do something, you just have to make sure you call serial.read() frequently enough (i.e., at least every 6ms).

That's really the purpose of the NeoGPS examples: they show how to wait until the quiet time.  You don't have to defer everything until then... just the things that you can't break into 6ms steps.  For beginners, it's the safest place to do things, because they don't usually know how long something takes.

The examples also put all the GPS handling (available, read, decode) in one routine, GPSloop().  You can call that from multiple places, either from the main loop(), or in between calculation steps from anywhere in your sketch.

Cheers,
/dev
Really, I used to be /dev.  :(

s4degh

Hi,
thank you -dev for your helpful guidance.

I'm trying to change my configurations so that i use only GLONASS signals but i'm having trouble to figure out what should i exactly send. I'm reading u-blox 7 Receiver Description but i'm still confused.

Could you please help me with a simple example of configuring?
I want to use simple Serial.write(); commands with my Arduino Mega.

Appreciations in advance.

Go Up