I want to use the compass for two reasons:
- Getting the orientation of my pidrone prior to takeoff which combines with GPS, gives the ability to flying between fixed predefined waypoints. This works perfectly.
- Use it as a long term fusion with yaw angle integrated from the gyrometer. This is the problem.
The compass works accurately with the motors off, returning the direction it's pointing; however once the motors turn on, the compass shifts by up to 40 degrees, and varies depending on which way it's going. I'm assuming this is the EMI from the motors distorting the earths magnetic field and hence the IMU magnetometer.
Has anyone use the magnetometer to provide long term accuracy for yaw? If so did you see this sort of problem? And if so, how did you handle it?
P.S. Not critical to fix as all works well without, but one of those WIBNIs