Optimization-Based Gravity-Assisted Calibration and Axis Alignment of 9-Degrees of Freedom Inertial Measurement Unit Without External Equipment
Optimization-Based Gravity-Assisted Calibration and Axis Alignment of 9-Degrees of Freedom Inertial Measurement Unit Without External Equipment
Abstract
Applicable in numerous fields, low-cost micro-electromechanical system inertial measurement units often require
on-sight calibration by the end user due to the existence of systematic errors. A 9-degrees of freedom inertial meas-
urement unit comprises a tri-axis accelerometer, a tri-axis gyroscope, and a tri-axis magnetometer. Various proposed
multi-position calibration methods can calibrate tri-axis accelerometers and magnetometers to a degree. Yet the full
calibration of a tri-axis gyroscope and axis alignment of all the sensors still often requires equipment such as a rate table
to generate a priori known angular velocities and attitudes or relies on the disturbance-prone magnetometer output as a
reference. This study proposes an augmentation to the popular multi-position calibration scheme, capable of fully
calibrating and aligning the sensor axes of the 9-degrees of freedom inertial measurement unit while eliminating the
reliance on external equipment or magnetometer. The algorithm does not rely on the inertial measurement unit attitude
during various stages of the multi-position data acquisition. Instead, it uses the gravity vector measured by the accel-
erometer to calibrate the gyroscope and align the magnetometer axes with the sensor body frame. Experimental results
using a navigation module with factory calibration and extensive simulation results indicate the current method’s ability in
estimating large calibration parameters with relative errors below 0.5%.
Keywords
Multi-position inertial measurement unit calibration, axis alignment, numerical optimization, gravity-assisted method,
magnetometer
Kim and Golnaraghi7 utilized optical tracking sys- the resulting calibration schemes are limited to low
tems to obtain the true acceleration and angular rate acceleration movements to avoid estimation errors
of the IMU to calculate the sensor non-idealities. in the inclination estimation.
External coils can be used to generate known mag- In Cheuk et al.,25 the accelerometer and magnet-
netic fields for magnetometer calibration.8 ometer of a 9-DoF IMU were separately calibrated by
To reduce costs, calibration methods have been ellipsoid fitting. The authors calibrated the gyroscope
devised requiring only the earth gravity and magnetic by comparing the orientation obtained by the inte-
field signals, effectively enabling the end user to cali- grated gyroscope output and the orientation obtained
brate the IMU. The calibration methods proposed in by the combined accelerometer and magnetometer.
literature9,10 utilize a gravity constraint to calibrate a The calibration process only used data from the per-
tri-axis accelerometer placed in multiple orientations, iods during which the sensor was static while ignoring
requiring the inclination angles at each orientation to the transient stages of the data during which the
be calculated. The authors in literature11,12 circum- sensor was moved from one static state to another.
vented the inclination angle calculation requirement Calibrated magnetometers were used in the studies
by constraining the specific force norm to be equal conducted in literature26,27 to estimate the accelerom-
to gravity under static conditions. eter and gyroscope biases. The estimation of other
Seeing that in the absence of external magnetic systematic errors such as scaling and axes non-
interferences the earth magnetic field is locally con- orthogonalities, however, was ignored in both studies.
stant, tri-axis magnetometers may be calibrated The algorithm introduced in Ding et al.28 utilized
using a principle similar to that of the static acceler- the transient stages in a multi-position data acquisi-
ometer (i.e. constraining the magnetometer output tion scheme to estimate the gyroscope calibration par-
vector norm to be constant during calibration).13,14 ameters (minus the linear acceleration effects on the
Methods belonging to this category usually involve gyroscope output). Furthermore, compared to more
fitting an ellipsoid to magnetometer data acquired robust optimization-based algorithms, the Kalman fil-
during calibration.15 The sensor non-idealities tering scheme, upon which the algorithm relied for
may then be accurately calculated using the ellipsoid parameter estimation, is more suited to real-time
parameters provided that there is a sufficient number applications.
of data points covering the ellipsoid surface. More recently Chow et al.29 proposed an optimiza-
Camps et al.16 utilized such norm constraining tion-based multi-position method capable of fully
approaches to calibrate a triad of accelerometers estimating the accelerometer, gyroscope, and magnet-
and magnetometers. ometer calibration parameters simultaneously. In
The earth rotation rate vector may be utilized to addition to constraining the accelerometer norm
calibrate tri-axis gyroscopes in multiple stationary during static states, constraints involving the change
orientations with norm constraining methods similar in position, velocity, and attitude of the IMU during
to those used in the calibration of accelerometer and transient stages were imposed. The enforcement of the
magnetometer triads,17 provided that the sensor additional constraints is dependent on the IMU atti-
accuracy and measurement noise levels allow for the tude during transient stages. Furthermore, in this
detection of such small signals. Shin and El-Sheimy17 method, despite the occasional magnetic disturbances
used magnitude constraining methods to simultan- being omitted from the dataset, magnetic measure-
eously calibrate gyroscope and accelerometer triads. ments, which may be subject to a non-uniform mag-
With minor compromises in accuracy, the authors in netic field in an indoor environment, may negatively
literature18,19 proposed methods for the automatic affect the calibration of the accelerometer and
detection of periods during which the sensor is gyroscope.
static, thus simplifying the multi-position calibration Numerous studies have been conducted regarding
process. Improvements to the multi-position tri-axis utilizing the magnetometer output for gyroscope cali-
gyroscope calibration have been introduced in litera- bration.30–32 Wu and Luo30 proposed an optimiza-
ture20–22 by utilizing a rate table to generate stronger tion-based method capable of estimating the bias,
reference signals for the gyroscope. These methods, scaling, and axis non-orthogonality parameters of
while resulting in more accurate calibration results, the magnetometer. Furthermore, the aforementioned
are harder to implement due to the reliance on exter- method was capable of estimating the gyroscope bias
nal equipment and increased calibration time. as well as the misalignment between the gyroscope
Some studies have utilized the correlation between and magnetometer axes. Wu and Pei31 augmented
gyroscope and magnetometer axes to calibrate each the aforementioned optimization-based calibration
sensor. In literatures,23,24 the authors calibrated the method, allowing it to estimate the gyroscope scaling
magnetometers by ellipsoid fitting and grey box iden- and axes non-orthogonality parameters as well. Wu
tification, respectively. The axes misalignments were et al.32 handled the same problem with an extended
calculated using inclination data obtained by inertial Kalman filtering approach, enabling it to be used in
sensors while ignoring accelerometer non-idealities. real time. Though the methods proposed in litera-
Due to neglecting the accelerometer non-idealities, ture30–32 do not rely on accelerometer measurements
Razavi et al. 3
or require the sensor to be static during calibration, integration process. This in turn results in g^ f being
they require a homogenous and undisturbed magnetic estimated more accurately and enables the calibration
field to function. method to robustly estimate large calibration param-
Out of the calibration methods reviewed earlier, eters. Based on the same principle, the current study
most of the ones capable of fully calibrating a also introduces an optimization-based method for
9-DOF IMU without external equipment rely on aligning the magnetometer axes with those of the
magnetometer measurements for parameter estima- gyroscope and accelerometer.
tion. A desirable method for the calibration of con- This paper comprises eight sections. In the follow-
sumer electronic devices containing 9-DOF IMU, ing section, the basics of the multi-position calibration
however, must be implementable in indoor environ- data are introduced. The various sensor calibration
ments where there are many sources of magnetic dis- parameters and the initial calibration of accelerometer
turbances. The calibration method introduced in the and magnetometer are discussed in the subsequent
current study relies solely on the gravity vector mea- section. The fourth section elaborates upon the
sured by the static accelerometer for the calibration recursive optimization-based calibration and axis
and axis alignment of the gyroscope; the magnetom- alignment of the gyroscope using calibrated acceler-
eter is calibrated and aligned with the accelerometer ometer data. In the fifth section, a method for the
and gyroscope axes in a later stage, effectively limiting alignment of the previously calibrated magnetometer
the effects of any magnetic disturbances to the cali- with the accelerometer and gyroscope axes is pro-
bration of the magnetometer alone. Furthermore, the posed. The performance of the proposed calibration
current calibration and axis alignment method are method is evaluated by experiment and rigorous simu-
completely independent of the IMU attitude during lation in the sixth and seventh sections, respectively.
the multi-position data acquisition process. Finally, the conclusions are presented in the final
One of the closest methods to the one proposed in section.
the current study is the method introduced in Fong Due to the high number of subscripts used
et al.18 During the multi-position calibration data throughout the paper, a summary is provided in
acquisition, the sensor undergoes multiple static and Table 1.
dynamic stages; i.e. time periods during which the
sensor is static and in motion, respectively. The grav-
Multi-position calibration data
ity vector at the beginning and end of each dynamic
stage— gs 2 R3 and gf 2 R3 , respectively—is mea- In this study, a single multi-position dataset is used
sured during its preceding and following static for the calibration and axis alignment of the acceler-
stages. On the other hand, an estimation of gf , ometer, gyroscope, and magnetometer in a 9-DOF
g^ f 2 R3 , is obtainable using gs and measured gyro- IMU. Many multi-position data acquisition schemes
scope data; Fong et al.,18 for example, have integrated have been proposed in various studies. All these meth-
quaternion dynamics using gyroscope data to estimate ods involve placing the sensor in multiple orientations
the attitude change and consequently g^ f . The gravity for a few seconds while logging the uncalibrated
estimation error vector, gf ¼ gf g^ f , is dependent on sensor measurements.
the gyroscope calibration parameters. With the sum- In this study, the data logged during the time per-
mation of gTf gf for all the dynamic stages as the iods in which the sensor was static in each orientation
objective function, the gyroscope calibration param- will be referred to as static data. On the other hand,
eters may be estimated using the least-squares the data logged during the transient stages of the
method. The method in Fong et al.18 uses this prin- data acquisition—when the sensor is rotated from
ciple for estimating gyroscope scaling parameters via one orientation to another—will be dubbed as transi-
optimization, though the details of the optimization ent data.
process were not discussed. The method’s ability in
estimating small scaling parameters was demonstrated
Table 1. Parameter subscripts.
via experimentation.
In the current study, the proposed optimization- ð:Þk Parameter corresponds to the kth time
based gyroscope calibration algorithm is capable of window
estimating bias, scaling and g-sensitivity parameters ð:Þs Parameter corresponds to the starting
(i.e. parameters corresponding to the effects of linear moment in the time window
acceleration on gyroscope measurements). ð:Þf Parameter corresponds to the final moment in
Furthermore, instead of relying on quaternion the time window
dynamics, the method in the current study uses gyro- ð:Þ Parameter estimation has been corrected
scope measurements to directly integrate gravity 2 N times
vector dynamics in the body frame for calculating ð:Þacc Parameter corresponds to the accelerometer
g^ f . Having a priori knowledge regarding gf allows ð:Þgyr Parameter corresponds to the gyroscope
for the introduction of an error growth model for ð:Þmgn Parameter corresponds to the magnetometer
the gravity vector during the gravity vector dynamics
4 Proc IMechE Part G: J Aerospace Engineering 0(0)
The static and dynamic data are detected and sepa- velocity, specific force, and magnetic field. There
rated automatically by monitoring the standard devi- exists a vigorous body of research regarding the cali-
ation of a fixed length time window of the gyroscope bration of tri-axis accelerometers and magnetometers
output norm time series; the time periods during using ellipsoid fitting methods. Thus, in this study, the
which the standard deviation is roughly constant are accelerometer and magnetometer calibration param-
categorized as static data while the rest of the data eters will be estimated using the method proposed in
belong to the transient dataset. Merayo et al.33 and the multi-position static data
Note 1: In this study, it is assumed that the multi- introduced earlier. The calibrated accelerometer
position calibration data comprises n static stages output is assumed to be resolved in the sensor body
with n 1 transient stages between them; thus the frame (the b frame). The frame in which the calibrated
entire data are composed of N ¼ 2n 1 stages. It is magnetometer output is resolved will be referred to as
further assumed that the sensor is initially static, the m frame. Since the ellipsoid fitting calibration pro-
resulting in the static and transient stages to be cesses of accelerometer and magnetometer occur inde-
indexed by odd and even numbers, respectively. For pendently (i.e. each process requires only the data
example, the even indexed kth stage comprises transi- from the sensor to be calibrated), the axes of the m
ent data, preceded and followed by the odd indexed frame are not necessarily coincident with those of the
ðk 1Þth and ðk þ 1Þth stages containing static
data. sensor body frame.
The kth stage spans over the time window ts,k tf,k , Note 2: In this study, the ‘‘ ’’ and ‘‘^’’ symbols are
where the ð:Þs and ð:Þf subscripts represent the initial utilized to denote measured and estimated values,
and final moments in the time window and the ð:Þk respectively.
subscript represents the kth stage correspondence. It Considering Note 2 and the earlier discussions, the
is notable that, throughout the paper, these subscripts relationship between the estimated specific force,
will be used for parameters other than time as well. angular velocity and magnetic field vectors, and
Furthermore, each stage begins immediately after the their corresponding measured values is expressed as
previous one (i.e. ts,kþ1 ¼ tf,k ).
b
b
The static data will be used for the calibration of f^ ¼ Sacc ~f bacc ð1Þ
the accelerometer and magnetometer and the transi-
ent data will be utilized for the alignment of the mag-
netometer axes with the accelerometer and gyroscope !bib ¼ Sgyr !~ bib bgyr þ Kf b ð2Þ
axes. Both the transient and static data will be utilized
simultaneously to calibrate and align the axes of the ^ m ¼ Smgn m
m ~ b bmgn ð3Þ
gyroscope with the accelerometer. The overall proced-
ure of the algorithm is depicted in Figure 1.
^ b ¼ Cbm m
m ^m ð4Þ
correspondence to the accelerometer, gyroscope, and derived from the constraints the gyroscope output
magnetometer, respectively. In that context, the must satisfy during transient and static stages of the
vector bacc 2 R3 and matrix Sacc 2 R33 represent multi-position dataset.
the accelerometer bias vector and scaling matrix, Note 5: For arbitrary vectors a 2 R3 , d 2 R6 , and
while bgyr 2 R3 and Sgyr 2 R33 represent similar par- c 2 R3 , we have
ameters for the gyroscope. The matrix K 2 R33 rep-
resents the g-sensitivity matrix containing the ða, dÞc ¼ diagðcÞa þ ðcÞd ð8Þ
parameters corresponding to the effects of linear
acceleration on the gyroscope measurements. The where diagðcÞ, ða, dÞ and ðcÞ are defined as
vector bmgn 2 R3 and matrix Smgn 2 R33 represent 2 3
the magnetometer bias vector and scaling matrix, c1 0 0
respectively. The rotation matrix Cbm 2 R33 repre- 6 7
diagðcÞ ¼ 4 0 c2 05 ð9Þ
sents the rotation from the m frame to the sensor
0 0 c3
body frame.
As explained earlier, the bias vectors bacc and bmgn 2 3
a1 d1 d2
and the scaling matrices Sacc and Smgn will be calcu- 6 7
lated using the ellipsoid fitting method introduced in ða, dÞ ¼ 4 d3 a2 d4 5 ð10Þ
Merayo et al.33 As a result, the remaining parameters d5 d6 a3
to be estimated are the gyroscope calibration param-
2 3
eters (i.e. vector bgyr and matrices Sgyr and K) and the c2 c3 0 0 0 0
magnetometer misalignment parameters (i.e. rotation 6 7
ðcÞ ¼ 4 0 0 c1 c3 0 05 ð11Þ
matrix Cbm , parametrizable by a rotation vector with
three elements). Thus, the total number of unknown 0 0 0 0 c1 c2
parameters to be estimated in this study is 24.
Note 3: The scaling matrix estimated by the method Considering Note 5, regarding the gyroscope scal-
introduced in Merayo et al.33 is upper triangular. ing matrix Sgyr and g-sensitivity matrix K we may
Given the numerous existing norm constraining algo- write
rithms developed for the calibration of accelerometers
and magnetometers, one may find it suitable to utilize Sgyr ¼ I sgyr , gyr ð12Þ
other methods. Regardless of the method however, it is
desirable to upper triangularize the resulting estimated K ¼ ð1 , 2 Þ ð13Þ
scaling matrix (using QR decomposition34 for example)
to obtain specific results. where the vectors sgyr 2 R3 and gyr 2 R6 are used to
Note 4: The misalignment rotation matrix parameterize the gyroscope scaling matrix, while the
33
Cmb 2R is parametrizable in terms of the rotation vectors 1 2 R3 and 2 2 R6 parameterize the g-sensi-
vector 2 R3 as tivity matrix. Considering equations (12) and (13)
equation (2) is rewritten as
sinkk
Cm ¼ C ¼ I33 ½
b
k k !bib ¼ I sgyr , gyr !~ bib bgyr þ ð1 , 2 Þf b
ð5Þ
1 coskk ð14Þ
þ ½2
ka k2
The optimization-based gyroscope calibration
where ½ is defined as method introduced in this section utilizes the earth
2 3 gravity vector as a reference for calibration. The
0 3 2 output vector of the static calibrated accelerometer
6 7 is equal to the negative local gravity vector, denoted
½ ¼ 4 3 0 1 5 ð6Þ
here by g 2 R3 . Regarding g we may write
2 1 0
gn ¼ Cnb gb ð15Þ
Assuming small rotations (i.e. kk 1), we may
write where Cnb represents the rotation matrix from the
sensor body frame to the north-east-down frame
C I33 ½ ð7Þ (NED frame or n frame) and adheres to the following
dynamics1
_ n ¼ Cn !b !n Cn
C ð16Þ
Gyroscope calibration b b ib in b
In this section, the calibration of the tri-axis gyro- where !nin denotes the angular velocity of the NED
scope is formulated as an optimization problem frame with respect to the inertial frame and is
6 Proc IMechE Part G: J Aerospace Engineering 0(0)
_ n gb þ Cn g_ b ,
g_ n ¼ C gbk ¼ gb g^ bk ð25Þ
b b
b b
¼ Cb !ib g þ Cnb g_ b ,
n ð18Þ
Considering equations (23) to (25), gbk must satisfy
¼0 the following constraints
It can be deduced from equation (18) that b
^gk ¼0 ð26Þ
t¼ts, k
g_ b ¼ !bib gb
ð19Þ ^gbk ¼ gbf,k g^ bf,k ð27Þ
¼ gb !bib t¼tf, k
b gyr ¼ I sgyr , gyr bgyr ð30Þ Integrating equation (29) over ts,k tf,k and sub-
stituting in equation (37) results in
W ¼ I33 diag !~ bib !~ bib diag f b f b Gk pgyr Dk ¼ 0 ð38Þ
ð31Þ
where Gk and Dk are defined by
h T
i
pTgyr ¼ b gyr ð32Þ Z
sTgyr T
gyr T1 T2 1 tf
Gk ¼ Wdt ð39Þ
tf,k ts,k ts
Considering equation (25) to (32) and integrating
equation (19) over t tf,k with initial condition Z tf, k
s,k 1
gb t¼ts, k ¼ gbs,k and terminal condition gb t¼tf, k ¼ gbf,k Dk ¼ !~ bib dt ð40Þ
tf,k ts,k ts, k
results in
The tri-axis gyroscope calibration problem is now
Z tf, k b presented considering the constraints derived in equa-
gbf,k gbs,k ¼ g !bib dt
ts, k
tions (34) and (38).
Z
tf, k
¼ g^ bk þ gbk !~ bib þ !bib dt Theorem 1. Considering equations (35), (36), (39),
ts, k and (40) an estimation of the gyroscope calibration
Z tf, k parameters vector, pgyr , is obtained by
¼ g^ bk þ gbk !~ bib dt
ts, k
Z P !1
tf, k r ATk Ak
b k¼2, 4, ..., ð2n2Þ
þ g^ k þ gbk !bib dt pTgyr ¼ P
ts, k þð1 rÞ k¼1, 2, ..., ð2n1Þ GTk Gk
Z tf, k P !
¼ g^ bk þ gbk !~ bib dt r k¼2, 4, ..., ð2n2Þ ATk Bk
P
ts, k
! þð1 rÞ k¼1, 2, ..., ð2n1Þ GTk Dk
Z tf, k
b ð41Þ
g^ k þ gbk W dt pgyr
ts, k
X dataset is defined as
T
k¼1, 2, ..., ð2n1Þ k
G G k pgyr
X
2pTgyr r A T B þ ð 1 rÞ
k¼2, 4, ..., ð2n2Þ k k
2 ¼ !^ bib, 2 j!^ bib, 2 ¼ S gyr, 1 !^ bib, 1 b gyr, 1 þ K
1 fb ,
X T o
k¼1, 2, ..., ð2n1Þ
Gk Dk !^ bib, 1 2 1 ð49Þ
X
þr BT B þ ð1 rÞ
k¼2, 4, ..., ð2n2Þ k k
X where b gyr,1 , S gyr,1 , and K
1 are the gyroscope calibra-
DT D
k¼1, 2, ..., ð2n1Þ k k
ð42Þ tion parameters calculated using 1 .
Considering equations (43) to (49), we may write
Differentiating equation (42) with respect to pgyr ,
equating it to zero, and solving for pgyr results in
equation (41). !^ bib,2 ¼ S gyr,1 !^ bib,1 b gyr,1 þ K
1f b
Note 8: Considering Assumption 1, the results
¼ S gyr,1 Sgyr,0 !^ bib,0 bgyr,0 þ K0 f b b gyr,1
obtained from (41) are suboptimal.
Considering Note 8, using the parameters obtained 1f b
þK
from equation (41) to correct the multi-position cali-
bration data result in a new dataset which may yet be ¼ S gyr,1 Sgyr,0 !^ bib,0 bgyr,0 þ S1
gyr,0 bgyr,1
subjected to gyroscope bias, scaling, axes non-ortho-
þ S gyr,1 K0 þ K 1 fb
gonality, and g-sensitivity. The original multi-position
gyroscope dataset is denoted by ¼ Sgyr,1 !^ bib,0 bgyr,1 þ K1 f b ð50Þ
n o
0 ¼ !^ bib,0 j!^ bib,0 ¼ !~ bib ð43Þ
where bgyr,1 , Sgyr,1 , and K1 are the best available
gyroscope calibration parameters after the first cor-
While the corrected multi-position gyroscope data- rection (denoted by the ð:Þ1 subscript) and are
set will be denoted by obtained by
n
1 ¼ !^ bib, 1 j!^ bib, 1 ¼ S gyr, 0 !^ bib, 0 b gyr, 0 þ K
0 fb ,
bgyr,1 ¼ bgyr,0 þ S1
gyr,0 bgyr,1 ð51Þ
o
!^ bib, 0 2 0 ð44Þ
Sgyr,1 ¼ S gyr,1 Sgyr,0 ð52Þ
8 9
< b gyr,1 !^ b gyr,1 þ K
1 f b =
b
^
! ib, ¼ S ib,1 b
¼ !^ ib, !^ bib,1 2 1 ð57Þ
: ¼ Sgyr,1 !~ bib bgyr,1 þ K1 f b , ;
!^ bib, 2 .
Note 9: The parameter estimation accuracy Integrating equation (60) with the initial condition
improvement capability of Algorithm 1, for which mm jt¼ts, k ¼ mm m m
s,k and terminal condition m jt¼tf, k ¼ mf,k
no analytical proof was presented, will be illustrated results in
numerically in the experimental results section.
Z tf, k
mm m
f,k ms,k ¼ mm !m
ib dt
Magnetometer alignment Z
ts, k
ð63Þ
tf, k
In this section, the gyroscope calibration parameters ¼ mm Cm b
b !ib dt
estimated in the previous section are utilized to cor- ts, k
Z !
tf, k m Considering equations (4) and (71), the best available
1
Fk ¼ mm m
f,k ms,k m !bib dt estimation of the misalignment rotation matrix, at this
tf,k ts,k ts, k
stage, is obtained as
ð67Þ
Cbm 0
¼ CT0 ð72Þ
the denominator tf,k ts,k is included in both equa-
tions (66) and (67) so that the constraint obtained in The ð:Þ0 subscript in Cbm 0 denotes that Cbm 0 was
equation (65) would be independent from the transi- corrected zero times.
ent stage time length. The alignment problem is now As a result of the misalignment correction in equa-
presented considering the constraint derived in equa- tion (71), the misalignment of 1 is expected to be
tion (65). smaller in magnitude compared to 0 . In other
words, regarding the objective function in equation
Theorem 2. Considering equations (66) and (67), an (69), it is expected that
estimation of the relative misalignment between the m
frame and the sensor body frame is obtained as Jmgn,1 5 Jmgn,0 ð73Þ
X 1 X
where Jmgn,0 and Jmgn,1 are the values of the objective
¼ ET E
k¼2,4, ...,ð2n2Þ k k
ET F
k¼2,4, ...,ð2n2Þ k k function in equation (69) computed using mb0 2 M0
ð68Þ and mb1 2 M1 , respectively. Thus, another corrected
dataset is defined as
Proof. The following alignment objective function is n o
defined considering the fact that the constraint M2 ¼ mb2 j mb2 ¼ CT1 mb1 , mb1 2 M1 ð74Þ
derived in equation (65) must be satisfied for all the
transient stages
where C1 is obtained using equation (5) and 1 is the
X misalignment rotation vector calculated using M1 .
Jmgn ¼ k¼2,4, ...,ð2n2Þ
ðEk Fk ÞT ðEk Fk Þ Considering equations (70) to (74), we can write
!
X T ETk Ek
¼ mb2 ¼ CT1 mb1
k¼2,4, ...,ð2n2ÞþFTk Fk 2T ETk Fk
X ¼ CT1 CT0 mb0
¼ T ET E
k¼2,4, ...,ð2n2Þ k k
ð75Þ
X ¼ CT1 Cbm 0 mb0
2T k¼2,4, ...,ð2n2Þ
E T
k F k ¼ Cbm 1 mb0
X
þ FT F
k¼2,4, ...,ð2n2Þ k k
ð69Þ
where Cbm 1 is the best available estimation of the
differentiating equation (69) with respect to , equat- misalignment rotation matrix after the first correction
ing the results to zero and solving for results in (denoted by the ð:Þ1 subscript) and is obtained by
equation (68).
Note 10: Considering Assumption 2, the results Cbm 1
¼ CT1 Cbm 0 ð76Þ
obtained from equation (68) are suboptimal.
Considering Note 10, using the parameters Thus, by the propagation of the relationship
obtained from equation (68) to rotate the calibrated between equations (72) and (76), a recursive misalign-
magnetometer measurements from the m frame to the ment estimation algorithm is introduced to increase
sensor body frame results in a new dataset which may the accuracy of the suboptimal results obtained in
not yet be completely aligned with the body frame. equation (68).
The original calibrated multi-position magnetom- Algorithm 2: Denoting the ideal maximum thresh-
eter dataset is denoted by old for the objective function in equation (69) by
Jmgn, max 4 0 and the maximum number of recursions
M0 ¼ mb0 jmb0 ¼ mm ð70Þ by max 2 N, the accuracy of the magnetometer mis-
alignment estimation is expected to be improved by
while the rotated multi-position gyroscope dataset the following recursive algorithm
will be denoted by
n o Cbm ¼ CT Cbm 1 ð77Þ
M1 ¼ mb1 j mb1 ¼ CT0 mb0 , mb0 2 M0 ð71Þ
where Cbm and Cbm 1 represent the best estimation
of the misalignment rotation matrix after 2 N and
where C0 is obtained using equation (5) and 0 is the 1 corrections, respectively. The rotation matrix C
misalignment rotation vector calculated using M0 . is calculated using equation (5) and the rotation
Razavi et al. 11
vector is obtained from equation (68) using the ability of the current method to tackle large non-
following magnetic field dataset idealities.
n o Note 12: As explained in Assumption 2, each stage
M ¼ mb j mb ¼ CT1 mb1 , mb1 2 M1 of the recursive magnetometer alignment process
introduced in Algorithm 2 proceeds with the assump-
ð78Þ tion of small misalignments. Thus, to properly evalu-
ate the misalignment estimation capabilities of
The recursion is to continue until 5 max and Algorithm 2, the magnetometer misalignments in the
Jmgn, 4 Jmgn, max , where Jmgn, is the value of the randomly generated calibration datasets are all
objective function in equation (69) computed using chosen with large magnitudes.
mb 2 M . Considering Note 3, the generated accelerometer
Note 11: The magnetometer misalignment estima- and magnetometer scaling matrices are upper triangu-
tion accuracy improvement capability of Algorithm 2, lar (i.e. Sacc,21 ¼ Sacc,31 ¼ Sacc,32 ¼ 0 and Smgn,21 ¼
for which no analytical proof was presented, will be Smgn,31 ¼ Smgn,32 ¼ 0).
illustrated numerically in the following section. The relative weighting parameter in equation (41)
is set to r ¼ 0:5. The recursive algorithms introduced
in Algorithms 1 and 2 are set up to continue for a
Experimental results maximum number of 30 recursions or until the fol-
In this section, an XSENS MTi-G-710 GPS/INS navi- lowing conditions are met
gation module with factory calibration is utilized to
verify the ability of the proposed calibration and axis Jgyr,gyr Jgyr,ðgyr 1Þ
alignment algorithm in estimating the calibration par- Jgyr,ðgyr 1Þ 100 5 0:01, gyr 4 2 ð79Þ
ameters. The noise levels of the accelerometer, gyro-
scope, and magnetometer sensors of the module, Jmgn,mgn Jmgn,ðmgn 1Þ
100 5 0:01, mgn 4 2 ð80Þ
calculated using 10 s of static sensor output, are Jmgn,ðmgn 1Þ
reported in Table 2.
In the context of not relying on expensive equip- where gyr 2 N and m 2 N are the recursion indexes
ment, a simple setup was conceived using a box whose for Algorithms 1 and 2, respectively. In other words,
vertices have been modified to create additional faces the gyroscope calibration and magnetometer align-
(Figure 2). The sensor module is then installed at the ment recursive processes will continue until the rela-
center of the box and put through a multi-position tive change in their respective objective functions are
sequence. During the sequence, the box is rotated less than 0.01%.
around the downward axis of the NED frame while As presented in Table 4, the calibration and align-
placed on each of its faces. The process results in 45 ment algorithms were capable of relative parameter
static states each lasting at least 5 s. The orientations estimation with maximum relative estimation errors
the module undertakes during the data acquisition below 0.3%. The relative errors were calculated with
process are estimated using the attitude estimation respect to the maximum parameter value in each
algorithm proposed in Madgwick35 and depicted in
Figure 3(a).
Due to the module having factory calibration, uti-
lizing the proposed method for calibration and axis
alignment results in parameter estimations having
near zero magnitude. To effectively evaluate the cap-
ability of the proposed method in estimating the cali-
bration parameters, the gathered multi-position
dataset is perturbed by 10 sets of randomly generated
calibration parameters, only three sets of which are
reported in Table 3 for brevity. The parameters have
been generated with large magnitudes to assess the
Figure 3. Experimental and simulated attitude quaternion, gray areas indicate static states.
ba (m/s2) Sa bm Sm
Set No 1 (%) 2 (%) 3 (%) 4 (%) 5 (%) 6 (%) 7 (%) 8 (%) 9 (%) 10 (%) Max (%)
ba 0.00031 0.00005 0.00022 0.00006 0.00025 0.00032 0.00028 0.00026 0.00006 0.00004 0.00032
Sa 0.00057 0.00056 0.00081 0.00068 0.00060 0.00043 0.00056 0.00041 0.00044 0.00049 0.00081
bg 0.00161 0.00274 0.00151 0.00083 0.00106 0.00252 0.00307 0.00083 0.00048 0.00094 0.00307
Sg 0.09984 0.10957 0.12122 0.10012 0.09255 0.09733 0.06434 0.08242 0.10373 0.10887 0.12122
K 0.11634 0.11279 0.09793 0.15660 0.09150 0.14940 0.13940 0.10373 0.07505 0.14725 0.15660
bm 0.00216 0.00338 0.00476 0.00136 0.00875 0.00696 0.01023 0.00083 0.00055 0.00148 0.01023
Sm 0.00728 0.00683 0.01016 0.00327 0.01627 0.02094 0.01231 0.00346 0.00337 0.00550 0.02094
0.14936 0.15900 0.15702 0.25966 0.13035 0.13005 0.25040 0.13445 0.25081 0.16072 0.25966
150
100
50
0
2 4 6 8 10 12
80
60
40
20
0
2 4 6 8 10 12 14 16 18 20
vector or matrix. Most notable among the results pre- measurements, the gathered multi-position dataset is
sented in Table 4 is the ability of Algorithm 2 in esti- once again perturbed by the 10 sets of randomly gen-
mating large magnetometer axis misalignments erated calibration parameters used earlier without
despite Assumption 2. considering the g-sensitivity matrix (i.e. K in Table 3
Figure 4 plots the maximum relative parameter is ignored). The method in Wu and Pei31 relies on a
estimation errors, for all the 10 sets of randomly gen- calibrated tri-axis magnetometer for gyroscope cali-
erated calibration parameters, at each recursion step bration and axis alignment. As reported in Table 5,
of Algorithms 1 and 2. The fact that all the maximum both the gravity-assisted and magnetometer-assisted
relative parameter estimation errors in Figure 4 methods perform similarly in terms of relative param-
strictly decrease as the number of recursions increases, eter estimation errors. This is due to the magnetom-
meets the expectations that Algorithms 1 and 2 are eter measuring a constant earth magnetic field as a
capable of increasing the estimation accuracy for the result of the data gathering process having been con-
gyroscope parameters and magnetometer misalign- ducted in an environment devoid of any magnetic
ment, respectively (see Notes 9 and 11). interferences. Similar to the magnetic field dynamics
The performance of the calibration method pro- introduced in equation (60), the method in Wu and
posed in the current study is compared with the Pei31 assumes the changes in magnetometer measure-
least-square estimation method for magnetometer- ments to occur only as a result of sensor rotation; an
assisted gyroscope calibration proposed in Wu and assumption that no longer holds in the presence of
Pei.31 As the method in Wu and Pei31 does not con- external magnetic disturbances. Thus, should the
sider the effects of linear acceleration on gyroscope local magnetic field prove to be unstable, it may no
14 Proc IMechE Part G: J Aerospace Engineering 0(0)
Set No 1 (%) 2 (%) 3 (%) 4 (%) 5 (%) 6 (%) 7 (%) 8 (%) 9 (%) 10 (%) Max (%)
Gravity-assisted
bg 0.00334 0.00509 0.00137 0.00361 0.00551 0.00317 0.00069 0.00159 0.00148 0.00232 0.00551
Sg 0.09134 0.10988 0.11330 0.08838 0.09210 0.09027 0.06396 0.08219 0.10456 0.10793 0.11330
0.14592 0.15778 0.15516 0.25209 0.12834 0.12743 0.22606 0.13176 0.24742 0.15748 0.25209
Magnetometer-assisted
bg 0.00334 0.00510 0.00137 0.00364 0.00551 0.00314 0.00070 0.00159 0.00148 0.00232 0.00551
Sg 0.12282 0.13702 0.14923 0.15661 0.10989 0.16909 0.12478 0.09465 0.12281 0.12551 0.16909
0.15797 0.16868 0.16697 0.27032 0.13896 0.13723 0.24314 0.13993 0.26543 0.16809 0.27032
longer serve as a reference for gyroscope calibration. randomly generated calibration parameters intro-
Furthermore, as stated before, the method in Wu and duced in the previous section (Table 3) resulting in
Pei31 does not consider the effects of linear acceler- 10 sets of multi-position calibration data. Each data-
ation on gyroscope measurements and it may no set is then perturbed by random sensor measurement
longer be used for gyroscope calibration in the pres- noise. The current study relies on external methods
ence of significant g-sensitivity parameters. based on ellipsoid fitting for the calibration of the
accelerometer and magnetometer, and the noise
levels of these sensors are chosen to be constant and
Simulation results
equal to the values reported in Table 2 (i.e. same as an
In this section, the effects of sensor measurement MTi-G-710 module). To evaluate the effects of gyro-
noise on the performance of the calibration and align- scope measurement noise on the performance of
ment algorithm is evaluated using a simulated multi- Algorithms 1 and 2, the generated gyroscope meas-
position attitude dataset. In the simulated dataset, a urements for each one of the aforementioned 10
9-DOF IMU is put through 36 different orientations multi-position datasets are perturbed by different
as seen in Figure 3(b). The generated attitude data are values of white measurement noise. The 1 standard
then utilized to calculate true sensor data (i.e. sensor deviation of the gyroscope measurement noise ranges
data without systematic non-idealities or measure- between 0:01 =s and 2 =s with the resolution of
ment noise) for the tri-axis accelerometer, tri-axis 0:01 =s. In other words, 200 sets of multi-position
gyroscope, and tri-axis magnetometer. The generated data with varying amounts of gyroscope measurement
sensor data are then perturbed using the 10 sets of noise were generated per each one of the 10 sets of
Razavi et al. 15
calibration parameters (i.e. 2000 multi-position data- 2. Amirsadri A, Kim J, Petersson L, et al. Practical consid-
sets in total). The introduced calibration and axis erations in precise calibration of a low-cost MEMS IMU
alignment algorithm was then applied to the gener- for road-mapping applications. In: American control con-
ated datasets. Figure 5 plots the minimum, mean, ference (ACC), IEEE, Montreal, QC, Canada , 27-29
June 2012, pp.881–888.
and maximum relative parameter estimation errors
3. Hanse JG. Method for calibrating an inertial measure-
(among the 10 calibration parameter datasets) as a
ment unit. Google Patents, 2005.
function of gyroscope measurement noise 1 standard 4. Madgwick SO. Automated calibration of an accelerom-
deviation. It is evident that the mean gyroscope rela- eters, magnetometers and gyroscopes-a feasibility study.
tive parameter estimation error remains below 0.5% Technical Report, x-io Technologies Limited, Bristol,
for gyroscope measurement noise values with 1 UK, 2010.
standard deviation below 0:68 =s; a noise level far 5. Peter B. Development of an automatic IMU calibration
greater than those of even the lowest quality commer- system. Swiss Federal Institute of Technology, Zurich,
cially available gyroscopes. The magnetometer mis- Switzerland, 2011.
alignment angle estimation error remains below 6. Panagas P. Inertial measurement unit calibration
0.2% for the entire evaluated range of the gyroscope system. Google Patents, 2013.
7. Kim A and Golnaraghi M. Initial calibration of an iner-
standard deviation, once more confirming the ability
tial measurement unit using an optical position tracking
of Algorithm 2 in estimating large magnetometer axis
system. In: Position location and navigation symposium,
misalignments despite Assumption 2. 2004 plans, IEEE, Monterey, CA, USA, 26-29 April
2004, pp.96–101.
Conclusion 8. Beravs T, Beguš S, Podobnik J, et al. Magnetometer
calibration using Kalman filter covariance matrix for
With the purpose of expanding upon the existing online estimation of magnetic field orientation. IEEE
multi-position IMU calibration framework, two Trans Instrum Meas 2014; 63: 2013–2020.
recursive optimization-based methods have been pro- 9. Panahandeh G, Skog I and Jansson M. Calibration of
posed to calibrate and align the axes of a 9-DOF IMU the accelerometer triad of an inertial measurement unit,
with no reliance on external equipment. The gravity maximum likelihood estimation and Cramer-Rao
bound. In: 2010 international conference on Indoor
measurement produced by the calibrated accelerom-
Positioning and Indoor Navigation (IPIN), IEEE,
eter acts as a reference for the gyroscope calibration Zurich, Switzerland, 15-17 September 2010, pp.1–6.
algorithm, which is itself based on the realization of 10. Yang J, Wu W, Wu Y, et al. Improved iterative cali-
the gravity vector dynamics in the sensor body frame. bration for triaxial accelerometers based on the optimal
Similarly, the calibrated magnetometer axes are observation. Sensors 2012; 12: 8157–8175.
aligned with the sensor body frame by an algorithm 11. Wu Z, Wang Z and Ge Y. Gravity based online cali-
based on the realization of the magnetic field bration for monolithic triaxial accelerometers’ gain and
vector dynamics in the sensor body frame. Both offset drift. In: Proceedings of the 4th world Congress
algorithms are independent of the IMU attitude on intelligent control and automation, IEEE, 2002,
during the calibration process. Experimental results pp.2171–2175.
involving a navigation module with factory calibration, 12. Lötters JC, Schipper J, Veltink P, et al. Procedure for
in-use calibration of triaxial accelerometers in medical
as well as extensive simulation results, indicated the
applications. Sens Actuators A 1998; 68: 221–228.
algorithm’s ability in estimating large calibration and 13. Renaudin V, Afzal MH and Lachapelle G. Complete
misalignment parameters with below 0.5% relative triaxis magnetometer calibration in the magnetic
errors. domain. J Sens 2010; 1–10. doi: 10.1155/2010/967245.
14. Hudák J, Blažek J, Kmec F, et al. Multi-position static
Declaration of Conflicting Interests test of magnetometer from IMU. J Electr Eng 2010; 61:
The author(s) declared no potential conflicts of interest with 24–27.
respect to the research, authorship, and/or publication of 15. Gebre-Egziabher D, Elkaim GH, David Powell J, et al.
this article. Calibration of strapdown magnetometers in magnetic
field domain. J Aerosp Eng 2006; 19: 87–102.
16. Camps F, Harasse S and Monin A. Numerical calibra-
Funding tion for 3-axis accelerometers and magnetometers. In:
The author(s) received no financial support for the research, 2009 eit’09 IEEE international conference on electro/
authorship, and/or publication of this article. information technology, IEEE, Windsor, ON, Canada,
7-9 June 2009, pp.217–221.
17. Shin E-H and El-Sheimy N. A new calibration method
ORCID iD
for strapdown inertial navigation systems. Z Vermess
Hassan Salarieh https://orcid.org/0000-0002-0604-5731 2002; 127: 1–10.
18. Fong W, Ong S and Nee A. Methods for in-field user
References calibration of an inertial measurement unit without
1. Shin E-H. Estimation techniques for low-cost inertial navi- external equipment. Meas Sci Technol 2008; 19: 085202.
gation. Library and Archives Canada Bibliothèque et 19. Tedaldi D, Pretto A and Menegatti E. A robust and
Archives Canada, 2006. easy to implement method for IMU calibration without
16 Proc IMechE Part G: J Aerospace Engineering 0(0)
external equipments. In: 2014 IEEE International based attitude estimation with smartphone sensors
Conference on Robotics and Automation (ICRA), for indoor pedestrian navigation. Sensors 2014; 14:
IEEE, Hong Kong, China, 31 May-7 June 2014, 22864–22890.
pp.3042–3049. 27. Li Y, Georgy J, Niu X, et al. Autonomous calibration
20. Syed Z, Aggarwal P, Goodall C, et al. A new multi- of MEMS gyros in consumer portable devices. IEEE
position calibration method for MEMS inertial naviga- Sens J 2015; 15: 4062–4072.
tion systems. Meas Sci Technol 2007; 18: 1897. 28. Ding Z, Cai H and Yang H. An improved multi-posi-
21. Zhang H, Wu Y, Wu W, et al. Improved multi-position tion calibration method for low cost micro-electro
calibration for inertial measurement units. Meas Sci mechanical systems inertial measurement units. Proc
Technol 2009; 21: 015107. IMechE, Part G: J Aerospace Engineering 2015; 229:
22. Nieminen T, Kangas J, Suuriniemi S, et al. An 1919–1930.
enhanced multi-position calibration method for consu- 29. Chow JC, Hol JD and Luinge H. Tightly-coupled joint
mer-grade inertial measurement units applied and user self-calibration of accelerometers, gyroscopes, and
tested. Meas Sci Technol 2010; 21: 105204. magnetometers. Drones 2018; 2: 6.
23. Kok M, Hol J, Schön TB, et al. Calibration of a mag- 30. Wu Y and Luo S. On misalignment between magnet-
netometer in combination with inertial sensors. In: 15th ometer and inertial sensors. IEEE Sens J 2016; 16:
International Conference on Information Fusion 6288–6297.
(FUSION), IEEE, Singapore, Singapore, 9-12 July 31. Wu Y and Pei L. Gyroscope calibration via magnetom-
2012, pp.787–793. eter. IEEE Sens J 2017; 17: 5269–5275.
24. Kok M and Schön T. Maximum likelihood calibration 32. Wu Y, Zou D, Liu P, et al. Dynamic magnetometer
of a magnetometer using inertial sensors. In: 19th World calibration and alignment to inertial sensors by
Congress of the International Federation of Automatic Kalman filtering. IEEE Trans Control Syst Technol
Control (IFAC), Cape Town, South Africa, 24–29 2018; 26: 716–723.
August 2014, pp.92–97. 33. Merayo JM, Brauer P, Primdahl F, et al. Scalar calibra-
25. Cheuk CM, Lau TK, Lin KW, et al. Automatic calibra- tion of vector magnetometers. Meas Sci Technol 2000;
tion for inertial measurement unit. In: 12th International 11: 120.
Conference on Control Automation Robotics & Vision 34. Francis J. The QR decomposition, Part 1. Comput J
(ICARCV), IEEE, Guangzhou, China, 5-7 December 1961; 4: 265–271.
2012, pp.1341–1346. 35. Madgwick S. An efficient orientation filter for inertial
26. Renaudin V and Combettes C. Magnetic, acceler- and inertial/magnetic sensor arrays. Report x-io and
ation fields and gyroscope quaternion (MAGYQ)- University of Bristol, UK, 2010, p.25.