# Distance with GPS impossible? <1% accuracy

Forget Einstein, let's talk about Reality! All of this is experimental, not theoretical. I've been doing this for 16 years as the technology has changed.

It's easy to calculate the distance between any 2 points accurately. Stand at A, write down numbers. Quickly go to B, the error will be the same, write down numbers. Assuming a straight line the math isn't so bad. You might be off by 1/2 meter.

I've got a great algorithm to calculate the radius given 3 data points nearly in a line. With this, centripetal acceleration, force, lean, friction etc. No one else has published this according to Google.

Interesting problem for you: How to calculate lean angle for a motorcycle for less than \$50k. This is important for racing. I've got 2 solutions, 1 untested. More than 50k?

Another: Record the exact line, within a lane, while racing. 1ft acc would be nice. You can drive around the course slowly right before the race begins to calibrate. Impossible! All you can do is compare yourself to other racers at the same time, assuming you have the same satellites locked. WAAS is not even close.

There's some weird math going on with GPS data. It doesn't matter how fast or slow you go. It doesn't matter how often you sample, even 20x a second. Only relative accuracy matters for this case, even if the error is changing slowly over time, that's OK, a separate issue. It doesn't matter how far apart the sample points are in feet or inches.

No matter what you do, it's difficult to calculate the distance traveled accurately. A mechanical odometer from 1950 is much more accurate. The rope with knots Columbus threw into the water in 1400AD. As accurate as GPS. Why?

I mean within 1-2%. Ignoring things like change in altitude and the weird shape of the planet. Nobody even calculates that. There's no point in trying. Seems like you need AI or a human and additional satellite image data. You could do better than simply adding up the distance between points by instead measuring the distance between accurate turns, in the city blocks for example. Or pick a few points on a curved road radius. Straight is easy using a map and a ruler. Adding up the data points is not the way to go. It never works out.

You have to make additional assumptions. How well are the corners defined? Perfectly square like in theory? With a finite radius? How much zig zag within your lane or while hiking a straight trail? The GPS measurements don't match the reality.

Speed is another problem. Even at a constant speed, you cannot measure this correctly using GPS. You can only measure the speed between any 2 points further apart. By looking at the GPS time and calculating the distance of the path. Which brings you back to the original problem above.

What matters anyway? The actual speed, which would be correct if you averaged 100 points. Or the speed it WOULD have been if you went perfectly straight? Or assuming a certain amount in % of wasted zigging? What matters for distance? Every little step to the side of the trail? Or how far it could have been in theory if you walked perfectly? There is no right answer. And no way to measure it today.

Einstein was wrong... ;) Thoughts?

Using realtime data from the internet, would a more accurate odometer be helpful to anyone you know?

Einstein was wrong... Thoughts?

"Whenever I hear the sparrow chirping, watch the woodpecker chirp, catch a chirping trout, or listen to the sad howl of the chirp rat, I think: Oh boy! I'm going insane again." - Deep Thoughts by Jack Handy

A couple of things:

1) Standard GPS (with SA off, as it is currently - though that could change in the future) is only accurate to 10 meters. 2) If you need more accuracy, you need to invest in DGPS (not cheap, only available in certain areas). 3) http://www.meridianworlddata.com/Distance-Calculation.asp 4) http://en.wikipedia.org/wiki/Geographical_distance

The formulas of points 3 and 4 aren't -that- difficult to implement, if not understand. The Arduino, though, may not have the built in precision needed to employ some of the formulas to obtain a more accurate result (even if the lat/lon data-points were coming from a DGPS-equipped receiver).

I would think someone with 16 years of experience in this would know this - but you didn't seem to give any indication of this in your post...?

Well if you figure out a way to get precise location measurements from off the shelf GPS units I can think of a few 3 letter government agencies that will be paying you a visit.

@zoomkat- I like it!

@crosh- 1) If you want more accuracy wo DGPS, wait 5 minutes and average, 1m. 2) DGPS does not effect relative accuracy. I'm sorry if I'm using the wrong words here. In other words, if I take 2 measurements at point A and B, 2 miles away quickly. They might both be off by 20' wo DGPS absolutely compared to a map. Only 5' w DGPS. But the distance between them will be the same in both cases if you drive quickly. It doesn't make a huge difference even in absolute terms. None in relative terms. DGPS doesn't help in any of the cases I've mentioned. And as you said only works in some areas because of the location of the satellite close to the horizon and trees in the way. You can't even get it to work reliably during a motorcycle race in CA, because of the RFI noise and small hidden antenna? 3) I've been calculating distance between 2 points for 16 years with every GPS model imaginable. PC's, microcontrollers, calculator, pen and paper in the woods etc. There are a couple of gotchas you have to watch for you failed to mentioned. The Equirectangular approximation is good enough for small distances, better than the GPS data itself.

The problem is adding up the distances along a path. Let's say 100 points. You can't beat 1% using GPS data. Less accurate than Columbus 500+ years ago. If you want I can start to explain my theory. It's easy to prove empirically. Do it twice. I'd love to hear a workable solution! So far no one has responded to my other 2 interesting problem challenges! I'm not trying to cheat by getting help on a school project. I've already solved one, and resigned on the other. Just curious if you see a better solution.

@ke7gkp - You want the raw numbers? I could use some exercise. The experiment is repeatable. Or you could do it yourself! Try it! How do you know I'm telling the truth and not trying to trick you with fake numbers? If I were wrong, and the absolute GPS error changes rapidly, then I wouldn't be able to get 2% accuracy measuring distance along a path. We've all watched our location wander on a map when we're not moving. Just zoom in. That's the speed the absolute error changes. If you take a minute to get from A to B the change in absolute error might be 5m, still not bad. Am I using the wrong word to describe this?

@wayneeft - Of course you can't do that. My proposal is to increase the accuracy of an odometer sketch using data from the internet. Maybe on a PC or iPhone? I'm assuming you stay on the road, or a hiking/bike trail. Also assuming you drive like a normal person who is not zig-zagging drunk. Nobody wants to know the actual distance including when you pulled over to take a picture or stopped on a trail to pee. Wouldn't it be more useful to know the distance assuming a perfect drive/driver? Currently it is not possible to get this in real time. Except with a 1-2% error. Maybe nobody cares about this error?

As I mentioned you can get extremely accurate readings from a regular GPS, if you wait an hour without moving. I wrote the simple software for this, running on a microcontroller, in 1995.

It looks like I've gone Insane! Talking to myself! An imaginary friend? It's because someone deleted all their comments and their entire account here... To see the drama, and what I said to cause this? Keep reading!

Emotional issues on the Arduino Forum? Wow!

Thinking... Some sort of smoothing to calculate the distance travelled? This would work for some routes.

You're correct, it is not very useful for most applications to wait an hour without moving. I stand by my statements. Please correct me with actual numbers if I'm wrong. Research? GPS is my life! On weekends, at work, while I'm sleeping. It's all I ever read except fiction. What topic would you have me research? I can explain it to you without looking. I've been involved in the digital side of designing a unit, and the RF signal module years before. I understand how all this relates to Einstein's Theory of Relativity, and how the empirical data disagrees with Einstein. Have you taken a class on this topic? It was my major for MSEE at Lehigh.

Please try to help by providing a solution or at least an idea. Not just laughing or calling it silly. Did I ask my question in a smart enough way for you to understand what I mean?

Please try to help by providing a solution or at least an idea. Not just laughing or calling it silly. Did I ask my question in a smart enough way for you to understand what I mean?

I really didn't see a clear question in what appears to me to be some type of rambling naration of thoughts and theoretical conjecture. You need to develop a clear problem statement and your proposals to solve it if there is an expectation of it being understood by others. Decaf might help. :)

But the distance between them will be the same in both cases if you drive quickly.

The distance between them will be the same if you drive slowly, too. Or walk, hop, skip. jump, or crawl.

The issue is, and always has been, how accurately you can measure point A with respect to any coordinate system, and how accurately you can measure point B with respect to the same (or different) coordinate system. The times at which the two measurements are taken - nanoseconds or years apart - is completely irrelevant.

In addition to that I could look at the actual numbers coming from a unit. I don't care about the military or how bad it was before SA was removed. I lived thru that myself developing applications. I have a friends in the defense industry who discussed the concepts with me before it was available to the public. Instead of just telling me I'm wrong, please specify how I'm wrong. I am very familiar with LORAN and the accuracy of the numbers it provided. I'm not aware of an alternative global system. The Russians? How does it differ? Please enlighten me.

Do you understand my 3 questions/topics? Did I ask them in a smart enough way?

Here we go: 1) How can we measure the distance of a path accurately while it's happening? Like an odometer. Less than 1% error. 2) How can we measure the lean angle of a motorcycle with respect to gravity in degrees? 3) How can we measure the line/track around a motorcycle race course during the race? 1-3ft acc would be nice.

Yes, I'm rambling. I'm aware of that and it was late.

@PaulS - I meant the measured distance will be the same regardless of with or wo DGPS. Of course the actual distance is unchanging! If you move too slowly from A to B, the measured distance between them will change due to absolute error up to 10m or more. The time the measurements are taken is very relevant. Because the relative error is much smaller than the absolute error. Understand?

If you move too slowly from A to B, the measured distance between them will change due to absolute error up to 10m or more. The time the measurements are taken is very relevant.

No, it isn't.

What you have is a relative error in the position of A, and a relative error in the position of B. Your (unrealistic) expectation is that if you move fast enough, the relative errors will cancel out. They do not. Ever. Under any circumstances.

1) How can we measure the distance of a path accurately while it's happening? Like an odometer. Less than 1% error.

You benchmark the current position against a previous position and then calculate/measure a distance between the two. Less than 1% is very easy when using an accurate measuring tool between to well marked positions. Using a 100' tape measure between two points 90' apart probably is well with in this accuracy. Typical GPS is not designed to do this type of measurments. Your use of 1% is relative to what is being measured. GPS is probably with in 1% accuracy when measuring the distance between a point in Dallas, TX. and a point in Denver CO.

2) How can we measure the lean angle of a motorcycle with respect to gravity in degrees?

A mechanical gimbled gyroscope has been the standard for many years.

3) How can we measure the line/track around a motorcycle race course during the race? 1-3ft acc would be nice.

Using a GPS satellite is not a realistic expectation. You will probably need to use benchmark and measurement tools at the track itself. Just remember the laws of physics generally ignore wishful thinking.

Asking for <10-feet accuracy from any GPS, short of military grade (and that will cost you well into the 1000’s of dollars, and will require military clearance) is asking the impossible. I’ve dealt with many off the shelf GPS models (Garmin, Lowrance, Magellan, DeLorme, Pharos , just to name brand names.) and the idea of pinpoint accuracy is not likely with the store-bought type. (even with WAAS (Wide Area Augmentation System))

You have factors like cloud cover, surrounding objects (mountains, buildings, trees) which will obscure the signals in various ways, thus the receiver will only allow that 10-foot minimum. (trust me, when your little Garmin eTrex says 8-ft accuracy, You’re lucky to be within 16-feet.)

I tried awhile back to make a robot-tank, based on the old VEX platform, and I could never get a simple navigation code to work, using just plain NMEA (National Marine Electronics Assoc.) format code. The main problem, was the VEX controller’s limited code (programmer 1.0), and speed.
it would always keep auto-correcting as the receiver received new coordinates. Sometimes, the device would just sit there, then suddenly jump, trying to get to corrected coordinates just inches away, then suddenly go back near where it had started. This, all on just one set of coordinates.
(to say nothing of not being able to decipher which way was north, unless it had moved a few feet. Unless you add a digital compass, a GPS will say you’re facing any direction til you’ve moved, then computer in which direction)

Computing distance, is no better. the distance will always change because of the changing coordinates from the receiver. again, looking for less than 10-feet, is asking the impossible… You’d be better off using a tape measure or a per-measured length of string.

Please pardon any mistakes I've made below, I replied in a rush.

@paul - I can prove that the absolute error will cancel out (be the same) within a few miles and within a few minutes. Time matters. Please help me design an experiment. I'd be happy to do it if you agree to its validity. I have 2 in mind. First, I'll go back and forth between 2 point about 1/4 mi apart. Each time writing down the L/L. Of course they will be different by a few meters. Only a few meters each round trip. Therefore the distance calculation will only be off by a few meters each time. Much less than you think, because the errors partially cancel. In other words my distance measured will not change much. If I take a lunch break before completing my last single measurement of Point B only, then the distance will be different than the rest. An outlier. Agreed? Do you want me to do it 10x to show you?

Second, at a street corner with known coordinates using multiple methods to calculate it... The actual reading will be off by a vector say 45 degrees, maybe 10m. Go to another known corner nearby. It'll be off in the same direction and approximate magnitude! Coincidence? The map is in error? I don't think so. I've been doing this every week for 16 years, the results are always the same.

@KE7 -

Path - Driving a car on a curvy road, or hiking on a trail. 100's of data points are required to capture the curves correctly.

Accurately - I'd like less than 2%. To test this walk the same short trail twice carefully. Or drive as if the cops were watching.

I've clearly agreed already with the rest that you said in 1).

2) I've solved. There are more than one ways to do it cheaply. And at least one expensive solution see below.

3) I told you what accuracy I wish for. Cheap and practical. How does a 5th wheel device determine position within a lane? Sorry if that's a stupid question.

My expectations are very realistic. You're just giving me the canned form letter answer that you say to everyone else on this forum. I'm the one who's telling you GPS cannot do much better than 2%. Is that realistic? I have solved the other problems to my satisfaction. Therefore I am realistic in my expectations. You don't think I can beat 2%? It's impossible? Difficult yes. Impossible no. I have a friend who does exactly what we're asking for at Conrail. His accuracy is 0.1% and his budget is not much bigger than mine for hardware. The only difference is that it's a curved rail, which of course makes it much easier. We're talking.

@zoomkat - 1) Yes, it's easy to get within 1% when point A is in TX and B in CO as the crow flies. But if the recorded path goes from TX to CO, forget it. You'll be off by 10's of miles.

2) A cheap gyroscope does not work. My friends have tried. Over the course of the race, with all the engine vibration, violent changes in angle, and slow changes too, it forgets which way is up. We have had some success with an expensive military grade unit.

3) I do not understand your solution. Here's what I have that works. I also have another theory to test. With 8 riders having GPS riding 10 laps, just average their tracks. A human can do this manually. Picture dragging the whole polygon until it lines up with the others overall. There are 80 per race so it's labor intensive. Of course there will be minor differences. This is what I want to measure! It can also be automated like this: Average all the points in 1 lap. For each lap and each rider, the result should be the same. Shift those which are not. I am satisfied except for the following limitations: You need access to multiple riders data. You have to shift the polygon more than once within a lap to get to 1ft accuracy.

@gelfing - I agree with your assessment of consumer grade WAAS. More like 30ft most of the time. I understand the problems in your project. Mine were similar. Over time 30ft is all I can expect to measure distance. But while you're driving you can expect each individual sample to be much more accurate, relatively, than that. Maybe inches. Let me exaggerate to illustrate my point. Let's say we're sampling our position 10x/sec. Each sample might be off by 1" relatively, compared to the last. But over the course of a trip to work we might be off by 100m. These small error are additive. The errors which matter are perpindicular to our path of travel. If a point was wrong in the direction we're going, it wouldn't matter to calculate the total distance traveled. If we assume it's a perfectly straight line (when it is), it's easy to fix the error. It's not much harder when you're driving around a city with square streets and no lane changes. What do we do about curves? My friend at Conrail knows the answer to this when they're constant curves. I'm getting closer! If someone could throw me an idea...

It looks like I'm talking to myself above because...

I think we lost KE7... whatever his Ham call sign was. It seems he can't hang with me. Did I say something wrong? He deleted his account on this Forum entirely! I'll try to be nicer. Sorry KE7! Steve KB3SF

I've noticed some of his posts still remain elsewhere. His account is NOT gone. How did he do this? Manually delete 100 posts 1 at a time?

How did he do this?

Probably the same way you have started deleting some of your more unusal post.

sbright33: No, it's very different. I have never deleted a post. Mine are being deleted by the Moderator. Watch this one will be gone in a minute. So no one will even know that this is true...

The moderator may delete stuff that is seriously off topic or deemed offensive by somebody, but I doubt that other material gets moderated (but i could be wrong).