Magnetometer calibration fails on Pixhawk Pro 3

I have a Pixhawk Pro 3, connected to the Sirius RTK GPS, which has a compass built in (Registering as Compass 1 = External). I am using QGround Control (V 3.4.4) to calibrate the magnetometers. I am using the ArduRover firmware (latest version). However the calibration keeps failing no matter what I try. I tried:

  1. Setting the orientation to Yaw270 as another post seem to suggest (Also tried Yaw90)
  2. Relaxing the convergence using COMPASS_CAL_FIT parameter >> Relaxed
  3. Set COMPASS_OFFS_MAX >> 3000 (maximum value)

The following message appears during calibration: “Compass 2 calibration below quality threshold”. In Mission Planner, offset values for Compass 3 (internal) in X and Y seems large and greater than 3000.

Any ideas how to resolve this issue?

Two types of correctable distortion affect magnetometers like the ST Microelectronics LSM303DLH and 2-axis Honeywell HMC6532 that I’ve been experimenting with: hard iron and soft iron distortions.

Hard iron distortions are caused by magnetized objects in a fixed location relative to the mounting point of the compass. Soft iron distortions are caused by magnetically soft objects or PCB traces that alter the magnetic field around the compass depending on the direction the compass is pointing.

If you plot the x, y and z magnetic readings at various positions in a 3d scatter plot, in a perfect world you’d see a sphere surface mapped out by the points.

Hard iron distortions will offset the sphere along the x, y and z axes. Soft iron distortions turn the sphere into a tilted ellipsoid.

There’s also scale distortion. All the axes should have equal sensitivity but they rarely, if ever, do. Correcting this is a question of normalizing the reported results of each axis.
Learn more here:

Therefore, if you cannot perform the calibration by software because the bias is too large, you can put a small piece of iron (or a low magnetic magnet) to compensate for the sensor deviation then try to combine with software.

Sometimes calibration is very difficult work. That’s when you need 2 RTK modules and use MOVING-BASE mode to get the Heading value instead of using the magnetic compass.