Error: Mag (2) bad radius 397 expected 526

Good afternoon colleagues. Faced a problem when transferring GPS from i2c bus to Can. The compass refuses to calibrate, after each attempt it starts the calibration again and gives an error: Mag (2) bad radius 397 expected 526
GPS on the CAN bus works fine, but the compass fails. Selected compass No. 3 as the main one. What does this error mean?

I have never seen this before. In the code, it is related to the compass scale factor. This is a new feature which uses your GPS position to look up what the earth magnetic field strength and scale the compass readings to match the field strength. The error appears when the scale factor is <0.85 or >1.3, because that might indicate that there is interference or there is something wrong with the sensor.

I’m not sure what might be causing the problem, but make sure you do these things:

  • have a good GPS lock before starting the calibration
  • the sensor is not near metal objects or electronics
  • do the calibration in a place that is far away from large metal objects, including reinforced concrete