Help noob: Cannot calibrate compass

My set up:
MP 1.3.7
Rover 4.0
Pixracer with buzzer
Compass+GPS Matek M8Q-5883 mounted externally 8 inches above FC.

Many attempts to calibrate with onboard mag calibration never go above 99% before restarting.
Tried using “relaxed”, setting COMPASS_OFFS_MAX to 2000, using different locations, Qgroundcontrol, and even RTFM with no joy.

Wiring checks OK and GPS works fine even indoors. Flight data screen responds to vehicle movement but is almost 45 degrees CCW from vehicle position. Compass and FC arrows are pointing in same direction.

Suspect I2C on this unit is not set up properly or is not being read properly. Have looked at U-Center software to tune this unit, but would rather no go down that rabbit hole if there is a simpler solution.

Any and all help appreciated.

This makes me think the arrow on either the FC or the Compass/GPS is wrong.
You might need to unplug the compass/GPS and calibrate the FC by itself and see if orientation works out OK for that - and experiment from there.

Is COMPASS_AUTO_ROT set to 2? This should resolve any directional issue you might have no matter how it’s mounted.

Thanks for the help, but no joy yet.

If I calibrate only the internal compass relaxed, when I go to flight data I get “bad compass health”, the heading shows due N when vehicle is pointed due S, and I cannot arm.

I have no way to set COMPASS_AUTO_ROT to a value of 2. See screen shot below:

mp%20compass%20parm

I did learn something new though…if I randomly roll the vehicle continuously during calibration, I can get past 99/%. When I read the docs, I assumed they meant to hold the vehicle fixed in each position (normal, left, etc.). Here is what the docs say: “hold the vehicle in the air and rotate it so that each side (front, back, left, right, top and bottom) points down towards the earth for a few seconds in turn.”

Thanks for the ideas and keep them coming.

“CheckAndFix” is 2 if you look in the Full Parameters list so that is not the problem. Rolling it around randomly is fine, that’s how I do it.

Update: Installed second external Compass+GPS Matek M8Q-5883 and still cannot calibrate compass.

When I do compass calibration I follow this procedure:

  1. Click PixHawk
  2. Is firmware greater than …yes
  3. Primary compass set to 1
  4. Compass #1 , use this compass, external mounted, none
  5. Compass #2 do not use this compass
  6. Compass #3 blank, default

… and calibration restarts even relaxed.

What am I doing wrong?

Update 2: I finally succeeded in calibrating internal compass 2 after setting all params to default. GPS works fine, but external 1 is not recognized on either unit for reasons unknown. By eliminating all pre arm checks, I can now ARM, but still have no steering or ESC. Still in pursuit of Nirvana…

Post a screen shot of Initial Setup>Mandatory Hardware>HW ID Maybe there is something useful to see there.

Thanks for staying with me, Dave. I do appreciate your help!

Current status at time pix were taken:

  1. Cannot arm even when pre-arm checks set to 0
  2. Internal pixracer mag calibrates, responds to vehicle rotation, but is off >90 deg. CCW. Vehicle is now pointing due S.

Here are some pix:

  1. screen shot of Initial Setup>Mandatory Hardware>HW ID

mp%20hwid

  1. MP arm check:

  1. Flight data with EKF overlay, vehicle static and level:

Sometimes, in the EKF flags, I see red flags for:
velocity_horiz_off
pos_horiz_abs_off
All other EKF flags are white.

If weather permits, I plan to reset all parameters to default and do all calibrations outdoors.

… but I’m hoping that you find a solution before then…:wink:

Hmm. Post a parameter file let’s check that out. Or enable disarmed logging and post a link to the last log after trying to arm. You will want to disable this after doing so or you can accumulate a lot of large logs.

Sorry for delayed response, I must have missed the notification.
I have not changed anything since last post. Here is full param list.

PixRover full param 12_18_19.param (15.6 KB)

Unless you need the logs, I will hold off generating them hoping that the param file is sufficient.

Thanks once again for your help, Dave

Bingo! Did outdoor compass calibration and both internal and external compasses calibrated with defaults (not relaxed).

Thank you Dave for you help and Happy Holidays !!