Break in latest master in-flight compass calibration

@tridge I did further testing and it looks like the latest master change to compass order switching broke the in-flight calibration. It appears that the in-flight calibration does not track changes in compass order and only calibrates the primary compass when 2 and 3 are switched in order. I haven’t tried changing the order of primary mag but definitely does not like change in order of 2 & 3

@siddharth just thought I would ping you directly with this and add a log

@siddharth @tridge

I have done testing on two CubeOrange vehicles and one CubeBlack and have determined that in all cases GCS mag calibration works as expected but in-flight learn only calibrates the first compass. I compared logs from IF calibrations before the compass order feature and after, in all cases the previous iteration initiated calibration of all selected mags and the current build only calibrates primary. I have spent several days and hours and I am convinced that this is not something I have overlooked and is firmware based. If you need anything specific please let me know and I will do my best to provide.

Cheers, RB

I’ve confirmed this in SITL. In-flight learning only works for the first compass.
I’ll ping @bugobliterator

1 Like

I’ve opened a PR to fix it here:


many thanks for reporting this!

1 Like

PR tested this morning and confirmed as fixed. A big thank you to Tridge for jumping on this and suppling a rapid deployment :sunglasses:
The in-flight compass learn is perhaps one of the best features to come along, especially for large aircraft. Easy to do and provides mag compensation under normal electrical load.

Cheers, RB

1 Like

Hi @rbachtell,
I have looked in MP but I have not seen the in-flight calibration option.
How is the in-flight calibration at MP?

Thanks in advance.

You need to set the COMPASS_LEARN parameter to 3
https://ardupilot.org/copter/docs/parameters.html#compass-learn-learn-compass-offsets-automatically
After learning it sets this value back to 0 (or maybe whatever it was before if non-zero)

I will try , thanks @xfacta