autopilot: Do it yourself UAVHome | Download | Mailing lists | Gallery | FAQ | Systems |
Pitch angle = asin( -accel_y / g ) Roll angle = -asin( -accel_x / g )However, this will introduce significant errors for angles larger than a few degrees and can not distinguish upside down from right side up. Aggressive aerobatics would not work here.
NxM transpose MxN * NxN * NxM multiplication MxM addition MxM inverse NxN * NxM * M*M M additions NxM * MxN * NxN multiplication NxN additionThe covariance update portion requires:
Two NxN * NxN multiplications NxN transpose NxN additionThis is in addition to the system specific setup required to produce the state vectors and matrices for the filter. In the case of the AHRS, this involves trigonometric operations on the accelerometer readings and matrix rotations of the compass heading.
With some amount of optimization techniques, it is possible to do this at 25 Hz on an 8 bit microcontroller running at 8 Mhz. Incredibly, this was also running a PPM radio decoder, ten servo drivers and a dual axis PID controller at the same time. Believe it or not, here is the source code.
On the negative side, gas engines are more expensive to buy and difficult to tune smoothly. Glow engines produce massive amounts of smoke and require expensive fuel. Electrics can't carry any payload and have very short flight times between recharges.
$Id: faq.html,v 1.18 2003/04/09 15:49:19 dennisda Exp $ |