Compass Issues/Error

Hi I’m having trouble with the compass and I’m at a loss to figure it out.

  1. Compass drifting with error up to 15-90 deg
  2. Check mag field warnings

I’ve tried with 3 different external compass’ in different locations with same outcome.

All the compass’ calibrate ok. But if the compass orientation is set to automatic it changes to pitch 180. And the compass points behind the drone.
If I manually set the correct orientation which is roll 180 it points in the correct direction but has the above issues (I also turn of automatic detect and fix orientation)

Flight controller orientation is 2: Yaw 90
Front of drone in direction of red arrow and FC pointed to the right hand side.
The compass orientation is pointing towards the front the aircraft but upside down (henced rolled 180).

I’ve done a dozen builds previously with the Matek Slim without these issues.
Compass is connected on I2C.
I’ve tried changing cables etc.
These are the calibration results when the compass is forced to 180 roll:

I only have the one compass so not sure why the results are stored under compass 2.

Share a param file. I think you need to sort out why it’s on compass 2 first.

R3.1 (Compass Issue).param (21.3 KB)
Please find parameter file attached. Thanks!

I just looked back to the last one I set up with turned around parts. I left the auto rotation turned on, and set the orientation. In yours I’d also remove any mention of a second compass if you’re only using one.


I’ve tried reflashing the flight controller and setting parameters back to default and doing the setup again. Now when I calibrate the values are stored against compass 1. But this doesn’t fix the issue.

I can rule out the compass because I have tested different compasses:

  • 2x RM3100 and 1x HMC5883
  • Different wires/connectors
  • Different power sources used for the compass - common gnd to FC
  • Different compass locations on the frame

The flight controller may be the the issue? I have not used the matek-mini before.

The compass still thinks the flight controller orientation is 270deg not 90 deg as I showed above.
If I change the FC orientation to 270 the compass orientation is calculated and the error is not too bad. However when I roll the aircraft to the left the HUD rolls to the right - so unflyable in that config.

Its a lot of work and cost to toss the FC…

Hopefully someone can shed some light on this.

Is your FC and compass on the same plane? (ie: when the aircraft is level, both the FC and compass are flat to the ground?) I had a quad that used an angled mount for the GPS/compass. It angled approx. 30 degrees towards the rear. I could not get the compass to work properly regardless of the calibration or orientation settings. I designed my own mount that held the GPS/compass flat. Then everything just worked with manufacturer settings. This was a couple years ago, so maybe Ardu handles an angled compass better now and this is not the cause of your problem. Just letting you know in case it helps.