
The barometric sensor alone in most cases provides noisy and drift prone measurements. I have been trying to come up with a simple way to implement a fixed gain filter to utilize the acceleration measurements from the accelerometers to help clean up the noise and also add a sanity check via sensor fusion.

The cool part about the filter is that it also estimates vertical velocity which is useful for altitude damping and control. The basic idea behind the filter is the Z or vertical component of the acceleration is derived using the body rotations to compare with the barometric measurement. The noise of the barometric sensor is rejected whenever the accelerometers disagree. The down side to this approach is it depends upon the accelerometers being less noisy than barometric sensor and also not being on a vibration intensive vehicle. The theory works but actual implementation is somewhat hardware dependant.
The real plus to this filter is the velocity estimate can be used for altitude damping and control. Instead of taking the derivative of the barometric sensor which is going to significantly increase the noise in the derivative term, you get a much cleaner vehicle state estimate with this approach.
The code is fairly simple but may require tuning based on units and hardware. I took the fixed gain approach to keep it simple and as a result looks like the following:

The thing to note here is these are all relative to the NED reference frame (ie: acc_z is not the body z acceleration it is the NED z acceleration)
Enjoy-
-Beall
Comment by Matthew Coleman on December 6, 2010 at 9:16am
Comment by Matthew Coleman on December 6, 2010 at 11:05am
Comment by Matthew Coleman on December 6, 2010 at 1:42pm
Comment by Brandon Wampler on December 6, 2010 at 1:51pm
Comment by Matthew Coleman on December 6, 2010 at 3:12pm
Comment by Brandon Wampler on December 6, 2010 at 4:28pm
Season Two of the Trust Time Trial (T3) Contest has now begun. The third round was a reliablilty/aerial photography round for both planes and copters, which is now closed. Stay tuned for the next round, beginning soon.61 members
57 members
95 members
108 members
617 members
© 2012 Created by Chris Anderson.

You need to be a member of DIY Drones to add comments!
Join DIY Drones