Three independent
calibrations.
Each sensor is calibrated on its own — don't confuse them. The magnetometer keeps heading honest, the accelerometer keeps bank true, and a short gyro alignment removes drift at power-up.
The three calibrations enter the signal chain at different points — the accelerometer fix is applied to the raw signal before the filters, the gyro alignment happens inside the filter, and the magnetometer fix feeds heading.
Metal and avionics distort the local magnetic field in two ways. Hard-iron comes from permanently magnetised material — speakers, screws, magnets — and adds a fixed offset that shifts the whole field; it moves the centre c. Soft-iron comes from ferromagnetic material that bends and re-scales the field differently with heading; it stretches the sphere of readings into a tilted ellipsoid — the shape W. Calibration maps both and corrects them, so magnetic heading reads true in the installed environment — not just on the bench.
Rotate
Turn the unit through many orientations so it samples the field from all directions.
Fit
A 3D fit (or 2D when motion is limited) recovers the hard- and soft-iron correction.
Apply
The correction is stored and applied continuously to incoming data.
The fit. Hand-held, the raw samples trace an off-centre, squashed sphere. A full ellipsoid fit — linear least-squares (Merayo-style) on the quadric — recovers the hard-iron centre c and a soft-iron 3×3 shape W that maps the ellipsoid back to a sphere. In the aircraft, where you can't tumble the airframe, a 2D ellipse in the horizontal plane is fitted instead. A residual-RMS (root-mean-square) and an axis-ratio check reject a bad fit.
Re-run when the environment changes — a new mounting, added avionics or a different airframe all shift the field. Recalibrate to keep the map current.
Keyed by what actually affects it — the 3D calibrations (the accelerometer 6-face fit and the magnetometer sensor fit) characterise the sensor itself, so they are stored per IMU (by its address) and stay valid at any mounting. Only the in-aircraft 2D magnetometer fit depends on the install orientation, so it is stored per IMU and per mounting preset. Swap IMUs or change the mounting and the app loads the matching calibrations automatically — and a 3D calibration is never re-run just because the mounting changed.
A small per-axis offset or scale error tilts the measured gravity vector and shows up as a bank error growing toward 45°. A classic six-point fit removes it. Hold the unit still on each of its six faces in turn:
Face +X up
Hold steady until captured.
Face −X up
Flip to the opposite face.
Face +Y up
Rotate to the next axis.
Face −Y up
Opposite face, hold still.
Face +Z up
Level, hold still.
Face −Z up
Inverted, hold still.
Each axis is bracketed by its + and − faces, giving a per-axis offset and scale — an axis-aligned ellipsoid mapped to a sphere of radius g, with no absolute-gravity assumption. The result is applied to the raw accelerometer before the filters, so every estimator benefits.
Every gyro has a small zero-rate bias that, uncorrected, would drift heading and attitude. A short static "Align" window at power-up — held still on the ground — measures and removes it automatically.
| When | at power-up, on the ground |
|---|---|
| Condition | aircraft held still |
| Window | a few seconds, automatic |
| Result | zero-rate bias removed |