My personal battle with compasses

Hello , this is my new chapter in my personal battle against compass, i am really trying to understand them as deep as possible.

My actual problem is that during flight if i give pitch or roll input than EKF goes up to orange and red sometimes it gives me variance too. It doesn’t do it with Z axis when i give rudder input all is ok.

I checked axis from real time tuning and all rotations are correct and agree.

Now, taking for granted that my PH 2.1 is ok and not defective (i’ll eventually change it after i finish all the possible testing).

What i did so far:

  • extend the compass pole very high, no joy, still variance during pitch and roll inputs
  • compass/mot calibration, helped some but still far from good
  • tried different positions on the frame. no help

What will try in next days:

  • put the compass high and away from frame, i want to test it up and away from frame to make sure the cables and power distribution boards don’t act as a solenoid
  • eventually change PH 2.1

All this has been tested and had same results on 3.6 RC10 ChibiOS both with Zubax and Here units.

Thye only weird problem i seem to have and nobody else is reporting is that if i boot the quad with sbus installed than my external Compasses are not picked up (bad compass health), this happens with I2C and Canbus compasses.

I am really puzzled as why i am the only one reporting this prob, probably i am overlooking something that causes this. I wonder if this sympthom i have (sbus locking stuff) is at the base of my continue compass problems.

Obviously as usual any help or hint is greatly appreciated.



Looks like i solved the problem, will continue testing in the next days but as far as of now the problem disapperead.

What fixed it was moving UP AND AWAY from frame the compass. for up and away i mean that i raised it 20cm up and moved it around 20cm aft. Compass is now out of the frame plates and distribution boards. My first attempt in moving it just up didn’t give a good enough result, it maybe got a bit better but nothing to scream about. What really made a big difference was moving it out of the boundaries of the frame.

Now the compass bar on mission planner hud goes at half of the green at the max and stays really really low for the entire flight. No more “mag ground anomaly”, that disapperead too.
And no more “compass variance during pitch and roll”. What i think was happening is the distribution board was crossed by very different current during pitch and roll due to very different power to the motors, that way the mag fields due to the currents were varying very much in those manouvers.

Now i’ll put in a bit of offset compensation for the gps since it is way back :slight_smile:

All of this on a PH2.1 and 3.6 RC10 ChibiOS.



Figured it would be worth mentioning: you will probably want to re-do your compassmot calibration (or just clear the calib values) after you moved the compass away from the frame, if you haven’t already.

Thanks, i already erased them, don’t even know if it is needed to make a new compass mot calibration since it works really nice now.

Here’s a thought: Dump ChibiOS and go back to Nuttx. I tried ChibiOS on a Pixhawk 2.4.8 and a 2.4.6. Had compass issues (not detected, bad compass health, compass variance, EKF variance) and bad logging, logging failed errors on both FCs. Went back to Nuttx and everything is fine…

What do you mean you had ChibiOS on 2.4.8 and 2.4.6? I tought ChibiOS has been available only since 3.6.

If not strictly neccessary i’d rather continue using ChibiOS and eventually work and solve the problem. If nobody does it the comunity never goes forward. Anyway thank you for your hint, i will definitely test to see if that is the prob, in case it is will open a prob on github so dev can look at it and solve.



2.4.6 and 2.4.8 are HARDWARE versions of Pixhawks.

The first time I tried using ChibiOS was on a Pixhawk 2.4.8. The 2.4.8 board is slightly different than the earlier 2.4.6 boards I have, so when ArduCopter 3.6 rc10 puked I figured it was a hardware incompatibility issue, and to test that theory I flashed a 2.4.6 board with rc10 and ChibiOS. Unfortunately I got similar results. This leads me to believe there is a problem with running ChibiOS on a Pixhawk…

Ok, understand now, i’ll try 3.6 rc10 nuttx version and see if the problems disappear, even if it is difficult now to see because with new compass placement it works really well. Did you have same symthoms as the ones i described above?

I made some real progress today. All three of my Pixhawks are running 3.6-rc10 with ChibiOS.

My 2.8 ran it with no problems, but my oldest 2.6 kept blowing chunks with “Bad Compass Health,” Logging Failed" and “No IO Heartbeat” errors. Turns out the SD card in the old 2.6 just couldn’t hack it. Replaced it with another card and it works just fine.