Cannot get compass calibration right

I have a BN-880 mounted with gps antenna up and cables towards tail.
Compass calibration succeeded with COMPASS_ORIENT set to 0 (None).
If I point the vehicle towards south (180°) heading shows 266°.

After setting COMPASS_AUTO_ROT=0 and COMPASS_ORIENT=2 (Yaw90) and new calibration heading shows 174°.

According to this calibration can be verified in Northern Hemisphere:
Z-component should be positive
when pitching the vehicle down, the X component should increase in value
when rolling the vehicle right, the Y component should increase in value

This is the case with COMPASS_ORIENT=0, with COMPASS_ORIENT=2 not.
Also I get “Error compass variance” with COMPASS_ORIENT=2.

What’s wrong and what can I do ?

ArduCopter 3.6.8
MP 1.3.66

If you are getting compass variance then you must have more than one compass active - what FC are you using and is the compass active? Be worth disabling compasses in turn to see if you have a defective compass. The auto rotation feature works quite well and will set COMPASS_ORIENT to the right value - what happens when you try this?

I use a matek F405-CTR and only have 1 external compass built in the BN-880 gps.
The 1st try was with auto rotation feature active (COMPASS_AUTO_ROT=2).
After calibration the COMPASS_ORIENT is set to 0 (None), see above.

I have a mini quad with a Omnibus F4 nano V6 and the Auto Rotation parameter does not select the proper orientation after calibration. I don’t know if it’s because of board orientation or what the issue is but I disable it and set it manually and all is well. Maybe the F405-CTR has a similar issue. Out of curiosity what is your board orientation parameter set for?

AHRS_ORIENTATION is (None). I tried already to set compass orientation manually,

Meanwhile I remounted the gps to have more distance to the power lines.
Than I did a new calibration outside with gps fix and now it looks alright.

It should be ROTATION_ROLL_180, the mag sensor is upside down on the panel.
But I would not trust in the BN880. Who had the idea to put the mag under the metal shielding ?

Yes, I found ROTATION_ROLL_180 with google here for example.
Might be right, but for now my compass seems to works pretty well with None.

Hi guys,

With 2 matek 405 wing I had compass problems. I destroyed 2 planes because I didn’t thought that there is a problem. Anyway I tried gps+compass combo from every manufacturer, from cheap to premium. The only compass that really works and works well is the rm3100. Usually if you look at the HWInfo in mission planner, you’ll see that the fc doesn’t reads the compass hardware. Or you can try with their gps+compass module. So to conclude, I think there is a hardware incompatibility with the majority of mags.