Skip to content

Calibration

Bjarne Hansen edited this page Jan 25, 2021 · 2 revisions

Calibration

There are two phases of calibration:

  1. Initial Installation Calibration
  2. In-use Calibration

Installation Calibration is a manual procedure performed once you have placed the orientation device at its final location. This procedure consists of manually rotating the sensor through as wide a variety of orientations as practical over a one or two minute period. The sensor will need to be hand-held for this, ideally very close to the final mounting location so the magnetic environment doesn't change after mounting. Use the parameters of calibration fit error GetMagneticFitErrorTrial() and calibration order GetMagneticCalOrder() reported by the sensor as an indication of when sufficient datapoints have accumulated for the calibration. Generally, a fit error of less than 3.5% at a calibration solver order of 10 is considered good.

Once the manual calibration is completed, save the calibration values to non-volatile memory via the appropriate call to the software. Then mount the sensor, power it up again, and test its performance while rotating the vessel through an entire 360 degrees. If the heading accuracy is acceptable, the initial installation calibration is done. If not, you need to redo the manual calibration. Check for and remove any magnetic materials (ferrous metals, electrical wires, speakers, compasses, etc) from the vicinity of the sensor.

In-use Calibration is performed automatically by the software while in operation. On power-up, any saved calibration values are loaded and used immediately. Then, while running, the software periodically collects sets of magnetic datapoints and tries to generate a new calibration using those points. If the new calibration has an improved fit and order over the current in-use calibration, then the new calibration replaces the in-use one. This allows the sensor to compensate for transient changes in the magnetic environment while in use. Note that any newly-generated calibration is not saved to non-volatile memory unless commanded to do so via software. If you suspect the saved calibration is no longer optimum, (e.g. you have made changes to the nearby environment of the sensor), then it likely would be a good idea to perform a new manual calibration and save it.

Calibration Algorithms

Three levels, or complexity, of the calibration algorithm are used, depending on the number of datapoints available in the magnetic readings buffer. The current algorithm in use is indicated by GetMagneticCalOrder() as a number in the set [0,4,7,10]. 0 means no calibration solver has produced a solution yet. 10 means that a solution using the most sophisticated algorithm is available.

  1. The four element solver determines the field strength and hard iron offsets vector. The inverse soft iron matrix is set to the identity matrix. This is the simplest solver.
  2. The seven element solver adds non-unity diagonal elements to the inverse soft iron matrix. This model gives a significant improvement when either the magnetometer sensor has differing gains in its three channels or when the local environment has differing magnetic impedances along its three Cartesian axes.
  3. The ten element solver adds off-diagonal non-zero elements to the inverse soft iron matrix. This model gives an improvement over the seven-parameter model when the local environment’s magnetic impedances steer the geomagnetic field in directions that are not aligned with the sensor's Cartesian axes giving a rotated magnetic ellipsoid.

Further Information

  • NXP Application Note AN5019 Magnetic Calibration Algorithms
Clone this wiki locally