I am trying to build a 9-DOF IMU using the MPU-9250 chip which contains a gyro, accelerometer and compass. I have successfully realized 6-DOF sensor fusion using the DMP chip and Sparkfun's library, but I still have some yaw drift which is why I want to use its onboard compass for 9-DOF.
The DMP unfortunately can't do that so I tried kriswiner's work on 9-DOF sensor fusion which seemed to work but after I rotate the PCB, the yaw moves in the correct direction but it then slowly returns back to where it started, without me moving the PCB any more. This happens with many different sensor fusion libs, some more some less severe.
I have also tried just reading the raw
my values and reading the heading using
atan2(my, mx) which made things a little better but still a 360° real-life rotation did not correspond at all to a 360° rotation on the chip.
Is this a known problem with the MPU-9250 and I am missing something completely obvious, or what could be wrong here?
Thank you for any help!