Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 1, No. 1, 2022 29 Three‐axis Fluxgate Sensor Error Correction Shuting Xiao College of Electrical & Information Engineering, Southwest Minzu University, Chengdu, 610041, China Abstract: When the ideal three-axis fluxgate sensor measures the magnetic field, its total magnetic field does not change with the attitude change of the sensor. However, due to the limitations of the existing sensor manufacturing and processing technology, the three-axis fluxgate sensor has errors, It may cause hundreds of thousands of nanometers of measurement error, so for high- precision magnetic detection, the analysis and correction of its errors are of great significance. Aiming at the above problems, this topic analyzes the error mechanism of the three-axis fluxgate sensor, establishes a mathematical model for error correction, and uses the ideal three-axis fluxgate sensor modulus value to be independent of the sensor attitude to correct the sensor to correct and compensate the sensor error. The correction algorithm proposed in this paper can complete the error correction of the sensor well, thereby obtaining high-quality magnetic field data, laying a good foundation for the subsequent magnetic target positioning, which has important practical significance. Keywords: Three-axis fluxgate sensor, Least Squares, Error correction. 1. Introduction The magnetic detecting technology [1], as a non-contact passive detection method, has no weather and climate impact, and is not interfered with non-ferromagnetic media such as water, air, and does not require a source of launch, all regional coverage and concealment. It has important research significance and important application value. The earliest and most extensive application of magnetic detection technology is in geological exploration. Underground minerals such as large mines such as metal, petroleum, natural gas, as well as geological structures such as Karst, underground rift, hidden explosives, submarines, etc., can form magnetic abnormal zones. General magnetic signals (such as magnetic induction strength vectors, field strength, magnetic field gradient, etc.) can indicate magnetic abnormalities. However, the magnetic field is extremely susceptible to interference, magnetic sensor technology [2] [3] [4] is a key to magnetic detection techniques and magnetic positioning and other issues, and magnetic field detection, especially the accurate measurement of weak magnetic field [5][6]. The higher requirements are put forward for magnetic detection technology in order to adapt to and meet the higher requirements of the application environment, including magnetic sensor technology needs to continue to develop to the trend of high resolution, high precision, fast response, miniaturization. This is increasingly required for sensor detection accuracy, which makes it urgent to improve detection accuracy. The current three-axis magnetometer calibration methods mainly include vector calibration method and scalar calibration method [7]: one is vector calibration method. The vector calibration [8] method uses the known precise vector magnetic field as a standard to correct the output of the three- axis magnetometer and obtain the error parameters. This method needs to obtain accurate magnetic field vector information, using three orthogonal circular or rectangular Helmholtz coils [9] or a more complex coil system to provide vector magnetic field information for the three-axis fluxgate sensor as a calibration reference, and With the help of attitude equipment such as a non-magnetic turntable, the attitude information is obtained, and the error parameters of the three- axis fluxgate are calibrated. One is the scalar calibration method [10]. The scalar calibration method assumes that the total magnetic field strength will not change with the attitude change of the fluxgate at the same position. In the calibration process, the three-axis magnetometer is rotated around a certain axis with the help of a non-magnetic turntable, and it is assumed that the vector output by the fluxgate should form a spherical surface, and the radius is the modulus value of the magnetic field where the fluxgate is located. In this paper, the error principle of the three-axis fluxgate sensor is analyzed, the error mathematical model is established, and the correction algorithm is used to correct according to the model. In the process of sensor manufacturing and processing, due to the limitations of technology and technology, there will be errors in the sensor itself, and the existing errors will have a serious impact on the measurement results. According to different types of errors, the errors of the sensor itself are divided into three categories: scale factor error, non-orthogonal error, and zero bias error. Due to the existence of these three types of errors, the sensor is affected in the measurement process, resulting in inaccurate measurement. Measurement errors can be in the hundreds of nut. This has a great impact on the magnetic field measurement and magnetic target positioning results. In order to obtain better measurement results, it is necessary to correct and compensate the error. 2. Error Principle 2.1. Scale Factor Error A magnetic field with the same direction and magnitude is applied to the three measurement axes of the three-axis fluxgate sensor. Due to the differences in the sensitivity of each axis and the amplification and conditioning circuit, the output values of the three axes are different. This error is called scale factor error. If there is a scale factor error, the relationship between the measured value and the ideal value can be expressed as Equation (1). mx x tx my y ty mz z tz B k 0 0 B B = 0 k 0 B B 0 0 k B                              (1) 30 Where the scale factor error matrix of the sensor is x y z k 0 0 = 0 k 0 0 0 k          K . three-axis fluxgate sensor measurement is T m mx my mz= B B B  B , the true value of the three-axis fluxgate sensor is T t tx ty tz= B B B  B . 2.2. Non-orthogonal Error When using a three-axis fluxgate sensor for measurement, it is generally considered that the three axes of the fluxgate sensor are orthogonal. However, the actual three axes cannot be strictly orthogonal, and there is a non-orthogonal error, and the three axes of the sensor are not mutually Orthogonality is an error that exists due to the fact that the sensor axes cannot be orthogonal to each other due to mechanical errors due to the limitations of the existing processing technology during the assembly process of the sensor. Therefore, the relationship between the ideal three-axis coordinate system and the actual three-axis coordinate system is shown in Figure 1. Suppose the ideal orthogonal three-axis coordinate system be XYZ , and the actual non-orthogonal three-axis coordinate system be ' ' 'X Y Z . In order to facilitate the establishment of the mathematical model, it is assumed that the 'Z and the actual non-orthogonal three-axis coordinate system be Z axis, the 'Y axis is coplanar with the plane  'YOZ Z , the angle between 'Y and Y is yθ , the angles between the 'X -axis and the XOY -plane, and the 'X -axis and the  'XOZ Z - plane is zθ and xθ respectively. The coordinate relationship is shown in Figure 1. z x y X 'X Y 'Y '( )Z Z Figure 1. Schematic diagram of sensor non-orthogonal coordinates According to the relationship between the three axes in the coordinate system, the relationship between orthogonal and non-orthogonality can be expressed as the Eq. (2). mx z x z x z tx my y y ty mz tz B cosθ cosθ cosθ sinθ sinθ B B = 0 cosθ sinθ B B 0 0 1 B                              (2) Where z x z x z y y cosθ cosθ cosθ sinθ sinθ = 0 cosθ sinθ 0 0 1          A is the non - orthogonal error matrix of the sensor. 2.3. Offset Error The offset is composed of residual magnetic and zero drift errors. Residual magnetism is generated because the internal ferromagnetic material is magnetized by the environmental magnetic field when the three-axis fluxgate sensor is in a magnetic field for a long time. Zero drift error is caused by bias resulting in the sensor probe structure is not symmetrical, analog processing circuit and A/D conversion zero inconsistency. This allows the sensor to have a non-zero output when the input is zero. The relationship between the offset and the measured value is shown in the Eq. (3). mx tx x my ty y mz tz z B B b B = B + b B B b                              (3) Where T x y z= b b b  b is the offset of the sensor. 2.4. Comprehensive Error Model According to the error types analyzed above, the error model of the three-axis fluxgate sensor is established as follows: mx z x z x z x tx x my y y y ty y mz z tz z B cosθ cosθ cosθ sinθ sinθ k 0 0 B +b B = 0 cosθ sinθ 0 k 0 B +b B 0 0 1 0 0 k B +b                                        (4) It can be abbreviated as: m tB = AK B + b)( (5) According to the above formula, the corrected error model can be obtained, and the real value is: -1 -1 t mB = K A B - b (6) 3. Calibration Model The error correction in this study is based on the least squares method [11][12]. The three-axis fluxgate sensor is corrected respectively, and its non-orthogonal error, scale factor error, and offset error are corrected and compensated. Inverse equation (4) for transformation, the expression to obtain the true value is shown in equation (7). -1 -1 tx x z x z x z mx x ty y y y my y tz z mz z B k 0 0 cosθ cosθ cosθ sinθ sinθ B b B = 0 k 0 0 cosθ sinθ B - b B 0 0 k 0 0 1 B b                                                  (7) For convenience, let z x 11 z x 12 z 13 y 22 y 23 cosθ cosθ = a cosθ sinθ = a sinθ = a cosθ = a sinθ = a       , -1 -1 tx x 11 12 13 mx x ty y 22 23 my y tz z mz z B k 0 0 a a a B b B = 0 k 0 0 a a B - b B 0 0 k 0 0 1 B b                                                  (8) 31 The result of its inversion is shown in formula (9). 12 12 23 13 22 mx my mz x x 11 x 11 22 x 11 22 tx 23 ty my mz y y 22 y 22 tz mz z z 1 a a a - a a B - B + B - b k a k a a k a a B 1 a B = B - B - b k a k a B 1 B - b k                         (9) The ideal three-axis fluxgate sensor rotates in a uniform magnetic field environment, the modulus value does not change with the attitude change, and the data is distributed on a spherical surface with a radius of the magnetic field modulus value, so the function can be constructed: 2 2 2 2 t t tx ty tz2 2 12 12 23 13 22 mx my mz x x 11 x 11 22 x 11 22 2 2 23 my mz y mz z y 22 y 22 z = = B + B + B 1 a a a - a a = B - B + B - b k a k a a k a a 1 a 1 + B - B - b + B - b k a k a k                   B B (10) For ease of writing, let: 12 12 23 13 22 23 1 2 3 4 5 6 x 11 x 11 22 x 11 22 y 22 y 22 z 1 a a a - a a 1 a 1 = l ,- = l , = l , = l ,- = l , = l k a k a a k a a k a k a k The formula (2-4) can be written in the form of formula (11).      2 22 2 t t 1 mx 2 my 3 mz x 4 my 5 mz y 6 mz z2 = = l B + l B + l B - b + l B + l B - b + l B - bB B (11) Further calculation of formula (11) can be obtained:                                       2 2 22 2 2 2 2 2 2 t 1 mx 2 my 3 mz x 4 my 5 mz y 6 mz z 1 mx 2 my 1 mx 3 mz 1 mx x 2 my 3 mz 2 my x 3 mz x 4 my 5 mz 4 my y 5 mz y 6 mz z B = l B + l B + l B + b + l B + l B + b + l B + b +2 l B l B + 2 l B l B - 2 l B b + 2 l B l B - 2 l B b - 2 l B b +2 l B l B - 2 l B b - 2 l B b - 2 l B b (12) The classification of formula (12) according to the input relationship is shown in formula (13).                     2 2 2 t 1 mx 2 2 2 2 4 my 2 2 2 2 3 5 6 mz 1 2 mx my 1 3 mx mz 2 3 4 5 my mz 1 x mx 2 x 4 y my 3 x 5 y 6 z mz 2 2 2 x y z = l B + l + l B + l + l + l B + 2l l B B + 2l l B B + 2l l + 2l l B B + -2l b B + -2l b - 2l b B + -2l b - 2l b - 2l b B + b +b +b B (13) Equation (13) can be simplified as: 2 2 2 t 1 mx 2 my 3 mz 4 mx my 5 mx mz2 6 my mz 7 mx 8 my 9 mz 10 m = c B + c B + c B + c B B + c B B +c B B + c B + c B + c B + c = B CB (14) 1 10c ~ c as follows : 2 1 1 2 2 2 2 4 2 2 2 3 3 5 6 4 1 2 5 1 3 6 2 3 4 5 7 1 x 8 2 x 4 y 9 3 x 5 y 6 z 2 2 2 9 x y z c = l c = l + l c = l + l +l c = 2l l c = 2l l c = 2l l + 2l l c = -2l b c = -2l b - 2l b c = -2l b - 2l b - 2l b c = b +b +b                          (15) Rotate the gradiometer on the non-magnetic turntable according to the set rotation angle in a stable and uniform magnetic field, and record the measurement values mB (n),(n = 1,2...,N) of each sensor in the gradiometer under N N 10( ) groups of different attitudes. At the same time, using a high-precision magnetometer to measure the modulus value of the total magnetic field of N groups is the ideal value 0B (n) . Construct the least squares objective function. N 2 2 m 0 n=1 1 F( )= min ( (n) - (B (n)) ) 2 C CB (16)  1 2 3 4 5 6 7 8 9 10= c c c c c c c c c cC , 0B (n) is the background magnetic field (i.e. the ideal value) measured by the high-precision magnetic measuring instrument in the nth group of attitudes, and 1 2 is added before the objective function for the convenience of calculation. T2 2 2 m mx my mz mx my mx mz my mz mx my mz(n)= B B B B B B B B B B B B 1  B is the combination of measured values of the nth group of attitude three-axis fluxgate sensor. The least squares method is to minimize the objective function F( )C , Correspondingly, the partial derivative is obtained for the unknown parameter 1 10c ~ c , and the partial derivative is set to zero, we have 1 10 F( ) F( ) = 0, , = 0 c c     C C � (17) The above equation system can be solved to obtain the position parameter 1 10c ~ c , and then the error parameter can be obtained according to equations (10) - (15). 32 4. Calibration Simulation In this chapter, MATLAB is used to simulate the error correction, and the validity of the correction algorithm is verified by setting the error and solving the error. Figure 2 shows the position of the magnetic field in the hypothetical coordinates. 1X 1Y 1Z 1O B ( , , )tx ty tzB B B 1 2 Figure 2. Schematic diagram of the magnetic field in three- dimensional coordinates It can be seen from the figure that the angle between the magnetic field B and the plane 1 1 1X O Z is 1α , and the angle between the projection of the magnetic field B on the plane 1 1 1X O Z and the axis is 2α , so the following relationship exists: tx 1 2 ty 1 2 tz 1 B = Bcosα cosα B = Bcosα sinα B = Bsinα    (18) where B is the magnitude of the modulus of the measured magnetic field. In the actual calibration process of the three- axis fluxgate sensor, the sensor is fixed on the non-magnetic turntable, and the non-magnetic turntable is rotated to obtain the three-component measurement of the three-axis fluxgate sensor under different attitudes. Therefore, according to the above formula 3-1 The relationship of the components to the total magnetic field, and change the value of the included angle 1α , 2α , three-component data at different attitudes can be obtained. In this paper, the total field of the geomagnetic field is set to 50000nT, simulating in a uniform and stable magnetic field space, the three-axis fluxgate sensor rotates according to the sampling requirements, and collects 32 sets of three- component data, which are ideal three-component data without error. Add error to the sensor to obtain the three- component measurement data with the error. The data measured by the sensor consists of three parts: m E b nB = B + B + B , where mB is the measured value of the sensor, EB is the geomagnetic field, bB is bias magnetic field, nB is the noise magnetic field. According to the error characteristics and the known sensor error magnitude, set the error parameters as shown in Table 1. Table 1. Simulation setting error parameter table of each sensor Preset parameter 1.00566 0.999516 1.002954 0 0 = 0 0 0 0         K xyz 0.026 -0.0014 0.0035 θ =         130.242 45.845 2 = 0.39          b Estimate parameter 1.0056561 0.9995121 1.0029501 0 0 = 0 0 0 0         K xyz 0.025999995 -0.0013999998 0.0034999 θ = 9988         130.24251 45.8451786 20.39008 =          b It can be seen that the error parameters of the sensor can be correctly solved by using the least square method, and the sensor can be corrected. The comparison chart before and after correction is shown in Figure 3. Figure 3. Comparison of the ideal total field before and after sensor calibration It can be seen that after the simulation data is corrected, the maximum error of the sensor is reduced from 405.1nT to 0.2nT, the correction algorithm is effective, and the correction effect is good. M a g n e tic fi e ld /n T 33 5. Correction Experiment Before carrying out the experiment, it is first necessary to determine the experimental site, because the scalar calibration is used, and it is a gradiometer calibration composed of multiple sensors. Therefore, the calibration requirements of each magnetic sensor must be in a uniform and stable magnetic environment, and the calibration needs to be carried out synchronously, which is relatively strict. Therefore, it is selected to be carried out in the zero-magnetism laboratory of the China Academy of Space Technology. Using large-scale magnetic field simulation equipment, you can Ensure that the magnetic field environment of each sensor in the gradiometer is consistent, and a better correction effect can be obtained. Scalar calibration requires a set of high-precision scalar magnetometer as auxiliary equipment, so high-precision HE- 1 helium optical pump magnetometer is used, and its measurement accuracy can reach 1nT, and the sampling rate is 0.5Hz; the experiment needs to obtain different The data under the attitude requires a gradiometer that can be fixed and placed in a stable magnetic environment. Since the range of the magnetic environment generated by the CM2 device is a spherical domain with a radius of 2.5m, the approximate length of the gradiometer is about 1m, so Choose a small two- axis non-magnetic turntable. Due to the particularity of the parameter estimation method, an attitude rotation table should be designed during data collection to make the collected data non-coplanar as much as possible; considering that the magnetic environment fluctuates greatly during the day, correction experiments should be avoided as much as possible during the day. The collected data is processed and corrected using the correction algorithm, and the error parameters are obtained as shown in Table 2. Figure 4. Laboratory calibration site map Table 2. The error coefficient matrix of the sensor in the laboratory environment Estimate parameter 1.0026853 1.0028525 1.0029635 0 0 0 0 0 0         1K xyz 0.0356466 0.0189960 -0.00435 θ = 80         1 -23.2097790 -44.7304276 -170.9444=b In order to observe the correction effect more intuitively, the comparison diagram of the total magnetic field before and after the correction is drawn as shown in Figure 5. Figure 5. Comparison of the ideal total field before and after sensor calibration It can be seen that after the experimental data is corrected, the maximum error of the sensor is reduced from 316.6nT to 6.7nT, the correction algorithm is effective, and the correction effect is good. 6. Conclusion In this paper, the correction method based on rotation- invariant scalar is used, and the error of a single three-axis fluxgate sensor is corrected and compensated by the least square method. It can be seen from the simulation and experimental results that the total magnetic field size of the sensor is reduced from 316.6nT to 6.7 nT, the error is reduced to about 2% of the original, and the correction effect is good. Acknowledgment This work was financially supported by the 2021 Graduate Innovative Research Master Program of Southwest Minzu University. Project name: In-line three-axis magnetic sensor gradiometer error correction, project number: CX2021SP110. M ag ne tic d ie ld /n T 34 References [1] Guo Haipeng (2016). Reserch on target localization methods based on magnetic anomaly gradient signal detection[D]. University of Electronic Science and Technology of China,p.1- 2. [2] Clem T R(1997).Progress in magnetic sensor technology for sea mine detection.Proc Spie,vol.3079,p.354-371. [3] D. Robbes(2006).Highly sensitive magnetometers—a review. Vol.129,no1-2, p.86–93. [4] G Vértesy;A Gasparics;J Szöllsy (2000). High sensitivity magnetic field sensor.Sensors and actuators , vol.85,no.1-3,p. 202-208. [5] Zhining Guan(2005). Geomagnetic Field and Magnetic Exploration [M]. Professor of Geophysics China University of Geosciences ( Beijing),p.54-66. [6] ZHANG Zhao-yang , XIAO Chang-han , YAN Hui(2009). Localization of a Magnetic Object Based on Magnetic Gradient Tensor at a Single Point. Journal of Detection &Control,vol.31,no.4,p.44-48. [7] Gao Quanming(2020). Research on system error calibration and interference compensation technology of aeromagnetic three-component survey based on fixed-wing UAV[D]. Jilin University,p. 6-9. [8] Primdahl, F; Jensen, P Anker (1982). Compact spherical coil for fluxgate magnetometer vector feedback. Journal of Physics E: Scientific Instruments, vol.15,no.2, p.221-226. [9] Bian Jiangwei(2016). Testing of UAV Aeromagnetic System and Calibration of Fluxgate sensor [D]. Chengdu University of Technology,p.26-27. [10] Gang, Yin; Yingtang, Zhang; Hongbo, Fan; GuoQuan, Ren; Zhining, Li (2015). Integrated calibration of magnetic gradient tensor system. Journal of Magnetism and Magnetic Materials, vol.374,p. 289–297. [11] I. Markovsky; A. Kukush; S. Van Huffel (2004). Consistent least squares fitting of ellipsoids.vol.98,no.1,p.177-194. [12] Qingde Li and J. G. Griffiths(2004), "Least squares ellipsoid specific fitting," Geometric Modeling and Processing.pp.335- 340.