MEMS magnetic sensor calibration method and system based on optimal iteration
The equivalent error model is constructed through the optimal iterative method and the parameter estimation is performed using the RLS algorithm. The problem of slow calibration speed of MEMS inertial magnetic system and dependence on external instruments is solved, high-precision and rapid calibration are achieved, and the accuracy of estimation is improved.
Patent Information
- Application Number
- CN202411983840.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-30
AI Technical Summary
The existing MEMS inertial magnetic systems have defects in measurement accuracy and noise, resulting in slow error calibration speed and relying on external high-precision instruments, affecting the accuracy of estimation of the stance.
The optimal iterative MEMS magnetic sensor calibration method is adopted to construct an equivalent error model and use the RLS algorithm to estimate the parameter to achieve high-precision and rapid calibration of the magnetic sensor.
Rapid calibration of magnetic sensors can be achieved without external high-precision instruments, reducing calibration costs and improving the accuracy of navigation posture estimation.
Smart Images

Figure CN120063321A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of error calibration of MEMS inertial magnetic measurement systems, and particularly relates to a calibration method and system for MEMS magnetic sensors based on optimal iteration. Background Art
[0002] Currently, MEMS inertial magnetic systems are being increasingly applied to military, civilian, and industrial fields, and their high cost performance and low power consumption characteristics have an increasingly broad application prospect. Due to the large defects in measurement accuracy, measurement noise, etc. of MEMS inertial magnetic systems, it is necessary to calibrate their errors during actual use. Most of the current common calibration methods use offline processing and require higher-precision instruments to measure true values. At the same time, there is a contradiction between the calibration accuracy and calibration speed of magnetic sensors. When the amount of data is small, the calibration accuracy will decrease, but when the amount of data is large, it will affect the calibration speed. Therefore, how to achieve rapid calibration of magnetic sensors under the condition of no external high-precision instrument observation, eliminate the influence of magnetic sensor errors on the accuracy of attitude estimation, and become an important research direction for attitude estimation and error calibration of current MEMS inertial magnetic systems.
[0003] To overcome the problems of slow calibration speed and dependence on external observation of traditional method error calibration methods, the present invention adopts an optimal iteration method for calibrating the errors of MEMS magnetic sensors. Based on the error modeling of MEMS inertial magnetic systems, the optimal iteration method is used to achieve the goal of high-precision and rapid calibration of magnetic sensors. Summary of the Invention
[0004] The purpose of the present invention is to propose a calibration method and system for MEMS magnetic sensors based on optimal iteration, solve the problem of calibrating magnetic sensors under the condition of no external high-precision equipment, reduce the calibration cost, and improve the accuracy of attitude estimation of MEMS inertial magnetic systems.
[0005] The technical solution for achieving the purpose of the present invention is as follows:
[0006] A calibration method for MEMS magnetic sensors based on optimal iteration, comprising the steps of:
[0007] Step 1, constructing an equivalent error model of the measurement model of the MEMS magnetic sensor;
[0008] Step 2, initializing the parameters of the equivalent error model;
[0009] Step 3, estimating and correcting the true value of the magnetic vector to obtain an estimated value of the true value of the magnetic vector;
[0010] Step 4: Reconstruct the true value estimate of the magnetic vector, use the RLS algorithm to estimate the parameters of the equivalent error model, and based on the sampling times of the MEMS magnetic sensor, loop through Steps 3 - 4 to obtain the parameter estimates of the equivalent error model after iteration is completed;
[0011] Step 5: Calculate the residual function value based on the parameter estimates of the equivalent error model. If the residual function value is less than the set value, then take the parameter estimates of the equivalent error model as the final calibration result; otherwise, execute Step 6;
[0012] Step 6: Take the estimated parameters of the equivalent error model as the initial values, and loop through Steps 3 - 5 iteratively.
[0013] Furthermore, the measurement model of the MEMS magnetic sensor is:
[0014]
[0015] where represents the output of the triaxial magnetometer in the body frame; S represents the scale factor; C no represents the non - orthogonality error; C si represents the soft - iron error; represents the attitude transformation matrix from the n - frame to the b - frame, m n represents the projection of the magnetic vector in the n - frame; b h represents the hard - magnetic error; b m represents the bias error; ε represents Gaussian white noise with a mean of 0.
[0016] Furthermore, the equivalent error model is:
[0017]
[0018] where represents the projection of the magnetic vector in the n - frame, C m =SC no C si represents the equivalent soft - magnetic error matrix, b m =SC no b h +b m represents the equivalent hard - magnetic error vector, ε m is the magnetic vector white noise, C m 、b m are the parameters to be calibrated;
[0019] Reconstruct the equivalent error model to obtain:
[0020]
[0021] In the formula, the subscript i represents the i-th group of data, where i = 1, 2, ..., N, and N represents the number of sampling times of the MEMS magnetic sensor. represents the i-th group of magnetic vector observation values, and H m,i represents the true value matrix of the i-th group of magnetic vectors, L is the vector to be calibrated, and ε m,i represents the white noise vector of the i-th group of data; where:
[0022]
[0023] Among them, 0 13 represents a three-dimensional all-zero row vector, and C ij is the element in the i-th row and j-th column of C m , and b mx , b my , b mz are the x, y, and z-axis components of b m respectively.
[0024] Furthermore, the initialization of the equivalent error model parameters specifically includes:
[0025]
[0026] L 1 = [1 0 … 1 0 0 0] T
[0027] Among them, C m,1 is the initial value of C m , I is the identity matrix with a dimension of 12, and b m,1 is the initial value of b m , whose elements are all 0, R is the covariance matrix of white noise, and L 1 is the initial value of L;
[0028] Let the parameter k = 1.
[0029] Furthermore, the true value estimate of the magnetic vector is:
[0030]
[0031] Among them, represents the estimated value of the i-th group of magnetic vectors, and after the modulus constraint, is the true value estimate of the magnetic vector , ||m n || is the modulus of the local geomagnetic vector, and C m,k+1 , b m,k+1 are the (k + 1)-th iteration estimates of C m , b m respectively. When k = 1 and i = 1, C m,k+1 = C m,1 , bm,k+1 = b m,1 , otherwise, C m,k+1 = C k+1,i , b m,k+1 = b k+1,i , C k+1,i , b k+1,i are the parameter estimation values of the k+1-th and the i-th group of data in step 4.
[0032] Furthermore, for the reconstruction of the true value estimation of the magnetic vector, the RLS algorithm is used for the parameter estimation of the equivalent error model, specifically including:
[0033] Initialize the parameter P k+1,1 : P k+1,1 = 10 5 I, where I is the identity matrix with a dimension of 12;
[0034] Substitute H m,i into the following formula and calculate using the RLS algorithm:
[0035]
[0036] where, represents the iterative value of the (k+1)-th and the (i+1)-th group of sampling data of L, P and K are the process parameters of the RLS algorithm, K i+1 is the gain vector of the (i+1)-th time, is the estimated value of the (i+1)-th time, P k+1,i+1 is the covariance matrix of the (i+1)-th time, P k+1,i+1 is the covariance matrix of the (i+1)-th time, I is the identity matrix with a dimension of 12;
[0037] Extract the parameter estimation value to be calibrated from as:
[0038]
[0039] After the parameter estimation of the (i+1)-th time is completed, i = i + 1.
[0040] Furthermore, the parameter estimation value of the equivalent error model after iteration is:
[0041]
[0042] where, C m,k+1 , b m,k+1 are the parameter estimation values to be calibrated.
[0043] Furthermore, the residual function is:
[0044]
[0045] Among them, represents the i-th group of magnetic vector observation values, λ is the Lagrange operator, ||m n || is the local magnetic vector modulus value, represents the estimated value of the i-th group of magnetic vectors, C m,k+1 , b m,k+1 are the parameters obtained after the iteration in step 4 ends.
[0046] Furthermore, in step 6, the estimated equivalent error model parameters are used as the initial values, including: C m,1 = C m,k+1 , b m,1 = b m,k+1 , k = k + 1.
[0047] A MEMS magnetic sensor calibration system based on optimal iteration includes:
[0048] An equivalent error model construction unit for constructing an equivalent error model of the MEMS magnetic sensor measurement model;
[0049] A parameter initialization unit for initializing the equivalent error model parameters;
[0050] A magnetic vector true value estimation unit for estimating and correcting the magnetic vector true value to obtain an estimated value of the magnetic vector true value;
[0051] A parameter estimation unit for reconstructing the estimated value of the magnetic vector true value and using the RLS algorithm to estimate the parameters of the equivalent error model;
[0052] A parameter estimated value evaluation unit, based on the parameter estimated value of the equivalent error model, calculates the residual function value. If the residual function value is less than the set value, the parameter estimated value of the equivalent error model is used as the final calibration result, otherwise recalibration is performed.
[0053] Compared with the prior art, the advantages of the present invention are as follows:
[0054] (1) The present invention adopts the method of true value iteration and has the characteristic of not requiring additional measuring instruments;
[0055] (2) The present invention adopts the recursive estimation method and has the advantages of small calculation overhead and fast convergence speed;
[0056] (3) The present invention is based on optimal iteration design and has the advantage of no systematic deviation in estimation. Description of the Drawings
[0057] Figure 1 is the flow chart of the optimal iteration algorithm.
[0058] Figure 2 is the magnetic calibration effect diagram. Detailed Implementation Manner
[0059] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments:
[0060] As can be seen from Figure 1 , the magnetic calibration algorithm only requires the output of the magnetic sensor as a calculation parameter, without other external observations, to construct a self-calibration observation equation. The modulus constraint, as a correction for true value estimation, plays a role in improving the accuracy during the iteration process.
[0061] Based on this, the present invention is a calibration method for MEMS magnetic sensors based on optimal iteration, which synchronously iterates the parameters to be calibrated and the magnetic vector estimation value. The algorithm flow is as Figure 1 shown and includes the following steps:
[0062] Step 1: Establish an equivalent error model for the MEMS magnetic sensor;
[0063] From the measurement model of the MEMS magnetic sensor, it can be known that:
[0064]
[0065] In the formula, represents the output of the three-axis magnetometer in the carrier system; S represents the scale factor; C no represents the non-orthogonality error; C si represents the soft iron error (non-magnetic material, but interfering with the magnetic field lines); represents the attitude conversion matrix from the n system to the b system, m n represents the projection of the magnetic vector in the n system; b h represents the hard magnetic error (magnetic material, changing the magnetic field strength); b m represents the zero bias error; ε represents Gaussian white noise with a mean of 0;
[0066] Among them, by simplifying the measurement model, the following equivalent error model is obtained:
[0067]
[0068] In the formula, represents the projection of the magnetic vector in the n system, C m =SC no C si represents the equivalent soft magnetic error matrix, b m =SC no b h +b m represents the equivalent hard magnetic error vector, ε m is the magnetic vector white noise, C m , b m are the parameters to be calibrated;
[0069] As can be seen from the above formula, C m , b m are parameters to be calibrated, the output value of the magnetic sensor, is the only available data, m b is the true value of the magnetic vector, which is not available;
[0070] Reconstruct the equivalent error model, extract the parameters to be calibrated, and obtain the following parameter estimation model:
[0071]
[0072] In the formula, the subscript i represents the i-th group of data, represents the i-th group of magnetic vector observation values, H m,i represents the true value matrix of the i-th group of magnetic vectors, L is the vector to be calibrated, and ε m,i represents the white noise vector of the i-th group of data; where:
[0073]
[0074] where 0 13 represents a three-dimensional all-zero row vector, C ij is the element in the i-th row and j-th column of C m , b mx , b my , b mz are the x, y, and z axis components of b m respectively;
[0075] Step 2: Initialize the error parameters:
[0076] This algorithm involves iteration and requires initializing the parameters to be calibrated. Assume that there is no error in the observed values, that is,
[0077]
[0078]
[0079] where C m,1 is the initial value of C m , which is used in the first (i) inner iteration of the first round (k) of outer iteration. I is the identity matrix with a dimension of 12, and b m,1 is the initial value of b m , and all its elements are 0. R is the covariance matrix of white noise, which is set as an assumed value during the simulation process and obtained through noise analysis in the system experiment;
[0080] Thus:
[0081] L 1 = [1 0…1 0 0 0] T
[0082] L 1 Is the initial value of L and is used in the first inner iteration of the first outer iteration;
[0083] Step 3: Magnetic vector true value estimation and correction:
[0084]
[0085] Among them, Represents the estimated value of the i-th group of magnetic vectors. After modulus constraint, Is the true value estimated value of the magnetic vector , ||m n || is the local geomagnetic vector modulus value, which can be obtained from the International Geomagnetic Database. C m,k+1 , b m,k+1 Are the (k + 1)-th iteration estimated values of C m , b m . When k = 1 and i = 1, C m,k+1 = C m,1 , b m,k+1 = b m,1 . Otherwise, C m,k+1 = C k+1,i , b m,k+1 = b k+1,i , C k+1,i , b k+1,i Are the parameter estimated values of the (k + 1)-th and the i-th group of data in Step 4.
[0086] Step 4: Use the RLS algorithm for parameter estimation:
[0087] Initialize the parameter P k+1,1 : P k+1,1 = 10 5 I, where I is the identity matrix with a dimension of 12;
[0088] Reconstruct the magnetic vector estimated value calculated in Step 3 as follows:
[0089]
[0090] The obtained H m,i Is the true value matrix of the i-th group of magnetic vectors, and substitute it into the following formula to calculate using the RLS algorithm:
[0091]
[0092] Among them Represents the (i + 1)-th inner iteration value of the (k + 1)-th outer iteration of L. P and K are the process parameters of the RLS algorithm. After initializing P k+1,1 , both P and K can be calculated during the iteration. K i+1is the gain vector for the (i + 1)-th inner iteration of the current outer loop, used to calculate using the estimated value obtained from the i-th inner iteration of Calculate P k+1,i is the covariance matrix for the i-th inner iteration of the (k + 1)-th outer iteration, and P k+1,i+1 is the covariance matrix for the (i + 1)-th inner iteration of the (k + 1)-th outer iteration. I is the identity matrix with a dimension of 12.
[0093] Extract the estimated value of the parameter to be calibrated from as follows:
[0094]
[0095] Let i = i + 1, that is, use the next set of magnetic vector observations, and repeat the above processes of steps 3 and 4 for iterative calculation. Perform loop calculation according to the number of sensor samples N to obtain as the result of the K-th outer iteration of L;
[0096] Use the following formula to extract C from m,k+1 and b m,k+1 :
[0097]
[0098] where C m,k+1 and b m,k+1 are the estimated values of C m and b m for the (k + 1)-th outer iteration, and L k+1,N (a) represents the a-th element of L k+1,N .
[0099] Step 5: Calculation of the residual function J:
[0100] Calculate the measurement residual function:
[0101]
[0102] where represents the i-th group of magnetic vector observations, λ is the Lagrange operator, which can be adjusted according to the actual data, ||m n || is the local magnetic vector modulus value, obtained from the International Geomagnetic Reference Field, represents the estimated value of the i-th group of magnetic vectors, obtained through step 3.
[0103] Judge whether J is less than the preset threshold δ. If so, the calibration ends, and output C m,k+1 and b m,k+1 are C respectively.m , b m Calibration result; conversely, go to step 6 for iterative calculation;
[0104] Step 6: Outer iteration of the parameters to be calibrated:
[0105] Use the result C calculated in step 4 m,k+1 , b m,k+1 as the initial value for the new round of iteration, C m,1 = C m,k+1 , b m,1 = b m,k+1 , k = k + 1;
[0106] Repeat steps 3 - 5 until the residual function J is less than the preset threshold δ, and the algorithm ends to obtain the calibration results of the parameters to be calibrated C m , b m Calibration result.
[0107] Figure 2 is a comparison graph of the magnetic vector modulus value. It can be seen from the graph that before calibration, the magnetic vector has a large fluctuation range and a relatively large overall amplitude, with bias error and distortion, and the relative error of its modulus value is about 2.4%. By using the optimal iteration method, error suppression can be achieved.
[0108] An error calibration method for an optimal iteration MEMS magnetic sensor proposed by the present invention adopts the MEMS inertial magnetic system error calibration modeling method, uses the optimal iteration estimation method, and synchronously iterates the parameters to be calibrated and the magnetic vector estimated value to realize error parameter estimation, achieving the purpose of rapid calibration, reducing the calibration cost, and improving the calibration accuracy.
[0109] The present invention also provides an MEMS magnetic sensor calibration system based on optimal iteration, including:
[0110] An equivalent error model construction unit for constructing an equivalent error model of the MEMS magnetic sensor measurement model;
[0111] A parameter initialization unit for initializing the equivalent error model parameters;
[0112] A magnetic vector true value estimation unit for estimating and correcting the magnetic vector true value to obtain the magnetic vector true value estimated value;
[0113] A parameter estimation unit for reconstructing the magnetic vector true value estimated value and using the RLS algorithm to estimate the parameters of the equivalent error model;
[0114] A parameter estimated value evaluation unit, based on the parameter estimated value of the equivalent error model, calculates the residual function value. If the residual function value is less than the set value, the parameter estimated value of the equivalent error model is used as the final calibration result, otherwise recalibration is performed.
[0115] The above are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the method of the present invention, several improvements and supplements can be made, and these improvements and supplements should also be regarded as the protection scope of the present invention.
Claims
1. A MEMS magnetic sensor calibration method based on optimal iteration, characterized in that: Includes steps: Step 1, constructing an equivalent error model of the MEMS magnetic sensor measurement model; Step 2, initializing the equivalent error model parameters; Step 3, estimating and correcting the true value of the magnetic vector to obtain an estimated value of the true value of the magnetic vector; Step 4, reconstruct the estimated value of the true value of the magnetic vector, use the RLS algorithm to estimate the parameters of the equivalent error model, and based on the sampling times of the MEMS magnetic sensor, repeat steps 3-4 to obtain the estimated values of the parameters of the iterative equivalent error model; Step 5, based on the parameter estimation value of the equivalent error model, calculate the residual function value. If the residual function value is less than the set value, the parameter estimation value of the equivalent error model is used as the final calibration result; Otherwise, go to step 6; Step 6: Use the estimated equivalent error model parameters as initial values and iterate through steps 3 to 5.
2. A MEMS magnetic sensor calibration method based on optimal iteration according to claim 1, characterized in that: The MEMS magnetic sensor measurement model is: In the formula, represents the output of the three-axis magnetometer under load; S represents the scale factor; C no represents the non-orthogonality error; C si Indicates soft iron error; represents the heading conversion matrix from the n system to the b system, m n represents the projection of the magnetic vector in the n system; b h Indicates hard magnetic error; b m represents zero bias error; ε represents Gaussian white noise with a mean of 0.
3. A MEMS magnetic sensor calibration method based on optimal iteration according to claim 2, characterized in that: The equivalent error model is: In the formula, represents the projection of the magnetic vector in the n system, C m =SC no C si represents the equivalent soft magnetic error matrix, b m =SC no b h +b m represents the equivalent hard magnetic error vector, ε m is the magnetic vector white noise, C m 、b m is the parameter to be calibrated; Reconstruct the equivalent error model and get: Wherein, subscript i represents the i-th group of data, i=1, 2, ..., N, N represents the sampling times of the MEMS magnetic sensor, represents the i-th group of magnetic vector observations, H m,i represents the true value matrix of the i-th group of magnetic vectors, L is the vector to be calibrated, ε m,i Represents the white noise vector of the i-th group of data; where: Among them, 0 13 represents a three-dimensional all-zero row vector, C ij C m The i-th row and j-th column element, b mx ,b my ,b mz b m The x, y, and z axis components of .
4. The method for calibrating a MEMS magnetic sensor based on optimal iteration according to claim 3, characterized in that: Initializing the equivalent error model parameters specifically includes: L1=[10…1000] T Among them, C m,1 C m The initialization value, I is the unit matrix, the dimension is 12, b m,1 for b m The initialization value of , whose elements are all 0, R is the covariance matrix of white noise, and L1 is the initialization value of L; Let parameter k=1.
5. The MEMS magnetic sensor calibration method based on optimal iteration according to claim 4, characterized in that: The estimated true value of the magnetic vector is: in, Represents the estimated value of the i-th group of magnetic vectors, after the modulus constraint is the magnetic vector The true value estimate of ||m n || is the local geomagnetic vector modulus, C m,k+1 、b m,k+1 c m 、b m The k+1th iteration estimate, when k=1, i=1, C m,k+1 =C m,1 , b m,k+1 =b m,1 , otherwise, C m,k+1 =C k+1,i , b m,k+1 =b k+1,i , C k+1,i 、b k+1,i is the parameter estimate for the k+1th time and the i-th group of data in step 4.
6. The method for calibrating a MEMS magnetic sensor based on optimal iteration according to claim 5, characterized in that: The reconstructing of the estimated value of the true value of the magnetic vector and using the RLS algorithm to estimate the parameters of the equivalent error model specifically includes: Initialization parameter P k+1,1 : R k+1,1 =10 5 I, where I is the unit matrix with a dimension of 12; H m,i Substitute the following formula and use the RLS algorithm to calculate: in, represents the iterative value of the k+1th and i+1th group of sampling data of L, P and K are the process parameters of the RLS algorithm, K i+1 is the i+1th gain vector, is the estimated value of the i+1th time, P k+1,i+1 is the i+1th covariance matrix, P k+1,i+1 is the i+1th covariance matrix, I is the unit matrix, and the dimension is 12; from Extract the estimated value of the parameter to be calibrated from: The i+1th parameter estimation is completed, i=i+1.
7. The method for calibrating a MEMS magnetic sensor based on optimal iteration according to claim 6, characterized in that: The parameter estimates of the equivalent error model after iteration are: Among them, C m,k+1 , b m,k+1 is the estimated value of the parameter to be calibrated.
8. The method for calibrating a MEMS magnetic sensor based on optimal iteration according to claim 1, characterized in that: The residual function is: in, represents the i-th group of magnetic vector observations, λ is the Lagrangian operator, ||m n || is the local magnetic vector modulus, represents the estimated value of the i-th group of magnetic vectors, C m,k+1 , b m,k+1 It is the parameter obtained after the iteration of step 4.
9. The method for calibrating a MEMS magnetic sensor based on optimal iteration according to claim 7, characterized in that: In step 6, the estimated equivalent error model parameters are used as initial values, specifically: C m,1 =C m,k+1 , b m,1 =b m,k+1 , k=k+1.
10. A MEMS magnetic sensor calibration system based on optimal iteration for implementing any of the methods described in claims 1-8, characterized in that: include: An equivalent error model building unit, used to build an equivalent error model of a MEMS magnetic sensor measurement model; A parameter initialization unit, used to initialize the equivalent error model parameters; A magnetic vector true value estimation unit, used for estimating and correcting the magnetic vector true value to obtain a magnetic vector true value estimation value; A parameter estimation unit, used to reconstruct the estimated value of the true value of the magnetic vector and use the RLS algorithm to estimate the parameters of the equivalent error model; The parameter estimation value evaluation unit calculates the residual function value based on the parameter estimation value of the equivalent error model. If the residual function value is less than the set value, the parameter estimation value of the equivalent error model is used as the final calibration result, otherwise it is recalibrated.