Calculating distance using GPS

Discussion in 'Electronic Design' started by jdhar, Sep 10, 2008.

1. jdharGuest

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??

2. Rich GriseGuest

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

Cheers!
Rich

3. Rich WebbGuest

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.

4. PeterDGuest

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

5. jdharGuest

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.

6. jdharGuest

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

7. Rich WebbGuest

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.
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.

8. dalai lamahGuest

Un bel giorno jdhar digitò:
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
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).

9. LVMarcGuest

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.