+ heli-sim
+ Roadmap
+ Scenarios
+ Download
+ Credits
+ Links
Mailing list:
+ Archives
+ Subscribe
+ Admin
+ PCB v2
+ PCB v1
+ Systems
+ Sensors
+ Field support
+ Prototypes
+ Summary
+ Bugs
+ Tasks
+ Stats
+ Non-SSL
<Blurry image of the first prototype in flight>

ADXL202-EB Interfacing

[ ADXL202-EB image on the PCB ] The Analog ADXL202 is a dual-axis MEMS accelerometer with a -/+2 G acceleration range. It can measure static acceleration and can be used as a tilt sensor. We're using two of them at right-angles to measure acceleration in all three axes.

The code for sampling the acceleration is in onboard/avr/accel.c and onboard/avr/accel.h. Due to the necessity for accurate timing of the pulses we use this as our mainloop. We also have jitter in the servo output right now. This is very troubling. It might be caused by noise in the clock, or perhaps spurious interrupts or who knows.

[ Plot of the accelerometer samples ]

Unfortunately, it is not very good right now. Spurious interrupts, random timing problems and other errors mean that we do not have a useful acceleration data. You can see the noise in this plot of 600 samples (above) while sitting on a stationary desk.

[ Plot of the accelerometer samples, no servos ]

Mark Ramsey suggested looking for periodic interrupts that might cause problems, so I disabled the ADC and servo outputs. The resulting samples (above) are much, much better, but still noisey.

[ Plot of new mainloop code ]

The new mainloop.c that wraps everything into one function, averages samples and disables interrupts at the appropriate time makes an enormous difference, as you can see from the above plot. That data was gathered from the same stationary desk, with servo output, UART incoming and outgoing, interrupt driven ADC sampling and PID loops in the background.

Autopilot Logo SourceForge HTML 4.0!
$Id: accel.html,v 1.15 2002/08/05 03:44:39 tramm Exp $