A Fast Calibration and Compensation Method for Magnetometers in Strap-Down Spinning Projectiles

Attitude measurement is an essential technology in projectile trajectory correction. Magnetometers have been used for projectile attitude measurement systems as they are small in size, lightweight, and low cost. However, magnetometers are seriously disturbed by the artillery magnetic field during launch. Moreover, the error parameters of the magnetometers, which are calibrated in advance, usually change after extended storage. The changed parameters have negative effects on attitude estimation of the projectile. To improve the accuracy of attitude estimation, the magnetometers should be calibrated again before launch or during flight. This paper presents a fast calibration method specific for a spinning projectile. At the launch site, the tri-axial magnetometer is calibrated, the parameters of magnetometer are quickly obtained by optimal ellipsoid fitting based on a least squares criterion. Then, the calibration parameters are used to compensate for magnetometer outputs during flight. The numerical simulation results show that the proposed calibration method can effectively determine zero bias, scale factors, and alignment angle errors. Finally, a semi-physical experimental system was designed to further verify the performance of the calibration method. The results show that pitch angle error reduces from 3.52° to 0.58° after calibration. The roll angle error is reduced from 2.59° to 0.65°. Simulations and experimental results indicate that the accuracy of magnetometer in strap-down spinning projectile has been greatly enhanced, and the attitude estimation errors are reduced after calibration.


Introduction
Attitude measurement is an essential technology in projectile trajectory correction. Only a few types of attitude sensors are suitable for spinning projectiles since the sensors must withstand extremely large loads at launch and rapid spins during flight [1,2]. Magnetometers have been used for projectile attitude measurement systems as they are small in size, lightweight, and low cost [3]. The magnetometers are normally aligned with the body axes of the spinning projectile, and the attitudes of projectiles are calculated by the measured magnetic field information [4,5]. However, magnetometers are easily disturbed by external magnetic fields, and the magnetometer measurement outputs are corrupted by different kinds of error sources, e.g., bias errors, scale factors and misalignment errors [6][7][8]. Therefore, calibration of strap-down magnetometers must be performed to ensure their measurement accuracy [9]. The conventional calibration methods of magnetometer, such as the swinging method and the multi-position method [10], require external references or auxiliary equipment. To reduce the cost of the calibration procedures, many previous studies on calibration have focused on methods that require no external equipment [7,8,11,12], i.e., auto-calibration and

Magnetometer Error Model
The measurement error of single-axis magnetometer mainly contains zero bias error and scale factor error, and the error model of single-axial magnetometer can be described as: where, k n is ideal scale factor, δk is scale factor error; k m is actual scale factor, and H 0 is zero bias. H m is the magnetometer measured output. In general, a tri-axial magnetometer is used to measure the strength of Earth's magnetic field. Therefore, the ideal error model of tri-axial magnetometer can be described as: where K 1 is a diagonal matrix, k x , k y and k z indicate scale factors. The magnetometers are normally aligned with the body axes of the projectile, but non-orthogonal angles are unavoidable. Figure 1 shows the non-orthogonal angles, where, O-XYZ defines the body coordinate frame, and O-X 1 Y 1 Z 1 defines the sensor coordinate frame. Obviously, the magnetometers are not aligned with the body axes of the projectile. There are non-orthogonal angles (α, β, γ) between O-XYZ and O-X 1 Y 1 Z 1 . Sensors 2018, 18 According to the vector relations shown in Figure 1, the non-orthogonal errors or misalignment errors which can be described as: If the non-orthogonal errors are taken into account, and the measurement error model of triaxial magnetometer can be described as:  (4) According to magnetometer measurement error model (4), the compensation model of the triaxial magnetometer can be described as:

H K K H H
( )   (5) To compensate the magnetometer measured outputs, the error parameters in 0 H , matrix K , and inverse of matrix K ( 1 − K ) must be determined. Since the non-orthogonal angles ( , , α β γ ) normally are small angles ( cos 1,sin ≈ ≈ i j j), and the matrix 2 K in Equation (3) can be simplified as follows: Substituting the approximate matrix of (6) into error model (4), the tri-axial magnetometer error model (4) can be simplified the follows: According to the vector relations shown in Figure 1, the non-orthogonal errors or misalignment errors which can be described as: If the non-orthogonal errors are taken into account, and the measurement error model of tri-axial magnetometer can be described as: According to magnetometer measurement error model (4), the compensation model of the tri-axial magnetometer can be described as: To compensate the magnetometer measured outputs, the error parameters in H 0 , matrix K, and inverse of matrix K (K −1 ) must be determined. Since the non-orthogonal angles (α, β, γ) normally are small angles (cos i ≈ 1, sin j ≈ j), and the matrix K 2 in Equation (3) can be simplified as follows: Substituting the approximate matrix of (6) into error model (4), the tri-axial magnetometer error model (4)  Similarly, by substituting inverse of matrix (6) into (5), the tri-axial magnetometer compensation model (5) also can be simplified as follows:

The Least Squares Ellipsoid Fitting
The total intensity of Earth's magnetic field that is measured by an ideal tri-axial magnetometer should be a constant scalar [12,24]. H e = (H e,x ) 2 + (H e,y ) 2 + (H e,z ) 2 = constant, the H e indicates the total intensity of Earth's magnetic field. Thus, according to the tri-axial magnetometer measurement error model (5), the total intensity of Earth's magnetic field can be calculated: Equation (9) indicates that the magnetic measured outputs are constrained to an ellipsoid or sphere [12]. Equation (9) can be rewrote as follows: Equation (10) is an ellipsoid surface equation, but an actual tri-axial magnetometer normally has measurement errors, and magnetometer measured data can't fit on a standard sphere. In general, the shape and origin of the sphere maybe changed. Here, the shifted origin indicates the existence of zero bias errors, and the changed shape indicates the existence of scale factor errors or misalignment angles. The equation of an ellipsoid can be described as [25]: where, vector ξ defines [a, b, c, d, e, f , p, q, r, g] T , and z = [x 2 , y 2 , z 2 , 2xy, 2xz, 2yz, 2x, 2y, 2z, 1] T .
To ensure the procedure is optimal fitting, a least-squares criteria is used to the ellipsoid fitting: where, the matrix D is given by: In order to obtain the optimal ellipsoid parameters, the ellipsoid fitting Equation (11) can be rewritten as follows: where, A =  In contrast to Equations (14) and (10), the following formulas can be obtained: Using the simplified magnetometer error model (4), and the matrix operation (KK T ) can be calculated by: Therefore, the optimal ellipsoid parameter matrix A and ellipsoid origin X 0 can be obtained by ellipsoid fitting, and the error parameters of the tri-axial magnetometer can be estimated by (15).

Assuming that the inverse matrix of A is
 , and the error parameters of the tri-axial magnetometer (k x ,k y ,k z ,α,β,γ,Ĥ 0 ) can be calculated by: where, H m e is the total intensity of Earth's magnetic field in the calibration site. Therefore, the algorithm flow chart for the calibration and compensation is shown in Figure 2.

Algorithm Performance
This section describes how numerical simulations assess the performance of the proposed magnetometer calibration method based on ellipsoid fitting. The section is shown by considering the calibration of magnetometers in two different error sources. Table 1 lists the magnetometer error parameters assumed in the simulation. As can be seen from Table 1, the difference between two

Algorithm Performance
This section describes how numerical simulations assess the performance of the proposed magnetometer calibration method based on ellipsoid fitting. The section is shown by considering the calibration of magnetometers in two different error sources. Table 1 lists the magnetometer error parameters assumed in the simulation. As can be seen from Table 1, the difference between two magnetometers is that the magnetometer (case 2) is affected by strong magnetic interference, and has large error parameters. In the numerical simulation, firstly, the ideal outputs are generated by the ideal model of tri-axial magnetometer. Then, according to the error model of the magnetometer, the actual measurement outputs including bias errors, scale factor errors and alignment angle errors are generated. Here, the International Geomagnetic Reference Model generates the local magnetic field of the Earth in the simulation. Calibration of the tri-axial magnetometer is carried out according to the following four different attitude changes, as follows: (1) At horizontal state, as shown in Figure 3a, each axis of a tri-axial magnetometer successively spins 360 • . (2) One axis of the tri-axial magnetometer successively spins 360 • under different inclination angles, as shown in Figure  Figures 4-11 show optimal ellipsoid fitting results. The ellipsoid is obtained by the ellipsoid fitting method described in this paper. Here, the blue points of the sphere surface indicate measured magnetic data. For example, in Figure 4, the magnetometer calibration attitude change is the same as change (1), the x-circle, y-circle and z-circle indicate magnetometer measured data when each axis spins 360°, respectively. As shown in Figure 5-7, these calibration attitudes correspond to the change (2)-(4), respectively. In Figure 7, it can be seen that the magnetometer   Figure 4, the magnetometer calibration attitude change is the same as change (1), the x-circle, y-circle and z-circle indicate magnetometer measured data when each axis spins 360 • , respectively. As shown in Figures 5-7, these calibration attitudes correspond to the change (2)-(4), respectively. In Figure 7, it can be seen that the magnetometer measured data almost fits on an ellipsoid, which is consistent with the previous conclusion.  4-11 show optimal ellipsoid fitting results. The ellipsoid is obtained by the ellipsoid fitting method described in this paper. Here, the blue points of the sphere surface indicate measured magnetic data. For example, in Figure 4, the magnetometer calibration attitude change is the same as change (1), the x-circle, y-circle and z-circle indicate magnetometer measured data when each axis spins 360°, respectively. As shown in Figure 5-7, these calibration attitudes correspond to the change (2)-(4), respectively. In Figure 7, it can be seen that the magnetometer measured data almost fits on an ellipsoid, which is consistent with the previous conclusion.    es 4-11 show optimal ellipsoid fitting results. The ellipsoid is obtained by the ellipsoid thod described in this paper. Here, the blue points of the sphere surface indicate magnetic data. For example, in Figure 4, the magnetometer calibration attitude change is as change (1), the x-circle, y-circle and z-circle indicate magnetometer measured data h axis spins 360°, respectively. As shown in Figure 5-7, these calibration attitudes d to the change (2)-(4), respectively. In Figure 7, it can be seen that the magnetometer data almost fits on an ellipsoid, which is consistent with the previous conclusion.     2 shows the calibration results. It can be seen that magnetometers can be calibrated by rent attitude changes. In case1, the ellipsoid fitting results correspond to the EF1-EF4. ere are minimal estimation errors in EF4. On the contrary, the EF1 has maximal estimation the case 2, the ellipsoidal fitting results show in Figure 8-11. Because the magnetometer error parameters, the ellipsoid fitting results (EF5-EF8) are obviously different from case studies on calibration have focused on methods that require no external equipment [7, 8,11,12], i.e., auto-calibration and the ellipsoid fitting method [12][13][14]. In addition, several researchers have proposed specific filtering methods for strap-down magnetometers [15], and an EKF filter is used to estimate the error parameters of magnetometers [16][17][18]. Since the filter models normally are nonlinear functions, nonlinear filter algorithms (EKF, UKF, and PF) are used to estimate the state of the system [19][20][21]. These calibration methods are effective for most applications, but they have several shortcomings such as the need for external equipment or auxiliary filter information is required.        Table 2 shows the calibration results. It can be seen that magnetometers can be calibra four different attitude changes. In case1, the ellipsoid fitting results correspond to the EF Where, there are minimal estimation errors in EF4. On the contrary, the EF1 has maximal estim errors. In the case 2, the ellipsoidal fitting results show in Figure 8-11. Because the magneto have large error parameters, the ellipsoid fitting results (EF5-EF8) are obviously different from    2 shows the calibration results. It can be seen that magnetometers can be calibrated by ent attitude changes. In case1, the ellipsoid fitting results correspond to the EF1-EF4. re are minimal estimation errors in EF4. On the contrary, the EF1 has maximal estimation the case 2, the ellipsoidal fitting results show in Figure 8-11. Because the magnetometer error parameters, the ellipsoid fitting results (EF5-EF8) are obviously different from case  Table 2 shows the calibration results. It can be seen that magnetometers can be calibrated by four different attitude changes. In case1, the ellipsoid fitting results correspond to the EF1-EF4. Where, there are minimal estimation errors in EF4. On the contrary, the EF1 has maximal estimation errors. In the case 2, the ellipsoidal fitting results show in . Because the magnetometer have large error parameters, the ellipsoid fitting results (EF5-EF8) are obviously different from case 1 (EF1-EF4). It can be seen that the EF8 calibration precision is the highest, and the EF5 has the maximal error. The numerical simulation results show that the proposed calibration method can effectively determine zero bias, scale factors, and alignment angle errors. Moreover, if the measured data can cover the whole ellipsoid surface such as EF4 and EF8, the calibration result is optimal. To further evaluate calibration algorithm performance, the calibration parameters of the EF4 are used to compensate the tri-axial magnetometer measured outputs. The compensation results are shown in Figures 12-15, where, Figure 12 shows tri-axial magnetometer measured outputs before and after compensation. Figure 13 shows the magnetometer measurement error curve before calibration, while Figure 14 shows the magnetometer measurement error curve after compensation.

EF4
1. To further evaluate calibration algorithm performance, the calibration parameters of are used to compensate the tri-axial magnetometer measured outputs. The compensation res shown in Figures 12-15, where, Figure 12 shows tri-axial magnetometer measured outputs and after compensation. Figure 13 shows the magnetometer measurement error curve calibration, while Figure 14 shows the magnetometer measurement error curve after compen      Figures 12-15, where, Figure 12 shows tri-axial magnetometer measured outputs before compensation. Figure 13 shows the magnetometer measurement error curve before n, while Figure 14 shows the magnetometer measurement error curve after compensation.

12.
Magnetometer measured outputs. Figure 13. Measurement error before calibration. It can be seen that without compensation, the each axis error standard deviation is 1440 nT and 360 nT, respectively, and the errors reduce to less than 200 nT after compensation. Fig  shows total intensity of Earth's magnetic field before and after calibration. It can be see without calibration, the total intensity of Earth's magnetic field varies from 50,822 nT to 56,0 However, after calibration, the total intensity of Earth's magnetic field is approximately co (52,600 nT). It can be seen that the calibration method brings a significant enhancement magnetometer measurement accuracy. The numerical simulations verify effectiveness calibration method mentioned in this paper.

An Application in Spinning Projectile
In this section, the calibration method is used for a spinning projectile. The correc experimentally assessed to evaluate the effectiveness of the calibration method in practice.  Figure 17 shows the full attitude of the project simulated trajectory has 20° initial pitch angle and 0° initial yaw angle. The initial roll is r variables, and its initial roll rate is 720 deg s −1 .   It can be seen that without compensation, the each axis error standard deviation is 1440 nT, 890 nT and 360 nT, respectively, and the errors reduce to less than 200 nT after compensation. Figure 15 shows total intensity of Earth's magnetic field before and after calibration. It can be seen that without calibration, the total intensity of Earth's magnetic field varies from 50,822 nT to 56,000 nT. However, after calibration, the total intensity of Earth's magnetic field is approximately constant (52,600 nT). It can be seen that the calibration method brings a significant enhancement of the magnetometer measurement accuracy. The numerical simulations verify effectiveness of the calibration method mentioned in this paper.

An Application in Spinning Projectile
In this section, the calibration method is used for a spinning projectile. The correction is experimentally assessed to evaluate the effectiveness of the calibration method in practice. Figure 16 shows the three-dimensional flight trajectory of the spinning projectile. The flight starting point is (0, 0, 0), and the end is marked by a red circle. Figure 17 shows the full attitude of the projectile. The simulated trajectory has 20° initial pitch angle and 0° initial yaw angle. The initial roll is random variables, and its initial roll rate is 720 deg s −1 . It can be seen that without compensation, the each axis error standard deviation is 1440 nT, 890 nT and 360 nT, respectively, and the errors reduce to less than 200 nT after compensation. Figure 15 shows total intensity of Earth's magnetic field before and after calibration. It can be seen that without calibration, the total intensity of Earth's magnetic field varies from 50,822 nT to 56,000 nT. However, after calibration, the total intensity of Earth's magnetic field is approximately constant (52,600 nT). It can be seen that the calibration method brings a significant enhancement of the magnetometer measurement accuracy. The numerical simulations verify effectiveness of the calibration method mentioned in this paper.

An Application in Spinning Projectile
In this section, the calibration method is used for a spinning projectile. The correction is experimentally assessed to evaluate the effectiveness of the calibration method in practice. Figure 16 shows the three-dimensional flight trajectory of the spinning projectile. The flight starting point is (0, 0, 0), and the end is marked by a red circle. Figure 17 shows the full attitude of the projectile. The simulated trajectory has 20 • initial pitch angle and 0 • initial yaw angle. The initial roll is random variables, and its initial roll rate is 720 deg s −1 .
In this section, the calibration method is used for a spinning projectile. The correction is experimentally assessed to evaluate the effectiveness of the calibration method in practice. Figure 16 shows the three-dimensional flight trajectory of the spinning projectile. The flight starting point is (0, 0, 0), and the end is marked by a red circle. Figure 17 shows the full attitude of the projectile. The simulated trajectory has 20° initial pitch angle and 0° initial yaw angle. The initial roll is random variables, and its initial roll rate is 720 deg s −1 .  . Measurement error after compensation. Figure 15. Total intensity of the magnetic field. n be seen that without compensation, the each axis error standard deviation is 1440 nT, 890 0 nT, respectively, and the errors reduce to less than 200 nT after compensation. Figure 15 tal intensity of Earth's magnetic field before and after calibration. It can be seen that alibration, the total intensity of Earth's magnetic field varies from 50,822 nT to 56,000 nT. , after calibration, the total intensity of Earth's magnetic field is approximately constant T). It can be seen that the calibration method brings a significant enhancement of the eter measurement accuracy. The numerical simulations verify effectiveness of the n method mentioned in this paper.

plication in Spinning Projectile
is section, the calibration method is used for a spinning projectile. The correction is ntally assessed to evaluate the effectiveness of the calibration method in practice. Figure 16 e three-dimensional flight trajectory of the spinning projectile. The flight starting point is nd the end is marked by a red circle. Figure 17 shows the full attitude of the projectile. The trajectory has 20° initial pitch angle and 0° initial yaw angle. The initial roll is random , and its initial roll rate is 720 deg s −1 .

16.
Trajectory of a spinning projectile. Figure 17. The full attitude of projectile.
mi-physical experimental system was designed for the simulation experiments. Figure 18 the homemade prototype. The experimental system is consist of two parts, one is attitude ent unite (AMU) which contains a tri-axial magnetometer (HMC1043) circuit board, Figure 17. The full attitude of projectile.
A semi-physical experimental system was designed for the simulation experiments. Figure 18 illustrates the homemade prototype. The experimental system is consist of two parts, one is attitude measurement unite (AMU) which contains a tri-axial magnetometer (HMC1043) circuit board, accelerometers and a data recorder, the other one is a flying simulation turntable. The flying simulation turntable can realize the simulation of any kind of projectile movement. To reduce the impact of turntable magnetic interference on the tri-axial magnetometer, the AMU is strap-down installed on a long aluminum pole (similar to a projectile), and the pole was fixed in the flying simulation turntable. accelerometers and a data recorder, the other one is a flying simulation turntable. The flying simulation turntable can realize the simulation of any kind of projectile movement. To reduce the impact of turntable magnetic interference on the tri-axial magnetometer, the AMU is strap-down installed on a long aluminum pole (similar to a projectile), and the pole was fixed in the flying simulation turntable. The AMU is mainly comprised of tri-axial magnetometer circuit, data recorder, battery and protective shell. The hardware components diagram of the AMU is shown in Figure 19. The data recorder collects and stores the tri-axial magnetometer measurement output at a sampling frequency of 1000 Hz. Then, through the USB port, the magnetometer measured data was transferred to computer for attitude calculation. The AMU is mainly comprised of tri-axial magnetometer circuit, data recorder, battery and protective shell. The hardware components diagram of the AMU is shown in Figure 19. The data recorder collects and stores the tri-axial magnetometer measurement output at a sampling frequency of 1000 Hz. Then, through the USB port, the magnetometer measured data was transferred to computer for attitude calculation.
The experimental verification is carried out in two steps. Firstly, in the test field (projectile launch site), the tri-axial magnetometer is calibrated again. The calibration of the magnetometer is carried out by rotating the AMU in various directions, and the parameters of magnetometer including bias errors, scale factors and misalignment angles are quickly obtained by optimal ellipsoid fitting. These calibration parameters are used to compensate for the measured data during flight. Then, semi-physical simulation is carried out to verify the effectiveness of calibration in the launch site. The semi-physical simulation system simulates the attitude movement of the spinning projectile, and the AMU measured data is used to calculate the attitude of the projectile. Calibration results are shown in Figures 20-22. Here, the solid blue lines represent each axis magnetometer measured outputs before calibration, the dotted red lines represent the each axis measured outputs after calibration. In order to see the details, the lower charts of each figures describe the local details in 5-8 seconds. accelerometers and a data recorder, the other one is a flying simulation turntable. The flying simulation turntable can realize the simulation of any kind of projectile movement. To reduce the impact of turntable magnetic interference on the tri-axial magnetometer, the AMU is strap-down installed on a long aluminum pole (similar to a projectile), and the pole was fixed in the flying simulation turntable. The AMU is mainly comprised of tri-axial magnetometer circuit, data recorder, battery and protective shell. The hardware components diagram of the AMU is shown in Figure 19. The data recorder collects and stores the tri-axial magnetometer measurement output at a sampling frequency of 1000 Hz. Then, through the USB port, the magnetometer measured data was transferred to computer for attitude calculation. The experimental verification is carried out in two steps. Firstly, in the test field (projectile launch site), the tri-axial magnetometer is calibrated again. The calibration of the magnetometer is carried out by rotating the AMU in various directions, and the parameters of magnetometer including bias errors, scale factors and misalignment angles are quickly obtained by optimal ellipsoid fitting. These calibration parameters are used to compensate for the measured data during flight. Then, semi-physical simulation is carried out to verify the effectiveness of calibration in the launch site. The semi-physical simulation system simulates the attitude movement of the spinning projectile, and the AMU measured data is used to calculate the attitude of the projectile. Calibration results are shown in Figures 20-22. Here, the solid blue lines represent each axis magnetometer measured outputs before calibration, the dotted red lines represent the each axis measured outputs   bration. In order to see the details, the lower charts of each figures describe the local details conds.
re 23 shows each axis measurement error of the tri-axial magnetometer. It can be seen that calibration, the each axis measurement error (standard deviation) is 3513.4 nT, 4029.5 nT .5 nT, respectively. However, as expected, after performing the magnetometer calibration, s are reduced to less than 350 nT. The reduction of magnetic measurement errors comes compensation of magnetometer outputs.      Figure 23 shows each axis measurement error of the tri-axial magnetometer. It can be seen that without calibration, the each axis measurement error (standard deviation) is 3513.4 nT, 4029.5 nT and 1743.5 nT, respectively. However, as expected, after performing the magnetometer calibration, the errors are reduced to less than 350 nT. The reduction of magnetic measurement errors comes from the compensation of magnetometer outputs.
re 23 shows each axis measurement error of the tri-axial magnetometer. It can be seen that calibration, the each axis measurement error (standard deviation) is 3513.4 nT, 4029.5 nT .5 nT, respectively. However, as expected, after performing the magnetometer calibration, s are reduced to less than 350 nT. The reduction of magnetic measurement errors comes compensation of magnetometer outputs. In order to further illustrate the calibration results, the attitude of spinning projectile is calculated using the magnetometer measured data before and after compensation. The definition of coordinate frame is shown in Figure 24. Where, the O-X b Y b Z b defines body coordinate frame (b-frame), and O-X n Y n Z n defines navigation coordinate frame (n-frame), the local level frame is selected as n-frame. In order to further illustrate the calibration results, the attitude of spinning projectile is calculated using the magnetometer measured data before and after compensation. The definition of coordinate frame is shown in Figure 24. Where, the O-X b Y b Z b defines body coordinate frame (bframe), and O-X n Y n Z n defines navigation coordinate frame (n-frame), the local level frame is selected as n-frame. Figure 24. Definition of coordinate frame.
According to the definition of the Euler angle and rotation order, the directional cosine matrix is: cos cos sin cos sin sin sin cos cos sin cos cos cos sin cos sin sin cos sin cos sin sin cos sin cos cos sin sin sin where φ , θ and γ represent yaw, pitch and roll angles, respectively. Therefore, the tri-axial magnetometer output is given by: is the magnetic vector of the Earth in the b-frame, According to the definition of the Euler angle and rotation order, the directional cosine matrix is: cos φ cos θ sin θ − cos θ sin φ sin γ sin φ − cos γ cos φ sin θ cos γ cos θ cos φ sin γ + cos γ sin φ sin θ cos γ sin φ + cos φ sin γ sin θ − cos θ sin γ cos γ cos φ − sin γ sin φ sin θ    (18) where φ, θ and γ represent yaw, pitch and roll angles, respectively. Therefore, the tri-axial magnetometer output is given by: where T is the magnetic vector of the Earth in the b-frame, H n e = [H n x , H n y , H n z ] T is magnetic field vector of the Earth in the n-frame.
Note that for projectile applications, if only the output information of the magnetometer is adopted for attitude estimation, the three attitude angles are not completely observable. Therefore, all the Euler angles cannot be estimated. To solve the problem, a common solution is the use of other auxiliary attitude sensor such as a gyroscope. Here, the yaw angle is assumed to be known (using the attitude feedback from the turntable), and the pitch and roll angles of the projectile can be calculated by: Therefore, substituting the magnetometer output into Equation (20), the pitch and roll angles are calculated by using the measured data. The pitch angle error is shown in Figure 25, where, the solid blue line represents the pitch angle error before correction, and the dotted red line represents the pitch angle error after correction. It can be seen that the attitude error increases with time.
The increase of the errors is due to the magnetic interference of the turntable. When the pitch angle is 20 • , the turntable magnetic interference is small. On the contrary, it is the largest at a −45 • pitch angle. It can be seen that without compensation, the pitch angle error is 3.52 • (1σ), and the maximum pitch error reaches 14.79 • . However, after calibration, the pitch angle error reduces to 0.58 • (1σ), and maximum pitch error reduces to more than 3.20 • .
Sensors 2018, 18, x solid blue line represents the pitch angle error before correction, and the dotted red line rep the pitch angle error after correction. It can be seen that the attitude error increases with time The increase of the errors is due to the magnetic interference of the turntable. When th angle is 20 °, the turntable magnetic interference is small. On the contrary, it is the largest a pitch angle. It can be seen that without compensation, the pitch angle error is 3.52° (1σ), maximum pitch error reaches 14.79°. However, after calibration, the pitch angle error red 0.58° (1σ), and maximum pitch error reduces to more than 3.20°.   Figure 26 shows the roll angle error before and after calibration. It can be seen that angle error is 2.59° (1σ) before calibration, while the roll angle error reduces to 0.65° (1 calibration. The maximum roll angle error reduces from 8.85° to less than 2.81°. Obviou attitude error reduction would have imposed significant positive effects on control perform spinning projectiles. Simulation and experiment results show that the accuracy of the magnetometer has been greatly enhanced, and the attitude estimation errors have been r after calibration.

Conclusions
This paper presents a fast calibration method specific for a spinning projectile. At the site, the tri-axial magnetometer is calibrated again, and the error parameters of the magne including bias errors, scale factors and misalignment angles are quickly obtained by ellipsoid fitting based on a least squares criterion. Then, the calibration parameters are compensate the magnetometer outputs during flight. This method has the following adva First, using a least-squares fitting criteria to ensure the procedure is an optimal ellipsoid Second, without need for a precision turntable or other equipment, the calibration process is and easy to implement. Moreover, the method is also suitable for tri-axial accelerometers. F physical simulation system was designed to further verify the performance of the cal method. The results show that pitch angle error is reduced from 3.52° to 0.58° (1σ) after cali Meanwhile, the roll angle error is reduced from 2.59° to 0.65° (1σ). Simulations and exper  Figure 26 shows the roll angle error before and after calibration. It can be seen that the roll angle error is 2.59 • (1σ) before calibration, while the roll angle error reduces to 0.65 • (1σ) after calibration. The maximum roll angle error reduces from 8.85 • to less than 2.81 • . Obviously, the attitude error reduction would have imposed significant positive effects on control performance of spinning projectiles. Simulation and experiment results show that the accuracy of the tri-axial magnetometer has been greatly enhanced, and the attitude estimation errors have been reduced after calibration.
angle error after correction. It can be seen that the attitude error increases with time. increase of the errors is due to the magnetic interference of the turntable. When the pitch 20 °, the turntable magnetic interference is small. On the contrary, it is the largest at a −45° gle. It can be seen that without compensation, the pitch angle error is 3.52° (1σ), and the m pitch error reaches 14.79°. However, after calibration, the pitch angle error reduces to ), and maximum pitch error reduces to more than 3.20°.  re 26 shows the roll angle error before and after calibration. It can be seen that the roll ror is 2.59° (1σ) before calibration, while the roll angle error reduces to 0.65° (1σ) after n. The maximum roll angle error reduces from 8.85° to less than 2.81°. Obviously, the error reduction would have imposed significant positive effects on control performance of projectiles. Simulation and experiment results show that the accuracy of the tri-axial meter has been greatly enhanced, and the attitude estimation errors have been reduced bration.
usions s paper presents a fast calibration method specific for a spinning projectile. At the launch tri-axial magnetometer is calibrated again, and the error parameters of the magnetometer g bias errors, scale factors and misalignment angles are quickly obtained by optimal fitting based on a least squares criterion. Then, the calibration parameters are used to ate the magnetometer outputs during flight. This method has the following advantages: ing a least-squares fitting criteria to ensure the procedure is an optimal ellipsoid fitting. without need for a precision turntable or other equipment, the calibration process is simple to implement. Moreover, the method is also suitable for tri-axial accelerometers. Finally, a simulation system was designed to further verify the performance of the calibration The results show that pitch angle error is reduced from 3.52° to 0.58° (1σ) after calibration. ile, the roll angle error is reduced from 2.59° to 0.65° (1σ). Simulations and experimental ndicate that the accuracy of magnetometer in a strap-down spinning projectile has been nhanced, and the attitude estimation errors of projectile have been reduced after calibration.

Conclusions
This paper presents a fast calibration method specific for a spinning projectile. At the launch site, the tri-axial magnetometer is calibrated again, and the error parameters of the magnetometer including bias errors, scale factors and misalignment angles are quickly obtained by optimal ellipsoid fitting based on a least squares criterion. Then, the calibration parameters are used to compensate the magnetometer outputs during flight. This method has the following advantages: First, using a least-squares fitting criteria to ensure the procedure is an optimal ellipsoid fitting. Second, without need for a precision turntable or other equipment, the calibration process is simple and easy to implement. Moreover, the method is also suitable for tri-axial accelerometers. Finally, a physical simulation system was designed to further verify the performance of the calibration method. The results show that pitch angle error is reduced from 3.52 • to 0.58 • (1σ) after calibration. Meanwhile, the roll angle error is reduced from 2.59 • to 0.65 • (1σ). Simulations and experimental results indicate that the accuracy of magnetometer in a strap-down spinning projectile has been greatly enhanced, and the attitude estimation errors of projectile have been reduced after calibration.