The gps system consists of three pieces. There are the satellites that transmit the position information, there are the ground stations that are used to control the satellites and update the information, and finally there is the receiver that you purchased. It is the receiver that collects data from the satellites and computes its location anywhere in the world based on information it gets from the satellites. There is a popular misconception that a gps receiver somehow sends information to the satellites but this is not true, it only receives data. So, just how is it able to compute its position?

### Geometric View

Your gps receiver uses an elaboration of a technique that is tried and true and used by navigators and surveyors for centuries. Basically you use a known set of locations to compute your current location by taking fixes on the known sites. In the old days you took bearings (compass sightings) on existing locations and triangulated these on a chart to compute a fix on your location. Once you have a compass bearing you can draw a line through the known location and you know you are somewhere on that line. Do the same thing to a second point and the two lines will intersect. This is your position. If you try a third point it should intersect at the same place the other two lines intersect. Usually however, because of imprecise sightings, it intersects both lines at slightly different points thereby forming a small triangle. You are somewhere inside that triangle but you don't know exactly where. If the triangle is small enough you consider it good enough, otherwise you need to take another sighting. Accuracy is determined primarily on your ability to get and plot an accurate bearing as well as the geometry of the known sites available. This means that if the sites are very close together you will get poorer results than if they are at some angular distance apart. What you would really like were two sites that were 90 degrees apart for best accuracy.

The gps receiver uses a slightly different approach. It measures its distance from the satellites and uses this information to compute a fix. How can it measure distance? Well it really measures the length of time the signal takes to arrive at your location and then based on knowing that the signal moves at the speed of light it can compute the distance based on the travel time. However, unlike the known sites of the olden days, these sites are moving. The solution to this problem is to have the satellite itself send enough information to calculate its current location relative to your receiver. Now, armed with the satellite location and the distance from the satellite we can expect that we are somewhere on a sphere that is described by the radius (distance) and centered at the satellite location.

By acquiring the same information from a second satellite we can compute a second sphere that cuts the first one at a plane. Now we know we are somewhere on the circle that is described by the intersection of the two spheres. If we acquire the same information from a third satellite we would notice that the new sphere would intersect the circle at only two points. If we know approximately where we are we can discard one of those points and we are left with our exact fix location in 3D space. Now, what would happen if we were to acquire the information from a fourth satellite? We should expect that it would show us to be at exactly the same point we just computed above. But what if it isn't? Before we can answer that question we need a little more background.

A more basic question is, "How does the gps know the travel time so that it can compute the distance?" The satellite sends the current time along with the message so the gps can subtract its knowledge of the current time from the satellite time in the message (which is the time that the signal started its descent) and use this to compute the difference. For this to work the time in your gps must be pretty accurate – to a precision of well under a microsecond. The satellite itself has an atomic clock to keep the time very precisely, but your unit is probably not big enough nor expensive enough to have an atomic clock built in, so your clock is likely to be in error! For this reason our assumptions about the distance calculation are likely to have considerable error and the fourth satellite fix will reveal this to us. However, if we assume the error is caused by an error in our clock then we can adjust our clock a little and recompute all 4 fixes, continuing to do this iteratively until the error disappears! We will then have a good position fix and as a side effect we will also have the correct time to about 200 nanoseconds or so. One of the applications of gps technology is to provide the correct time even when we don't care about our position.

Maintaining the fix means that we need to continuously recalculate the information based on the moving satellites. Once we have a number of fixes we can derive much more information than just location data. For example a gps can compute the travel direction (compass heading) by comparing current location to previous location. Similarly the gps can keep track of travel distance, compute speed, record travel time and other valuable data.

This view is simplified. In addition to the data already mentioned the unit uses Doppler data from the moving satellites, almanac data to figure out the approximate positions of all the satellites, and ephemeris data download directly from the satellite that can be used to compute its position in the sky. For a more detailed look at this information you should read the section on obtaining a fix. Similar to the geometry problem we had in the older system of taking bearings on fixed sites, the satellite geometry has a significant effect in the accuracy of our final position. A unitless number representing this geometry is called Dilution Of Position, DOP and is used by the gps in determining which of the satellites available represents the best ones to use. The smaller the number the better the geometry.

### Mathematical View

Another way to understand the operation of a gps system is to look at the math that goes into calculating a position. From Pythagoras we have:

Prs + T + Es = sqrt{(X - Xs)^2 + (Y - Ys)^2 + (Z - Zs)^2}

Where X, Y, Z are the positions we are trying to find and T is the time error at the receiver. The terms Xs, Ys, Zs are the satellite positions that can be calculated from ephemeris information sent from each satellite. The Es term is a lump sum of all the modeling errors considered by the gps. These include such things as troposphere and ionosphere errors, clock errors from the satellite and any other error the gps receivers thinks is significant enough to model. Prs is the approximate (pseudorange) distance from the receiver to the satellite. Since we can calculate the pseudorange and satellite positions independently and we can factor in modeling information from hardcoded data we are left with four unknowns, X, Y, Z, and T. Therefore we need 4 equations to solve for the 4 unknowns. Mathematically this is a standard least squares problem. One approach is to use guesses of our current position to calculate delta's from what we would expect and then iterate towards a converged solution. This is the reason that the unit requires an estimate of our current location to compute our position. Once we have the delta's down to an acceptable level we have a solution.

In actual practice a Garmin receiver calculates a set of equations with 7 unknowns. In addition to the 3 positions and time they have added the Doppler data dx, dy, and dz which represents the relative speed between the satellite and the receiver. These terms are needed because our solution is based on moving objects and dx and dy can be used as part of the receiver velocity calculation (dz is discarded). Four equations will compute a full 3D solution but new 12 channel Garmin units can use additional satellites to perform an overdetermined solution that will offer more accuracy. Older multiplex units pick the best 4 satellites based on their DOP. As satellites move out of view or get blocked from the receivers view by buildings, trees, and other objects the receiver will switch to other satellites to maintain a location fix. If the number of tracked satellites drops to three then a 3D solution is no longer possible and the receiver will use the last available altitude and compute a 2D fix for horizontal position.

### The Other Two Elements of the GPS System

In addition to the receiver we must have a set of satellites in the sky and a method of updating the data in each satellite. There are full time land based sites that monitor the various satellites, which are often referred to as Space Vehicles, SV's. These land based sites check the health of the SV's, check how close they are to their optimum orbits, check the clock accuracy, and send adjustments as needed. The land based sites are located a precisely known positions so that they can verify the operation of the satellites.

The satellites are travelling around the world 11,000 nautical miles high in carefully controlled orbits at a speed that means they will make a complete orbit twice a day. Each orbit takes 11 hours and 58 minutes, so like the stars they will seem to drift 4 minutes a day. The complete constellation consists of a minimum of 21 SV's and 3 working spares. Currently there are 27 total satellites in the sky and it is possible that there could be as many as 31 or 32. There are 6 orbits with multiple satellites in each orbit as depicted in the drawing at the top of the page. Each orbit is inclined 55 degree from the equator and thus there are no orbits that go directly over the poles, but certainly a great many orbits can be seen from the poles or anywhere else on the earth. The goal of the system is to always provide at least 4 satellites somewhere in the visible sky. In practice there are usually many more than this, sometimes as many as 12.

Each satellite contains a supply of fuel and small servo engines so that it can be moved in orbit to correct for positioning errors. With update control from the ground units it can maintain an essentially circular orbit around the earth. It also contains a receiver to get update information, a transmitter to send information to the gps receiver, an antenna array to magnify the weak transmitter signal, several atomic clocks to accurately know the time, control hardware, and photoelectric cells to power everything.

### More Detail on Calculating a Receiver Position

The steps involved in calculating a position are:

1. Sync with an available satellite and download the navigation information. (See the obtaining a fix section for more details.)
2. Convert the messages to internal format for calculation. These include clock information, ionosphere data, and ephemeris (orbit) data.
3. Calculate the exact satellite position. This will include both the elevation and azimuth data so we can apply troposphere modeling corrections that are dependent on how far above the horizon the satellite is.
4. Calculate the pseudorange data and then correct for ionosphere and other modeling errors. (Note that consumer units may not compensate for ionosphere or tropospheric errors.)
5. Repeat these steps for each available satellite. On a Garmin we will initially attempt to find 3 SV's starting directly overhead and compute a 2D fix using the previous fix altitude (or data input by the user).
6. Correct the SV position for earth's rotation based on the time it takes for the signal traversal using the pseudo range data. (If the internal clock is close this can be done once, otherwise it will have to be repeated after the receiver position is computed.)
7. Correct using differential data if available. (This may have to be done after the initial position is computed as part of the refinement step if the internal clock isn't accurate.) If the differential station is near the gps receiver it will be able to skip the corrections for modeling errors since this is part of the correction data available. Using dgps corrections leads to accuracy considerably beyond the capability of a standard receiver.
8. Calculate the initial receiver position as described in the prior section.
9. Convert the data based on whatever datum and grid system you have chosen and display the answer on the position page. Altitude is also corrected for geoid height prior to display.
10. Add in the leap seconds and time offset from UTC time to the computed time data and convert it for display.
11. Refine the position based on additional satellites and the correct time to obtain a 3D fix and subsequently improve the fix based on choosing SV's with a better DOP, applying an overdetermined solution, etc.