4.1.4.1 Hardware Implementation
The Attitude and Heading Reference System will be
implemented as an embedded system with the following
main components
Microchip's dsPIC30F4013 as the main processor,
• 3 Analog Device's Gyroscope ADXRS150
arranged orthogonal each other to form a gyro
triad,
• 1 Freescale's 3 Axis Accelerometer MMA7260Q,
• 1 PNI's Micromag 3 axis magnetometer,
• 1 uBlox TIM LA GPS receiver.
Figure 3: Diagram block of the APHRS Hardware
Figure 4: Finished AHRS Hardware
4.1.4.2 Algorithm and Firmware Implementation
The firmware is implemented in C language and compiled
with Microchip's C30 compiler. The general algorithm is
the combination of two algorithm
• rotation rate integration to get high update rate,
and
• absolute attitude determination to bound the
discrete integration error in rotation rate
integration.
The analog sensors (accelerometers and gyros) are sampled
in 250Hz and filtered using IIR butterworth 2 order low
pass filter. The cut of frequency chosen is 5Hz. This low
pass filtering is needed to avoid the vibration caused by
UAV's engine. The 5Hz cut of frequency is chosen with the
assumption that the UAV's maneuver frequency is below
5Hz. The magnetometer is read through Synchronous Serial
Interface / Serial Peripheral Interface (SPI) in 50 Hz update
rate. The GPS receiver can give velocity and position
updates every 0.25 second or 4Hz.
The Rotation Rate Integration is implemented using
quaternion angle representation. The quaternion is updated
using gyro reading [p q r]T. This quaternion angle
representation is chosen because it doesn't suffer from
singularity problem in 90 degrees pitch. This algorithm is
ICIUS 2007
Oct 24-25, 2007
Bali, Indonesia
ICIUS2007-A020-P
ISBN 978-979-16955-0-3 115 © 2007 ICIUS