^{1}

^{1}

^{1}

^{1}

Due to the influence of processing technology and environmental factors, there are errors in attitude measurement with the three-axis magnetometer, and the change of parameters during the operation of the magnetometer in orbit will have a great impact on the measurement accuracy. This paper studies the calibration method of magnetometer based on BP neural network, which reduces the influence of model error on calibration accuracy. Firstly, the error model of the magnetometer and the structural characteristics of the BP neural network are analyzed. Secondly, the number of hidden layers and hidden nodes is optimized. To avoid the problem of slow convergence and low accuracy of basic BP algorithm, this paper uses the Levenberg Marquardt backpropagation training method to improve the training speed and prediction accuracy and realizes the on-orbit calibration of magnetometer through online training of the neural network. Finally, the effectiveness of the method is verified by numerical simulation. The results show that the neural network designed in this paper can effectively reduce the measurement error of magnetometer, while the online training can effectively reduce the error caused by the change of magnetometer parameters, and reduce the measurement error of magnetometer to less than 10 nT.

Three-axis magnetometer has the advantages of small size, lightweight and low power consumption, which is often used to determine the attitude of the earth observation satellite. However, there are many problems in the application of magnetometer, such as the three axes are not orthogonal, the sensitivity of the three axes is not consistent, the constant value drift and the internal remanence, leading to a large error between the measured value and the actual value [

At present, the calibration methods of magnetometer mainly include the least square method [

BP neural network has good model learning ability, a three-layer BP neural network can fit any continuous function [

In reference [

The rest of this paper is organized as follows. Firstly, the structure of the BP neural network is designed according to the error characteristics of the magnetometer. Then the LM method is used to improve the speed of network training, and the convergence is verified by simulation. After that, the periodic training method is proposed to calibrate the magnetometer and the effectiveness of the proposed method is verified by numerical simulation. Finally, the concluding remarks of the present investigation are noted.

The measurement errors of magnetometer mainly include the nonorthogonal errors caused by the three-axis nonorthogonal, the nonorthogonal errors caused by the inconsistent sensitivity, the drift, and noise caused by the circuit characteristics. The magnetometer error model can be expressed by the following formula.

B m = B 0 + Δ B + A B (1)

where B m is the output data of magnetometer, B is the constant drift, Δ B is the measurement noise, A is the coefficient matrix generated by nonorthogonal error, and B is the actual magnetic field data.

According to Kolmogorov’s theorem [

The structure of the BP neural network is one of the main factors affecting its performance. Too many hidden nodes in the network might cause over fitting, while too few hidden nodes in the network might affect the prediction ability of the network [

The data in

Hidden nodes | 7 | 6 | 5 | 4 | 3 | 2 |
---|---|---|---|---|---|---|

regression coefficient | 0.9999 | 0.9999 | 0.9999 | 0.9999 | 0.9999 | 0.82121 |

The basic BP algorithm has the problems of long training time, difficult to determine the network structure and easy to fall into the local optimal solution. To avoid these problems, some improved BP algorithm were proposed. Compared with the basic BP algorithm, the LMBP training method has higher accuracy and stability and has a better training effect under the same network structure [

Set network input vector is x = ( x 1 , x 2 , ⋯ , x m ) T , output vector is y = ( y 1 , y 2 , ⋯ , y N ) T and weight vector is ω = ( ω 1 , ω 2 , ⋯ ω n ) T .

The loss function is:

E ( ω ) = 1 2 ∑ i = 1 N ( y i − O i ) 2 = 1 2 ∑ i = 1 N e i 2 (2)

where O i is the expected output of sample i , y i is the network output, and e i is the error of sample i .

Neglecting the higher-order infinitesimal, the second-order Taylor expansion of the error function is carried out at the minimum point.

φ ( ω ) = E ( ω k ) + ∇ E ( ω k ) ( ω − ω k ) + 1 2 ( ω − ω k ) T ∇ 2 E ( ω k ) ( ω − ω k ) (3)

where ∇ E is gradient vector and ∇ 2 E is Hessian matrix.

∇ E = [ ∂ E ∂ ω 1 ∂ E ∂ ω 2 ⋯ ∂ E ∂ ω n ] T (4)

∇ 2 E = [ ∂ 2 E ∂ ω 1 ∂ ω 1 ∂ 2 E ∂ ω 1 ∂ ω 2 ⋯ ∂ 2 E ∂ ω 1 ∂ ω n ∂ 2 E ∂ ω 2 ∂ ω 1 ∂ 2 E ∂ ω 2 ∂ ω 2 ⋯ ∂ 2 E ∂ ω 2 ∂ ω n ⋮ ⋱ ⋮ ∂ 2 E ∂ ω n ∂ ω 1 ∂ 2 E ∂ ω n ∂ ω 2 ⋯ ∂ 2 E ∂ ω n ∂ ω n ] (5)

According to the necessary conditions of extreme value:

∇ φ ( ω ) = 0 (6)

Therefore:

g k + H k ( ω − ω k ) = 0 (7)

where H k = ∇ 2 E is Hessian matrix and g k = ∇ E is gradient vector. The weight updating formula of Newton method can be obtained when H k is nonsingular.

Δ ω = − H k − 1 g k (8)

Hessian matrix can be transformed into the following form

H k = ∇ 2 E = J ( ω ) T J ( ω ) + S ( ω ) (9)

where S ( ω ) = ∑ i = 1 N e i ( ω ) ∇ 2 e i ( ω ) , J is Jacobian matrix.

J = [ ∂ e 1 ∂ ω 1 ∂ e 1 ∂ ω 2 ⋯ ∂ e 1 ∂ ω n ∂ e 2 ∂ ω 1 ∂ e 2 ∂ ω 2 ⋯ ∂ e 2 ∂ ω n ⋮ ⋮ ⋱ ⋮ ∂ e N ∂ ω 1 ∂ e N ∂ ω 2 ⋯ ∂ e N ∂ ω n ] (10)

When the solution is near the extreme point S ( ω ) ≈ 0

H k = J ( ω ) T J ( ω ) (11)

The weight updating formula of Newton method is as follows:

Δ ω = − ( J ( ω ) T J ( ω ) ) − 1 J ( ω ) T e ( ω ) (12)

Newton’s method needs to inverse the Hessian matrix H k in every iteration, but in practice, H k might be irreversible while LMBP algorithm can avoid this problem.

Let:

G = H k + μ I (13)

where μ > 0 , I is the unit matrix.

It can be proved that G and H k have the same eigenvector, and the eigenvalue of G is λ i + μ . Properly choosing the value of μ makes the matrix G invertible.

The weight updating formula of LMBP algorithm is as follows.

Δ ω = − ( J ( ω ) T J ( ω ) + μ I ) − 1 J ( ω ) T e ( ω ) (14)

where e ( ω ) = ( e 1 ( ω ) , e 2 ( ω ) , ⋯ , e N ( ω ) ) T is the error vector.

According to the error model of Formula (1), this paper uses the BP neural network to calibrate magnetometer. The random error is the random noise with the mean value of 0 and the standard deviation of 2. The parameters of ground error model are set as follows.

{ B 0 = ( − 633.2 1281.7 − 455.5 ) T n T A = [ 0.9599 − 0.0209 − 0.0065 0.0020 0.9476 − 0.0040 0.0011 0.0561 0.9657 ] (15)

The actual magnetic field is as follows:

B = 4000 + 100 [ sin ( t ) cos ( t ) − sin ( t ) ] n T (16)

The trained BP neural network can predict the real magnetic field data according to the measured value of magnetometer. The training process is shown in

The structure of the BP neural network is determined as three neurons in a single hidden layer. LMBP algorithm is used to train the network. After 26 times of training, the network error is reduced to less than 0.001. The mean square error is shown in

The calibration results are shown in

The trained BP neural network can predict the real magnetic field data according to the measured value of the magnetometer by calibrating the ground model. The maximum error of the neural network calibrated by the ground model is less than 10 nT.

In the process of satellite on-orbit operation, due to the influence of environmental factors, the installation matrix and sensor characteristics change, resulting in the actual performance of the sensor inconsistent with the results of ground calibration. Thus, on-orbit calibration is necessary. While doing on-orbit training, the data of accurate magnetic field intensity should be obtained. Fortunately, the position of the satellite is recorded during operation, combined with the geomagnetic field model, the accurate magnetic field can be obtained, which makes the on-orbit training possible.

Assuming that the satellite is affected by the space environment in t = 15 s, the constant drift of magnetometer and the coefficient matrix change to Formula (17)

{ B = [ − 652.7 1266.4 − 444.49 ] T n T A = [ 0.9579 − 0.0209 − 0.0065 0.0020 0.9456 − 0.0040 0.0011 0.0561 0.9637 ] , t > 15 s (17)

As shown in

And the calibration error of the ground error model will reach 30 nT (as shown in

In this paper, LMBP neural network is designed for magnetometer calibration to avoid calibration error caused by the model error. The structure of the neural network is designed, and the LMBP algorithm is used to improve the training speed and convergence of the network. A periodic training method is designed to calibrate the magnetometer in orbit by collecting online data. The calibration effect of the LMBP neural network is verified by simulation. The results show that the BP neural network can improve the measurement accuracy of the magnetometer when the error model of the magnetometer is unknown. And it can effectively reduce the error caused by the change of magnetometer parameters caused by the change of space environment, and the measurement error of magnetometer can be less than 10 nT.

The authors declare no conflicts of interest regarding the publication of this paper.

Wang, Y.K., Sheng, T., He, L. and Cheng, Z.Y. (2020) Calibration Method of Magnetometer Based on BP Neural Network. Journal of Computer and Communications, 8, 31-41. https://doi.org/10.4236/jcc.2020.86004