Kalman Filtering code for ArduIMU (flat)

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.zipPlease try the code and post any improvements/enhancements you make!!Thanks,-Jamie

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Challenge accepted sir!  The math doesn't scare me.  The processing power is the scary part.  I'll let you all know how it turns out in a month or so.

  • Hi Jamie,

    Very interesting work.

    The left picture represent the process without KF, isn't it? Can you link the sources of GUI test?

    Thanks,
  • hi Jaime,

    i have read your kalman.pde code, i'm impressed about how you did implement the theory of kalman filter.

    Would you share your kalman theory paper with me?, I need read this paper for take a better understanding.

    thanks, have you nice day
  • I´ve watch on my experiments, that i have just glitches on the angles, it reads fine, but it has some glitches, i was thinking in applying a second filter, a filter for the angles, what do you think about that??
  • 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!!!

  • Developer
    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.
  • The code is all there. It should compile fine in the Arduino IDE, does it not? The kalman_update method is in the kalman.pde file...

    As for documentation, I am not sure what to write. Basically the firmware in the zip file should compile and upload onto the ArduIMU board without issue. Then, you simply run the "IMU Test.exe" executable in the GUI folder. You can then view the outputted data (both as raw data and in an artificial horizon like above^^).

    If you have any specific questions, I am glad to answer them. But the code is far to experimental at this point to provide any formal documentation.

    Thanks,

    -Jamie
  • Hi Jamie,

    Can you write some kind of documentation rather than giving us the code ?

    Paul
  • Developer
    It doesn't seem to be complete. Where are all of the function calls?

    kalman_update for example is no where in the source?
  • Ok guys - 50+ downloads and I have not received any feedback.

    Perhaps a bit more background would help:

    My goal is to implement a kalman filter to fuse the gyro and accel data together, in hopes to get a smooth/fast enough response from the sensors, while also reducing noise (especially from vibration).

    My eventual application for this will be a quadrotor: the IMU will supply raw & filtered sensor values (including GPS) via i2c to a parent controller board, and the PID loops and other quadrotor code can run without having to filter the sensor values.

    Since posting this code, I have noticed that the kalman is not working properly for all 360 degrees of rotation: at around 90 degrees it gets a bit goofy. I am not sure why it is doing this as the sensor values all respond correctly when viewed as raw values.

    I am not the best when it comes to the complex math involved here - I only know enough to get the filter code implemented and working to some degree.

    If anyone with good IMU/Math skills can contribute to this I would greatly appreciate it. Also there would then be a good, open-source Arduino-based Kalman filter IMU!!

    Thanks,

    -Jamie
This reply was deleted.

Activity