Friday, January 21, 2011

GPS - Gets a *little* complicated...

Who doesn't love a good GPS unit?  Makes for a hard time to get lost when driving in unfamiliar places.  But, there is an awful lot of stuff going in in that teeny little box you take for granted.
Remember on my last post - how I said 
"Not so complicated after all - is it?"

As I alluded, that is a bit of a white lie.  Before I continue, an important caveat.  This is not a technical blog.  it is my aim to give a word explanation with near zero math.  As such I will at times simplify a concept to a degree that technically speaking, it is incorrect.  For those with knowledge about the subject, please indulge me a little!
OK - back to some explanations.
Yes, the concept of triangulating your position from satellite locations is in principle not hard to wrap your head around.  All you need to know if the exact position of all the satellites, and the exact distance from each satellite to where you are.  Satellite positions are the easy part.  There are some pretty accurate ways to get their positions - in fact, part of the message these satellites embed in their radio signals is this very information. 
The harder part is to determine just how far you are from any one satellite.  Since we don't have a long enough yard stick, we instead measure the time it takes from a signal leaving the satellite to reach us.  Then, knowing the speed of propagation of light, we get the corresponding distance. 
That sounds good, but we are still left with some information we need.  We need to knew just when that timing signal left the satellite, and we need to have a synchronized clock on hand for us to measure the interval.  Sadly, we don't automatically have information about the time of departure for any of the satellite's timing radio signals.  To make matters worse, we don't have accurate enough clocks on our tiny GPS receiver to accurately measure our distance.  Each satellite has an atomic clock on board.  You are not likely to have a spare one to use on hand!
It looks like we are at an impasse right?  Wrong.  Here comes a curve ball.
Remember the triangulation analogy - where if you want to know where you are, you need to have 2 landmarks and a distance to each one?  A general rule, is that you can get one piece of information for each landmark you have.  So one landmark... you only know one thing... the distance you measured.  Not very helpful.  Two landmarks, and you can determine your latitude and longitude.  What happens if you have 3 landmarks?  Turns out that if the 3 landmarks are well placed, you can find your height/altitude with respect to these landmarks.  So going back to satellites.... 
If we know time where we are, we then need 3 Satellites to get our location (latitude, longitude, and height/altitude).  But there is a trick we can use to help us out, when we don't know what time it is where we are.  Turns out if you triangulate on 4 satellites, you get 4 pieces of information.  With the right math, you can make the 4th item of information be your time!  One problem down.
Now... for the Satellite time.  If you recall, the Satellites broadcast their own position to assist us here on the ground to knew where they are.  But - "where" implies a location, and that really does not mean anything without the proper time.  And indeed, that is how we get Satellite timing - they send it to us!
With all this information on hand, we can now let a smart computer chip do the complicated math for us, and extract our time, height, latitude and longitude.  All we need is 4 well placed GPS satellites.

This could be the end of the story, and is the end of this blog post.  But wait...
The position we just calculated seems to be off the mark a little.  Miles off!
How can ever we use this to navigate streets and such?  What are we missing?  Stay tuned :-)

No comments: