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

DIY Robocars via Twitter
RT @chr1sa: Donkeycar 4.4 released with tons of new features, including path learning (useful with GPS outdoors), better Web and Lidar supp…
Sunday
DIY Robocars via Twitter
RT @NXP: We are already biting our nails in anticipation of the #NXPCupEMEA challenge! 😉 Did you know there are great cash prizes to be won…
Nov 24
DIY Robocars via Twitter
RT @gclue_akira: レースまであと3日。今回のコースは激ムズかも。あと一歩 #jetracer https://t.co/GKcEjImQ3t
Nov 24
DIY Robocars via Twitter
UC Berkeley's DIY robocar program https://roar.berkeley.edu/
Nov 24
DIY Robocars via Twitter
RT @chr1sa: The next @DIYRobocars autonomous car race at @circuitlaunch will be on Sat, Dec 10. Thrills, spills and a Brazilian BBQ. Fun…
Nov 24
DIY Robocars via Twitter
RT @arthiak_tc: Donkey car platform ... Still training uses behavioral cloning #TCXpo #diyrobocar @OttawaAVGroup https://t.co/PHBYwlFlnE
Nov 20
DIY Robocars via Twitter
RT @emurmur77: Points for style. @donkeycar racing in @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/Y2hMyj1…
Nov 20
DIY Robocars via Twitter
RT @SmallpixelCar: Going to @diyrobocars race at @UCSDJacobs https://t.co/Rrf9vDJ8TJ
Nov 8
DIY Robocars via Twitter
RT @SmallpixelCar: Race @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/kK686Hb9Ej
Nov 8
DIY Robocars via Twitter
RT @PiWarsRobotics: Presenting: the Hacky Racers Robotic Racing Series in collaboration with #PiWars. Find out more and register your inter…
Oct 23
DIY Robocars via Twitter
RT @Hacky_Racers: There will be three classes at this event: A4, A2, and Hacky Racer! A4 and A2 are based around UK paper sizing and existi…
Oct 23
DIY Robocars via Twitter
Oct 23
DIY Robocars via Twitter
Oct 19
DIY Robocars via Twitter
Oct 18
DIY Robocars via Twitter
RT @NeaveEng: Calling all UK based folks interested in @diyrobocars, @f1tenth, @donkey_car, and similar robot racing competitions! @hacky_r…
Oct 13
DIY Robocars via Twitter
RT @araffin2: 🏎️ After hours of video editing, I'm happy to share a best of my Twitch videos on learning to race with RL. 🏎️ Each part is…
Oct 13
More…