This $30 PICAXE board can be used to build a cheap digital auto
pilot. You can use an RS232 input from a GPS
with a NEMA 1083 output and control a model airplane
servo connected to an aileron trim tab.
The electrical connection from the PICAXE to the
servo could not be easier.
The servo shown puts out 20 inch pounds of torque.
GPS NEMA 0183 data out looks like this second jpg.
This ASCII data is sent out ever 2 seconds from the GPS.
Any cheap $89 dollar GPS with NEMA interface will work.
Most have the interface.
The job of the PICAXE is to read the heading in from the
GPS and compare it to a heading entered into the PICAXE by
you using a single push button. Fly a steady heading and push
the button to record that heading in the PICAXE. From now on the
PICAXE will hold the heading. The numbers in this case are
181.9 degrees. (Field 8) These ASCII character codes are converted
to a binary number and this is added to or subtracted from
the preset initial heading binary number. The difference
forms a pulse width sent to the model airplane servo on
the aileron trim tab. A simple programming job. It does
this every two seconds. The rest of the GPS data is ignored.
You could use a separate PICAXE for altitude hold and direction
because they are so cheap. The altitude hold would work much
the same way only it would read a Free Scale pressure sensor
every few seconds and control a servo on the elevator trim tab.
--------------------------------------------------------
Here is the gist of the problem. The heading data comes in
from the GPS in four digit 8 bit ASCII code and we need to
convert it to a 3600 step binary number. I.E. 360 degrees in
steps of .1 degree. A 10 bit binary number only has 1024
steps so we probably need a 12 bit binary number which has
4096 steps. This has to do with how accurately
our auto pilot will maintain a heading. We could use a look
up table but that IMHO would take 3600 16 bit memory locations.
We need a routine to convert.
Decimal Binary Hex ASCII
48 00110000 30h 0
49 00110001 31h 1
50 00110010 32h 2
51 00110011 33h 3
52 00110100 34h 4
53 00110101 35h 5
54 00110110 36h 6
55 00110111 37h 7
56 00111000 38h 8
57 00111001 39h 9
Paul Lamar ...No rotor no motor.
The Rotary Engine NewsLetter. Powered by Linux.
ACRE NL web site.
http://www.rotaryeng.net
Copyright 1998-2006 All world wide rights reserved.