presented on two LCD displays. Figure 1 is the overall block
diagram of the complete system. Needless to say, several PIC
processors and a lot of software is involved. Figure 2 presents
the three boards, (sitting on Mr. Darby) undergoing a typical
debug session with a built-in GPS simulator package.
The Navigator system consists of three independent
software “engines,” each executing on its own board. The
main board is PIC18F2525 based and is programmed in
Microchip C, using their C18 compiler and MPLAB v8.20
development tools. This board does all the heavy lifting by
executing the primary navigation routines, providing the
initial course leg user input interface, controlling a 2x16
LCD, and communicating with the other engines. The
18F2525 was selected as the processor of choice due to
having a large amount of program and data space, as well as
the advanced architecture required to support a C program.
Initially, I was going to program the entire system in
assembly, but the need for complex spherical trigonometry
and floating point mandated a high level programming
language with a runtime library and floating point support.
This Navigation engine communicates with the other two
engines via the synchronous Serial Peripheral Interface (SPI),
asynchronous (UART) port, and direct digital port interface.
The second element of the system is the GPS engine.
This board gathers raw GPS navigation information from a
Garmin 15/H sensor module, which is a basic 12 channel
GPS receiver supporting WAAS corrections. Once every
second, the sensor module presents a “GPS sentence” in
ASCII at 4800 baud to the GPS engine board for processing.
The GPS engine extracts the necessary navigation elements
(current time, current latitude/longitude position, and signal
quality factor) from the sentence and grinds them into the
form required for our system.
The GPS engine is also responsible for the critical
synchronization of data transfer over the SPI bus to the
engine. The PIC16F876A based board also supports an LCD
2x16 display — primarily for status
information — and a large
number of LEDs to indicate
critical failures and “state of
The GPS engine has a built-in
system simulator which was critical
in developing and debugging the
code. The simulator function is
summoned by depressing a button
on the board, and allows the user
to enter latitude and longitude
coordinates via any terminal
program. Using the simulator,
I was able to debug the entire
system without having the actual
Garmin 15/H sensor present in the
shop. The simulator allows you
to “test” a new course without
actually sending your platform
into the wild!
Finally, after all the
computations, we need to
actually control our boat or
platform. The third
engine in our system is
the PWM engine. This
board is somewhat
minimal as all it needs
to do is produce the
standard 1.5 ms
center PWM pulse
used by most of the
hobby servos. The
PWM engine is hard
wired to the
Navigation board using
a three-pin digital port-to-port connection.
Three pins allow eight unique binary numbers to be
presented to the PWM engine, corresponding to eight
different rudder movements as determined by the
Navigation engine. This board also allows the servo in
question to be calibrated prior to operation, using a small
potentiometer connected to the PIC’s A/D converter. Again,
I used a PIC16F876A processor — which is way overkill for
this application — but I already had a board based on that
processor on the bench, built up on a PICProto3 PP3 board
by microEngineering Labs, Inc.
Basically, any low to mid range PIC with a PWM and
A/D peripherals could be used. Again, this subsystem is
programmed in Microchip assembly and, as a bonus, when
you check out the code, there are several unused code
blocks featuring PWM generation and simulation modules
for standard three-wire servos. Enjoy!
So, How Does It Work?
By now, you’re probably wondering how this thing
FIGURE 2. The Navigator board set in debug mode, driven by the GPS simulator. Leftmost
is the GPS board (with simulator software); on the right is the Navigation board displaying
intentional off-course coordinates to test navigation algorithms. The PWM board is out of
sight in the rear, all perched on the boat’s deck.