An Improved Calibration Method for the Misalignment Error of a Triaxial Magnetometer and Inertial Navigation System in a Three-Component Magnetic Survey System

: In order to calibrate the misalignment error of a triaxial magnetometer and an inertial navigation system in a three-component magnetic survey system, an improved method with easy realization is proposed in this paper. We establish the misalignment error model based on Euler’s theorem. We transform the calibration of misalignment error into estimating calibration parameters to minimize the value of objective function. Then, the nonlinear least squares method is used to estimate the calibration parameters. In the simulation experiment, the deviation between the value and the preset value is within 1 nT. In the ﬁeld experiment, the ﬂuctuation value of the x , y , and z components reduce to 1.09%, 0.92%, and 1.28%, respectively. The absolute deviation values are reduced to 0.72%, 0.70%, and 0.81% and the standard deviation value are reduced to 0.74%, 0.71%, 0.86%, respectively. The proposed method has advantages of high operability and precision as compared with existing methods.


Introduction
A three-component magnetic survey system is composed of a triaxial magnetometer and an inertial navigation system (INS) and is widely used in resource exploration [1], magnetic anomaly detection [2], and geomagnetic aid for navigation [3,4]. An INS is used to provide attitude information to restore three-component magnetic data to a geographic coordinate system. The accuracy of the restoration process is affected by the accuracy of the INS and the misalignment error of the system. There have been many research achievements made in error correction of a magnetometer [5][6][7] and improving the accuracy of an INS [8][9][10]. In 1997, Primdahl proposed a method to align the magnetometer and star sensor [11]. However, research on misalignment error is still relatively weak. Theoretically, 1 • misalignment error results in thousands of nT errors in the measurement results [12]. According to the above studies, calibration of misalignment error is necessary, and it has been classified into a physical method and an algorithm calibration method. Since the physical method is difficult to implementation and has low precision, we need to develop an algorithm method to calibrate

Misalignment Error Analyses
We define two orthogonal coordinate systems to describe the misalignment error as follows: the INS coordinate system (o − x i y i z i ) and the magnetometer coordinate system (o − x m y m z m ). As shown in Figure 1, the three-axis misalignment between a magnetometer coordinate system and an INS coordinate system caused by misalignment error is reflected.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 2 of 13 calibrate misalignment error. In recent years, some achievements for calibrating misalignment error have appeared in the research. A class of method called ''dot product invariance'' (DPI) was proposed in 2012, based on the fact that the vector dot product of geomagnetic field and gravitational field is constant [13]. The method calibrates the misalignment error between gravimeter and magnetometer by using an auxiliary vector to simulate the gravitational field. The calibration accuracy of this method is easily affected by the selection of auxiliary vectors, which is reduced when there is a difference between the auxiliary vector and the gravitational field.
Zhu proposed a method, in 2017, that combined the ellipsoid fitting method with the DPI method [14,15]. This method could calibrate the misalignment error between an accelerometer and a magnetometer effectively, but it had the same defects as the DPI method.
Gao proposed a new method, in 2019, which was based on the fact that the trajectories of magnetic data obtained by a magnetometer which rotated in the same attitude under different background magnetic field were parallel to each other [16]. This method solved the problem of the DPI method that was sensitive to the selection of auxiliary vector. However, it needed at least two sets of data rotated about different axes to complete parameter optimization. When replacing the rotating plane, the misalignment error could change due to improper operation.
Consider the deficiencies of the above methods, we propose an improved method to calibrate the misalignment error. The misalignment error of magnetometer and INS is analyzed and modeled firstly. Then the principle of the calibration method is introduced. Finally, the feasibility and accuracy of the proposed method are verified by simulation and field experiment.

Misalignment Error Analyses
We define two orthogonal coordinate systems to describe the misalignment error as follows: the . As shown in Figure 1, the three-axis misalignment between a magnetometer coordinate system and an INS coordinate system caused by misalignment error is reflected.  According to Euler's theorem [17], the rotation transformation between two orthogonal coordinate systems can be described by a 3 × 3 rotation matrix R. Then, the misalignment error calibration can be transformed into solving the rotation matrix R.
We set a matrix S as follows: Then, we can express the rotation matrix R as: where I denote the unit matrix.

Calibration Method
This method is based on the following three principles: (a) The trajectory of the measurement data is a circle if the triaxial magnetometer rotates about an axis in a steady magnetic field. Two trajectories of the measurement data obtained by the same magnetometer rotating about the same axis under different background magnetic fields are also two circles which are parallel to each other.
(b) The tangent vectors of two parallel circles at the same phase are parallel.
(c) The normal vectors of two parallel circles are parallel.

Virtual Auxiliary Vector
In order to determine the position relationship between an INS coordinate system and a magnetometer coordinate system, we assume a virtual vector V to expand the INS's angle to magnetic value.
We set V as a different background magnetic field in the INS coordinate system. The INS coordinate system is based on a geographic coordinate system, i.e., the x-, yand z-axes point east, north, and up, respectively. The auxiliary correction data can be obtained by rotating V. Euler's rotation method is used to generate auxiliary calibration data. A vector can be rotated to any angle by three rotations around a single coordinate axis [18,19]. These three rotations are as follows: rotating around the z-, xand y-axes, respectively. They can be expressed as: Appl. Sci. 2020, 10, 6707 4 of 12 where α, β and γ denote heading, roll, and pitch angles. E x , E y and E z denote the rotation matrix around the x-axis, y-axis, and z-axis, respectively. According to Euler rotation method, the analytical order of INS attitude data is shown in Figure 2:  (7) where ,  and  denote heading, roll, and pitch angles.
, xy EE and z E denote the rotation matrix around the x-axis, y-axis ,and z-axis, respectively. According to Euler rotation method, the analytical order of INS attitude data is shown in Figure  2:  We set the virtual vector as the magnetic field value of the geographic coordinate system. Therefore, we can generate the auxiliary correction dates as Equations (8) and (9). (9) where the "  " donates the matrix multiplication.
We can consider that the virtual vector and the real geomagnetic field are two different stable background magnetic fields. The auxiliary correction data and the measured data are obtained from the same rotation in these two stable background magnetic fields. The trajectories of v V and measured magnetic data m H should be parallel. However, these two trajectories are not parallel under the influence of misalignment error.
The trajectory of the measured data is shown in Figure 3.
We set the virtual vector as the magnetic field value of the geographic coordinate system. Therefore, we can generate the auxiliary correction dates as Equations (8) and (9).
where the "·" donates the matrix multiplication. We can consider that the virtual vector and the real geomagnetic field are two different stable background magnetic fields. The auxiliary correction data and the measured data are obtained from the same rotation in these two stable background magnetic fields. The trajectories of V v and measured magnetic data H m should be parallel. However, these two trajectories are not parallel under the influence of misalignment error.
The trajectory of the measured data is shown in Figure 3. N h is the normal vector of the plane (o − x m y m ) and T h (i) is the tangent vector of the circle at this phase which can be calculated using Equations (10) and (11), respectively.
where the "×" donates the cross product.
The position relationships among the trajectories of actual measurement data and virtual data are shown in Figure 4.
We can calculate the angle between  (14). (14) We can rotate about the zm-axis by using Equations (15) and (16). The position relationships among the trajectories of actual measurement data and virtual data are shown in Figure 4. N v is the normal vector of the plane (o − x i y i ) and T v (i) is the tangent vector of the circle at this phase which can be calculated using Equations (12) and (13), respectively.
The position relationships among the trajectories of actual measurement data and virtual data are shown in Figure 4. () v i T is the tangent vector of the circle at this phase which can be calculated using Equations (12) and (13), respectively.
We can calculate the angle between   (14) We can rotate about the zm-axis by using Equations (15) and (16).
We can calculate the angle between T h (i) and the plane which is made up of vector V v (i) and z i -axis by Equation (14).
We can rotate T h (i) to T h (i) about the z m -axis by using Equations (15) and (16).
We rotate the magnetic background field to the plane which is made up of vector V v (i) and the z i -axis by Equation (16). As the phases coincide, the two trajectories can be completely overlapped by making the normal vectors of the two trajectories parallel by rotation.
If the magnetic data trajectory rotation coincides exactly with the auxiliary correction vector trajectory, Equations (17)-(19) can be obtained.

Calibration Parameters Solution
The magnetic measurement data are substituted into Equation (20) to calibrate the misalignment error by matrix R which is a composite matrix consisting of multiple rotations [17]. Let: According to Equations (17) and (19), we can get: The cross product of two parallel vectors is zero which is used as a constraint to estimate the R matrix. According to Equations (22) and (23), the objective function of obtaining the matrix R can be set as Equation (24): where n denotes the measurement points. The value of the objective function is zero when the misalignment error is calibrated completely. Therefore, matrix R can be estimated by solving the minimum value of the objective function. The nonlinear least squares (NLS) function provided by the MATLAB (R2014b, Mathworks, MA. US) optimization toolbox is used to solve the parameter optimization of matrix R. The objective function in the process of solving calibration parameters using the NLS function is as Equation (25): In particular, this method has high operability. Because the normal vector and tangent vector of magnetic data trajectory are used in the calibration process, the two trajectories can completely coincident theoretically. In this method, only one set of rotational experimental data are required to uniquely determine the rotation matrix R without any requirement of the rotating axis. This characteristic has high value in a practical application.

Setup of Simulation Experiment
In order to verify the feasibility of this method, we used MATLAB to carry out the simulation experiment. In the experiment, the INS data is obtained by simulating a rotation about an axis as follows: The attitude angles (β, γ) are set to (−10 • , 0 • ) and (−10 • , 5 • ), respectively, and the heading angle α goes from 0 • to 360 • degrees at 1 • intervals. The former set of attitude data is used to simulate the attitude data of the INS output, and the latter set is used to simulate the attitude of the magnetometer. The angular deviation of these two sets of data is used to simulate the misalignment error. The Euler's rotation theory is used to rotate the preset background magnetic field to form magnetic data. In addition, the magnetic background field and the virtual vector are set as [10,000 30,000 20,000] nT and [3000 2000 2000] nT, as demonstrated in Table 1. Then, the method proposed in this paper is used to analyze the magnetic data and estimate matrix R. In order to verify whether the misalignment error is effectively compensated, the INS simulation data is used to restore the magnetometer data to the geographic coordinate system. Theoretically, the calibrated three-component magnetic data restored to the geographical coordinate system should be completely consistent with the preset magnetic background field value if the misalignment error is eliminated.

Simulation Results and Analysis
The calibration results are shown in Figure 5. After restoring the data to the geographic coordinate system, the deviation between the calibrated value and the preset value of the simulation experiment is shown in Table 2, which verifies the feasibility of this improved method. The virtual vector is set arbitrarily and has no relation with the preset background magnetic field value. Therefore, the simulation experiment shows this method is insensitive to the selection of the virtual vector.

Setup of Simulation Experiment
In order to verify the feasibility of this method, we used MATLAB to carry out the simulation experiment. In the experiment, the INS data is obtained by simulating a rotation about an axis as follows: The attitude angles ( , ) are set to (−10°, 0°) and (−10°, 5°), respectively, and the heading angle  goes from 0° to 360° degrees at 1° intervals. The former set of attitude data is used to simulate the attitude data of the INS output, and the latter set is used to simulate the attitude of the magnetometer. The angular deviation of these two sets of data is used to simulate the misalignment error. The Euler's rotation theory is used to rotate the preset background magnetic field to form magnetic data. In addition, the magnetic background field and the virtual vector are set as [10,000 30,000 20,000] nT and [3000 2000 2000] nT, as demonstrated in Table 1. Then, the method proposed in this paper is used to analyze the magnetic data and estimate matrix R. In order to verify whether the misalignment error is effectively compensated, the INS simulation data is used to restore the magnetometer data to the geographic coordinate system. Theoretically, the calibrated threecomponent magnetic data restored to the geographical coordinate system should be completely consistent with the preset magnetic background field value if the misalignment error is eliminated.

Simulation Results and Analysis
The calibration results are shown in Figure 5. After restoring the data to the geographic coordinate system, the deviation between the calibrated value and the preset value of the simulation experiment is shown in Table 2, which verifies the feasibility of this improved method. The virtual vector is set arbitrarily and has no relation with the preset background magnetic field value. Therefore, the simulation experiment shows this method is insensitive to the selection of the virtual vector.

Setup of Experiment
The experimental system is composed of a tri-axis magnetometer, an INS, and a non-magnetic turntable, the performance specifications of which are shown in Table 3. The INS and magnetometer are fixed on the same carbon-fiber frame so that they can rotate synchronously. A diagram of the experimental system is shown in Figure 6. During the installation of these two sensors, the misalignment error is generated randomly. The performance of the proposed method in practical application is verified.

Setup of Experiment
The experimental system is composed of a tri-axis magnetometer, an INS, and a non-magnetic turntable, the performance specifications of which are shown in Table 3. The INS and magnetometer are fixed on the same carbon-fiber frame so that they can rotate synchronously. A diagram of the experimental system is shown in Figure 6. During the installation of these two sensors, the misalignment error is generated randomly. The performance of the proposed method in practical application is verified.  The experiment was conducted in an open space without magnetic interference. The local magnetic gradient is about 86 nT/m and the magnetic diurnal variation is less than 5 nT in one hour.

Experiment Results and Analysis
In the field experiment, the experimental data are obtained by rotating the three-component magnetic survey system about an arbitrary axis. The situation of experimental data trajectory before and after calibration can be seen in Figure 7. The attitude of the trajectory changes after calibration.

Experiment Results and Analysis
In the field experiment, the experimental data are obtained by rotating the three-component magnetic survey system about an arbitrary axis. The situation of experimental data trajectory before and after calibration can be seen in Figure 7. The attitude of the trajectory changes after calibration.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 9 of 13 The experiment was conducted in an open space without magnetic interference. The local magnetic gradient is about 86 nT/m and the magnetic diurnal variation is less than 5 nT in one hour.

Experiment Results and Analysis
In the field experiment, the experimental data are obtained by rotating the three-component magnetic survey system about an arbitrary axis. The situation of experimental data trajectory before and after calibration can be seen in Figure 7. The attitude of the trajectory changes after calibration.  It is very difficult to obtain the standard values of the three-component magnetic field at the experimental site and the misalignment error calibration has no effect on the total field values measured by the magnetometer. The misalignment error of the magnetic survey system is finally reflected in the measurement results of the x, y and z components, that is, the misalignment error causes the fluctuation of the measurement values. Theoretically, under the condition of no misalignment error, the fluctuation of the magnetic measurement data after being restored to the geographical coordinate system is zero. Therefore, the calibrated magnetic measurement data can be restored to the geographic coordinate system and the effect of the misalignment error calibration of the magnetic survey system can be evaluated by the fluctuation of the three-component magnetic data.
The calibration results of the field experiment are shown in Figure 8. The fluctuation range, absolute deviation value, and standard deviation value are used to judge whether the method is effective in calibrating the misalignment error. Numerical values of these evaluation indicators are shown in Table 4, which can reflect the dispersion degree of calibrated and uncalibrated data. By calculating the numerical ratio of these evaluation indicators, the improved method proposed in this paper reduces the fluctuation value of the x, y, z-component to 1.09%, 0.92%, 1.28%, respectively. The absolute deviation value is reduced to 0.72%, 0.70%, 0.81%, respectively. The standard deviation value is reduced to 0.74%, 0.71%, 0.86%, respectively. The calibration improves the dispersion degree of the experimental data significantly, which indicates that the misalignment error is effectively eliminated. The calibration results of the field experiment show that the proposed method has high operability and high precision in a practical application. It is very difficult to obtain the standard values of the three-component magnetic field at the experimental site and the misalignment error calibration has no effect on the total field values measured by the magnetometer. The misalignment error of the magnetic survey system is finally reflected in the measurement results of the x, y and z components, that is, the misalignment error causes the fluctuation of the measurement values. Theoretically, under the condition of no misalignment error, the fluctuation of the magnetic measurement data after being restored to the geographical coordinate system is zero. Therefore, the calibrated magnetic measurement data can be restored to the geographic coordinate system and the effect of the misalignment error calibration of the magnetic survey system can be evaluated by the fluctuation of the three-component magnetic data.
The calibration results of the field experiment are shown in Figure 8. The fluctuation range, absolute deviation value, and standard deviation value are used to judge whether the method is effective in calibrating the misalignment error. Numerical values of these evaluation indicators are shown in Table 4, which can reflect the dispersion degree of calibrated and uncalibrated data. By calculating the numerical ratio of these evaluation indicators, the improved method proposed in this paper reduces the fluctuation value of the x, y, z-component to 1.09%, 0.92%, 1.28%, respectively. The absolute deviation value is reduced to 0.72%, 0.70%, 0.81%, respectively. The standard deviation value is reduced to 0.74%, 0.71%, 0.86%, respectively. The calibration improves the dispersion degree of the experimental data significantly, which indicates that the misalignment error is effectively eliminated. The calibration results of the field experiment show that the proposed method has high operability and high precision in a practical application.

Conclusions
An improved method for calibrating the misalignment error is proposed in this paper. Firstly, the misalignment error is modeled. Then, we set a constraint to transform the calibration of misalignment error into estimating calibration parameters to minimize the value of the objective function. Finally, the MATLAB's NLS function is used to estimate the calibration parameters. The feasibility and performance of the improved method are verified by simulation and the field experiment.
Compared to the preceding methods, this improved method has the following advantages: (1) The first advantage is that the method has high operability. Because the normal vector and tangent vector of data trajectory are used simultaneously, the calibration experiment only needs to rotate about an axis once and the axis of rotation can be arbitrarily chosen. In addition, the DPI method and Gao's method cannot uniquely estimate the calibration matrix R with the same data. These two methods need at least two sets of dates rotated about different axes to calibrate the misalignment error. (2) The second advantage is that the method is insensitive to the selection of the virtual vector. The virtual vector can be arbitrarily chosen, and different virtual vectors do not affect the accuracy of calibration.
Future research should focus on developing a method to accurately fit data trajectories. The error of a non-magnetic turntable could lead to the data not in the same plane. The discretization of data could lead to a decrease in calibration accuracy.

Conclusions
An improved method for calibrating the misalignment error is proposed in this paper. Firstly, the misalignment error is modeled. Then, we set a constraint to transform the calibration of misalignment error into estimating calibration parameters to minimize the value of the objective function. Finally, the MATLAB's NLS function is used to estimate the calibration parameters. The feasibility and performance of the improved method are verified by simulation and the field experiment.
Compared to the preceding methods, this improved method has the following advantages: (1) The first advantage is that the method has high operability. Because the normal vector and tangent vector of data trajectory are used simultaneously, the calibration experiment only needs to rotate about an axis once and the axis of rotation can be arbitrarily chosen. In addition, the DPI method and Gao's method cannot uniquely estimate the calibration matrix R with the same data. These two methods need at least two sets of dates rotated about different axes to calibrate the misalignment error. (2) The second advantage is that the method is insensitive to the selection of the virtual vector. The virtual vector can be arbitrarily chosen, and different virtual vectors do not affect the accuracy of calibration.
Future research should focus on developing a method to accurately fit data trajectories. The error of a non-magnetic turntable could lead to the data not in the same plane. The discretization of data could lead to a decrease in calibration accuracy.