This was an extremely involved week for me as I tried to improve the functionality of our Kalman filter. Upon running numerous tests on 2D data of the IMU moving across my desk, I couldn’t seem to entirely remove the traces of drift and gravitational error present in my data. Frustrated and not willing to build a Kalman filter for the gyroscope only to see drift error accumulate, I stumbled upon the work of Seb Madgwick. I was highly inspired by Madgwick’s ability to produce fairly accurate 3D positioning results with an IMU without the use of Kalman filters. Using custom AHRS algorithms and high pass filters to remove drift, Madgwick’s work presents a solution to our problems since we are using oscillatory motion (mean position and velocity are zero).

I found a python implementation of Madgwick’s algorithm and combined it with my own custom Python script to run it. Through this implementation, I was finally able to get meaningful data representing the swing of an arm. I’m still working through tuning Madgwick’s algorithm to work with my IMU data but I have nonetheless made significant progress this week in reaching our goal of reliable 3D positioning.

Madgwick’s implementation is not without its flaws, however, and the data for the arm swing certainly drifts towards the origin when motion is stationary. That is why I’ll be looking to combine some of Madgwick’s ideas (like HPF for drift removal) with my existing Kalman implementation to see if I can’t do a better job of removing the drift that’s been stunting my progress in that area.

Here are some images of my new data:


0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *