kalman filter

toxicmouse

Senior Member
has anybody thought of using a Kalman filter, or some alternative with a picaxe? my application is an accelerometer used to find pitch on an RC plane, i have 3 axes on the accelerometer to play with but don't have to use all three. the intention is to measure the direction of gravitational acceleration.

any ideas or suggestions are welcome, but there is not enough payload capacity for a rabbit. thanks
 

BeanieBots

Moderator
Could be tricky to implement without using an FPU co-processor. Try simple averaging first.
Don't know what sort of output your accelerometer has but a simple RC between it and the PICAXE is probably all that's required.

Just out of curiousity, how do you distinguish between flying up at 45 degrees to ground at contant velocity and flying level with an acceleration of 0.707G?
(that has always bugged me but maybe it's only an issue with pendulum type sensors)
 

toxicmouse

Senior Member
well i have a FPU coprocessor, but without simplification i doubt the X chips have enough memory. there may be another simplified filter out there that i have not heard of, hopefully.

for the problem of 45 degrees, i am using three axes, so i hope to be able to distinguish between a plane at 45 degrees and a plane dropping at 0,3g and a strong reverse acc using the other axes, or combinations thereof.
 

moxhamj

New Member
"Just out of curiousity, how do you distinguish between flying up at 45 degrees to ground at contant velocity and flying level with an acceleration of 0.707G?"

Good question BeanieBots. Einstein says you can't. He says that the forces you might feel in an elevator that is accellerating are indistinguishable to the forces you feel from a gravitational field.

From a biological perspective, animals including us solve this problem using accellerometers in the middle ear to give information about position, and this works for a few seconds. But you need information from the eyes and/or proprioceptors in muscles and joints to update the absolute position of the horizon. The brain puts all this together so well that we tend to underestimate the complexity of the task.

There are some very clever people doing work on autonomous planes and helicopters eg <A href='http://autopilot.sourceforge.net/faq.html' Target=_Blank>External Web Link</a> These use accellerometers and then combine with infrared sensors and/or GPS to define the horizon, and their solution ends up being very close the the biological solution.

The only other way is to use gyros that change very slowly, eg those in an autopilot for a commercial jet, but they cost hundreds of thousands.

I think picaxes could well prove to be a cheaper solution for a UAV - I wonder if anyone is working on this?
 

toxicmouse

Senior Member
Dr_acula, nice link. there are some people on rcgroups, UAV that use picaxes, but these mostly seem to be for subsystems. see <A href='http://www.rcgroups.com/uav-unmanned-aerial-vehicles-238/ ' Target=_Blank>External Web Link</a> i get the impression that most people use autopilot modules.
 

Brietech

Senior Member
It would be awesome to create an entire picaxe-based UAV. Another way to do it is to complement the accelerometer data with data from a magnetometer, or if you are just interested in angle, just using the magnetometer by itself. I got one from sparkfun.com that is 3-axis and works over SPI for around 55USD, and it worked pretty well before I accidentally fried it.
 
Top