Compass offsets get changed while flying

I have tested this with the latest 3.4 dev version and have found that if you disarm after flying for a while and then change flight modes the compass offsets for compass 1 change.
This happens both with Pixracer and Pixhawk hardware flight controllers.

This requires hooking the unit back up to Mission Planner and changing them back.

Compass Learn is disabled.


I just confirmed that the bug was in 3.3.3 as well. It just didn’t change the values by much.


This bug has been fixed in 3.4 dev caused by a bug in EKF causing it to save the compass values it learned during flight. Even though compass learn was turned off it still saved new values. This bug is still in 3.3.3.


Hard to call post#3 a “solution”!
And your description is not totally clear as to exactly WHEN the offsets get changed: “while flying”, or after disarming, or when you then change flight mode… For instance, if I should land and instead of disarming, just disconnect power to the FC, do the offsets still get altered? If there is a reliable way such as disconnecting power to avoid offset change, then we can still use 3.3x as it seems a fix of the bug is only to appear for 3.4…

I wouldn’t call it a bug either. The option to use EKF to calibrate compass is still there in RC1. However, what confuses me is that using EKF to update compass offset is like using a predicted state to correct a measured state. Perhaps this is why the new offset obtained from EKF is really throwing off the compass heading.

It only gets changed once the unit disarms. If you write the numbers down and then check them after flight you can change them back to what you wrote down. They do not updated in mid flight.


Where do you find the numbers and how do you then change them back? Most of us have no clue how to do this.

In GCS, under full parameters list, find compass_learn, 0 turns off compass learn, 1 for normal learning and 2 for EKF learning.

When you bring up the Compass calibration screen the numbers are shown along the bottom of each compass as OFFSETS. Write them down. In the Full Parameter list they are listed as COMPASS_OFS_X, Y, and Z.

You can also save them to a file in this screen and later compare them to see what’s changed.


1 Like

Which is recommended? “0 turns off compass learn, 1 for normal learning and 2 for EKF learning”

I’m still a few weeks away before I finish the build which will use 3.3, but from your message it seems that to avoid compass offset change we should arm, fly, land, and then disconnect power to the FC, and NOT DISARM first. I’ll be testing this hypothesis, but if anyone has occasion to do it before I do, please let us know.

I never allow auto-learn for the compass, once you get good offsets what’s the point of having them changed by a rather opaque process? I don’t even trust the compass calibration routine of MP, I use it to get in the ball park and then manually tweak the offsets while turning the copter on a tripod. Only by this method can I get offsets which produce < ± 2° compass accuracy all around the horizon and with up to ~25° pitch or roll.

You can safely disable compass learn (compass_learn=0) if you have a good compass calibration. I haven’t had much issue with it.

Just checked my compass offsets via MP. As far as I can determine all looks good at this point, do these look good?

The primary compass looks good, but the secondary compass seems to have a high offset. Usually the offset around 100 is good.

In cases like this; it is recommended to disable the sencondary compass?

I didn’t realize an Iris+ has more than one compass…

yes, it would work better based on my experience, but I haven’t tried dual compass with RC1 yet.

One on pixhawk FC and one on 3DR gps module.

Should “Auto Accept” we checked or unchecked? I have read conflicting instructions.

I use it. It works most of the time. If you get tired of the dance you can always just except it where your at.