The Effect of Vehicles Attitude Angle Error on Magnetic Compass Heading Estimation

The three-component magnetic sensor is used to measure the heading of the vehicle. Under working, the magnetic sensor be rotated to the horizontal plane according to the attitude angle of the vehicle, and then the heading estimation is performed. However, the vehicle’s attitude angle measurement errors affect the accuracy of the magnetic sensor measurement’s east and north components and then lead to a false heading result. Based on the relation of magnetic field measurement error and magnetic heading error, the effect model of geomagnetic measurement error on magnetic heading error is derived in this paper. Finally, the characteristics of attitude angle errors on magnetic heading are verified by experiments, and the results show that particular angles can avoid the magnetic compass’s effect by the vehicle’s attitude angle error.


Introduction
A geomagnetic field is a vector field whose unique magnetic field characteristics can be used to determine the orientation.In ancient China, the compass and other tools used to provide direction discrimination were discovered.With the progress of industrial society, sensors with flux or reluctance characteristics have achieved significant progress advantages in vector magnetic field measurement.However, the electromagnetic field and the metal magnetized by the geomagnetic field will cause interference with the geomagnetic measurement and eventually affect the orientation accuracy of the magnetic compass.
Eliminating the vehicle's soft and hard magnetic interference is a crucial step to measuring the magnetic field accurately.However, only considering the soft and hard magnetic interference cannot perfectly solve the problem of magnetic compass measurement error.In the magnetic compass model based on a vector magnetic sensor, the magnetic compass needs to be adjusted to the horizontal plane according to the vehicle attitude angle, and the vehicle attitude measurement has specific errors.Therefore, the accuracy of the magnetic compass is further affected by the inaccurate attitude angle measurement of the vehicle.
Currently, most of the research on magnetic compass error focuses on correcting soft and hard magnetic interference [1,2], and only some people pay attention to the magnetic compass error caused by the attitude angle of the vehicle.Kim et al. [3] tested the influence of the vehicle roll angle and pitch angle errors on the heading calculation through simulation tests.The results show that the heading error changes with the heading angle in a sinusoidal manner.In addition, the heading error law caused by the attitude angle is very similar to the magnetic compass error law before calibration.
In this paper, the model of magnetic compass heading angle error and magnetic field measurement error is established from the perspective of the magnetic field.Based on the analysis, the vehicle attitude angle error is deduced from the influence mechanism of the heading error, pointed out that there is a 2 particular point of view, under the angle can avoid vehicle attitude error influence on magnetic field measurement, and enhance accuracy of magnetic compass.Finally, the effect of the deduced attitude error on the heading error is verified by experiments.

Geomagnetic field and magnetic compass model
The geomagnetic field is a geophysical field generally described by the strength measure and the angle quantity of the geomagnetic field when the geomagnetic field is used, as shown in Figure 1.F is the total strength vector mode of the observation points at the geomagnetic field, F in the observation position projection to the three-axis rectangular coordinate system, obtained northerly X, east to the component Y, vertical component Z, horizontal component H, inclination I and magnetic declination D. The basic principle of the heading measurement of the magnetic compass is shown in Figure 2. In general, magnetic compasses based on vector magnetic sensors should be aligned and installed with the vehicle's central line.The vehicle heading angle is calculated by calculating the angle between the magnetic compass and the magnetic north pole.

Figure 2. Schematic diagram of magnetic heading measurement
In engineering applications, the magnetic compass cannot always be in the horizontal plane, so it is necessary to use the vehicle attitude measurement instrument to provide the inclination angle relative to the horizontal plane.Then, use equation (1) to rotate the magnetic compass to the horizontal plane and further calculate the heading angle.
In equation ( 1), X, Y, and Z represent the geomagnetic field's north, east, and vertical strength, respectively.Superscript b represents the vehicle coordinate system, superscript h represents the horizontal coordinate system, and represents the vehicle's roll angle and pitch angle.
Assuming that the three-axis vector magnetic sensor is placed horizontally, the heading angle is obtained using equation ( 2) by measuring the magnetic field component of the geomagnetic field on the horizontal axis of the magnetic sensor.

(
) X and Y are the X-axis and Y-axis magnetic sensor measurements.D is the local magnetic declination, and  is the vehicle of heading angle, namely the vehicle central line and the geographic north pole angle.If there are no special instructions, the heading described in this article refers to the heading angle.
In addition to the heading angle, there is also the magnetic heading, which refers to the angle between the vehicle's baseline central and the horizontal component of the geomagnetic field.The magnetic heading and the heading angle differ by a local magnetic deflection angle.However, due to the existence of interference magnetic fields, the measurement results have errors [4,5]; therefore, the magnetometer needs to be appropriately calibrated to achieve high-precision heading angle measurement.

The effect of vehicle attitude of magnetic compass
Demoz et al. [6] derived the relationship between the magnetic field measurement error and the heading error of the magnetic compass: assuming that the three-axis magnetometer is placed horizontally, and each measuring axis of the sensor is orthogonal to each other, the horizontal component of the geomagnetic field is h h , then the measured values of the X-axis and Y-axis of the magnetometer are: Where  is the magnetic heading.Theoretically, the magnetic field values w y h and w x h of the X- axis and Y-axis in the world coordinate system should be the same as those in the vehicle coordinate system.However, due to the existence of measurement errors, the real w

xx h xy h h h h h h h
Similarly, the magnetometer Y-axis output is:

yx h yy h h h h h h h
In equations ( 5) and ( 6),  2), the heading measured by the magnetic compass is calculated by the output of the X-axis and Y-axis of the magnetometer, so the heading angle error is directly related to the measurement error of the magnetometer, and the relationship between heading error and measurement error is further established.

y y yx h yy h h h h h h h h h h
Substituting equation (8) into equation ( 7) and sorting out, the following heading angle error formula can be obtained: Assign, Therefore, the heading angle error formula can be simplified as, The equation expresses the relationship between the vehicle's magnetic interference and the heading angle error.From the relationship, it can be found that the heading angle error is not only related to the strength of the interference magnetic field, but also closely related to the vehicle's direction.For AUV, its structure is generally unchanged during use, and the interference magnetic field generated by the vehicle is relatively stable.The magnetic compass heading compensation model can be obtained by solving the coefficient in the equation (15).Then, according to the real-time magnetic heading measured by the magnetic compass, the heading angle error value under the heading can be estimated using equation (15).Because, under the dynamic environment, the vehicle's attitude angle measurement error and external environment of the impact of the wave and current on the vehicle, cause the magnetic compass in the actual heading angle error and the heading error model estimates there are some differences.
In the process of rotating the magnetic compass with any inclination angle under the vehicle coordinates to the horizontal plane using equation ( 1), the measurement errors of roll angle and pitch angle will be introduced into the magnetic heading calculation model.Assuming that the roll angle and pitch angle errors are  and  , respectively, the horizontal plane magnetic field strength value considering the attitude angle error is: In equation (18), ˆh h represents the horizontal magnetic field strength considering the influence of attitude angle error, which can be simplified as follows equation (19) for easy understanding.
( ) where h h Theoretical value of horizontal magnetic field strength， ( ) , h    is horizontal magnetic intensity error by attitude angle error, which amplitude is related to vehicle roll angle and pitching angle error.Further, substituting equation (19) into equation ( 9), ( From equation (20), it can be observed that the heading error caused by attitude angle errors mainly affects terms ( ) ( ) ( ) ( ) . Under the condition that the roll angle and pitch angle errors are determined, h  becomes a constant value.Therefore, the effect of attitude angle errors on heading is manifested in the coefficient perturbations of terms ( ) ( ) cos  .Based on the above analysis, it can be concluded that heading error is a periodic function related to heading.The  and 2 determine its period in equation (20).Assuming there is no influence of attitude angle errors, the heading error is 0° when the magnetic heading is.Since the heading error compensation model phase is not affected by attitude measurement errors, the heading error curve influenced by attitude errors still passes through the 0° mark of the heading error at the magnetic heading equal to T  .In other words, at this angle, attitude errors do not affect the heading calculation.

Experiment
This paper designed a prototype of an array magnetic sensor to investigate the influence of vehicle attitude angle error on heading angle error, as shown in Figure 3.The experimental prototype consists of 16 three-axis magnetic sensors, each oriented toward a different azimuth at intervals of 22.5°.Based on the magnetic compass calculation principle described in Section 2, the 16-channel magnetic sensors synchronously measure the heading angles in different directions at a sampling rate of 10Hz.The array magnetic sensor prototype is also connected to an inertial navigation system (INS)/Global Positioning System (GPS), providing the reference heading and attitude angles for the magnetic compass.The reference heading accuracy is 0.1°, and the attitude angle accuracy is 0.1°..  Figure 4 shows the actual heading error and the fitting curve of heading error for 16 different azimuths under arbitrary attitudes during high-speed vehicle navigation.From Figure 4, it is evident that there is a particular difference between the actual heading error and the heading error curve obtained during the calibration of the magnetic compass.However, the overall characteristics of the heading error still follow a sinusoidal pattern.Additionally, at the peaks and valleys of the heading error fitting curve, the dispersion between the actual heading error and the fitting curve is almost at its maximum.As the heading error gradually decreases towards 0°, in several experiments, the real heading error curve gradually approaches and intersects with the fitting curve.Then, as the heading error increases, the dispersion between the actual heading error and the fitting curve increases again.
The effect of vehicle attitude angle error on heading angle calculation accuracy was verified through simulation experiments in reference [3], and the results are shown in Figure 5. From the results, it can be observed that a 0.3° attitude angle error already causes a 1°heading error.Additionally, it can be observed that the influence of vehicle attitude angle error on heading error also follows a sinusoidal distribution.Moreover, when the heading angle is at 45°and 225°, regardless of the different attitude angle errors, they do not affect the heading calculation.The results of this study are consistent with the simulation conclusions in reference [3], which validates the correctness of the analysis on the influence of attitude angle error on heading error both theoretically and experimentally.

Conclusion
This paper studies the high-precision heading measurement of a magnetic compass in a dynamic environment.Due to the error of the attitude Angle of the aircraft in the motion process, the measurement of the horizontal magnetic field is inaccurate.Eventually, it interferes with the calculation of the heading.In order to solve this problem, a model of the influence of the attitude angle of the aircraft on the heading error is established, and the effect of the attitude angle error on the heading error is analyzed.It is pointed out that the phenomena affecting the course measurement can be alleviated by effectively avoiding the influence of the attitude angle error of the vehicle.

Figure 1 .
Figure 1.Schematic diagram of the components of the geomagnetic field y h and w x h are inconformity with the measured b y h and b x h .Let the X-axis output of the magnetometer be: magnetic interference error.According to equation (

Figure 3 .
Figure 3. Prototype of an array magnetic sensor

Figure 4 .Figure 5 .
Figure 4. True value and estimated value of heading error )