I have an MPU9250 on my PCB and I use an AHRS system with a Madgwick filter to get yaw angle. I took source code from here: https://github.com/sonphambk/MPU9250/tree/master/Src and changed there MadgwickAHRSupdate
function as someone said here: Madgwick sensor fusion on LSM9DS0. Now yaw angle is quite accurate, but there is a problem. When I move my PCB, without rotating it, the yaw angle changes like that:
Why does the yaw angle changes if I don't rotate my PCB? What I have to change in my code?