Maker Pro
Maker Pro

Calculating distance using GPS

J

jdhar

Jan 1, 1970
0
Using standard RMC NMEA strings from a GPS unit, I'm trying to figure
out the best way to calculate distance traveled over time. The two
methods I have are:

- Use lat/long. coordinates and calculate distance using Haversine
method (or similar) each sample, and keep a running total of distance
traveled
- Use velocity each sample, and multiply by sample interval to get
distance traveled during that interval

I have done some basic tests, and these two methods work out to be
"almost" the same, but not quite... I don't know enough about the
underlying GPS design to determine how lat/long vs. how speed are
determined. Any comments on which method may be more accurate? (or are
they both equally inaccurate).

What is interesting however, is when going under a bridge structure,
the velocity readings become distorted (there is a jump and then a
dip). The lat/long readings don't seem to suffer from this same issue
however. Does anyone know why this is??
 
R

Rich Grise

Jan 1, 1970
0
Using standard RMC NMEA strings from a GPS unit, I'm trying to figure
out the best way to calculate distance traveled over time. The two
methods I have are:

- Use lat/long. coordinates and calculate distance using Haversine
method (or similar) each sample, and keep a running total of distance
traveled
- Use velocity each sample, and multiply by sample interval to get
distance traveled during that interval

I have done some basic tests, and these two methods work out to be
"almost" the same, but not quite... I don't know enough about the
underlying GPS design to determine how lat/long vs. how speed are
determined. Any comments on which method may be more accurate? (or are
they both equally inaccurate).

What is interesting however, is when going under a bridge structure,
the velocity readings become distorted (there is a jump and then a
dip). The lat/long readings don't seem to suffer from this same issue
however. Does anyone know why this is??

First, you lose info from the leading satellite, then, you lose info from
the trailing satellite?

Cheers!
Rich
 
R

Rich Webb

Jan 1, 1970
0
Using standard RMC NMEA strings from a GPS unit, I'm trying to figure
out the best way to calculate distance traveled over time. The two
methods I have are:

- Use lat/long. coordinates and calculate distance using Haversine
method (or similar) each sample, and keep a running total of distance
traveled
- Use velocity each sample, and multiply by sample interval to get
distance traveled during that interval

I have done some basic tests, and these two methods work out to be
"almost" the same, but not quite... I don't know enough about the
underlying GPS design to determine how lat/long vs. how speed are
determined. Any comments on which method may be more accurate? (or are
they both equally inaccurate).

What is interesting however, is when going under a bridge structure,
the velocity readings become distorted (there is a jump and then a
dip). The lat/long readings don't seem to suffer from this same issue
however. Does anyone know why this is??

The reported GPS velocity is likely to be the instantaneous velocity
estimate at the "data valid" time rather than the effective mean
velocity over the sample interval.
 
P

PeterD

Jan 1, 1970
0
What am I missing. Take the starting point, and the ending point and
compute distance? Or do you want road distance?
 
J

jdhar

Jan 1, 1970
0
The reported GPS velocity is likely to be the instantaneous velocity
estimate at the "data valid" time rather than the effective mean
velocity over the sample interval.

Right, I have read this before as well. I'm assuming that the
instantaneous velocity will hold true until the next sample. Obviously
not 100% accurate, but it's all I can do given the limitations of the
system.
 
J

jdhar

Jan 1, 1970
0
What am I missing. Take the starting point, and the ending point and
compute distance? Or do you want road distance?

Ya, basically road distance. If I go around a circle of 1km
circumference, I want to read 1km, not 0.
 
R

Rich Webb

Jan 1, 1970
0
Right, I have read this before as well. I'm assuming that the
instantaneous velocity will hold true until the next sample.

Not quite true. The discrete estimates hold true only for that instant.
You have no information about what happens between estimates, although
the physical constraints of the system may allow you to make some
inferences.
Obviously
not 100% accurate, but it's all I can do given the limitations of the
system.

Not quite true, either. In addition to a simple linear approximation
based on two preceding samples, you can do an n-th order approximation
based on n+1 predecessors. Or, you can use an alpha-beta filter or go
full bang and do a Kalman.
 
D

dalai lamah

Jan 1, 1970
0
Un bel giorno jdhar digitò:
- Use lat/long. coordinates and calculate distance using Haversine
method (or similar) each sample, and keep a running total of distance
traveled
- Use velocity each sample, and multiply by sample interval to get
distance traveled during that interval

Velocity is more accurate, because it is calculated measuring the doppler
shift which is less affected by the ionospheric error. Here's an
informative document:

http://acl.mit.edu/papers/2002_MSEC_93.pdf
What is interesting however, is when going under a bridge structure,
the velocity readings become distorted (there is a jump and then a
dip). The lat/long readings don't seem to suffer from this same issue
however. Does anyone know why this is??

I've noticed this too. Probably it's because the doppler calculation is
"differential" (which is also the reason of its better accuracy): when the
module loses the satellite signal, at the next good fix the difference in
doppler phase will be bigger. For your purpose this is actually good,
because the integral of the speed should remain almost correct (for small
outages).
 
L

LVMarc

Jan 1, 1970
0
jdhar said:
Using standard RMC NMEA strings from a GPS unit, I'm trying to figure
out the best way to calculate distance traveled over time. The two
methods I have are:

- Use lat/long. coordinates and calculate distance using Haversine
method (or similar) each sample, and keep a running total of distance
traveled
- Use velocity each sample, and multiply by sample interval to get
distance traveled during that interval

I have done some basic tests, and these two methods work out to be
"almost" the same, but not quite... I don't know enough about the
underlying GPS design to determine how lat/long vs. how speed are
determined. Any comments on which method may be more accurate? (or are
they both equally inaccurate).

What is interesting however, is when going under a bridge structure,
the velocity readings become distorted (there is a jump and then a
dip). The lat/long readings don't seem to suffer from this same issue
however. Does anyone know why this is??
Changes in the local magnetic potion of the magnetic field we are
naturally exposed to. By addding Iron structure the local magnetic field
is disturbed by the ferrite material. This leaks into the velocity
meters sensing.
 
Top