MarkSherstan / MPU-6050-9250-I2C-CompFilter

MPU6050/9250 I2C and SPI interface. Sensor fusion using a complementary filter yields sensor Euler angles and is implemented in five different languages.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

10 times same Madwickfilter calculation and compFilter not used

WillemD61 opened this issue · comments

In the 9DOF main.py program loop on line 580 you are performing the Madwick filter calculation 10 times with the same sensor values but with a different deltat. Not clear why.

Also the compFilter method in your program is not used and it is not clear why it exists.

Kris explains the 10x calculation here. Basically you want to run the algorithm as many times as possible even if you do not have fresh sensor data, otherwise the estimation may begin to drift.

The compFilter method is included as its another way to processes 9 DOF from the MPU9250 and also includes tilt compensation on the magnetometer values. I wrote these algorithms during my MSc and was comparing the two. Looks like I forgot to show how to use the compFilter method so I will update the documentation accordingly.

I will address both of your questions (and other issue) in my next PR.