CalibofMag 2012 PDF
CalibofMag 2012 PDF
Abstract: Calibration of all 3 axes of a 3D magnetometer in cases where the true field strength is unknown involves
an elaborate test set-up and rotation of the unit about all three axes so as to cover a sphere/ellipsoid. This paper
presents an alternate method for calibrating all three axis of a magnetometer, i.e. estimating bias and scale factors for
all axes, using a simpler 2 step procedure. The proposed technique exploits the relation between the body axis rates
and the Euler angles to define a limited rotation and an associated optimization problem to determine the calibration
parameters.
Keywords: Magnetometer, Calibration, Scale factor, Bias, Optimization.
The magnetometer output with errors are modeled as The following experimental set up has been designed in our
2 2 2 lab. As a truth reference sensor for angular positions we use
hx Bx hy By hz Bz Ideal Aerosmith’s Position Table [Ideal, 2010], which has
h2 (1)
x y z
angular position accuracies better than 0.1°. The following
are the general specifications of our set up:
where
Bx , By , Bz are the hard iron parameters. Sensors
x, y, z
are the scale factor and soft iron error parameters. Micromag 3 – 3-axis Magnetometer, [PNI 2010]
ADIS16365 – 3-axis Inertial Measurement Unit, [Analog
hx , hy , hz are the actual magnetic field strength. 2010]
The calibration procedures then involve computing the above Communication Board
parameters, and there are well known techniques for doing Fox board with processor ETRAX100lx
this, e.g. [Nathaniel Bowditch (1995), Demoz (2006),
Vasconcelos et. al. (2008)].
2hx (t1 ) 2h y (t1 ) (h y (t1 )) 2 1
2hx (t 2 ) 2h y (t 2 ) (h y (t 2 )) 2 1
(4)
H .. .. .. 1
.. .. .. ..
2hx (t k ) 2h y (t k ) (h y (t k )) 2 1
Since v is assumed to be sufficiently small, an estimate of
x can be obtained by the least squares solution as
xˆ
1
Figure (1): Experimental set up with 3axis magnetometer, HT H HT z (5)
IMU and FoxBoard embedded system The change in the parameters vector can be expressed as
1 (6)
Both the sensors are communicating through the Software x 2 By
SPI device driver code. Initially both sensors with 2
roll rotation) there must be no change in the . This are the magnetic field measurements in the horizontal plane.
along with pitch rate q using a gyro, then the measured
By using the fminsearch optimization routine in MATLAB, can be compared to the true change in heading computed
the solution to the minimum of the cost function can be analytically; and a simple cost function can be defined and
computed, and the solution gives the optimal values of Bz solved for obtaining the magnetometers Z-axis parameters.
and . In a more general case when the vehicle experiences both
z
pitch and roll motion the following relationship between the
After computing the optimal values of the Z axis parameters heading angle and body rates
the heading values are again plotted with the roll manoeuvre. sin (11)
0 p q
The heading error is restricted to ±7˚ as shown in Figure (4), cos
except where the roll rotation comes close to +90◦. Note that can be used to define an appropriate cost function and solve
the error is computed with respect to the position table. for the magnetometer Z-axis parameters.
Finally note that the initial conditions for the optimization 5. CONCLUSIONS
routine have not been chosen carefully, and we could use the
procedure described in Section 2.3 to compute accurate initial We have presented a simple technique for performing 3D
values which could further reduce the above heading error. magnetometer calibration.
The resulting heading error after our calibration has been
reduced to 7° - further reduction in the error can be obtained
by controlling measurement errors (e.g. modelled as white
Heading- Roll Plot
100 noise), misalignment errors, and by improving our initial
condition estimates for the Z-axis calibration parameters.
50
The complicated procedure of having to gather a large
0 amount of data by rotating the magnetometer in a sphere is
avoided. Instead, the problem is simplified to only having to
-50
rotate the sensor only about its roll axis.
Euler angles
Then we see
sin (10)
q
cos
If the Euler angles , can be measured (e.g. using an
accelerometer under a constant acceleration assumption),