how can i combine three sensor values accelerometer, gyroscope and magnetometer using kalman filter?
Asked Answered
O

3

9

how can i combine three sensor values accelerometer, gyroscope and magnetometer using kalman filter? we are using arm and avr uC.

i've read every questions on stack overflow and searched a lot on net but i did'nt get the satisfied result for basic information about combining values using kalman filter.

Extended Kalman Filter Magnetometer Yaw drifting

Combine Gyroscope and Accelerometer Data

Ostmark answered 20/6, 2013 at 11:29 Comment(0)
M
12

The sad news is that there is no such thing as "Kalman filter for programmers". Don't hope for some formulas that you can blindly use and everything will magically work.

If your are dead set on the Kalman filter approach, Google this (keywords: attitude, error state, kalman filter):

http://scholar.google.com/scholar?q=attitude+%22error+state%22+kalman+filter

In particaluar, a relatively light read is Indirect Kalman filter for 3D attitude estimation. Make sure you are comfortable with the maths in it and you fully understand it; otherwise you won't be able to implement it. :(

If you have trouble understanding the above stuff, I highly recommend the

It is basically a tutorial, I cannot imagine an easier way to achieve sensor fusion. It would nicely work on a microcontroller as the authors developed it to be run on a microcontroller.


Just a side note. Kalman filter is so popular because

  • it is optimal under certain conditions and

  • the theory tells you how to estimate your filter parameters.

As for the filter parameters, you are likely to end up tuning them so the latter is not a big advantage in my opinion. See 5.1 Parameter estimation or tuning in the SIGGRAPH Course Pack.

As for optimality, in real life applications, depending on the domain, those conditions often do not hold anymore; the Kalman filter degrades to a (good) heuristic.

But if you are using a heuristic anyway, why not pick one that is a lot easier to implement? Such as the one presented in Direction Cosine Matrix IMU: Theory.

Minnie answered 20/6, 2013 at 13:45 Comment(3)
Unfortunately, a number of these links are out of date, namely, the "Kalman filters for programmers" and the "Direct Cosine Matrix IMU: Theory". Great reference material otherwise thoughArt
@Art Thanks for letting me know! I uploaded the "Direct Cosine Matrix IMU: Theory" to my Google Drive, and shared a link to it. This link will hopefully stay stable. As for the "Kalman filter for programmers", it was a good question with good answers, but unfortunately it was deleted. You can still read it if you have enough reputation, but I removed that link since many people cannot read it. :-( In any case, the answer has all the relevant information, so don't worry too much about it. I appreciate your feedback.Minnie
Great, thanks for the update. Much appreciated. I'll read your Theory document with great interest. Kind regardsArt
A
2

Now, this is quite an old question, but people might come looking for this still. One of the best current guides/papers right now is the "Quaternion kinematics for the error-state KF" by J. Solá (http://www.iri.upc.edu/people/jsola/JoanSola/objectes/notes/kinematics.pdf)

It provides a full primer on quaternions and how to use them in an error state Kalman Filter, with easy to follow equations for embedded implementation. Also, if you are just testing the algorithm and want performance later (and have an ARM Cortex-M4/M7) you can use the Eigen template library with C++ for implementing this in a few hours.

Good luck!

Ayesha answered 26/9, 2016 at 17:5 Comment(0)
B
0

For anyone coming across this question, if you're a programmer and have time to dive a little into the theory to better understand what you're doing, there's the Kalman and Bayesian Filters in Python book by Roger Labbe.

It helped me understand the theory of Kalman filters and how to program one using various methods.

It covers the following: Multivariate Kalman Filters, Unscented Kalman Filters, Extended Kalman Filters, and more.

Although it might not cover your exact case, it will definitely help you understand what you're reading when searching for answers.

Bugaboo answered 18/5 at 10:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.