Go Down

Topic: GPS: set update frequency (Read 20982 times) previous topic - next topic

petterg

About 100 sentences pr second, is an average of 10ms/sentence  sounds like what I've measured. My static test set, I think it was 7 sentences (5 supported + 2 unsupported, I don't have it on this pc) took 75ms to process. After modifying the library to skip the sentence if the first 5 bytes indicates an unsupported sentence, the same data set took 48ms. So clearly some (longer) sentences takes longer to process than others (shorter).

How long will it take for the buffer to overflow at 9600 baud? If that is more than the processing time for the longest sentence, there will be overflow.

PaulS

Quote
How long will it take for the buffer to overflow at 9600 baud?

That depends on how often/quickly data arrives. Once the last sentence in the batch arrives, there is a relatively long delay before another character arrives.
The art of getting good answers lies in asking good questions.

petterg


Quote
How long will it take for the buffer to overflow at 9600 baud?

That depends on how often/quickly data arrives. Once the last sentence in the batch arrives, there is a relatively long delay before another character arrives.



Assumed buffer is empty and the gps start sending data continuously at max speed. How long will it take to fill the buffer?

wildbill

9600 baud is ~960 characters/second. The buffer on the UNO is 64 bytes, so you have about 67ms of continuous input before overflow if you're not reading.

PaulS

Quote
so you have about 67ms of continuous input before overflow if you're not reading.

So, if parsing takes 48 milliseconds, you should never have a buffer overflow problem.

Serial.print()s take time, too, though. What exactly is happening in this 48 millisecond interval? Just the parsing or the parsing and the printing?
The art of getting good answers lies in asking good questions.

petterg

PaulS, you're spot on. Serial.print took almost half the processing time.

So my theory of why the data is delayed is wrong. Then, how can I figure out why there is such major delay in the position data?

PaulS

Quote
Then, how can I figure out why there is such major delay in the position data?

Each sentence includes a time-stamp. What we need to understand is where the discrepancy comes from. Are the sentences arriving late? That is, is there a difference between the time stamp in the sentence and the time when you get the sentence? Perhaps your clock is wrong? :)

How are you determining that there is a delay? You might have mentioned that already, but this thread has wandered all over the place.
The art of getting good answers lies in asking good questions.

petterg

I notice the delay with this test:
Power on
Stand still until I the gps has connection with at least 10 satellites and position is stable.
Run about 50m.
Stop and wait for a few seconds.
Run 50m more in the same direction.
Stop and wait for gps position to update.

The printed positions shows exactly my pattern of stand still-run-stand still-run-stand still - with a delay of 15-20 seconds. I did not pay attention to the timestamp vs clock.

michinyon

GPS devices implement a whole bunch of funny strategies  to work well in cars.

if you are moving slowly,  they tend to assume that you are actually stationary,  because they don't want you to feel that you car is sliding halfway across the road when you are stopped at the traffic light.    That is,   until it realises that you really have moved,   in which case it updates suddenly to the new position.

On some GPS devices,   you can turn these annoying features off,    and see what it really has calculated.

petterg


On some GPS devices,   you can turn these annoying features off,    and see what it really has calculated.


Which leads me back to; where the heck did Docedison find the doc he partially pasted into this post?


Doc

PaulS

Along with what michinyon suggests, my GPS has two modes - walk and drive. Perhaps yours can be similarly configured. For a GPS in a car, 50 meters is not a significant movement. Still, even when driving, my GPS shows much better reaction than yours seems to.

I think that you do need to pay attention to the time stamps vs. clock. Does the last time stamp before you start moving correlate to your clock time? After you run 50 meters, does the next time stamp correlate with your clock? Is the position data in that sentence correct, or not?
The art of getting good answers lies in asking good questions.

petterg


Along with what michinyon suggests, my GPS has two modes - walk and drive. Perhaps yours can be similarly configured.

How did you do that configuration?
If I'm lucky my gps will understand the same commands.


I think that you do need to pay attention to the time stamps vs. clock.

I will, once the rain stops.

PaulS

Quote
If I'm lucky my gps will understand the same commands.

I set mine using the touch screen. Your GPS chip is only one part of a GPS. It's a critical component, but not the only one.

I suspect that the walk/drive option is used to tell the GPS chip how often to report data. But, before you try to go there, I think it's important to understand whether the delay is in the time stamp or the time it takes to recognize that your position has changed. If the time stamp updates correctly, but the corresponding position data is not in sync, you have one problem. If the timestamps are incorrect, you have a different problem. Knowing which you have is crucial to solving it.
The art of getting good answers lies in asking good questions.

alnath

Have you already seen thins link ?
http://tutorial.cytron.com.my/2012/08/16/skm53-gps-module-starter-kit-skgps-53/

it gives some commands to change your chip configuration ( baud rate, NMEA sentences allowed ...)
I didn't try, I don't use the SKM53 ;)
HTH

petterg


Have you already seen thins link ?
http://tutorial.cytron.com.my/2012/08/16/skm53-gps-module-starter-kit-skgps-53/

it gives some commands to change your chip configuration ( baud rate, NMEA sentences allowed ...)
I didn't try, I don't use the SKM53 ;)
HTH


I hadn't seen that exact link, just a similar one.
There surely is a set of commands that can be sent to the gps to change its configuration. The challenge is to figure out / find docs for how those commands are supposed to look. I did only see commands for changing baudrate in that link.

Go Up