circuitcellar.com
Magazine Support   Digital Library   Products & Services   Suppliers Directory 
 
 





 

January 2001, Issue 126

Where's Waldo?
Pinpointing Location by Interfacing with a GPS Receiver


by Jeff Bachiochi

GPS RECEIVER

Stand-alone GPS receivers are available today. Just check the pages of Circuit Cellar for manufacturers. In fact, if you want to know the details about GPS data output and how to calculate distances on bearings from any two coordinate points on earth, see Jeff Stefan’s article, "Navigating with GPS," (Circuit Cellar 123). This month, I plan to go into why it works and how you can use this new technology. First, I want to look at what it takes to pinpoint a location.

Each of the 24 GPS satellites orbits the earth in about 12 hours. The GPS satellites are arranged in six shells of four satellites per shell. Each group of satellites within a shell is spaced equidistant from one another in their orbit at a specific shell altitude. The orbits of each shell are offset at 60° covering a full 360°. This arrangement allows at least five satellites to be seen from any point on earth.

For the moment, let’s think about a satellite as a thundercloud. If you count how many seconds it takes for you to hear the crack of thunder after you see the flash, you can figure out how far away you are from the cloud. If the cloud is stationary and you know exactly where it is, you could be anywhere around the cloud, a diameter equal to the distance the sound takes to reach you. If you know the location of two stationary clouds and count the times for each, you can draw circles around each cloud with radii equal to the times you counted. This would produce two intersecting circles. Figure 1a shows an impossible solution, where the times could not be real, and no intersection is possible. Figure 1b shows a solution where the circles intersect at only one point. This pinpoints your location and you must be on a line directly between the two clouds. Figure 1c is most likely the solution, but you still cannot be sure if you’re at location A or B (in reality, there are many more points to this solution).

2102002-f1.gif (12586 bytes)
Figure 1—The circles represent your possible position when you count the time between lightning flash and thunder crack. a—This has no intersecting solution because the times are less than the actual distance between the two lightning strikes. b—If you happen to be at just the right distance, circles just touch and produce a single-point solution. c—Most likely, circles will overlap giving two points on a flat earth. In 3-D reality, the circles are actually bubbles where their intersection is a circle of possible solutions.

I drew circles to indicate the distance. Think of these circles as three-dimensional spheres, not just two- dimensional circles. This means that in Figure 1c you might be anywhere the two spheres intersect, which is a circle around the axis of a line between the two clouds. On a flat surface point, A and B are the only solutions, however, in the GPS world you may be at any altitude, so other solutions are possible. Using the known position of three clouds can narrow it to two points (eliminating one if you know elevation), however, it can take four to narrow it down to a single solution in free space.

This example of the GPS system is like a snapshot in time. With all the satellites orbiting above, you must first be able to figure out exactly where they are to be able to figure out where you are. Each satellite transmits two microwave carriers; one is modulated with a 1023-bit sequence that repeats every millisecond. A GPS receiver looks for these sequences. When identified, it uses the start of sequence as a time of arrival (TOA) value. The TOA is an indication of distance because you know how long it takes the microwaves to travel through the atmosphere.

To help identify the satellite’s location, the carrier is also modulated by navigation and system data. From this data, the GPS receiver can calculate the satellite’s earth-centered, earth-fixed x, y, and z (ecef xyz) coordinates at a particular time of day UTC (Universal Time Coordinated), as shown in Figure 2. If you only knew exactly when the satellite started its transmission, you could calculate the distance by subtracting the two times. The GPS receiver can’t get synchronized in time with this single satellite. But, by "seeing" other satellites and calculating their exact ecef xyz positions, the GPS receiver can adjust all of the relative TOAs because they are synchronized. With four satellite ecef xyzs and ranges to each satellite, the GPS receiver can then calculate its ecef xyz and translate it into latitude and longitude.

2102002-f2.gif (6770 bytes)
Figure 2—All x, y, and z points are based on the center of the earth (0, 0, 0). The x axis starts at the intersection of the equator and the prime meridian and extends through the center of the earth. The y axis starts at the intersection of the equator and the 90° prime meridian and extends through the center of the earth. The z axis begins at the North Pole and extends through the center of the earth. A satellite’s position can be defined using ecef x, y, and z coordinates at any point in time.