Kalman filter, you dampening beast

My angle filter didn't work as expected, it had a high and low pass filter built in but it had some drifting problems where the angle got bigger and bigger.

Why am I not freaking out about this?  I found some sweet c# Kalman filter code by Adriaan Swanepoel.  It has a few bugs in it that I'm going to report back on.  Plus after asking, he switched the license to the BSD license for me instead of the GPL.

Clint's view on a Kalman filter:

magic_span_600[1]

It is Magic, but magic that works and has been proven.  So going to see if I can't use it.  I'm adding in a boolean to say useKalmanFilter.  If enabled, I'll use it instead of the high / low pass filter.

So I've decided I need to ship this out by the 28th of April for Maker Faire.  I need to swap out the filter and tweak the adjustment variables.  I also need to add in code for the deadman switches that arrived while I was in South Dakota.  If I do have time, I'll get this working on Windows CE too else a laptop will be strapped to the skateboard somehow.

I'm shocked at how long the batteries last too.

Tim Harter Jun 28, 2008 @ 8:39 PM

# re: Kalman filter, you dampening beast
I am looking for a c# Kalman filter implementation without much luck, and it seems the project you link to is no longer under development. If it is possible to send me the source you recieved, or even your improved version it would be greatly appreciated

Clint Rutkas Jun 28, 2008 @ 9:08 PM

# re: Kalman filter, you dampening beast
Hey Tim, I have 2, both of which I no longer use. One was very bias toward the IMU unit I was using too.

contact me and I'll send you the code for the generic one.

Tim Harter Jul 1, 2008 @ 9:30 PM

# re: Kalman filter, you dampening beast
I send you an e-mail via you contact form, but I figured I'd leave you a message here to, cuz I didn't which would be better to reach you by. My e-mail is tharter@ut.edu, and thanks a ton for the code, its greatly appreciated. :)

Tim Harter Jul 5, 2008 @ 4:53 PM

# re: Kalman filter, you dampening beast
Hey, its me again. I just noticed the next post after this one and was wondering if, when u send me the kalman filter, you could also let me know exactly what the code was missing, or wasnt working properly, that would help me greatly in fixing as I am not too strong in Calc, and fairly new to C# as well. Thanx again, and i cant wait to hear from you. --Tim Harter tharter@ut.edu

Jon Dec 11, 2008 @ 3:48 AM

# re: Kalman filter, you dampening beast
Hi Clint, I am trying to use Adriaan's C# Kalman filter code as well, and can't get it to work. Which bugs did you discover? Would you mind sharing your code? Any hint, help or solution is highly appreciated.
Thanks, Jon

Jeremiah Morrill Jan 2, 2009 @ 5:26 AM

# re: Kalman filter, you dampening beast
Hi Clint,
Hate to solicit your blog like this, but I'm building a UAV (powered by .NET) and I own a SparkFun 6DOF and was hoping to get a head start with the Kalman filter if you could give me some pointers (Adriaan's code seems to be taken down).

Anyways, take it easy,

-Jer

Post a Comment

Please add 3 and 3 and type the answer here:
  • About
  • Clint Rutkas: I build stuff that will eventually hurt me. I'm your average nerd.
  • Follow Clint on Twitter