Compass Calibration in 1.50 causes inconsistencies with Pixhawk

Mission planner version - 1.3.50
OS - Win10 Home
Hardware setup - Pixhawk with a 3DR GPS module

I was facing compass inconsistency issues with a new plane that I built. The Pre-Arm check was failing due to compass inconsistencies. I tried recalibrating the compass using Live calibration in mission planner several times to no avail. The inconsistency was consistent.

I had two other planes of an identical setup, which were working fine. I saved the parameters of those planes and tried calibrating their compasses using the same method. Both planes failed the pre-arm check due to compass inconsistencies after being calibrated. On loading the saved parameters, they were passing the arming checks. Strange.

I compared the parameters before and after the calibration, as expected the COMPASS_OFS in X, Y, and Z changed by a small amount in all of them. In addition to the offsets, the COMPASS_DIA and COMPASS_ODI parameters in all directions had changed too. on resetting them back to the original values (1 and 0 for all three axes respectively) the inconsistency disappeared and the Pre-arm check passed.

To further confirm this, I opened up an archived version of Mission planner 1.3.38 which I had saved a long while back. I tried the Live calibration using that, and only the offsets had changed. There was no compass inconsistency. Seems like the new version of mission planner sets DIA and ODI values which are causing the inconsistency in my system.

TLDR:
Mission planner live calibration causes compass inconsistencies by setting poor DIA and ODI values. This behaviour was not observed in some earlier versions.

do you have the tlog and examples of the bad values?

Hi Michael,

Here is the log from mission Planner 1.3.50 - 2017-11-28 16-43-36.tlog (659.9 KB)

Here is the log from mission planner 1.3.38 - 2017-11-28 16-51-18.tlog (378.1 KB)

Both the logs were recorded for the same plane.

Here is the comparison of the parameters which were changed from initial values( which were working fine) to the ones after calibration using 1.3.50. When calibrating with 1.3.38, the DIA and ODI values remained the same, and only the offsets changed.

If you need any additional info or tests, let me know. :slight_smile:

have you done an onboard calibration? and compared the results? I’m interested in what they show

No, I haven’t. And I just noticed that mission planner 1.3.50 does not show the Onboard Mag calibration option. It is visible in 1.3.38 though. I’ll try to do it using 1.3.38 and compare the results. Could this be dependent on the firmware? I’m using Arduplane 3.5.2 in the pixhawks.

yes it is dependent on the firmware version.

So, 1.3.50 does not show Onboard mag calibration for Plane 3.5.2 whereas 1.3.38 does. I’ll do it using 1.3.38 and check the results

Hi Michael,

I tried the onboard mag calibration using 1.3.38 twice and here are the log files for the same:

2017-11-30 12-44-40.tlog (644.6 KB)

2017-11-30 12-33-04.tlog (430.8 KB)

I noticed that the onboard mag calibration does set the COMPASS_DIA and COMPASS_ODI values for the internal compass. The external was unchanged. Here is the comparison -

It seems 1.3.50 sets unusually high DIA values during Live calibration which might be causing this.

looks like compass1/external failed to calibrate using the onboard calibration, that’s why they are either 1’s or 0’s

I did make a change that limits the growth of the DIA’s

1 Like

Thanks, That was quick!
I will download the beta, test it out soon and post the results. :smiley:

I’m using the last today MP beta, and I’ve whats look like a issue similar to this one apparently, but here only with compass_DIAX around 442, and the last beta doesn’t solve this :frowning:

https://discuss.ardupilot.org/t/compass-calibration-really-weird-result/23636

i just noticed current MP beta does not set DIA at all. my mistake. so your error must be from a previous calibration.

also please provide a log of the calibration

Michael,
I was able to test the new beta MP with Live calibration on my setup. There seems to be something wrong going on. Similar to @Giorgio_Rinolfi, The values are being set way too high. Here is the attached tlog file -

2017-12-04 11-43-32.tlog (235.8 KB)

The parameters were set with very high values for the offsets. I repeated the test with 1.3.38 to check and it worked just fine.

Hi @Michael_Oborne,

Did you have a look at this?