A method and system for estimating a magnetic interference compensation coefficient
By constructing a ridge regression objective function with prior means and a Kalman filter algorithm, the problem of compensation instability in traditional magnetic interference compensation methods under complex environments is solved, achieving high-precision and robust magnetic interference compensation, adapting to dynamically changing magnetic field environments, and improving the accuracy and stability of geomagnetic vector measurement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA UNIV OF GEOSCIENCES (WUHAN)
- Filing Date
- 2026-03-25
- Publication Date
- 2026-07-07
Smart Images

Figure CN122345388A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of magnetic interference compensation coefficient estimation technology, and more specifically, relates to a method and system for estimating magnetic interference compensation coefficient. Background Technology
[0002] Geomagnetic measurement systems are widely used in navigation and attitude estimation for platforms such as rotary-wing UAVs. Traditional geomagnetic interference compensation methods are often based on the Tolles-Lawson (TL) model, which models magnetic interference using 18 linear basis functions. The TL model considers interferences such as constant magnetic fields, induced magnetic fields, and eddy current magnetic fields. However, due to the high linear correlation between variables in the model, the compensation coefficient estimation is often unstable, especially when dealing with complex environments or changing magnetic field conditions. When attitude coverage is insufficient, the flight path is singular, or sensor noise increases, the regression matrix is prone to ill-conditioned behavior, causing the compensation coefficients to be highly sensitive to noise, resulting in coefficient oscillations or drifts, which in turn affects the compensation accuracy and cross-condition generalization.
[0003] In existing technologies, the least squares method is commonly used to estimate compensation coefficients, but this method is prone to overfitting or instability when faced with multicollinearity. To address this issue, ridge regression has been proposed as a regularization method, capable of stabilizing the least squares solution by incorporating a regularization term during the solution process. Although ridge regression can alleviate the multicollinearity problem, it still cannot adapt to dynamically changing magnetic field environments. Furthermore, traditional ridge regression typically uses the zero vector as the prior mean, and while its regularization can stabilize the solution, it fails to reflect the physical structural constraints that the magnetic compensation coefficients should satisfy, thus potentially leading to insufficient generalization when dealing with changes in site or operating conditions.
[0004] Therefore, improving the robustness and accuracy of magnetic interference compensation methods under different working conditions is an urgent problem to be solved. Summary of the Invention
[0005] In view of the shortcomings of the prior art, the purpose of this application is to provide a method and system for estimating the magnetic interference compensation coefficient, which can effectively improve the robustness and compensation accuracy of the magnetic interference compensation method under different working conditions.
[0006] To achieve the above objectives, in a first aspect, this application provides a method for estimating the magnetic interference compensation coefficient, comprising the following steps: S10, acquire magnetic field measurement data and attitude measurement data during carrier motion; S20, construct a geomagnetic vector measurement model, rewrite the geomagnetic vector measurement model into a linear regression form, establish a state space equation with compensation coefficients as state variables, construct a single-time joint observation matrix and measurement vector based on the state space equations, the compensation coefficients include an induced magnetic field interference coefficient matrix and a fixed magnetic field interference vector; S30, based on the magnetic field measurement data and attitude measurement data, the single-time joint observation matrix at multiple times is stacked, and the measurement vectors at multiple times are stacked to construct a regularized objective function with prior mean. The prior estimate of the compensation coefficient is obtained by solving the ridge regression problem, and the prior error covariance matrix is constructed according to the training residual and information matrix. The prior mean is preset according to the physical structure of the compensation coefficient. The physical structure includes setting the diagonal elements of the induced magnetic field interference coefficient matrix to 1 and the off-diagonal elements to 0, and setting the fixed magnetic field interference vector to 0. S40, using the prior estimate and prior error covariance matrix as the initial state variables and initial error covariance matrix of the Kalman filter, execute the prediction and update steps of the Kalman filter, and iteratively calculate the posterior estimate of the compensation coefficient.
[0007] As a further preferred embodiment, in step S10, the method for obtaining the magnetic field measurement data and attitude measurement data during the carrier's movement is as follows: the attitude sensor, triaxial magnetic sensor, power supply, host computer, and data acquisition module are placed on the carrier to form a geomagnetic vector measurement device. The carrier moves around a circle once in the experimental site, and the magnetic field data and corresponding attitude data are collected as training set data; it moves around a circle again once, and the magnetic field data and corresponding attitude data are collected as validation set data.
[0008] As a further preferred embodiment, in step S20, the geomagnetic vector measurement model is: ,in These are the three components of the geomagnetic field in the carrier coordinate system. The output magnetic field vector of the triaxial magnetic sensor. B p For a fixed magnetic field vector, K This is the matrix of interference coefficients for the induced magnetic field; The geomagnetic vector measurement model can be rewritten in linear regression form as follows: For Transpose and transform both sides to obtain Then As a state quantity Establish state equations The number of measurement points is n = 1, 2, 3, ... N , N This represents the maximum number of measurement points. These are the three components of the geomagnetic field in the carrier coordinate system; A 3×1 fixed magnetic field vector; a 4×3 vector This is process noise.
[0009] As a further preferred embodiment, in step S20, the formula for calculating the measurement vector is: , where the measurement vector It is a 1×3 matrix, the measurement matrix It is a 1×4 matrix. The measurement noise is 1×3. For state variables; The formula for calculating the single-time joint observation matrix is as follows: ,in, I 3 is the 3rd order identity matrix.
[0010] As a further preferred embodiment, in step S30, the regularization objective function with prior mean is:
[0011] In the formula, These are prior estimates; The state quantity is vectorized; The prior mean vector; This is the result of stacking measurement vectors from multiple time points; This is the result of stacking single-time joint observation matrices from multiple time points; This is a regularized weight matrix.
[0012] As a further preferred option, the regularized weight matrix It is a diagonal matrix, and weights are assigned according to the grouping of compensation coefficients: the off-diagonal elements of the induced magnetic field interference coefficient matrix are assigned a first weight value, the diagonal elements of the induced magnetic field interference coefficient matrix are assigned a second weight value, and the three components of the fixed magnetic field interference vector are assigned a third weight value. The first weight value is greater than the second weight value, and the second weight value is greater than the third weight value.
[0013] As a further preferred embodiment, in step S30, the prior estimate is... The solution method is as follows:
[0014] In the formula, These are prior estimates; The prior mean vector; This is the result of stacking measurement vectors from multiple time points; This is the result of stacking single-time joint observation matrices from multiple time points; This is a regularized weight matrix.
[0015] As a further preferred embodiment, in step S30, the prior error covariance matrix is constructed as follows: defining the training residuals... ,Pick ,in To train the residual variance, Let be the prior error covariance matrix. This is the result of stacking measurement vectors from multiple time points. This is a stacked result of single-time joint observation matrices from multiple time points. This is a regularized weight matrix. These are prior estimates. N This represents the maximum number of measurement points.
[0016] As a further preferred embodiment, in step S40, the iterative step of the Kalman filter specifically includes: prior estimation Prior error covariance Kalman filter gain ; Posterior estimation Update error covariance ; In the formula, For the first n The prior state estimate at time 1; For the first n The prior error covariance matrix at time t; Q The process noise covariance matrix; R To measure the noise covariance matrix, ; For the first n The observation matrix at time points; For the first n The measured vector at time; I 12 It is a 12th-order identity matrix.
[0017] Secondly, this application provides a magnetic interference compensation coefficient estimation system for implementing the method described in any one of the above, comprising: The data acquisition module is used to acquire magnetic field measurement data and attitude measurement data during the movement of the carrier; The model building module is used to construct a geomagnetic vector measurement model, rewrite the geomagnetic vector measurement model into a linear regression form, establish a state space equation with compensation coefficients as state variables, and construct a single-time joint observation matrix and measurement vector based on the state space equations. The compensation coefficients include an induced magnetic field interference coefficient matrix and a fixed magnetic field interference vector. The prior estimation module is used to stack the single-time joint observation matrix at multiple times and the measurement vector at multiple times based on the magnetic field measurement data and attitude measurement data, construct a regularized objective function with prior mean, obtain the prior estimate of the compensation coefficient by solving the ridge regression problem, and construct the prior error covariance matrix based on the training residual and information matrix. The prior mean is preset according to the physical structure of the compensation coefficient. The physical structure includes setting the diagonal elements of the induced magnetic field interference coefficient matrix to 1 and the off-diagonal elements to 0, and setting the fixed magnetic field interference vector to 0. The posterior update module is used to take the prior estimate and the prior error covariance matrix as the initial state variables and initial error covariance matrix of the Kalman filter, execute the prediction and update steps of the Kalman filter, and iteratively calculate the posterior estimate of the compensation coefficient.
[0018] Compared with existing magnetic interference compensation technologies, this application has several significant advantages: First, this application sets a prior mean based on the physical structural characteristics of magnetic interference, and constructs a ridge regression objective function through a grouping weighting regularization strategy. It applies strong constraints to the off-diagonal coupling terms of the induced magnetic field interference coefficient matrix and weak constraints to the diagonal terms and the fixed magnetic field interference vector. This not only limits the compensation coefficients to a physically reasonable range and effectively suppresses coefficient drift and oscillation caused by ill-conditioned regression matrix and multicollinearity, but also retains the data-driven parameter fine-tuning capability, thus solving the defect that the traditional ridge regression zero prior mean cannot fit the physical characteristics of magnetic interference. Secondly, this application uses the ridge regression estimation results with physical structure prior as the initial state quantity and initial error covariance matrix of Kalman filtering, which avoids the problems of filter divergence and slow parameter convergence caused by unreasonable initial value setting in traditional Kalman filtering, and greatly improves the stability of coefficient estimation under harsh conditions such as small sample size, high noise, and insufficient attitude coverage. Thirdly, this application addresses the practical engineering characteristics of triaxial magnetic sensors where the measurement noise of each axis is independent and the noise characteristics differ. The measurement noise covariance matrix R adopts a diagonal form of the variances of each axis, achieving accurate modeling of the sensor noise distribution. This significantly improves the matching degree between noise modeling and actual working conditions, effectively avoiding the problems of filter gain mismatch and large parameter estimation deviations caused by traditional unified noise variance modeling. It effectively improves the robustness and compensation accuracy of the magnetic interference compensation method under different working conditions. Verified through multi-site, cross-condition experiments, this application can achieve stable magnetic interference compensation in various scenarios, including consistent training and testing conditions, cross-geographical locations, and different noise levels. The compensated geomagnetic vector more closely matches the theoretical standard value, and the RMSE is significantly lower than that of the traditional Kalman filtering method. It possesses strong engineering practicality and generalization ability, providing a high-precision, highly robust magnetic interference compensation solution for geomagnetic measurements in scenarios such as UAVs and carrier navigation. Attached Figure Description
[0019] Figure 1 This is an overall design flowchart of the solution provided in the embodiments of this application; Figure 2 This is a schematic diagram of the ridge regression-Kalman filter algorithm provided in the embodiments of this application; Figure 3 This is a schematic diagram of the device connection provided in the embodiments of this application; Figure 4This is the magnetic field graph after magnetic interference compensation provided by the Wuhan training set Ling prior Kalman filter algorithm in the embodiments of this application; Figure 5 This is the magnetic field graph after magnetic interference compensation using the ordinary Kalman filter algorithm on the Wuhan training set provided in this application embodiment; Figure 6 This application provides an embodiment of the magnetic field graph obtained after magnetic interference compensation using the Wuhan verification Jiling a priori Kalman filter algorithm. Figure 7 This is a magnetic field graph after magnetic interference compensation using the ordinary Kalman filter algorithm on the Wuhan verification set provided in this application embodiment; Figure 8 This is a comparison chart of the RMSE of the Wuhan training set provided in the embodiments of this application; Figure 9 This is a comparison chart of RMSE of the Wuhan verification set provided in the embodiments of this application; Figure 10 This is the magnetic field graph after magnetic interference compensation using the Qingdao Jiling a priori Kalman filter algorithm provided in this application embodiment; Figure 11 This is a magnetic field graph after magnetic interference compensation using the ordinary Kalman filter algorithm on the Qingdao verification set provided in this application embodiment; Figure 12 This is a comparison chart of RMSE of the Qingdao verification set provided in the embodiments of this application; Figure 13 This is the magnetic field graph after magnetic interference compensation using the Sanya verification Jiling a priori Kalman filter algorithm provided in this application embodiment; Figure 14 This is a magnetic field graph after magnetic interference compensation using a common Kalman filter algorithm on the Sanya verification set provided in this application embodiment; Figure 15 This is a comparison chart of the RMSE of the Sanya verification set provided in the embodiments of this application. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0021] This application provides a T-L magnetic interference compensation method based on ridge regression prior Kalman filtering. The overall design flow of the implementation scheme is as follows: Figure 1 As shown: Step 1: Obtain the latitude and longitude of the experimental site, and use the IGRF model to calculate the geomagnetic field vector value in the geographic coordinate system of the experimental site as the standard geomagnetic field value of the experimental site.
[0022] The latitude and longitude information of the experimental site was obtained, and combined with the geographical location parameters at the time of the experiment, it was input into the International Geomagnetic Reference Field (IGRF) model to calculate the geomagnetic field vector value of the experimental site in the geographic coordinate system. This value was then used as the standard geomagnetic field value for the experimental site. The standard geomagnetic field value is used to characterize the theoretical geomagnetic field distribution of the experimental site under carrier-free magnetic interference conditions, and serves as a reference benchmark for subsequent construction of the geomagnetic vector measurement model and magnetic interference compensation.
[0023] Step 2: The carrier moves in a circle around the experimental site for one revolution, and the magnetic field and corresponding attitude data are measured using a triaxial magnetic sensor and an attitude sensor.
[0024] A geomagnetic vector measurement device is constructed by placing an attitude sensor, a triaxial magnetometer, a power supply, a host computer, and a data acquisition module on a carrier, as shown in the schematic diagram. Figure 3 As shown.
[0025] The attitude sensor's y-axis points towards the front of the carrier, its x-axis points to the right side of the carrier, and its z-axis is perpendicular to the carrier and points upwards. The triaxial magnetometer's x-axis is aligned with the attitude sensor's x-axis, and its y-axis is aligned with the attitude sensor's z-axis, but in the opposite direction. The z-axis is aligned with the attitude sensor's y-axis. The carrier moves in a circle around the experimental site once, collecting magnetic field data and corresponding attitude data as training data. It then moves in a circle again once, collecting magnetic field data and corresponding attitude data as validation data.
[0026] Step 3: Construct a geomagnetic vector measurement model.
[0027] The magnetic fields generated by the carrier during its movement mainly consist of fixed magnetic fields and induced magnetic fields: 1) Fixed Magnetic Field: The carrier is often constructed using a large amount of ferromagnetic materials, which will become magnetized under the influence of an external magnetic field. When the external magnetic field is removed, this magnetism will not completely disappear; this is called residual magnetism. The magnetic field generated by this residual magnetism will not change with the carrier's attitude and position for a certain period of time; this is called a fixed magnetic field.
[0028] 2) Induced magnetic field: A carrier made of steel material is magnetized under the influence of the Earth's magnetic field, and the magnetic field generated by the magnetization is called the induced magnetic field.
[0029] All magnetic fields are unified under the carrier coordinate system. In equation (1) This is the transformation matrix between the geographic coordinate system and the vehicle coordinate system, referred to here as the attitude transformation matrix. The elements of this matrix are functions of the vehicle's attitude angles. (1) A triaxial magnetometer measures the combined vector magnetic field at its location, including the Earth's magnetic field, induced magnetic fields, and fixed magnetic fields. The triaxial magnetometer outputs a magnetic field. The mathematical expression is as follows: (2) In the formula, It is a 3×1 geomagnetic field vector. These are the three components of the geomagnetic field in the carrier coordinate system. A 3×1 fixed magnetic field vector, This is a 3×3 matrix of induced magnetic field interference coefficients. The above equation can be simplified to: (3) in The three components of the geomagnetic field in the carrier coordinate system. This is called the induced magnetization interference coefficient matrix.
[0030] For the same carrier, assuming the carrier structure and vector sensor installation positions remain unchanged, the ship's induced magnetic field interference coefficient matrix... and fixed magnetic field interference coefficient It is a time-domain invariant. Therefore, the geomagnetic field in the carrier coordinates can be expressed as: (4) in and Therefore, as long as the induced magnetic field interference coefficient matrix is known... and fixed magnetic field interference coefficient And combined with the vector measured by the triaxial magnetic sensor This allows us to obtain the geomagnetic field under the carrier coordinates and complete the geomagnetic vector measurement error compensation.
[0031] The geomagnetic vector measurement model is rewritten into a linear regression form to facilitate calculations using ridge regression and Kalman filtering algorithms. Transpose both sides of equation (4) to obtain: (5) From (5), we can obtain: (6) In equation (6) As a state quantity The state equation can then be established as follows: (7) The number of measurement points n = 1, 2, 3, ..., N, where N is the maximum number of measurement points, and the vector is 4×3. This is process noise.
[0032] The observation equation is established based on equation (6): (8) Measurement vector in equation (8) It is a 1×3 matrix, the measurement matrix It is a 1×4 matrix. The measurement noise is 1×3. The variance of the noise on each axis can be estimated statistically from the training residuals or given by the sensor noise model.
[0033] By combining equations (7) and (8), we can establish... Let be the state-space equation for the state.
[0034] From equation (8), for Vectorization: (9) Then a single-time joint observation matrix can be constructed: (10) And obtain the equivalent observation expression: (11) Will By stacking the training data, we get: (12) Step 4: Use ridge regression to obtain the prior values of the training data.
[0035] To reflect " Approximate identity matrix, smaller off-diagonal coupling, The prior structure of "weak constraints" defines the prior mean: (13) To suppress ill-conditioned and multicollinear phenomena, and to introduce a prior physical structure for compensation coefficients, a regularized objective function with prior means is constructed: (14) in This is a regularized weight matrix. Preferably, Take the diagonal matrix and group it according to the parameters, then assign weights. For The off-diagonal elements are assigned larger weights (strong constraints) to suppress the drift of unreasonable coupling terms; The diagonal elements are assigned smaller weights (weak constraints), allowing them to be fine-tuned with the data; The three components are given smaller weights to achieve weak constraints, allowing them to absorb biases while avoiding drift when the data is noisy or the sample size is small.
[0036] The above optimization problem has an analytical solution: (15) Depend on The prior compensation coefficients can be recovered. To obtain the initial error covariance of the Kalman filter, the parameter covariance can be approximated by constructing the training residual variance and the information matrix. Define the training residuals and use them for subsequent Kalman filter initialization: (16) Then it is acceptable: (17) And it is used for subsequent Kalman filter initialization.
[0037] Step 5: Introduce ridge regression into the Kalman filter algorithm to iteratively calculate the matrix K and matrix Bp of the geomagnetic vector measurement error compensation model.
[0038] The prior values obtained in step four are used as the initial state for the Kalman filter to improve the stability of coefficient estimation.
[0039] (1) Prior initialization: (18) in and The results are given by equations (14) and (16) respectively; This is the covariance inflation coefficient, used to avoid filter lock-up caused by overconfidence in the initial values.
[0040] (2) State prediction: (19) in This is the process noise covariance matrix, used to characterize the uncertainty of the compensation coefficients as they slowly change over time.
[0041] (3) Kalman gain: (20) in To measure the noise covariance matrix, it is defined as: Preferably, if the triaxial noise is approximately uncorrelated, a diagonal form is taken. .
[0042] (4) Post-hoc update: (twenty one) The state variables can be obtained through the above recursion. ,Depend on get: (twenty two) Right now for The first three lines, for The fourth line.
[0043] In summary, the iterative steps of Kalman filtering are as follows: Figure 2 As shown.
[0044] Step 1: Prior estimation: ; Step 2: Prior error covariance: ; Step 3: Kalman filter gain: ; Step 4: Posterior estimation: ; Step 5: Update the error covariance: ; Then repeat Step 1 through Step 5; Step 6: Substitute the geomagnetic vector measurement model, use matrices and Matrix to perform online compensation of the geomagnetic vector, and calculate the error-compensated geomagnetic vector in the carrier coordinate system.
[0045] Real-time measured geomagnetic vector data Substituting into the geomagnetic vector measurement model (3.3) and combining it with the compensation matrix obtained through online updating... and bias vector By performing online compensation on the geomagnetic vector, the error-compensated geomagnetic vector in the carrier coordinate system can be calculated. The online compensation process described above can correct measurement errors caused by interference from the fixed magnetic field of the carrier and induced magnetic field in real time, thereby improving the accuracy and stability of geomagnetic vector measurement results.
[0046] The key technical point of this application is: (1) using For the prior mean, Apply strengthening constraints to the off-diagonal coupling terms, for diagonal terms and (1) Apply weak constraints to limit the compensation coefficients to a physically reasonable range and suppress coefficient drift caused by pathological conditions and noise; (2) Use the ridge regression solution as the initial state and covariance of the Kalman filter to avoid parameter oscillation and divergence in the traditional KF under small sample, high noise and collinear conditions; (3) Measure the noise covariance matrix R in the diagonal form of the variance of each axis to improve the noise modeling matching degree and enhance the robustness and generalization ability of the algorithm under different sites and noise levels.
[0047] The following are specific implementation examples provided in this application: To display in real time the variation of the magnetic field measured by the vector sensor with the carrier attitude angle during magnetic interference compensation, the following method can be used: (a) Let the horizontal axis represent the Y component of the magnetic field and the vertical axis represent the X component of the magnetic field. Take the negative value of the Y component as the positive direction of the Y axis.
[0048] (b) Based on the local geomagnetic horizontal component Draw two standard circles with a radius of (1±5%).
[0049] (c) Using the local geomagnetic vertical component (1±5%) Draw two straight lines parallel to the horizontal axis on the vertical axis.
[0050] The physical meaning of this specification is as follows: the positive direction of the horizontal axis represents the magnetic east direction of the carrier, the positive direction of the vertical axis represents the magnetic north direction, and 5% represents the allowable error range of the horizontal and vertical components of the magnetic field control signal of the demagnetization system during the carrier's navigation. When the carrier completes one revolution, the magnetic field curve before magnetic interference compensation is generally an eccentric ellipse, and after magnetic interference compensation, it becomes a "standard circle" located between the two circles. The vertical component, after anti-interference, should also be located between the two straight lines.
[0051] When the training condition is in Wuhan and the test condition is in Wuhan: The calculation results of the compensation parameters for the prior Kalman filter algorithm in the Wuhan training set are as follows: , The calculation results of the compensation parameters for the ordinary Kalman filter algorithm are as follows: , The graph after magnetic interference compensation using the Wuhan training set's prior Kalman filter algorithm is shown below. Figure 4 As shown, the graph after magnetic interference compensation using the ordinary Kalman filter algorithm on the Wuhan training set is as follows. Figure 5 As shown, the graph after magnetic interference compensation using the Wuhan verification Jiling prior Kalman filter algorithm is as follows. Figure 6 As shown, the graph after magnetic interference compensation using the ordinary Kalman filter algorithm on the Wuhan validation set is as follows. Figure 7 As shown, the RMSE of the training set and the validation set are compared to, for example... Figure 8 and 9 As shown.
[0052] When the training condition was Wuhan and the test condition was Qingdao, the compensation parameter results were consistent with those described above. The Qingdao verification of the Jiling prior Kalman filter algorithm for magnetic interference compensation yielded the following graph: Figure 10 As shown, the graph after magnetic interference compensation using the ordinary Kalman filter algorithm on the Qingdao validation set is as follows. Figure 11 As shown, the RMSE of the Qingdao validation set is as follows: Figure 12 As shown.
[0053] When the training condition was Wuhan and the test condition was Sanya, the compensation parameter results were consistent with those described above. The graph after magnetic interference compensation using the prior Kalman filter algorithm from Sanya verification is shown below. Figure 13As shown, the graph after magnetic interference compensation using the ordinary Kalman filter algorithm on the Sanya validation set is as follows. Figure 14 As shown, the RMSE of the Sanya validation set is as follows: Figure 15 As shown.
[0054] The experimental results show that when the training data has sufficient pose coverage and the test conditions are consistent with the training conditions, both the ridge prior Kalman filter and the ordinary Kalman filter can achieve good compensation results, so the difference in compensation error indices may not be significant. However, when noise increases, the number of training samples decreases, or the test conditions differ from the training conditions, the traditional Kalman filter is prone to oscillations in the compensation coefficients, abnormal increases in off-diagonal coupling terms, and other issues. Bias term drift and other phenomena lead to increased compensation errors. This invention constrains the initial values through structural prior ridge regression and combines it with axial noise covariance modeling, which can significantly suppress coefficient drift and make the compensation error more accurate. and It remains within physically reasonable limits, thus exhibiting better robustness and generalization ability across sites or under complex noise conditions.
[0055] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for estimating magnetic interference compensation coefficients, characterized in that, Includes the following steps: S10, acquire magnetic field measurement data and attitude measurement data during carrier motion; S20, construct a geomagnetic vector measurement model, rewrite the geomagnetic vector measurement model into a linear regression form, establish a state space equation with compensation coefficients as state variables, construct a single-time joint observation matrix and measurement vector based on the state space equations, the compensation coefficients include an induced magnetic field interference coefficient matrix and a fixed magnetic field interference vector; S30, based on the magnetic field measurement data and attitude measurement data, the single-time joint observation matrix at multiple times is stacked, and the measurement vectors at multiple times are stacked to construct a regularized objective function with prior mean. The prior estimate of the compensation coefficient is obtained by solving the ridge regression problem, and the prior error covariance matrix is constructed according to the training residual and information matrix. The prior mean is preset according to the physical structure of the compensation coefficient. The physical structure includes setting the diagonal elements of the induced magnetic field interference coefficient matrix to 1 and the off-diagonal elements to 0, and setting the fixed magnetic field interference vector to 0. S40, using the prior estimate and prior error covariance matrix as the initial state variables and initial error covariance matrix of the Kalman filter, execute the prediction and update steps of the Kalman filter, and iteratively calculate the posterior estimate of the compensation coefficient.
2. The method for estimating the magnetic interference compensation coefficient as described in claim 1, characterized in that, In step S10, the method for obtaining magnetic field measurement data and attitude measurement data during carrier movement is as follows: the attitude sensor, triaxial magnetic sensor, power supply, host computer, and data acquisition module are placed on the carrier to form a geomagnetic vector measurement device. The carrier moves around a circle once in the experimental site, and magnetic field data and corresponding attitude data are collected as training set data; it moves around a circle again once, and magnetic field data and corresponding attitude data are collected as validation set data.
3. The method for estimating the magnetic interference compensation coefficient as described in claim 2, characterized in that, In step S20, the geomagnetic vector measurement model is as follows: ,in These are the three components of the geomagnetic field in the carrier coordinate system. The output magnetic field vector of the triaxial magnetic sensor. B p For a fixed magnetic field vector, K This is the matrix of interference coefficients for the induced magnetic field; The geomagnetic vector measurement model can be rewritten in linear regression form as follows: For Transpose and transform both sides to obtain Then As a state quantity Establish state equations The number of measurement points is n = 1, 2, 3, ... N , N This represents the maximum number of measurement points. These are the three components of the geomagnetic field in the carrier coordinate system; A 3×1 fixed magnetic field vector; a 4×3 vector This is process noise.
4. The method for estimating the magnetic interference compensation coefficient as described in claim 1, characterized in that, In step S20, the formula for calculating the measurement vector is: , where the measurement vector It is a 1×3 matrix, the measurement matrix It is a 1×4 matrix. The measurement noise is 1×3. For state variables; The formula for calculating the single-time joint observation matrix is as follows: ,in, I 3 is the 3rd order identity matrix.
5. The method for estimating the magnetic interference compensation coefficient as described in claim 1, characterized in that, In step S30, the regularization objective function with prior mean is: In the formula, These are prior estimates; The state quantity is vectorized; The prior mean vector; This is the result of stacking measurement vectors from multiple time points; This is the result of stacking single-time joint observation matrices from multiple time points; This is a regularized weight matrix.
6. The method for estimating the magnetic interference compensation coefficient as described in claim 5, characterized in that, The regularized weight matrix It is a diagonal matrix, and weights are assigned according to the grouping of compensation coefficients: the off-diagonal elements of the induced magnetic field interference coefficient matrix are assigned a first weight value, the diagonal elements of the induced magnetic field interference coefficient matrix are assigned a second weight value, and the three components of the fixed magnetic field interference vector are assigned a third weight value. The first weight value is greater than the second weight value, and the second weight value is greater than the third weight value.
7. The method for estimating the magnetic interference compensation coefficient as described in claim 1, characterized in that, In step S30, the prior estimate The solution method is as follows: In the formula, These are prior estimates; The prior mean vector; This is the result of stacking measurement vectors from multiple time points; This is the result of stacking single-time joint observation matrices from multiple time points; This is a regularized weight matrix.
8. The method for estimating the magnetic interference compensation coefficient as described in claim 1, characterized in that, In step S30, the prior error covariance matrix is constructed as follows: define the training residuals. ,Pick ,in To train the residual variance, Let be the prior error covariance matrix. This is the result of stacking measurement vectors from multiple time points. This is a stacked result of single-time joint observation matrices from multiple time points. This is a regularized weight matrix. These are prior estimates. N This represents the maximum number of measurement points.
9. The method for estimating the magnetic interference compensation coefficient as described in claim 1, characterized in that, In step S40, the iterative steps of the Kalman filter specifically include: prior estimation Prior error covariance Kalman filter gain ; Posterior estimation Update error covariance ; In the formula, For the first n The prior state estimate at time 1; For the first n The prior error covariance matrix at time t; Q The process noise covariance matrix; R To measure the noise covariance matrix, ; For the first n The observation matrix at time points; For the first n The measured vector at time; I 12 It is a 12th-order identity matrix.
10. A system for estimating magnetic interference compensation coefficients, characterized in that, To implement the method of any one of claims 1 to 9, comprising: The data acquisition module is used to acquire magnetic field measurement data and attitude measurement data during the movement of the carrier; The model building module is used to construct a geomagnetic vector measurement model, rewrite the geomagnetic vector measurement model into a linear regression form, establish a state space equation with compensation coefficients as state variables, and construct a single-time joint observation matrix and measurement vector based on the state space equations. The compensation coefficients include an induced magnetic field interference coefficient matrix and a fixed magnetic field interference vector. The prior estimation module is used to stack the single-time joint observation matrix at multiple times and the measurement vector at multiple times based on the magnetic field measurement data and attitude measurement data, construct a regularized objective function with prior mean, obtain the prior estimate of the compensation coefficient by solving the ridge regression problem, and construct the prior error covariance matrix based on the training residual and information matrix. The prior mean is preset according to the physical structure of the compensation coefficient. The physical structure includes setting the diagonal elements of the induced magnetic field interference coefficient matrix to 1 and the off-diagonal elements to 0, and setting the fixed magnetic field interference vector to 0. The posterior update module is used to take the prior estimate and the prior error covariance matrix as the initial state variables and initial error covariance matrix of the Kalman filter, execute the prediction and update steps of the Kalman filter, and iteratively calculate the posterior estimate of the compensation coefficient.