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





 

Issue 115, February 2000
Launching the RoboatNavigation by GPS and Digital Compass


by Ricardo Rocca

Riccardo's first-prize-winning Design 99 project tests the feasibility of an autonomous GPS-guided model. Step aboard for this stem-to-stern review of everything from the details of construction to the software required for its maiden voyage.


Start Mecahnical Assembly GPS - Digital Compass Proportional Servo Circuit Description Software Test Modes Crossing the Atlantic Sources

GPS

The accuracy of this method for the basic, commercial GPSs, is said to be within 100 m for the 99% of the measurements collected in the same place during an sufficient interval of time. (For more information on GPS and its accuracy, see the series of articles by Ingo Cyliax in Circuit Cellar 109–111.)

A test was done with the GPS mounted on the Roboat. A number of measurements were collected at the same spot over a period of 50 min., and then plotted to obtain the diagrams shown in Figures 3a and b. As you can see, the measurements actually fluctuate in time with periods of roughly 5–10 min. and variations of ±50–60 m.

These results confirm that the degree of accuracy for this GPS is actually in the order of tens of meters. That information was taken into account when planning the course, so the Roboat never approached any obstacle (island or a shoreline) at a distance closer than 100 m.

The GPS device used in the projects is a Garmin GPS25-LVS with the preamplified antenna GA27A. It sends a string of ASCII data, according to the NMEA format, through the serial output once every second, at a rate of 4800 bps (see Figure 4).

The string is terminated by the ASCII codes "13" (carriage return) and "10" (line feed). Once a string is received, it is checked for reliability by testing the checksum byte and by verifying that the acquisition code is "A".

The data that the program actually reads and uses are the latitude and the longitude. Both latitude and longitude are output by the GPS in the form of degrees, minutes, and fractions of minutes, therefore the program first converts them into "deci-milli-minutes of degree," in order to obtain a single integer number, without the troubles associated with degrees, minutes, and fractions of minutes.

This process is accomplished using the formulas:

latitude = (dd × 60 + MM.mmnn) × 10000

longitude = (Ddd × 60 + MM.mmnn) × 10000

In assembler, the formulas are actually split into smaller bits because the strings of ASCII data are first converted into binary bytes (two characters at a time). Therefore, the actual formulas are:

latitude = ((dd × 60 + MM) × 100 + mm) × 100 + nn

longitude = (((D × 100 + dd) × 60 + MM) × 100 + mm) × 100 + nn

The coordinates of the GPS are then compared to the coordinates of the next course point, and the linear distances to it are calculated expressed in meters, such as:

dX = |longitude – course_point_long| × Xcf/10000

dY = |latitude – course_point_lat| × Ycf/10000

Xcf and Ycf are the conversion factors and should be chosen according to the geographical area where the Roboat is going to sail. The factors are computed as:

Xcf = meters/minutes of longitude ($512 in the test area shown in Figure 2)

Ycf = meters / minutes of latitude ($744 in the test area)

There is no checking done for east or west longitude, or for north or south latitude, so the rest of the Roboat program works properly only with positive longitudes and latitudes (as in most parts of Europe, Asia, and North Africa).