GPS receivers work because of something navigators have known about for hundreds of years, but what actually goes on inside those microprocessors and is it really just as simple as triangulation and ranging? Here’s how they really do it…
OLD SCHOOL…
Back in ground school, we learned that we could get a good approximation of our position by using two VORs. If you’re ever uncertain of your position, you find what radial you’re on from VOR #1, then do the same thing from VOR #2, and then instead of being somewhere on the chart, you’re somewhere in a much smaller, diamond-shaped area where those two radials intersect. (It’s diamond shaped because of the fact that your VOR radials are really shaped like very thin pie slices, and not lines, due to VOR and receiver inaccuracies.) If we have DME on board, then we can get a good idea with just one navaid. But what if the VOR signal went out and all we had was our DME? (We’d find another VOR of course, or use our ADF — whatever.)
…AND THE NEW MATH
But for argument’s sake, what if all we had were DMEs? That’s a great segue into GPS, because that’s exactly what a GPS satellite represents (although it’s not actually responding to any signal from you). GPS works by “time of arrival ranging”. Two somewhat synchronized stations, one (the satellite) transmits a signal at some precise instant, and the other (you) receive it, some precise interval of time later. Multiplying the amount of time by signal propagation speed gives a distance. If that DME was up (11,000 nautical miles or so up) in orbit, you could be anywhere on a sphere around it… and that’s not much help. Even factoring a known altitude, that still leaves you with a circle of altitude above (or on) the earth. where your position intersects the “sphere” of your distance from the satellite.
IN FROM THE FOG…
Let’s go back to two dimensions first. Let’s say you were lost in a fog, and there were three foghorns. (You know exactly where they are; you just don’t know where you are.) Each one blows a different note right at the minute mark. Your pocket watch is a little rusty, and might be off by a second or two. Right at the minute mark, you look at your watch. One arrives at your ears 10 seconds later, another a few seconds after that, and a third a couple of seconds later. You multiply each duration by the speed of sound, and that gives you the radii for (and you then plot) three intersecting circles. To be more realistic, you really get three sets of two concentric circles each, since your watch is off by some small unknown amount. (In this figure, the thickness of the circles represents that unknown error.) The beauty of it is that it doesn’t matter! Those three “bands” will still intersect at only one point! (Well actually, if it’s off by more than the propagation time of the closest horn, then you’d be in trouble. Let’s assume for argument’s sake though that it’s just one second.) As you see, these three circles have a small triangular shape in the middle that’s common to the inside of all three. Shrink them all down by the same amount (that’s how you factor out your chronometer’s error) and they meet at one point. GPS works the same way, but in this case where we’re dealing with three dimensions, you need four “foghorns”. That still doesn’t explain how it really does it, but we’re getting there…
…COMES GPS
With GPS, the signals are actually pseudorandom noise (meaning it sounds like noise, but it’s really a very complicated repeating pattern). They’re phase-modulated L-band radio waves, called (acronymically enough) a PRN signal. The “noise” part is actually two parts:
- a coarse acquisition (C/A) signal, and
- a precision (P) code.
Each is nothing more than ones and zeroes. Each satellite’s sequence is unique, though. In GPS, the mariner’s ear, his watch, calculator, and plotting table are all replaced by your GPS. Each GPS receiver unit generates a code that matches each satellite’s, and slews it back and forth in time until it “synchs up”. The stopwatch is a free-running clock (one that’s basically left to its own devices, accuracy-wise). The clock bias just becomes another variable to solve for, like in the previous two-dimensional scenario, where it takes the raw “ranging spheres” (or circles, in two dimensions) and adjusts the “pseudo-range” value by the clock bias.
Beyond the Obvious: Actually there are other distortions, like atmospheric refraction, differences between each satellite’s clock and GPS system time, and even relativity, since they’re moving around a few miles a second up there. And your handheld GPS gets some help from another signal, broadcast down with the C/A and P codes.) Well now… we’re getting closer, still.
ELECTRONICS AND SEEING IN 3-D
In three dimensions, visualization gets tricky. Visualizing two spheres intersecting (the sum of their radii being greater than or equal to the distance between their centers) is easy: the locus of points is a circle (or a point). Three is harder. Assuming a classical ‘soap bubble’ configuration (their centers aren’t collinear or one sphere isn’t inside another, etc.) then the intersection becomes two points. One more sphere, and it’s just one point. This is without outside data, such as a known point on the surface of the earth.
Note: A central concept in this explanation though is that to solve a mathematical puzzle, you need at least as many relationships as there are unknowns. In this case, our unknowns are our position (in three dimensions) and the clock bias.
NOW HERE’S THE BIG SECRET. How does your GPS calculate the answer? Simple! It just becomes four equations in four unknowns. Remember algebra, and solving simultaneous equations? We’ve all encountered problems like this in third grade, right? (Well, no; eighth grade, maybe.) Here’s a ‘simpler’ example of this kind of problem, where you have two equations, in two unknowns (I apologize in advance for any adverse reactions):
‘John is twice Karen’s age. In six years, both their ages together will total 42. How old are John and Karen now?’
In algebra, we’d let J = John, and K = Karen.
One equation would be: J = 2K, and
Another would be (J + 6) + (K + 6) = 42.
(Pretty easy when someone else does it for you, isn’t it?)
RUNNING THE NUMBERS… AND LETTERS: Remember being taught to solve for one variable in terms of the other in one equation, then you plug that into the second equation? Plugging in “2K” wherever we see “J” in the second equation would give us:
((2K) + 6)) + (K + 6) = 42.
Combining terms, 3K + 12 = 42, or 3K = 30, or K = 10.
Aha! So Karen is 10, and John is 20.
IN 3-D: This is pretty straightforward. Three equations in three unknowns (or four in four) you’d do the same substitution technique, just with more intermediate steps and more variables. Well, the microprocessor is a glutton for this kind of punishment. These are our four ranging equations:
(X1 – Ux)2 + (Y1 – Uy)2 + (Z1 – Uz)2 = (PR1 – CB x c)2
(X2 – Ux)2 + (Y2 – Uy)2 + (Z2 – Uz)2 = (PR2 – CB x c)2
(X3 – Ux)2 + (Y3 – Uy)2 + (Z3 – Uz)2 = (PR3 – CB x c)2
(X4 – Ux)2 + (Y4 – Uy)2 + (Z4 – Uz)2 = (PR4 – CB x c)2
DEFINITIONS: The X, Y, & Z represent satellite positions, the subscripts 1, 2, 3, & 4 represent the four GPS spacecraft, the Us are the X, Y, & Z user positions (using a WGS-84 or similar coordinate system), the PRs are pseudoranges, CB is clock bias, and c is the velocity of light.
And that my friends, is what goes on behind the liquid crystal ball… er, rectangle.