Error calibration method for ellipsoid fitting triaxial magnetometer based on particle swarm optimization

The ellipsoid parameters are solved through the particle swarm optimization algorithm, and the matrix pathological problem in three-axis magnetometer calibration is solved, the calibration accuracy is improved, and high-precision magnetometer error calibration is achieved.

CN119689340APending Publication Date: 2025-03-25CHINA JILIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411938939.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

In the existing three-axis magnetometer calibration technology, the ellipsoid fitting algorithm has low ellipsoid parameter accuracy due to matrix pathological problems, which affects the measurement accuracy of the magnetometer.

Method used

The particle swarm optimization algorithm is used to solve the ellipsoid parameters. By constructing the relationship between the error model of the three-axis magnetometer and the general equation of the ellipsoid, the ellipsoid parameters that minimize the sum of the squares of the distance between the magnetic field data point and the ellipsoid surface.

Benefits of technology

The accuracy of ellipsoid parameters is improved, the accuracy of the error calibration of the three-axis magnetometer is enhanced, and high-precision calibration of the magnetometer is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119689340A_ABST
    Figure CN119689340A_ABST
Patent Text Reader

Abstract

The invention discloses a particle swarm error correction method based on ellipsoid fitting. The method comprises the following steps: firstly, establishing an error comprehensive model of a three-axis magnetometer, secondly, establishing a relationship between the error model of the three-axis magnetometer and an ellipsoid quadric surface general equation, and converting the error model of the three-axis magnetometer into an ellipsoid parameter solving model; then, a group of ellipsoid parameters are found by using a particle swarm optimization algorithm through an ellipsoid parameter solving model, so that the quadratic sum of the distance from magnetic field data measured by the three-axis magnetometer to the ellipsoid is minimum; finally, the solved ellipsoid parameters are converted into corresponding zero offset errors, sensitivity errors and non-orthogonality errors through the relation between the error model and an ellipsoid quadric surface general equation, the three error parameters are substituted into the error model, and correction of the magnetometer is completed. According to the invention, error calibration of the three-axis magnetometer can be realized, and the calibration precision is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of vector magnetic sensor calibration, and in particular to an ellipsoid fitting three-axis magnetometer error calibration method based on particle swarm optimization. Background Art

[0002] As a magnetic measurement device, the triaxial magnetometer has been widely used in geomagnetic navigation, magnetic anomaly detection and other fields due to its advantages such as high magnetic measurement sensitivity and small size. [1-3] . However, due to the limitations of manufacturing process and installation technology, the three-axis magnetometer itself has errors. The three sensitive axes of the magnetometer cannot be guaranteed to be completely orthogonal. The sensitivity of each axis is not exactly the same, and the bias error caused by internal residual magnetism makes the ideal value and the actual value have a large deviation in the actual magnetic field measurement, which seriously affects the measurement accuracy of the three-axis magnetometer. Therefore, the three-axis magnetometer needs to be corrected for errors before use.

[0003] The error calibration methods of the three-axis magnetometer can be divided into two types: one is vector calibration, which uses a known vector magnetic field as a standard field and uses a high-precision three-dimensional non-magnetic turntable to obtain magnetic field data and attitude information to complete the magnetometer calibration. However, the high-precision device involved in this calibration method has high technical requirements and is not suitable for low-cost occasions. The other is scalar calibration, which places the three-axis magnetometer in a uniform magnetic field and obtains magnetic measurement data by rotating the three-axis magnetometer. Ideally, the data point trajectory collected by the magnetometer should be a sphere with a radius equal to the size of the uniform magnetic field. However, affected by the magnetometer error, the output of the magnetometer becomes an ellipsoid that deviates from the center of the sphere. This is the ellipsoid assumption of the three-axis magnetometer error. Through the ellipsoid assumption theory, the correction of the three-axis magnetometer can be attributed to how to fit the magnetic field data points on an ellipsoid surface and restore the ellipsoid surface to a spherical surface. This restoration process is the "ellipsoid fitting method" for the calibration of the three-axis magnetometer. [4-5]

[0004] In the existing magnetometer calibration technology [6-8] The ellipsoid fitting algorithm is to find a set of ellipsoid parameters by constructing the relationship between the error model of the three-axis magnetometer and the general equation of the ellipsoid, so that the sum of the squares of the distances from the magnetic field data measured by the three-axis magnetometer to the ellipsoid surface is minimized. In the fitting process, it is necessary to give constraints to ensure that the fitting result is the ellipsoid surface, and then introduce the Lagrange multiplier. The ellipsoid fitting is transformed into finding the conditional extreme value of the function under the constraint conditions. The eigenvector corresponding to the positive eigenvalue of the function is the ellipsoid parameter to be solved. However, in the process of solving the eigenvalue and eigenvector, since the magnetic field measured by the three-axis magnetometer itself has errors and the magnetic field matrix B used in the solution process TB is mapped from N dimensions to 10 dimensions, where B is an N×10 magnetic survey data matrix, and N represents the number of magnetic survey data points. This mapping makes the matrix ill-conditioned, that is, B T B may be a singular matrix, which will affect the accuracy of the solved ellipsoid parameters, and further affect the accuracy of magnetometer calibration. [9-10] To solve the matrix ill-conditioned problem in the process of solving eigenvalues ​​and eigenvectors and give the result analysis of solving error parameters by this method.

[0005] References

[0006] [1] Chen Wen, Gao Ying, Jiang Zhiyuan, et al. Overview of research progress of high-sensitivity vector atomic magnetometer[J]. Metrology Science and Technology, 2022, 66(04): 19-25+39.

[0007] [2] Sun Hao, Li Zhiwei, Xiong Xiong. Application and development status of marine magnetic measurement technology[J]. Marine Surveying and Mapping, 2019, 39(06): 5-8+20.

[0008] [3] Lin Yi, Sun Jingjing, Yan Xu. A review of the principles and methods of geomagnetic navigation and positioning technology[J]. Global Positioning System, 2023, 48(06): 32-41.

[0009] [4] Sun Wei, Yang Yihan, Wang Ye. Research on magnetometer error correction method based on ellipsoid fitting[J]. Journal of Sensor Technology, 2018, 31(09): 1373-1376.

[0010] [5] Yu Xiangqian, Liu Si, Xiao Chijie, et al. Two-step calibration method for three-axis magnetometer based on ellipsoid fitting[J]. Instrument Technology and Sensor, 2021, (04): 52-56.

[0011] [6]X.Li,S.Yan,J.Liu,Y.Sun,et al.Partition Beetles Antennae SearchAlgorithm for Magnetic Sensor Calibration Optimization[J].IEEE SensorsJournal, vol.21, no.5, pp.5967-5974, 1March1, 2021, doi:10.1109 / JSEN.2020.3043352.

[0012] [7]L. Yue, D. Cheng, Y. Wang, et al. Fast Error Calibration for Three-Axis SQUID Magnetometers Based on Full-Space Rotational and Frequency-Controllable Magnetic Field[J]. IEEE Sensors Journal, vol. 23, no. 7, pp. 6706-6716, 1 April 1, 2023, doi: 10.1109 / JSEN.2023.3244956.

[0013] [8]J. Liu, Y. Yan, S. Yan, et al. A Hybrid Calibration Method for a Three-Axis Magnetometer in Limited-Range Attitudes[J]. IEEE Sensors Journal, vol. 22, no. 1, pp. 203-210, 1 Jan. 1, 2022.

[0014] [9]H. Huang, P. Wang, H. Shen, et al. Magnetometer Error Compensation Algorithm Based on Improved Particle Swarm Optimization Algorithm[C]. 2021 40th Chinese Control Conference(CCC), Shanghai, China, 2021, pp. 3486-3490.

[0015]

[10] B. A. Riwanto, P. H. Ehrpais, et al. Particle Swarm Optimization for Magnetometer Calibration With Rotation Axis Fitting Using In-Orbit Data[J]. in IEEE Transactions on Aerospace and Electronic Systems, vol. 58, no. 2, pp. 1211-1223, April 2022. Summary of the Invention

[0016] Purpose of the invention: In view of the problems existing in the prior art, the present invention provides a method for solving the ellipsoid parameters using a particle swarm optimization algorithm, thereby avoiding the morbidity problem caused by solving the matrix eigenvalues ​​and eigenvectors, making the solved ellipsoid parameters more accurate, and providing a guarantee for the subsequent process of solving the corresponding error parameters through the relationship between the general equation of the ellipsoid and the error model of the three-axis magnetometer, thereby achieving high-precision calibration of the three-axis magnetometer error.

[0017] The method of the present invention is as follows:

[0018] (1) First, the error model of the magnetometer is constructed based on the error of the three-axis magnetometer itself:

[0019] B e =M -1 (B m -B 0 ) (1)

[0020] Among them B e is the actual value of the background magnetic field, B m is the measurement value of the three-axis magnetometer, B 0 is the zero bias error of the magnetometer in the three axes, M = B k B n is the total transformation matrix, B k is the sensitivity error matrix, B n is the non-orthogonality error matrix. M -1 is the inverse matrix of matrix M.

[0021] (2) Secondly, the relationship between the error model of the three-axis magnetometer and the general equation of the quadratic surface of the ellipsoid is established, and the error model of the magnetometer is converted into an ellipsoid parameter solution model.

[0022] (3) Furthermore, it is necessary to find a set of ellipsoid parameters through the above-mentioned ellipsoid model so that the sum of the squares of the distances from the magnetic field data measured by the three-axis magnetometer to the ellipsoid surface is minimized, and the particle swarm optimization algorithm is used to iterate the corresponding objective function. When the number of iterations reaches the preset number or the value of the sum of the squares of the distances is less than the preset value, the ellipsoid parameters are output.

[0023] (4) Finally, the solved ellipsoid parameters are converted into corresponding zero bias error, sensitivity error and non-orthogonality error through the relationship between the error model and the general equation of the ellipsoid quadratic surface. These error parameters are brought into step (1) to complete the calibration of the magnetometer.

[0024] Furthermore, the general equation of the ellipsoidal quadratic surface in step (2) is in the form of:

[0025]

[0026] Where β=(v1 ,v 2 ,v 3 ,v 4 ,v 5 ,v 6 ,v 7 ,v 8 ,v 9 ,v 10 ) T are the ellipsoid parameters that need to be solved, is the magnetic field measurement matrix of the triaxial magnetometer output, B mx , B my , B mz They are the three-axis components in the three-dimensional coordinate system, and the magnetometer measurement value matrix form B m =[B mx ,B my ,B mz ] T .

[0027] Furthermore, in step (3), the parameters of the ellipsoid fitting are solved according to the particle swarm optimization algorithm, and the objective function to be solved is given based on the model of the ellipsoid quadratic surface, also known as the fitness function, and the ellipsoid parameters are obtained by solving the minimum value of the fitness function. Where N represents the number of measurement data points of the three-axis magnetometer. m,i represents the i-th magnetometer measurement value B m The corresponding magnetic field measurement value matrix B.

[0028]

[0029] Further, according to the above fitness function, the particle swarm algorithm is used to solve the parameters. The steps are as follows:

[0030] 1. Parameter initialization: Initialize the number of particle swarms m, number of iterations k, particle dimension n, initial speed and position, and learning factor c 1 and c 2 And the inertia weight w, set the iteration stop condition.

[0031] 2. Initialization of individual and global optimal positions: Set the current positions of the m particles initialized in step 1 as the individual optimal positions and calculate the corresponding fitness function values. Then, by comparing the fitness function values ​​corresponding to the individual optimal positions of all particles, set the position corresponding to the particle with the smallest fitness value as the global optimal position.

[0032] 3. Iterative optimization of particles: Update the position and speed of the particles in the entire population. Each iteration requires updating the position and speed information of each particle to gradually approach the optimal value of the parameter being solved. The update equations for its speed and position are as follows:

[0033]

[0034] x ij (k+1)=x ij (k)+V ij (k+1) (5)

[0035] Among them, i represents the i-th particle, j represents the j-dimensional variable of each particle, V ij represents the j-dimensional variable of the ith particle, r 1 and r 2 Represents a random number in the range [0,1], pbest ij The j-th dimension variable representing the individual optimal position of the i-th particle, gbest 1j represents the j-th dimension variable of the global optimal position, and x is the position information of the particle.

[0036] 4. Comparison of particle fitness after update: Calculate the fitness value of all particles after update, and compare the fitness value with the individual optimal fitness value before update. If the new fitness value is less than the individual optimal value of the particle before update, the updated particle position is updated to the individual optimal position, otherwise it remains unchanged.

[0037] 5. Global optimal position update: compare the individual optimal fitness values ​​of all particles, select the particle with the smallest fitness value and compare it with the fitness value of the global optimal position. If the fitness value of the particle is less than the fitness value of the global optimal position, the position of the particle is updated to the global optimal position, otherwise it remains unchanged.

[0038] 6. Iterate until the upper limit of the preset number of iterations is reached or the fitness function value of the global optimal position is less than the preset threshold, and output the global optimal position, that is, the ellipsoid parameters.

[0039] Furthermore, in step (4), the relationship between the error model and the general equation of the ellipsoid quadratic surface is used to solve the various error parameters of the three-axis magnetometer. The general equation of the ellipsoid is organized into a vector form:

[0040] (BB 0 )TA(BB 0 )=1 (6)

[0041] in It is a matrix that describes the three semi-axes of the ellipsoid and the rotation angle of the ellipsoid, which involves the solution of the ellipsoid sensitivity error and non-orthogonality error. is the center coordinate of the fitted ellipsoid, and its value is equal to the zero bias error of the ellipsoid. By substituting the solved error parameters into step (1), the error calibration of the three-axis magnetometer measurement results is completed.

[0042] The present invention also provides an electronic device, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction implements the steps of the above-mentioned method when executed by the processor.

[0043] The present invention further provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described above are implemented.

[0044] Beneficial effects of the present invention: The particle swarm error correction method based on ellipsoid fitting of the present invention can quickly realize the error calibration of the three-axis magnetometer with high calibration accuracy. By comparing the preset error value with its solution value, the relative error of each parameter is less than 0.45%, which further proves the effectiveness of the method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 It represents the overall flow chart of the particle swarm error calibration method based on ellipsoid fitting;

[0046] Figure 2 It represents the flow chart of solving the ellipsoid parameters by particle swarm optimization algorithm;

[0047] Figure 3 The Matlab simulation result diagram of the present invention is shown. DETAILED DESCRIPTION

[0048] The present application discloses a particle swarm error calibration method based on ellipsoid fitting; the technical principle and implementation process of the present application will be further described below in conjunction with the accompanying drawings.

[0049] like Figure 1 As shown, the steps of this application are as follows:

[0050] (1) Construct a comprehensive error correction model of the magnetometer based on the error of the three-axis magnetometer itself:

[0051] The errors of the three-axis magnetometer mainly include the three-axis non-orthogonality error, sensitivity error, zero bias error and the measurement noise of the magnetometer itself. From this, the relationship between the measured value and the actual value of the three-axis magnetometer can be obtained:

[0052] B m =B n B k B e +B 0 +ε (7)

[0053] Among them B m is the measurement value of the three-axis magnetometer, B e is the actual value of the background magnetic field, B nis the non-orthogonal error matrix, B k is the sensitivity error matrix, B 0 is the zero bias error matrix, and ε is the measurement noise of the three-axis magnetometer itself.

[0054] Simplifying formula (7) yields:

[0055] B m =MB e +B 0 (8)

[0056] Where M = B k B n is the total transformation matrix. Compared with the error of the three-axis magnetometer, its own measurement noise can be approximately ignored. Finally, the error model is simplified to formula (8). The calibrated magnetic field strength can be obtained through formula (8):

[0057] B e =M -1 (B m -B 0 ) (9)

[0058] (2) By establishing the relationship between the three-axis magnetometer error correction model and the general equation of the ellipsoid quadratic surface, the error model of the three-axis magnetometer is converted into an ellipsoid error model.

[0059] This embodiment uses the scalar correction method to perform error correction on the magnetometer, that is, the three-axis magnetometer is placed in a uniform magnetic field environment without magnetic interference to collect magnetic field data. In this magnetic field environment, the total intensity of the magnetic field can be regarded as a constant value within a certain period of time. Combining formula (9), it can be derived that:

[0060]

[0061] Further transformation of formula (10) yields:

[0062]

[0063] Converting equation (10) into algebraic form is as follows:

[0064]

[0065] Where β=(v 1 ,v 2 ,v 3 ,v 4 ,v 5 ,v 6 ,v 7 ,v 8 ,v 9 ,v 10 ) Tare the ellipsoid parameters that need to be solved, is the magnetic field measurement matrix of the triaxial magnetometer output, B mx ,B my ,B mz They are the magnetic field components in the three axes of the magnetometer.

[0066] (3) Solve the parameters of the ellipsoid fitting using the particle swarm optimization algorithm. Use the particle swarm optimization algorithm to find a set of optimal parameters so that the magnetometer measurement value B m =[B mx ,B my ,B mz ] T The distance to the quadratic surface F(β,B)=0 is the minimum. Formula (13) is the objective function to be solved, also known as the fitness function. The ellipsoid parameters are obtained by solving the minimum value of the fitness function. Where N represents the number of measurement data points of the three-axis magnetometer. B m,i represents the i-th magnetometer measurement value B m The corresponding magnetic field measurement value matrix B.

[0067]

[0068] The particle swarm optimization algorithm is used to solve the ellipsoid parameters. The flow chart is as follows: Figure 2 As shown, the steps are as follows:

[0069] 1. Parameter initialization: Initialize the number of particle swarms m, number of iterations k, particle dimension n, initial speed and position, and learning factor c 1 and c 2 And the inertia weight w, set the iteration stop condition.

[0070] 2. Initialization of individual and global optimal positions: Set the current positions of the m particles initialized in step 1 as the individual current optimal positions and calculate the corresponding fitness function values. Then, by comparing the fitness function values ​​of the individual optimal positions between particles, set the position corresponding to the individual with the smallest fitness function value as the global optimal position.

[0071] 3. Inertia weight and learning factor selection: Use dynamically adjusted inertia weight and learning factor to improve the diversity of particle search and solution accuracy. Inertia weight represents the inheritance of the current velocity by the particle. When this value is large, the particle has a stronger global optimization ability, and vice versa, the particle has a stronger local optimization ability.

[0072] In the early stage of algorithm iteration, it is hoped that each particle can search in the given solution space at a higher speed to improve the diversity of the obtained solutions. In the later stage of iteration, it is necessary to ensure that the particles can search more accurately near the extreme points that have been searched to improve the accuracy of the solution, so that the algorithm converges to the position of the global optimal solution. Therefore, the inertia weight w is dynamically adjusted using formula (14) to balance the global search and local search capabilities. w max and w min Represent the maximum and minimum values ​​of inertia weight respectively. max Represents the maximum number of iterations.

[0073]

[0074] Learning factor c 1 and c 2 Represent the particle’s self-cognition and social cognition respectively. 1 When c is larger, particles are influenced by their own individual experience and tend to search locally in the solution space. 2 When is larger, particles are more inclined to share information and cooperate with each other, making particles more inclined to global search in the solution space. Therefore, it is necessary to adjust the global search and local exploration capabilities of the algorithm by setting a reasonable learning factor. This embodiment uses the following (15) and (16) to balance the search capabilities of the particle swarm optimization algorithm:

[0075]

[0076] where c 1_min and c 2_min Represent the learning factor c 1 and c 2 The initial value of c 1_max and c 2_max By selecting reasonable initial values ​​and maximum values, the search solution space has a strong global optimization capability in the initial stage, and has a strong local search capability at the end of the iteration.

[0077] 4. Iterative optimization of particles: Update the position and speed of the particles in the entire population. Each iteration requires updating the position and speed information of each particle to gradually approach the optimal value of the parameter being solved. The update equations for its speed and position are as follows:

[0078]

[0079] x ij (k+1)=x ij (k)+V ij (k+1) (18)

[0080] Among them, i represents the i-th particle, j represents the j-dimensional variable of each particle, V ij represents the j-dimensional variable of the ith particle, r 1 and r 2 Represents a random number in the range [0,1], used to increase the diversity of search solutions, pbest ij The j-th dimension variable representing the individual optimal position of the i-th particle, gbest 1j represents the j-th dimension variable of the global optimal position, and x is the position information of the particle.

[0081] 5. Comparison of particle fitness after update: Calculate the fitness value of all particles after update, and compare the fitness value with the individual optimal fitness value before update. If the new fitness value is less than the individual optimal value of the particle before update, the updated particle position is updated to the individual optimal position, otherwise it remains unchanged.

[0082] 6. Global position update: compare the individual optimal fitness values ​​of all particles, select the particle with the smallest fitness value and compare it with the fitness value of the global optimal position. If the fitness value of the particle is less than the fitness value of the global optimal position, the position of the particle is updated to the global optimal position, otherwise it remains unchanged.

[0083] 7. Ellipsoid constraint: In the iterative process of the global optimal position, it should be noted that its position information is the coefficient matrix of the quadratic surface, but the quadratic surface includes ellipsoids, cylinders, paraboloids and other forms. The result of the particle swarm algorithm cannot guarantee that the obtained parameters are definitely the quadratic surface equations about the ellipsoid. Therefore, constraints should be added in the parameter solution process, as follows:

[0084] C 1 =v 1 +v 2 +v 3 (19)

[0085]

[0086] The constraints for fitting to an ellipsoid are: C 1 ≠0,C 2 >0,C 1 ·C 3 >0,C 4 <0. Where v 1 ,v 2 ,v 3 It is the parameter describing the major axis, minor axis and intermediate axis of the ellipsoid, and is used to solve the sensitivity error v in the magnetometer error. 4 ,v 5 ,v 6is a parameter describing the inclination angle between each two axes of the ellipsoid, which is used to solve the non-orthogonal error in the magnetometer error, v 7 ,v 8 ,v 9 It is a parameter that describes the deviation of the ellipsoid center from the origin of the three-dimensional coordinate system and is used to solve the zero bias error in the magnetometer error. 10 is a constant term.

[0087] 8. After adding the constraints of the ellipsoid, perform mutation operations on the solution values ​​that do not meet the constraints and make them enter the next iteration. As the particle iterations reach the upper limit of the preset number of iterations or the fitness function value of the global optimal position is less than the preset threshold, the global optimal position, i.e., the ellipsoid parameters, is output.

[0088] (4) According to the relationship between the error model and the general equation of the ellipsoidal quadratic surface, the error parameters of the three-axis magnetometer are solved. Convert equation (12) into a matrix expression:

[0089] B T EB+2F T B+v 10 =0 (23)

[0090] in,

[0091] Transform formula (23) and the process is as follows:

[0092] B T EB+F T B+B T F+v 10 =0 (24)

[0093] Using E -1 E=I, I is the unit matrix, which can make F T B to F T E -1 EB, formula (24) is further transformed:

[0094] (B T +F T E -1 )(EB+F)=F T E -1 F 10 (25)

[0095] Convert (EB+F) to E(B+E -1 F) Further simplify equation (25):

[0096]

[0097] Take H 0=-E -1 F, We can get:

[0098] (BH 0 ) T A(BH 0 )=1 (27)

[0099] Combining equations (11) and (27), we can obtain the mathematical relationship between the error correction parameters of the three-axis magnetometer and the general equation of the quadratic surface of the ellipsoid:

[0100]

[0101] Among them, B 0 is the zero bias error of the three-axis magnetometer.

[0102] Then order According to formula (28) and the relationship between the total error change matrix M, the non-orthogonal error and sensitivity error of the magnetometer can be calculated, and the formula is as follows:

[0103]

[0104] In formula (29), B kx , B ky , B kz represents the sensitivity error of the three sensitive axes of the three-axis magnetometer, and B in (30), (31) and (32) nx , B ny , B nz They respectively represent the non-orthogonal errors between the three sensitive axes of the three-axis magnetometer and the x, y, and z axes of the three-dimensional orthogonal coordinate system.

[0105] (5) Substituting the solved three-axis magnetometer error parameters into equation (9) can complete the error calibration and compensation of the three-axis magnetometer.

[0106] The embodiment of the present application further provides an electronic device including a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs include computer executable instructions for performing the following:

[0107] Step (1) constructs the error model of the magnetometer according to the error of the three-axis magnetometer itself:

[0108] Step (2) establishing a relationship between the error model of the three-axis magnetometer and the general equation of the quadratic surface of the ellipsoid, and converting the error model of the magnetometer into an ellipsoid parameter solution model;

[0109] Step (3) using the ellipsoid parameter solution model and a particle swarm optimization algorithm to find a set of ellipsoid parameters so that the sum of the squares of the distances from the magnetic field data measured by the three-axis magnetometer to the ellipsoid surface is minimized;

[0110] Step (4) converts the solved ellipsoid parameters into corresponding zero bias error, sensitivity error and non-orthogonality error through the relationship between the error model and the general equation of the ellipsoid quadratic surface, and brings these three error parameters into the error model of step (1) to complete the calibration of the magnetometer.

[0111] The embodiment of the present application also provides a readable storage medium, which is loaded with one or more programs mentioned above and is used to execute the above computer instructions.

[0112] like Figure 3 As shown, this application shows the "ellipsoid" shape fitted by the magnetic field data points and the acquisition trajectory of the magnetic measurement data. By giving an ideal total magnetic field strength, adding preset zero bias error, sensitivity error and orthogonality error: zero bias error is the bias error caused by the internal residual magnetism and zero drift of the three-axis magnetometer, sensitivity error is the error caused by the inconsistent output of the three-axis magnetometer in the three axes, and orthogonality error is the error caused by the limitation of the manufacturing process, which makes the three axes of the magnetometer unable to be orthogonal to each other. These three errors are applied to the ideal magnetic field to fit the error parameters. Figure 3 The imported data on the left shows the three-component data of the magnetometer after the error is applied, and the right side shows the result of the fitted ellipsoid. Figure 3 The following table shows the error parameter results of the fitting, and the results are analyzed as follows:

[0113] Error solution result comparison table

[0114]

[0115]

[0116] The table gives the preset values ​​and solution values ​​of the error parameters and the relative errors between the preset values ​​and the solution values. It can be seen from the relative errors that the error of the solution values ​​of each parameter is less than 0.45%, proving the accuracy of the solution of the present application. The sensitivity error of the solution of the traditional ellipsoid fitting parameters is [1.01332, 0.99348, 1.00722], the zero bias error is [19.869, 24.882, 30.052], and the orthogonality error is [-0.143494, 0.171032, 0.258446]. Compared with the data in this table, the orthogonality error and sensitivity error accuracy solved by the present application are at least improved by one order of magnitude, and the zero bias error is also more accurate.

[0117] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. An ellipsoid fitting three-axis magnetometer error calibration method based on particle swarm optimization, characterized in that The method comprises the following steps: Step (1) constructs the error model of the magnetometer according to the error of the three-axis magnetometer itself: Step (2) establishing a relationship between the error model of the three-axis magnetometer and the general equation of the quadratic surface of the ellipsoid, and converting the error model of the magnetometer into an ellipsoid parameter solution model; Step (3) using the ellipsoid parameter solution model and a particle swarm optimization algorithm to find a set of ellipsoid parameters so that the sum of the squares of the distances from the magnetic field data measured by the three-axis magnetometer to the ellipsoid surface is minimized; Step (4) converts the solved ellipsoid parameters into corresponding zero bias error, sensitivity error and non-orthogonality error through the relationship between the error model and the general equation of the ellipsoid quadratic surface, and brings these three error parameters into the error model of step (1) to complete the calibration of the magnetometer.

2. The error calibration method of a three-axis magnetometer based on ellipsoid fitting by particle swarm optimization according to claim 1, characterized in that: The error model described in step (1) is: B e =M -1 (B m -B0) Among them B e is the actual value of the background magnetic field, B m is the measurement value of the three-axis magnetometer, B0 is the zero bias error of the magnetometer in three axes, M = B k B n is the total transformation matrix, B k is the sensitivity error matrix, B n is the non-orthogonality error matrix, M -1 is the inverse matrix of the matrix M.

3. The error calibration method of a three-axis magnetometer based on ellipsoid fitting and particle swarm optimization according to claim 1, characterized in that: In step (2), the error correction of the magnetometer is performed using the scalar correction method, that is, the three-axis magnetometer is placed in a uniform magnetic field environment without magnetic interference to collect magnetic field data. In this magnetic field environment, the total intensity of the magnetic field is regarded as a constant value within a certain period of time.

4. The error calibration method of a three-axis magnetometer based on ellipsoid fitting and particle swarm optimization according to claim 2, characterized in that: The general equation of the ellipsoidal quadratic surface in step (2) is in the form of: Where β = (v1, v2, v3, v4, v5, v6, v7, v8, v9, v 10 ) T are the ellipsoid parameters that need to be solved, is the magnetic field measurement matrix of the triaxial magnetometer output, B mx , B my , B mz They are the three-axis components in the three-dimensional coordinate system.

5. The error calibration method of a three-axis magnetometer based on ellipsoid fitting and particle swarm optimization according to claim 1, characterized in that: The objective function solved in step (3) is as follows: Where N represents the number of measurement data points of the three-axis magnetometer, B m,i represents the i-th magnetometer measurement value B m The corresponding magnetic field measurement matrix B, B e is the actual value of the background magnetic field, F is the quadratic surface function, and β is the ellipsoid parameter to be solved.

6. The error calibration method of a three-axis magnetometer based on ellipsoid fitting and particle swarm optimization according to claim 5, characterized in that: The constraint conditions are added in the process of particle swarm optimization to ensure that the solved parameters are quadratic surface equations about the ellipsoid.

7. The error calibration method of a three-axis magnetometer based on ellipsoid fitting and particle swarm optimization according to claim 6, characterized in that: The constraints of fitting to an ellipsoid are: C1≠0, C2>0, C1·C3>0, C4<0, where C1=v1+v2+v3 Among them, v1, v2, v3 are the parameters describing the major axis, minor axis, and intermediate axis of the ellipsoid, which are used to solve the sensitivity error in the magnetometer error. v4, v5, and v6 are the parameters of the inclination angle between each two axes of the ellipsoid, which are used to solve the non-orthogonal error in the magnetometer error. v7, v8, and v9 are the parameters of the deviation of the ellipsoid center from the origin of the three-dimensional coordinate system, which are used to solve the zero bias error in the magnetometer error. 10 is a constant term.

8. An electronic device, characterized in that: The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method according to any one of claims 1 to 7.

9. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.