Hi all -

I have an ArduIMU version 2 (flat), and have implemented a kalman filtering code for the x and y axis.

I have also created a GUI to test/debug/optimize the kalman filter. I am by no means an expert in this category, so I am asking that you guys please try it out and then try to further optimize/develop the kalman filter. Currently it works well but I am not sure if it is reacting fast enough, or it it rejects enough noise.


The download URL is: http://imukalmantest.googlecode.com/files/ArduIMU_Kalman_Test.zip

Please try the code and post any improvements/enhancements you make!!

Thanks,

-Jamie

Tags: artificial, filter, horizon, imu, kalman

Views: 2945

Reply to This

Replies to This Discussion

My code currently does not work well after hitting 90 degrees in either direction, so I cannot test that. However - no, I am not compensating for that. But with my application being a quadrocopter, I do not need accurate filtering for more than 90 degrees of rotation. Therefore, I don't think this is a problem?

Also - have you loaded my firmware yet? I appreciate the input, but if you could test my code as well then your input would be even more valuable.

Thanks,

-Jamie
90 deg is just an over exageration so you can see the difference between what you have and what is modeled in a 6dof setup. However.....in all actuality your's doesn't work much pas 30 deg because of the coupling not being accounted for. Worth looking into because my guess is you will never actually get solid controll out of something that is a 3D vehicle when you are controlling two 1D filters. I say that because my first attempt at it failed numerous times until I switched.
OK well the 2 1D filters (seems more like 2D since they both take Z axis into account) controlling a 3D craft makes sense. But I have been researching this stuff extensively for some time now and have not come across this. Bare in mind again that my application is exclusively for a quadrotor.

Is there a industry-standard method of doing this? (i.e. such as "Kalman FIlter" or PID" are industry standards)

If you could help me out I would greatly appreciate it.

-Jamie
Yeah, an "Extended" Kalman is what I have found to be the industry standard which its state update matrix is based upon the 6dof equations.

Look for the Beall/Trueman EKF to be realeased here soon.
From my understanding, the differences between a kalman filter and an extended kalman filter are that a kalman filter uses a linear model, whereas an extended kalman does not.

How does this translate into the axes being combined into one 3d value? Can you offer any technical advice? With all due respect, you are not giving me any concrete information.

Thanks,

-Jamie
Hey mate, I too am having a crack at a Accel/Gyro based IMU with Kalman filtering for a remote controll helicopter. From my understanding of the dynamics in play here, pitch, roll and yaw are not totally independent processes, they should all be inter-related (or "coupled").

If you would like to gain a more in-depth understanding of Kalman filters and the maths behind them I cannot recommend this short book enough, it's called "Poor man's explanation of Kalman Filters, or, How I stopped worrying and learned to love matrix inversion". It provides a simple statistics example first, then applies the same theory to a pitch/roll/yaw dynamics problem. You can get a copy here: http://www.taygeta.com/kalman_book.html for only $25.

Feel free to correct me if I'm wrong, but that is my current (I'm still learning) understanding of Kalman, applied to IMUs.
Jamie,

I, too am designing a Quadrotor (http://www.rcgroups.com/forums/showthread.php?t=1075426). I do not have a working quad yet, but my sense, based on my (perhaps incomplete) understanding of the Kalman filter, is that they are really not the way to go. (I would like to learn more about the KF myself, so these responses are certainly not from an expert's standpoint. welcome any corrections that the experienced users may have)

First of all, since the attitude estimation problem is non-linear and coupled, the Kalman filter in any of its forms won't be "optimal". In fact, the filter may even diverge if you're not careful. Second, unless you have the proper statistical parameters encoded, the filter also won't be optimal. Third, even if you get everything else right, the KF must still be tuned. Fourth, all this means you'll be spending lots of computation for potentially little to no benefit.

My feeling is that the machine cycles would be better spent computing the non-linear coupled attitude kinematics via a simpler (constant gain) estimator/observer (to use the control theory term) than the KF. Bill Premerlani's DCM is just such an observer (http://gentlenav.googlecode.com/files/DCMDraft2.pdf. Also try the UAV Dev Board threads here on DIY Drones)

I do agree with you, Jamie, that for a quadrotor, we really only care about computing the attitude in that "linear" region within 30 deg or so of level. That's where the vehicle will be when we're concerned about fine control of velocity and position (and hence of attitude). Outside of that, we should just need gyro feedback for damping. I have designed this linear complementary filter for just this purpose (http://www.rcgroups.com/forums/showthread.php?p=12082524). Outside the "linear" range, the attitude will not be correct, but as long as you don't use in in your feedback or display calculations until the quad is back in range, it shouldn't matter

Also, in any event you need to be careful to understand what your accelerometers are measuring (http://www.diydrones.com/forum/topics/accelerometer-question-for-im...)

- Roy
Of course, the original paper is available for free from the Rochester Institute of Technology.

Poor Man's Explanation of Kalman Filters, et-al.

No need to pay $25 if you don't mind a PDF scan of the original text, which contains all the same original equations and explanation.
You are correct about the EKF being non-linear....Including the 6dof equations as your model makes it non-linear. Study the 6dof equations and the Kalman takes the exact same approach as you have written except its only one Kalman with a larger matrix. Simple as that. It becomes quite clear why its non linear once you start working the math in the same approach as you have written except including more equations.
Hi!!!

Im making a RUAV, or for start, the stabilization of a helicopter.

Im using the DCM filtering, but with issues, i just now try your kalman filtering...

I did not use your GUI, i used labview...

I got more problems with kalman than with dcm..... any idea of why?? is not suppose to be better kalman than DCM??

In the picture, the helicopter is on a table, and i got half a throttle on.

The angles are completly lost!!!

Ideas??

10x!!!

You may have to tune the parameters in the Kalman filter.

What type of sensors are you using? Also, what is your other hardware setup?

-Jamie
hi!

- Arduino

- IMU 6dof razor flat ( http://www.sparkfun.com/commerce/product_info.php?products_id=9431 )

Ill be posting a topic about my project very soon...

10x!

RSS

Social Networking

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service