Kalman filters

The Kalman filter seems rather complex to implement and needs floating point maths. I would like to use integer maths, so I have been testing a 2 pass filter based on what I think is the 1D Kalman filter, however I am not sure of the response time required. The version I have effectively acts as a low pass filter and I run the simulated gyro data through two filters so there are noticeable delays in underlying real data changes, but I am not sure whether this matters.
How quickly do Kalman filters react to changes in the real underlying data? (rather than noise which they should eliminate)

The 1D formula I am experimenting with is:
(new value*K)+(1-K)*previous value

I do this twice and for the excel model simulation can change the value of K for each pass.
A good value seems to be K=0.07.

Would this work?

The attached JPEG shows the calculations in action, the noise level is taken from a french paper -
Modélisation et interface de contrôle d'un quadri-rotor
Rapport de projet
Pierre Beugnet
Raphaël Polonowski
Nik Khairail Afzan Nik Mohamed
www.beugnet.fr/projets/fichiers/rapportquadri.pdf View attachment 356
 

Attachments

  • kalman.jpg
    kalman.jpg
    70.6 KB · Views: 341



dankers

Member
Have a look at OpenPilot, we have a Extended Kalman Filter written by a Professor that has consulted to NASA and a number of high end commercial UAV companies.

We currently run it as a 13 state but this will be going to a 16 state shortly.

http://wiki.openpilot.org/download/....pdf?version=1&modificationDate=1293749715000

This filter is really fantastic, performs *very* well and of course all code is available as well. This is why a lot of the commercial high margin companies are scared to death of our little project, it is the real deal for once.
 

Pano-Dirk

Member
@dankers
Nice nice!
What do I have to do, when I want to use the OpenPilot board only for stabilization of a 3 axis camera mount?
Has the hardware 3 PWM inputs and 3 PWN outputs?
Software?

Thank you
 

dankers

Member
Well, I'd use coptercontrol for that, camera stabilisation is was one of the things it was designed for actually.

CopterControl is a 6DoF AHRS with 6 PWM inputs and 6 PWM outputs. Its has a STM32 running on it (exactly the same as the vector Nav) and can run digital servers @ 333Hz if you need to do that (50Hz standard servos are fine as well). The firmware for it currently runs a complementary filter we call 3C, but you should be able to get Professor Dale's code to run on it with just a bit of effort if you wanted the full EKF, of course it has no mag being 6 DoF only so you could run with less states.

I think Jame's 3C complementary filter is going to be good enough for camera stabi to be honest. Will it be 100% turnkey for this? Not sure, depends on what you are doing and no one has used it for this yet either. The software is all open source as well (hence OpenPilot), I think it will already be 95% of where you need it to be, maybe more.

And if you get bored of camera stuff, you can use it to fly a quad, hexa, heli or fixed wing also.

My suggestion would be to read about the hardware here:

http://wiki.openpilot.org/display/Doc/CopterControl+Hardware+Manual

Then see if it is suitable. I think OpenPilot.eu has some currently and please understand we are totally non-profit, this is not to increase sales, in fact we are running low on things so I am not helping much here :)
 
Last edited by a moderator:

Crash

Defies Psychics
EDIT: Ooops I see I posted at the same time as Dankers who should be in bed. ;) I'll leave the post here anyway.

The CopterControl board from OpenPilot.org is currently available. It has 6 in and 6 out. I just got mine and haven't played with it enough to know if it can do camera stabilization out of the box. It certainly could be hacked into the code though.

I think it should be added to the code if it hasn't already been done. It would be a great use for this little board. It does lack a magnetic compass so that may be a deal breaker for a 3 axis mount.
 
Last edited by a moderator:

dankers

Member
It does lack a magnetic compass so that may be a deal breaker for a 3 axis mount.

You mean say for example, if someone designed a mag and pressure board for the CC like this one:

View attachment 364

But then to add that we would need something like a Flexi-port to plug in to.

;-)

It might not look it in the picture but that board is very small, only 1.5cm x 1.5cm.

Test versions are ordered but will take some time, the hard bit will be finding a developer to add support (know anyone?), the core devs now are all working on the Pro/INS platform, so adding support for mag and pressure sensors (that board has both), will be a community effort for sure.
 

Attachments

  • CC MAG & Pressure.jpg
    CC MAG & Pressure.jpg
    10.7 KB · Views: 277

Top