Magnetometer error correction method based on ellipsoid fitting
Through the magnetometer error correction method based on ellipsoid fitting, the magnetometer error model is established and the least squares adjustment method is used to estimate the ellipsoid equation coefficients, which solves the problem of reduced measurement accuracy of the magnetometer in the actual environment and achieves a more accurate Obtain magnetic field information.
Patent Information
- Application Number
- CN202410660863.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-08-23
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The measurement accuracy of existing magnetometers is reduced in the actual environment, mainly due to the process and structure limitations of the device itself and the interference of the surrounding magnetic field. In particular, the ellipse fitting method cannot effectively correct the magnetic field information in three-dimensional space, and the soft and hard magnetic field compensation speed is slow and inefficient. Low.
The magnetometer error correction method based on ellipsoid fitting is adopted. By establishing the magnetometer's own error and soft and hard magnetic characteristics model, the least squares adjustment method is used to estimate the ellipsoid equation coefficients, calculate the calibration matrix and offset vector, and then correct the magnetic force. meter output.
It improves the measurement accuracy of the magnetometer in the actual environment, reduces the impact on device process and structural limitations and surrounding magnetic field interference, and obtains more accurate magnetic field information.
Smart Images

Figure CN118535846A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of magnetometer error correction, and in particular relates to a magnetometer error correction method based on ellipsoid fitting. Background Art
[0002] There is no cumulative error when the MEMS magnetometer is working. In the absence of an interfering magnetic field in the current state, it can measure a constant local magnetic field vector, and use this vector to calculate the heading angle of the carrier. In actual environments, magnetometers are susceptible to the limitations of the device's own process and structure and the interference of the surrounding magnetic field, resulting in reduced measurement accuracy. In order to obtain more accurate magnetic field information, the magnetometer needs to be calibrated. Research solutions related to magnetometer error correction have always been a hot topic in this field.
[0003] However, the ellipse fitting method is limited to a two-dimensional plane and cannot correct the magnetic field information in three-dimensional space; the compensation correction scheme for the magnetometer subjected to soft, hard and iron magnetic fields has the disadvantages of slow speed and low efficiency. In view of the above problems, the present invention proposes a calibration algorithm based on ellipsoid fitting. Summary of the invention
[0004] The purpose of the present invention is to provide a magnetometer error correction method based on ellipsoid fitting in order to solve the above-mentioned problem.
[0005] The technical solution adopted by the present invention is as follows: a magnetometer error correction method based on ellipsoid fitting, the correction method comprising the following steps: S1: First, the error model of the magnetometer is established based on its own error and soft and hard magnetic characteristics; S2: Estimate the ellipsoid equation coefficients by using the least squares adjustment method after ellipsoid fitting; S3: Construct the ellipsoid equation, use the least squares method to calculate the coefficients of the equation, calculate the calibration matrix and offset vector through the ellipsoid fitting method, and obtain the corrected magnetometer output.
[0006] In a preferred embodiment, in step S1, the errors of the magnetometer are divided into two types: one is the error generated during the manufacturing and installation process, including the sensitivity error and zero bias error caused by the inconsistent sensitivity of the three axes of the magnetometer during the manufacturing process, and the three-axis non-orthogonal error caused by the three axes of the magnetometer being non-orthogonal to each other during the installation process. The other is the error caused by the interference of the external electromagnetic environment, including hard magnetic interference and soft magnetic interference.
[0007] In a preferred embodiment, the inter-axis static sensitivity error comes from the fact that the sensitivity of each axis of the three-axis magnetic sensor and the amplification circuit of the measurement signal are not completely the same. The sensitivity matrix K can be used to represent the relationship between the output value of the magnetometer in the ideal state and the actual value.
[94] ,
[0008] In the formula, is the rated sensitivity of the three-axis magnetometer. Ideally, the sensitivity of each axis of the three-axis magnetometer is the rated sensitivity. ; are the sensitivity deviations of the three axes respectively; They are the sensitivities of the three axes respectively.
[0009] Its mathematical model is:
[0010] The matrix form is:
[0011] In the formula, They are the actual outputs of the three-axis magnetometer in the state of sensitivity error; are the theoretical outputs of the three-axis magnetometer.
[0012] In a preferred embodiment, the zero bias error is also called the zero position error, which refers to the error caused by the sensor, analog circuit and A / D conversion zero point not being zero and data offset during data processing during actual operation. Under the premise that the magnetic sensor does not receive any signal, the static operating point changes, causing the original constant output voltage to fluctuate up and down. Since the hard magnetic interference error does not change with time, its actual value is a constant, so it can be equivalent to the zero bias error to a certain extent. Formula (3.4) can be obtained,
[0013] In the formula, They are the actual outputs of the three-axis magnetometer with zero-point error, They are the three-axis pointing bias errors of the magnetometer.
[0014] The error model is rewritten into matrix form: .
[0015] In a preferred embodiment, the three-axis non-orthogonality error During the manufacturing process, the three axes of the magnetometer cannot be completely orthogonal to each other, so non-orthogonal errors will occur. X, Y, and Z represent the vector pointing of the three-axis magnetic sensor in the orthogonal model under ideal conditions, and X1, Y1, and Z1 represent the three-axis pointing under actual conditions.
[0016] Assume that the Z1 axis coincides with the Z axis in the orthogonal model, and the X1OZ1 plane coincides with the XOZ plane. is the angle between the X1 axis in the X1OZ1 plane and the X axis, is the angle between the projection of Y1 on the XOY plane and Y, is the angle between Y1 and XOY plane, and the mathematical model of the non-orthogonal angle of the three-axis magnetometer can be obtained as follows:
[0017] The matrix form is:
[0018] In the formula, They are the actual output values of the three-axis magnetometer with non-orthogonal errors; are the theoretical outputs of the three-axis magnetometer.
[0019] In a preferred embodiment, the hard magnetic interference comes from the magnetized hard magnetic material. This material has a characteristic that after being magnetized, a fixed magnetic field will be generated. Changes in the surrounding magnetic field parameters will neither affect the fixed magnetic field nor change over time. Once this magnetic material is magnetized, even if the external magnetic field is reduced, a large part of the magnetic induction intensity will remain, which is relatively stable. In actual situations, hard magnetic materials are more common in the environment where the carrier is located. The magnetic field strength is related to the type of material and the distance from the magnetic source. The hard magnetic material and the magnetometer are connected to the carrier. No matter what state of motion the carrier is in, the projection on the carrier is unchanged. The material with hard magnetic material has similar properties to permanent magnets. This type of error is relatively easy to remove. The magnetic heading angle can be eliminated after multiple experiments. The magnetometer is slowly rotated in the plane of the axis, and the analysis data is recorded. The maximum value measured is recorded as , the minimum value is recorded as , and the offset of each axis can be obtained according to the formula. When processing data, the hard magnetic interference can be eliminated by removing the offset. .
[0020] In a preferred embodiment, the magnetism of the soft magnetic material depends on the external magnetic field. Once the external magnetic field disappears, its magnetism will also disappear. In addition, the interference caused by soft magnetism is relatively more difficult to eliminate than the interference caused by hard magnetism, and the compensation method is also more complicated. Usually, metals such as nickel or iron will cause soft magnetic interference. This type of error is difficult to eliminate. Before compensation, the hard magnetic interference must be eliminated first, and the origin of the ellipse is returned to (0, 0). To a certain extent, the interference ability of soft magnetism depends on the direction of the magnetometer. The spatial distribution of the data of the magnetometer will be distorted from the surface of the sphere to the ellipsoid due to magnetic interference.
[0021] Determine the angle between the major axis of an ellipse and the horizontal axis using the formula ,
[0022] Make the point vector on the ellipse , the major axis of the ellipse is rotated to the horizontal position by the formula,
[0023] Then scale the major axis of the ellipse to a suitable proportion. When the ellipse is fitted into an approximate circle, the magnetic interference error correction of the soft iron is completed.
[0024] In a preferred embodiment, in step S1, constructing a magnetometer error model includes: The error model is established by considering the manufacturing error in the magnetometer error and the interference of the external environment.
[0025] In the formula, is the theoretical output of the magnetometer; is the actual output of the magnetometer sensor; is the zero position deviation of each axis; Represents the diagonal matrix of sensitivity components; Represents the non-orthogonal relationship matrix of each axis.
[0026] Taking into account the soft and hard magnetic errors in the environment, the model can be obtained as follows:
[0027] In the formula, is the hard magnetic error; is the bias vector; is the coefficient matrix.
[0028] The comprehensive error model is:
[0029] Simplified to,
[0030] In the formula, the matrix is the product of three coefficient matrices, ;matrix Zero deviation and hard magnetic error of and, The effect of sensor noise in the magnetometer on the output value is negligible, so it is ignored in the model. By converting equation (3.14), the output value of the magnetometer with error interference can be calibrated to the true value in the actual magnetic field.
[0031] In the formula, For the matrix The inverse matrix of .
[0032] In a preferred embodiment, in step S3, when the environment remains unchanged, the magnetic field strength sensed by the sensor in each posture is the same. , , When the axes are perpendicular to each other, the magnetometer measures , , The values of the axes can form a sphere in three-dimensional space. However, in the actual working environment, the magnetometer is affected by errors such as scale factor, three-axis non-orthogonality and zero bias, as well as errors such as hard and soft iron in the external environment, making the output data of the three sensitive axes form an ellipsoid whose center deviates from the origin of the coordinate system. [95-96] Therefore, the coordinates of the center of the ellipsoid composed of magnetic flux in three-dimensional space are part of the magnetometer calibration.
[0033] The general form of the quadratic surface equation is,
[0034] Written in matrix form, it simplifies to
[0035] In the formula, the ellipsoid coefficient matrix , the coordinates of the center of the sphere are .
[0036] In a preferred embodiment, in step S3, the essence of using the ellipsoid fitting method to correct the magnetometer error is to calculate the coordinates of the center of the sphere and the coefficients of the ellipsoid equation through the ellipsoid fitting algorithm, fit the center of the sphere to the origin of the coordinate system, and obtain the calibration matrix and offset vector through the obtained coefficients to obtain the true value of the magnetic field intensity to achieve the purpose of correcting the error.
[0037] The ellipsoid equation is constructed from the magnetometer error model.
[0038] In the formula, the matrix ; .
[0039] The linear equations derived from the magnetometer measurement data are:
[0040]
[0041] In the formula, is the residual between the true value of the magnetic field and the measured value of the magnetometer, when the magnetometer is not disturbed by any interference ; ; is the coefficient matrix of the ellipsoid equation .
[0042] Finally, the residual The minimum is the minimum sum of the squares of the distances between the original data collected by the magnetometer and the ellipsoid surface. The least squares estimation method is used to obtain the coefficients of the ellipsoid equation.
[0043] Therefore, the calibration matrix can be obtained and the offset vector .
[0044] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are: In the present invention, firstly, an error model of a magnetometer is established according to its own error and soft and hard magnetic properties, and the coefficients of the ellipsoid equation are estimated by using a least square adjustment method after ellipsoid fitting, so as to obtain a calibrated magnetic field intensity value, so that the magnetometer will not be easily restricted by the process and structure of the device itself and the interference of the surrounding magnetic field in an actual environment, thereby improving the measurement accuracy of the entire magnetometer, and more accurate magnetic field information can be obtained when the magnetometer is used. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 The present invention is a flow chart of a magnetometer error correction method based on ellipsoid fitting. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0047] Reference Figure 1 , Example
[0048] A magnetometer error correction method based on ellipsoid fitting is firstly to establish its error model according to the magnetometer's own error and soft and hard magnetic characteristics. After ellipsoid fitting, the ellipsoid equation coefficients are estimated by the least square adjustment method to obtain the calibrated magnetic field intensity value. The specific steps are as follows: (1) Analyze the types of magnetometer errors; There are two types of errors in magnetometers. The first is the error caused during the manufacturing and installation process, including the sensitivity error and zero bias error caused by the inconsistent sensitivity of the three axes of the magnetometer during the manufacturing process, and the three-axis non-orthogonality error caused by the non-orthogonality of the three axes of the magnetometer during the installation process. The second is the error caused by interference from the external electromagnetic environment, including hard magnetic interference and soft magnetic interference.
[93] .
[0049] 1) Sensitivity error In the actual application of the three-axis magnetometer, it is necessary to measure the projection components of the magnetic field on the three axes. The three-axis characteristics of the magnetometer are not exactly the same, and the errors between the three are proportional. The inter-axis static sensitivity error comes from the sensitivity of the axes of the three-axis magnetic sensor and the amplification circuit of the measurement signal are not exactly the same. The sensitivity matrix K can be used to represent the relationship between the output value of the magnetometer in the ideal state and the actual value.
[94] ,
[0050] In the formula, is the rated sensitivity of the three-axis magnetometer. Ideally, the sensitivity of each axis of the three-axis magnetometer is the rated sensitivity. ; are the sensitivity deviations of the three axes respectively; They are the sensitivities of the three axes respectively.
[0051] Its mathematical model is:
[0052] The matrix form is:
[0053] In the formula, They are the actual outputs of the three-axis magnetometer in the state of sensitivity error; are the theoretical outputs of the three-axis magnetometer.
[0054] 2) Zero bias error Zero bias error, also known as zero position error, refers to the error caused by the sensor, analog circuit and A / D conversion zero point not being zero and data offset during data processing during actual operation. Under the premise that the magnetic sensor does not receive any signal, the static operating point changes, causing the original constant output voltage to fluctuate. Since the hard magnetic interference error does not change with time, its value is actually a constant, so it can be equivalent to zero bias error to a certain extent. Formula (3.4) can be obtained,
[0055] In the formula, They are the actual outputs of the three-axis magnetometer with zero-point error, They are the three-axis pointing bias errors of the magnetometer.
[0056] The error model is rewritten into matrix form:
[0057] 3) Three-axis non-orthogonality error During the manufacturing process, the three axes of the magnetometer cannot be completely orthogonal to each other, so non-orthogonal errors will occur. X, Y, and Z represent the vector pointing of the three-axis magnetic sensor in the orthogonal model under ideal conditions, and X1, Y1, and Z1 represent the three-axis pointing under actual conditions.
[0058] Assume that the Z1 axis coincides with the Z axis in the orthogonal model, and the X1OZ1 plane coincides with the XOZ plane. is the angle between the X1 axis in the X1OZ1 plane and the X axis, is the angle between the projection of Y1 on the XOY plane and Y, is the angle between Y1 and XOY plane, and the mathematical model of the non-orthogonal angle of the three-axis magnetometer can be obtained as follows:
[0059] The matrix form is:
[0060] In the formula, They are the actual output values of the three-axis magnetometer with non-orthogonal errors; are the theoretical outputs of the three-axis magnetometer.
[0061] 4) Errors caused by external environment The surrounding environment of the magnetometer when it is working is generally more complex, and the magnetometer needs to be fixed on a moving carrier. The final magnetic field environment is generally composed of the geomagnetic field plus multiple surrounding magnetic fields. If you want to get an accurate heading value in the end, you need to compensate for the external magnetic field interference. Generally, there are two types of materials that cause interference: hard magnetic materials and soft magnetic materials.
[0062] Hard magnetic interference comes from magnetized hard magnetic materials. This material has a characteristic that after being magnetized, it will generate a fixed magnetic field. Changes in the surrounding magnetic field parameters will neither affect this fixed magnetic field nor change over time. Once this magnetic material is magnetized, even if the external magnetic field is reduced, a large part of the magnetic induction intensity will remain, which is relatively stable. In actual situations, hard magnetic materials are more common in the environment where the carrier is located. The magnetic field strength is related to the type of material and the distance from the magnetic source. The hard magnetic material and the magnetometer are connected to the carrier. No matter what state of motion the carrier is in, the projection on the carrier is unchanged. Materials with hard magnetic materials have similar properties to permanent magnets. This type of error is relatively easy to remove. The magnetic heading angle can be eliminated after multiple experiments. The magnetometer is slowly rotated in the plane of its axis, and the analysis data is recorded and the maximum value measured is recorded as , the minimum value is recorded as , and the offset of each axis can be obtained according to the formula. When processing data, the hard magnetic interference can be eliminated by removing the offset.
[0063] In contrast to hard magnetic materials, soft magnetic materials do not have magnetic properties and do not generate magnetic fields. This magnetic field will change over time, but it can be magnetized by the surrounding magnetic field to generate a magnetic field. Soft magnetic materials are easily magnetized and their magnetism is unstable. The magnetic field magnetization of soft magnetic materials is mainly related to the interaction with the external magnetic field and the properties of the material itself. The direction and size of the magnetic field are different, and the magnetism of the corresponding soft magnetic material will also change. The magnetism of soft magnetic materials depends on the external magnetic field. Once the external magnetic field disappears, its magnetism will also disappear. In addition, the interference generated by soft magnetic materials is relatively more difficult to eliminate than the interference generated by hard magnetic materials, and the compensation method is also more complicated. Usually, metals such as nickel or iron will cause soft magnetic interference. This type of error is difficult to eliminate. Before compensation, the hard magnetic interference must be eliminated first, and the origin of the ellipse is returned to (0,0). To a certain extent, the interference ability of soft magnetic depends on the direction of the magnetometer. The spatial distribution of the data of the magnetometer will be distorted from the surface of the sphere to the ellipsoid due to magnetic interference.
[0064] Determine the angle between the major axis of an ellipse and the horizontal axis using the formula ,
[0065] Make the point vector on the ellipse , the major axis of the ellipse is rotated to the horizontal position by the formula,
[0066] Then scale the major axis of the ellipse to a suitable proportion. When the ellipse is fitted into an approximate circle, the magnetic interference error correction of the soft iron is completed.
[0067] (2) Construct a magnetometer error model; The error model is established by considering the manufacturing error in the magnetometer error and the interference of the external environment.
[0068] In the formula, is the theoretical output of the magnetometer; is the actual output of the magnetometer sensor; is the zero position deviation of each axis; Represents the diagonal matrix of sensitivity components; Represents the non-orthogonal relationship matrix of each axis.
[0069] Taking into account the soft and hard magnetic errors in the environment, the model can be obtained as follows:
[0070] In the formula, is the hard magnetic error; is the bias vector; is the coefficient matrix.
[0071] The comprehensive error model is:
[0072] Simplified to,
[0073] In the formula, the matrix is the product of three coefficient matrices, ;matrix Zero deviation and hard magnetic error of and, The effect of sensor noise in the magnetometer on the output value is negligible, so it is ignored in the model. By converting equation (3.14), the output value of the magnetometer with error interference can be calibrated to the true value in the actual magnetic field.
[0074] In the formula, For the matrix The inverse matrix of .
[0075] (3) Construct the ellipsoid equation, use the least squares method to calculate the coefficients of the equation, calculate the calibration matrix and offset vector through the ellipsoid fitting method, and obtain the corrected magnetometer output; In the case of unchanged environment, the magnetic field strength sensed by the sensor in each posture is the same. , , When the axes are perpendicular to each other, the magnetometer measures , , The values of the axes can form a sphere in three-dimensional space. However, in the actual working environment, the magnetometer is affected by errors such as scale factor, three-axis non-orthogonality and zero bias, as well as errors such as hard and soft iron in the external environment, making the output data of the three sensitive axes form an ellipsoid whose center deviates from the origin of the coordinate system. [95-96] Therefore, the coordinates of the center of the ellipsoid composed of magnetic flux in three-dimensional space are part of the magnetometer calibration.
[0076] The general form of the quadratic surface equation is,
[0077] Written in matrix form, it simplifies to
[0078] In the formula, the ellipsoid coefficient matrix , the coordinates of the center of the sphere are .
[0079] The essence of using the ellipsoid fitting method to correct the magnetometer error is to calculate the coordinates of the center of the sphere and the coefficients of the ellipsoid equation through the ellipsoid fitting algorithm, fit the center of the sphere to the origin of the coordinate system, and obtain the calibration matrix and offset vector through the obtained coefficients to obtain the true value of the magnetic field intensity to achieve the purpose of correcting the error.
[0080] The ellipsoid equation is constructed from the magnetometer error model.
[0081] In the formula, the matrix ; .
[0082] The linear equations derived from the magnetometer measurement data are:
[0083]
[0084] In the formula, is the residual between the true value of the magnetic field and the measured value of the magnetometer, when the magnetometer is not disturbed by any interference ; ; is the coefficient matrix of the ellipsoid equation .
[0085] Finally, the residual The minimum is the minimum sum of the squares of the distances between the original data collected by the magnetometer and the ellipsoid surface. The least squares estimation method is used to obtain the coefficients of the ellipsoid equation.
[0086] Therefore, the calibration matrix can be obtained and the offset vector .
[0087] The least squares method is a mathematical optimization technique that determines the best function match for data by minimizing the sum of squares of errors. This method can be used to quickly solve unknown data so that the sum of squares of the difference between the solved data and the actual data is minimized. This method can also be applied to other optimization problems such as curve fitting.
[0088] The common function model is the linear function model. The simplest model is , the matrix form is:
[0089] The parameter solution of this formula is,
[0090]
[0091]
[0092] When there are several uncorrelated model variables , can be composed into a linear function,
[0093] That is, the system of equations is expressed as,
[0094] The derived linear squared difference calculation is of the form: , the optimal solution is: .
[0095] Verification results: Then, the feasibility of the algorithm was verified by using the magnetic sensor carried by the Mti-G-710 MEMS inertial measurement module. The sensor performance indicators are shown in Table 1.
[0096] Table 1 Performance indicators of Mti-G-710 built-in magnetometer parameter Magnetometer Resolution 0.25mG Nonlinear 0.2% Standard full scale + / -8G Total RMS noise 0.5mG The measurement module is rotated arbitrarily in three-dimensional space, its magnetometer data is collected and the entire ellipsoid surface is covered as much as possible, and the coefficients of the fitting ellipsoid equation are calculated using the least squares algorithm, that is, .
[0097] So the calibration matrix and the offset vector , , .
[0098] Substituting the above two matrix values into the magnetometer output calculation formula, the MEMS magnetometer output value corrected by the ellipsoid fitting algorithm is calculated. It can be seen that the origin of the ellipsoid calculated by the original data in the coordinate system deviates from the origin of the coordinate system, and the origin of the ellipsoid calculated by the data for error correction using ellipsoid fitting is closer to the origin of the coordinate system. Table 2 shows the coordinates of the centers of the two spheres calculated according to the ellipsoid parameters for the two sets of data, which more intuitively reflects the reliability of the algorithm.
[0099] Table 2 Absolute values of spherical center coordinates before and after correction x y z Before calibration 0.0026 0.0302 0.2367 After correction 0.0002 0.0007 0.0100 The magnetic field strength modulus values of the two sets of data were calculated and compared. The fluctuation of the magnetic field strength modulus value after algorithm correction was much smaller than that of the magnetic field strength modulus value of the original data. The standard deviation was introduced to quantify the experimental results. The standard deviation of the magnetic field strength after correction was 0.0519, which was much smaller than the standard deviation of the magnetic field strength before correction, 0.1462. The above verified the feasibility and reliability of the present invention.
[0100] In the present invention, firstly, an error model of a magnetometer is established according to its own error and soft and hard magnetic properties, and the coefficients of the ellipsoid equation are estimated by using a least square adjustment method after ellipsoid fitting, so as to obtain a calibrated magnetic field intensity value, so that the magnetometer will not be easily restricted by the process and structure of the device itself and the interference of the surrounding magnetic field in an actual environment, thereby improving the measurement accuracy of the entire magnetometer, and more accurate magnetic field information can be obtained when the magnetometer is used.
[0101] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0102] The above description enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A magnetometer error correction method based on ellipsoid fitting, Features: The calibration method comprises the following steps: S1: Establish the error model of the magnetometer according to its own error and soft and hard magnetic characteristics; S2: Use the magnetometer error model to form the ellipsoid equation; S3: After constructing the ellipsoid equation, the least square method is used to calculate the coefficients of the equation. The coordinates of the center of the sphere and the coefficients of the ellipsoid equation are calculated through the ellipsoid fitting algorithm. The center of the sphere is fitted to the origin of the coordinate system. The calibration matrix and offset vector are obtained through the obtained coefficients to obtain the true value of the magnetic field intensity and thus achieve the correction error. In step S1, constructing a magnetometer error model includes: The error model is established by considering the manufacturing error in the magnetometer error and the interference of the external environment. In the formula, is the theoretical output of the magnetometer; is the actual output of the magnetometer sensor; is the zero position deviation of each axis; Represents the diagonal matrix of sensitivity components; Represents the non-orthogonal relationship matrix of each axis; Taking into account the soft and hard magnetic errors in the environment, the model can be obtained as follows: In the formula, is the hard magnetic error; is the bias vector; is the coefficient matrix; The comprehensive error model is: Simplified to, In the formula, the matrix is the product of three coefficient matrices, ;matrix Zero deviation and hard magnetic error of and, ; The effect of sensor noise in the magnetometer on the output value is negligible, so it is ignored in the model; by converting equation (3.14), the output value of the magnetometer with error interference can be calibrated to the true value in the actual magnetic field, In the formula, For the matrix The inverse matrix of .
2. A magnetometer error correction method based on ellipsoid fitting as claimed in claim 1, Features: In step S1, the errors of the magnetometer are divided into two types: one is the error generated during the manufacturing and installation process, including the sensitivity error and zero bias error caused by the inconsistent sensitivity of the three axes of the magnetometer during the manufacturing process, and the three-axis non-orthogonality error caused by the non-orthogonality of the three axes of the magnetometer during the installation process; the other is the error caused by the interference of the external electromagnetic environment, including hard magnetic interference and soft magnetic interference.
3. A magnetometer error correction method based on ellipsoid fitting as claimed in claim 2, Features: The inter-axis static sensitivity error comes from the fact that the sensitivity of each axis of the three-axis magnetic sensor and the amplification circuit of the measurement signal are not completely the same. The sensitivity matrix K can be used to represent the relationship between the output value of the magnetometer in the ideal state and the actual value. In the formula, is the rated sensitivity of the three-axis magnetometer. Ideally, the sensitivity of each axis of the three-axis magnetometer is the rated sensitivity. ; are the sensitivity deviations of the three axes respectively; They are the sensitivities of the three axes respectively; Its mathematical model is: The matrix form is: In the formula, They are the actual outputs of the three-axis magnetometer in the state of sensitivity error; are the theoretical outputs of the three-axis magnetometer.
4. The magnetometer error correction method based on ellipsoid fitting as claimed in claim 2, Features: The zero bias error is also called the zero position error, which refers to the error caused by the sensor, analog circuit and A / D conversion zero point is not zero and the data offset during data processing in the actual operation process. Under the premise that the magnetic sensor does not receive any signal, the static working point changes, causing the original constant output voltage to fluctuate up and down. Since the hard magnetic interference error does not change with time, its actual value is a constant, so it can be equivalent to the zero bias error to a certain extent. Formula (3.4) can be obtained. In the formula, They are the actual outputs of the three-axis magnetometer with zero-point error, They are the three-axis pointing bias errors of the magnetometer respectively; The error model is rewritten into matrix form: 。 5. The magnetometer error correction method based on ellipsoid fitting as claimed in claim 2, Features: The three-axis non-orthogonality error is caused by the fact that the three axes of the magnetometer cannot be completely orthogonal to each other during the manufacturing process, so non-orthogonality error will occur. X, Y, and Z represent the vector orientation of the three-axis magnetic sensor in the orthogonal model under ideal conditions. 1 , Y 1 , Z 1 Indicates the three-axis orientation in actual conditions; Assume Z 1 The axis coincides with the Z axis in the orthogonal model, and the X 1 OZ 1 The face coincides with the XOZ plane, For X 1 Axis in X 1 OZ 1 The angle between the surface and the X-axis, Y 1 The angle between the projection on the XOY plane and Y, Y 1 The angle with the XOY plane can be obtained, and the mathematical model of the non-orthogonal angle of the three-axis magnetometer is: The matrix form is: In the formula, They are the actual output values of the three-axis magnetometer with non-orthogonal errors; are the theoretical outputs of the three-axis magnetometer.
6. A magnetometer error correction method based on ellipsoid fitting as claimed in claim 2, Features: The hard magnetic interference comes from the magnetized hard magnetic material. This material has a characteristic that it will generate a fixed magnetic field after being magnetized. Changes in the surrounding magnetic field parameters will neither affect this fixed magnetic field nor change with time. Once this magnetic material is magnetized, even if the external magnetic field is reduced, a large part of the magnetic induction intensity will remain, which is relatively stable. In actual situations, hard magnetic materials are more common in the environment where the carrier is located. The magnetic field intensity is related to the type of material and the distance from the magnetic source. The hard magnetic material and the magnetometer are connected to the carrier. No matter what state of motion the carrier is in, the projection on the carrier is unchanged. Materials with hard magnetic materials have similar properties to permanent magnets. This type of error is easier to remove. The magnetic heading angle can be eliminated after multiple experiments. The magnetometer is slowly rotated in the plane of its axis, and the analysis data is recorded. The maximum value measured is recorded as , the minimum value is recorded as , and the offset of each axis can be obtained according to the formula. When processing data, the hard magnetic interference can be eliminated by removing the offset. 。 7. The magnetometer error correction method based on ellipsoid fitting as claimed in claim 1, Features: The magnetism of the soft magnetic material is dependent on the external magnetic field. Once the external magnetic field disappears, its magnetism will also disappear. In addition, the interference caused by soft magnetism is relatively more difficult to eliminate than the interference caused by hard magnetism, and the compensation method is also more complicated. Usually, metals such as nickel or iron will cause soft magnetic interference. This type of error is difficult to eliminate. Before compensation, the hard magnetic interference must be eliminated first, and the origin of the ellipse is returned to (0, 0). To a certain extent, the interference ability of soft magnetism depends on the direction of the magnetometer. The data space distribution of the magnetometer will be distorted from the surface of a sphere to an ellipsoid due to magnetic interference. Determine the angle between the major axis of an ellipse and the horizontal axis using the formula , Make the point vector on the ellipse , the major axis of the ellipse is rotated to the horizontal position by the formula, Then scale the major axis of the ellipse to a suitable proportion. When the ellipse is fitted into an approximate circle, the magnetic interference error correction of the soft iron is completed.
8. The magnetometer error correction method based on ellipsoid fitting as claimed in claim 1, Features: In step S3, when the environment remains unchanged, the magnetic field strength sensed by the sensor in each posture is the same; when there is no deviation and the sensor is internal , , When the axes are perpendicular to each other, the magnetometer measures , , The values of the axes can form a sphere in three-dimensional space; however, the magnetometer in the actual working environment is affected by errors such as scale factor, three-axis non-orthogonality and zero bias, as well as errors such as hard and soft iron in the external environment, so that the output data of the three sensitive axes form an ellipsoid with the center deviating from the origin of the coordinate system. [95-96] ; Therefore, the coordinates of the center of the ellipsoid composed of magnetic flux in three-dimensional space are part of the magnetometer calibration; The general form of the quadratic surface equation is, Written in matrix form, it simplifies to In the formula, the ellipsoid coefficient matrix , the coordinates of the center of the sphere are .
9. The magnetometer error correction method based on ellipsoid fitting as claimed in claim 1, Features: In step S3, the essence of using the ellipsoid fitting method to correct the magnetometer error is to calculate the coordinates of the sphere center and the ellipsoid equation coefficients through the ellipsoid fitting algorithm, fit the sphere center to the origin of the coordinate system, and obtain the calibration matrix and offset vector through the obtained coefficients to obtain the true value of the magnetic field intensity to achieve the purpose of correcting the error; The ellipsoid equation is constructed from the magnetometer error model. In the formula, the matrix ; ; The linear equations derived from the magnetometer measurement data are: In the formula, is the residual between the true value of the magnetic field and the measured value of the magnetometer, when the magnetometer is not disturbed by any interference ; ; is the coefficient matrix of the ellipsoid equation ; Finally, the residual The minimum is taken as the criterion, and the minimum sum of the squares of the distances between the original data collected by the magnetometer and the ellipsoid surface is used to obtain the coefficients of the ellipsoid equation using the least squares estimation method. Therefore, the calibration matrix can be obtained and the offset vector .
Citation Information
Patent Citations
Three-axis magnetic sensor error compensation method based on sampling point weight adaptive distribution
CN115420305A
Magnetic sensor correction method and system based on INS / GNSS integrated navigation assistance
CN115507849A
Three-axis magnetometer correction method based on coordinate system transformation matrix
CN117491933A
Cited By
Magnetometer calibration method for optimizing ellipsoid fitting based on Pauta criterion
CN119619949A
Magnetometer external parameter calibration method, system and device of electronic device and storage medium
CN120703660A
Magnetometer extrinsic calibration method, system, device and storage medium of electronic device
CN120703660B
Magnetic mineral detection method based on mobile terminal and related device
CN120802360A
Magnetoresistive sensor calibration method and system and electronic equipment
CN122194034A
