Geomagnetic vector measurement error adaptive compensation method based on improved mayfly naiad algorithm
By improving the mayfly algorithm combined with magnetic field sensors and attitude sensors, a geomagnetic vector measurement error compensation model is established, which solves the measurement deviation problem caused by carrier magnetic field interference, and realizes high-precision magnetic field measurement and reduces the number of iterations.
Patent Information
- Application Number
- CN202510530121.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-07-29
AI Technical Summary
The existing geomagnetic vector measurement methods are susceptible to the carrier's own magnetic field interference and environmental magnetic field disturbance, resulting in measurement data deviations. The standard ephemeral algorithm has high parameter sensitivity and is easily trapped in local optimal solutions, affecting the reliability of high-precision applications.
The improved ephemeral algorithm is adopted to measure the magnetic field and attitude of the carrier environment through magnetic field sensors and attitude sensors, and the standard earth magnetic field value is calculated in combination with the IGRF model, a carrier interference magnetic field model is established, and the global optimal solution of the compensation parameters is calculated using the ephemeral algorithm to achieve geomagnetic vector measurement error compensation.
Effectively eliminate the interference of induced magnetic field and fixed magnetic field in geomagnetic vector measurement, achieve higher accuracy of magnetic field measurement, and fewer iterations, improving the accuracy of geomagnetic field measurement.
Smart Images

Figure CN120386972A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of geomagnetic vector measurement methods, and particularly relates to an adaptive compensation method for geomagnetic vector measurement errors based on an improved mayfly algorithm. Background Technique
[0002] Geomagnetic vector measurement technology has important applications in fields such as navigation and positioning, geological exploration, military target detection, and space science research by obtaining geomagnetic field intensity and its direction information. However, in actual measurement, sensors are easily affected by factors such as the magnetic field interference of the carrier itself and environmental magnetic field disturbances, resulting in significant deviations in measurement data. The superimposed effect of these errors seriously reduces the measurement accuracy of geomagnetic vectors and restricts the reliability of high-precision application scenarios. Currently, the compensation methods for geomagnetic vector measurement errors mainly include analytical correction methods based on physical models and intelligent optimization algorithms based on data-driven. Although the analytical method has high calculation efficiency, it has insufficient adaptability to complex non-linear errors and dynamic disturbances, and relies on accurate error model assumptions; while conventional intelligent optimization algorithms can handle non-linear problems, they generally have problems such as slow convergence speed and easy to fall into local optimal solutions. In recent years, the mayfly algorithm has received attention due to its simple bionic mechanism and strong parallel search ability. However, the application of the standard mayfly algorithm in the field of geomagnetic error compensation still has defects such as high parameter sensitivity and easy to fall into local optimal solutions. Summary of the Invention
[0003] The purpose of the present invention is to provide an adaptive compensation method for geomagnetic vector measurement errors based on an improved mayfly algorithm, which solves the problem that the existing geomagnetic vector measurement error compensation methods are easy to fall into local optima.
[0004] The technical solution adopted by the present invention is an adaptive compensation method for geomagnetic vector measurement errors based on an improved mayfly algorithm. A magnetic field sensor and an attitude sensor are used to measure the ambient magnetic field and attitude of the carrier. After calculating the standard geomagnetic field value of the region where the carrier is located through the IGRF model, a geomagnetic vector measurement error compensation model is established based on the carrier interference magnetic field model. The global optimal solution of the compensation parameters of the model is calculated using the mayfly algorithm, and finally, the error compensation of geomagnetic vector measurement is realized based on the optimal compensation parameters and the compensation model.
[0005] The characteristics of the present invention also lie in: Specifically, it is implemented according to the following steps: Step 1, install the attitude sensor and the magnetic field sensor on the carrier; Step 2, collect the ambient magnetic field and attitude data of the carrier through the magnetic field sensor and the attitude sensor, and calculate the projection components of the standard geomagnetic field value of the region where the carrier is located on the magnetic field sensor through the IGRF model and the attitude data; Step 3: Establish a geomagnetic vector measurement error compensation model based on the carrier interference magnetic field model. Using the standard geomagnetic field value and the carrier environmental magnetic field and attitude data collected by the magnetic field sensor and the attitude sensor as known conditions, and the carrier induced magnetic field coefficient matrix and the fixed magnetic field interference vector as parameters to be solved, use the mayfly algorithm to calculate the optimal solution of the compensation parameters; Step 4: Calculate the compensated geomagnetic field value based on the optimal compensation parameters and the geomagnetic vector measurement error compensation model.
[0006] In Step 2, according to the carrier heading angle, pitch angle, and roll angle data collected by the attitude sensor, calculate the transformation matrix between the geographic coordinate system and the carrier coordinate system, so as to calculate the three-component projection of the standard geomagnetic field value on the magnetic field sensor.
[0007] In Step 2, the calculation formula for the transformation matrix from the geographic coordinate system to the carrier coordinate system is as follows: (1) where γ is the pitch angle, θ is the roll angle, and ψ is the heading angle.
[0008] Step 3 is specifically implemented according to the following steps: Step 3.1: Establish a carrier interference model including a fixed magnetic field and an induced magnetic field without considering the magnetic sensor installation error; Step 3.2: Establish a magnetic field measurement error compensation model according to the carrier interference model; Step 3.3: Initialize and generate male and female mayfly populations in the mayfly algorithm through the method of stratified-quasi-random hybrid sampling. Each mayfly is a 1-row and 12-column vector, representing the compensation parameters in the induced magnetic field coefficient matrix and the fixed magnetic field; Step 3.4: Map the fixed magnetic field parameters to the parameter search range of the induced magnetic field coefficient matrix through parameter normalization; Step 3.5: Select a fitness function and evaluate the quality of the current position of the mayfly by calculating the size of the fitness function; Step 3.6: Calculate the corresponding fitness function according to the initial positions of the male and female mayflies, then select the optimal positions of the male and female mayfly populations and the historical optimal positions of the individuals according to the fitness values, then update the speed and position of the male mayflies, and then update the global optimal fitness; Step 3.7: Update the speed and position of the female mayflies, and then update the global optimal historical fitness; Step 3.8: Select some samples from the updated male and female mayfly populations, and select the optimal, second-best and other individuals for mating; Step 3.9: Apply perturbations to the mayfly individuals using a combined Gaussian mutation and Cauchy mutation hybrid mutation strategy to make the algorithm take into account both local optimization and global optimization; Step 3.10, calculate the population fitness, and update the global optimal fitness, optimal position, individual historical optimal fitness, and optimal position; Step 3.11, repeatedly execute Steps 3.6 to 3.10 until the stop condition is met and end, and obtain the optimal position of the population as the optimal compensation parameter.
[0009] In Step 3.1, the carrier interference model is: (2) where B m is the magnetic sensor measurement value, B e is the standard geomagnetic field, K ic is the induced magnetic field coefficient, and B p is the three-component projection of the fixed magnetic field on the magnetic sensor; In Step 3.2, the magnetic field measurement error compensation model is: (3) where K m =(I + K ic ) -1 , and I is the identity matrix.
[0010] In Step 3.5, the calculation formula of the fitness function is as follows: (4) where N represents the number of data points collected by the magnetic sensor; In Step 3.6, the update formula of the male mayfly velocity is as follows: (5) where t is the iteration number, v ij represents the velocity of the i-th male mayfly in the j-th dimension space, x ij represents the position of the i-th male mayfly in the j-th dimension space, p best is the historical optimal position of the i-th male mayfly, g best is the optimal position of the mayfly population; a1 and a2 are the attraction coefficients of male mayflies; β is the visibility coefficient; r p represents the distance between the current position and the historical optimal position of the male mayfly; r g represents the distance between the current position and the optimal position of the population of male mayflies; d represents the dance coefficient for attracting female mayflies; r is a random coefficient, and r ∈ [-1, 1]; The update formula of the position is as follows: (6).
[0011] In Step 3.7, the update formula of the female mayfly velocity is as follows: (7) Among them, a3 represents the attraction coefficient of female mayflies; r m represents the distance between male mayflies and female mayflies; f l is the random walk coefficient; The update formula of the position is as follows: (8) The mating formula in step 3.8 is as follows: (9) (10) In the formula, O1 and O2 are the generated offspring, m represents male mayflies, f represents female mayflies, L is a random number and L ∈ [-1, 1].
[0012] In step 3.9, the specific mutation strategy is to sample Cauchy mutation for individuals with lower fitness rankings and adopt Gaussian mutation for individuals with higher fitness rankings. The hybrid mutation formula is as follows: (11) Among them, M is an individual in the mayfly population, is the Gaussian mutation step size, is the Cauchy mutation step size, rank(M) is the fitness ranking of the individual in the population, and a and b represent the number of individuals adopting Gaussian mutation and Cauchy mutation respectively.
[0013] The beneficial effects of the present invention are The self - adaptive compensation method for geomagnetic vector measurement based on the improved mayfly algorithm of the present invention can eliminate the interference of the induced magnetic field and the fixed magnetic field during the geomagnetic vector measurement, so as to realize the geomagnetic vector measurement in an environment with an interfering magnetic field; compared with the standard mayfly algorithm and the particle swarm algorithm, the algorithm of the present invention can achieve higher - precision measurement of the geomagnetic field and fewer iteration times. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 is the schematic diagram of the self - adaptive compensation method based on the improved mayfly algorithm of the present invention; Figure 2 is the comparison diagram of geomagnetic components before and after compensation in the present invention; Figure 3 is the comparison of the total geomagnetic field before and after compensation in the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0015] The present invention will be described in detail below in conjunction with the drawings and specific embodiments.
[0016] The present invention provides an adaptive compensation method for geomagnetic vector measurement error based on an improved mayfly algorithm. A magnetic field sensor and an attitude sensor are used to measure the carrier environmental magnetic field and attitude. After calculating the standard geomagnetic field value of the area where the carrier is located through the IGRF model (International Geomagnetic Reference Field model), a compensation model for geomagnetic vector measurement error is established based on the carrier interference magnetic field model. The global optimal solution of the compensation parameters of the model is calculated using the mayfly algorithm. Finally, the error compensation of the geomagnetic vector measurement is realized based on the optimal compensation parameters and the compensation model.
[0017] Embodiment 1 The adaptive compensation method for geomagnetic vector measurement error based on an improved mayfly algorithm, as Figure 1 shown, is specifically implemented according to the following steps: Step 1: Install the attitude sensor and the magnetic field sensor on the carrier; Step 2: Collect the carrier environmental magnetic field and attitude data through the magnetic field sensor and the attitude sensor, and calculate the projection components of the standard geomagnetic field value of the area where the carrier is located on the magnetic field sensor through the IGRF model and the attitude data; Step 3: Establish a compensation model for geomagnetic vector measurement error based on the carrier interference magnetic field model. Using the standard geomagnetic field value and the carrier environmental magnetic field and attitude data collected by the magnetic field sensor and the attitude sensor as known conditions, and using the carrier induced magnetic field coefficient matrix and the fixed magnetic field interference vector as parameters to be solved, calculate the optimal solution of the compensation parameters using the mayfly algorithm; Step 4: Calculate the compensated geomagnetic field value based on the optimal compensation parameters and the geomagnetic vector measurement error compensation model.
[0018] Embodiment 2 The adaptive compensation method for geomagnetic vector measurement error based on an improved mayfly algorithm, in which in Step 2, according to the carrier heading angle, pitch angle, and roll angle data collected by the attitude sensor, calculate the transformation matrix between the geographic coordinate system and the carrier coordinate system, so as to calculate the three-component projection of the standard geomagnetic field value on the magnetic field sensor. The calculation formula of the transformation matrix from the geographic coordinate system to the carrier coordinate system is as follows: (1) where γ is the pitch angle, θ is the roll angle, and ψ is the heading angle.
[0019] Embodiment 3 The adaptive compensation method for geomagnetic vector measurement error based on an improved mayfly algorithm, in which Step 3 is specifically implemented according to the following steps: Step 3.1: Establish a carrier interference model including a fixed magnetic field and an induced magnetic field without considering the installation error of the magnetic sensor; Step 3.2: Establish a magnetic field measurement error compensation model according to the carrier interference model; Step 3.3, initialize the male and female mayfly populations in the generated mayfly algorithm by the method of hierarchical-quasi-random mixed sampling. Each mayfly is a 1-row and 12-column vector, representing the induced magnetic field coefficient matrix and the compensation parameters in the fixed magnetic field; Step 3.4, since the search space ranges of the induced magnetic field coefficient matrix parameters and the fixed magnetic field parameters are different, and to prevent the parameters with a large search space range from dominating the results when updating the population velocity subsequently, map the fixed magnetic field parameters to the search space range of the induced magnetic field coefficient matrix parameters through parameter normalization; Step 3.5, select a fitness function and evaluate the quality of the current position of the mayfly by calculating the magnitude of the fitness function; Step 3.6, calculate the corresponding fitness function according to the initial positions of the male and female mayflies (the parameters of the fixed magnetic field need to be restored to the actual values each time the fitness is calculated), then select the optimal positions of the male and female mayfly populations and the historical optimal positions of the individuals according to the fitness values, and then update the velocity and position of the male mayflies, and then update the global optimal fitness; Step 3.7, update the velocity and position of the female mayflies, and then update the global optimal historical fitness; Step 3.8, select some samples from the updated male and female mayfly populations, and select the optimal, second-best, etc. individuals for mating; Step 3.9, apply perturbations to the mayfly individuals by adopting a mixed mutation strategy combining Gaussian mutation and Cauchy mutation, so that the algorithm takes into account both local optimization and global optimization; Step 3.10, calculate the population fitness, and update the global optimal fitness and optimal position, as well as the individual historical optimal fitness and optimal position; Step 3.11, repeatedly execute Steps 3.6 to 3.10 until the stop condition is met and end, and obtain the optimal position of the population as the optimal compensation parameter.
[0020] Example 4 An adaptive compensation method for geomagnetic vector measurement errors based on an improved mayfly algorithm, in which in Step 3.1, the carrier interference model is: (2) where B m is the magnetic sensor measurement value, B e is the standard geomagnetic field, K ic is the induced magnetic field coefficient, and B p is the three projection components of the fixed magnetic field on the magnetic sensor; In Step 3.2, the magnetic field measurement error compensation model is: (3) where K m =(I + Kic ) -1 , where I is the identity matrix.
[0021] The calculation formula of the fitness function in step 3.5 is as follows: (4) Among them, N represents the number of data points collected by the magnetic sensor; The update formula of the speed of male mayflies in step 3.6 is as follows: (5) Among them, t is the number of iterations, v ij represents the speed of the i-th male mayfly in the j-th dimensional space, x ij represents the position of the i-th male mayfly in the j-th dimensional space, p best is the historical optimal position of the i-th male mayfly, g best is the optimal position of the mayfly population; a1 and a2 are the attraction coefficients of male mayflies; β is the visibility coefficient; r p represents the distance between the current position and the historical optimal position of the male mayfly; r g represents the distance between the current position and the optimal position of the population of male mayflies; d represents the dance coefficient, which is used to attract female mayflies; r is a random coefficient, and r ∈ [-1, 1]; The update formula of the position is as follows: (6).
[0022] Example 5 An adaptive compensation method for geomagnetic vector measurement error based on an improved mayfly algorithm, where the update formula of the speed of female mayflies in step 3.7 is as follows: (7) Among them, a3 represents the attraction coefficient of female mayflies; r m represents the distance between male mayflies and female mayflies; f l is the random walk coefficient; The update formula of the position is as follows: (8) The formula for mating in step 3.8 is as follows: (9) (10) In the formula, O1 and O2 are the generated offspring, m represents male mayflies, f represents female mayflies, and L is a random number and L ∈ [-1, 1].
[0023] In step 3.9, the specific mutation strategy is to sample Cauchy mutation for individuals with lower fitness rankings and Gaussian mutation for individuals with higher fitness rankings. The hybrid mutation formula is as follows: (11) where M is an individual in the mayfly population, is the Gaussian mutation step size, is the Cauchy mutation step size, rank(M) is the fitness ranking of the individual in the population, and a and b represent the number of individuals using Gaussian mutation and Cauchy mutation respectively.
[0024] Example 6 An adaptive compensation method for geomagnetic vector measurement error based on an improved mayfly algorithm. Step 1: In the simulation experiment, first, the attitude data collected by the attitude sensor was simulated. Subsequently, using the International Geomagnetic Reference Field (IGRF) model and the collected attitude data, the projection components of the standard geomagnetic field value in the area where the carrier is located on the magnetic field sensor were calculated. Then, simulated interference magnetic field data was generated and superimposed on the standard geomagnetic field. Finally, Gaussian noise with a mean of 0 and a standard deviation of 500 nanotesla (nT) was added to the superimposed magnetic field data.
[0025] Step 2: Based on the carrier interference magnetic field model, a geomagnetic vector measurement error compensation model was established, with the carrier induction magnetic field coefficient matrix and the fixed magnetic field interference vector as the parameters to be solved, and the parameters of the improved mayfly algorithm were initialized. The initial parameters of the algorithm are as follows in the table: Table 1 Related parameters of the improved mayfly algorithm
[0026] Step 3: Based on the optimal compensation parameters and the geomagnetic vector measurement error compensation model, the compensated geomagnetic field value was calculated and compared with a method based on the damped particle swarm optimization (DPSO). The comparison of the three components of the geomagnetic field before and after compensation is as Figure 2 shown, and the comparison of the total geomagnetic field before and after compensation is as Figure 3 . The average absolute error of the magnetic field before and after compensation is as shown in the following table.
[0027] Table 2 Average absolute error before and after compensation
[0028] The present invention constructs a geomagnetic vector measurement error compensation model and provides a geomagnetic vector measurement error compensation method based on an improved mayfly algorithm. The optimal compensation parameters calculated by the algorithm can achieve higher-precision magnetic field measurement.
Claims
1. An adaptive compensation method for geomagnetic vector measurement error based on an improved mayfly algorithm, characterized in that, The magnetic field sensor and the attitude sensor are used to measure the magnetic field and attitude of the carrier environment. After calculating the standard geomagnetic field value of the area where the carrier is located through the IGRF model, a geomagnetic vector measurement error compensation model is established based on the carrier interference magnetic field model. The global optimal solution of the compensation parameters of the model is calculated using the mayfly algorithm. Finally, the error compensation of the geomagnetic vector measurement is realized based on the optimal compensation parameters and the compensation model.
2. The adaptive compensation method for geomagnetic vector measurement error based on the improved mayfly algorithm according to claim 1, wherein Specifically, it is implemented according to the following steps: Step 1: Install the attitude sensor and the magnetic field sensor on the carrier; Step 2: Collect the magnetic field and attitude data of the carrier environment through the magnetic field sensor and the attitude sensor, and calculate the projection components of the standard geomagnetic field value of the area where the carrier is located on the magnetic field sensor through the IGRF model and the attitude data; Step 3: Establish a geomagnetic vector measurement error compensation model based on the carrier interference magnetic field model. Using the standard geomagnetic field value and the magnetic field and attitude data of the carrier environment collected by the magnetic field sensor and the attitude sensor as known conditions, and the carrier-induced magnetic field coefficient matrix and the fixed magnetic field interference vector as parameters to be solved, calculate the optimal solution of the compensation parameters using the mayfly algorithm; Step 4: Calculate the compensated geomagnetic field value based on the optimal compensation parameters and the geomagnetic vector measurement error compensation model.
3. The adaptive compensation method for geomagnetic vector measurement error based on the improved mayfly algorithm according to claim 2, wherein In Step 2, according to the carrier heading angle, pitch angle, and roll angle data collected by the attitude sensor, calculate the transformation matrix between the geographic coordinate system and the carrier coordinate system, so as to calculate the three-component projection of the standard geomagnetic field value on the magnetic field sensor.
4. The geomagnetic vector measurement error adaptive compensation method based on the improved mayfly algorithm according to claim 3, characterized in that In Step 2, the calculation formula for the transformation matrix from the geographic coordinate system to the carrier coordinate system is as follows: (1) where, γ is the pitch angle, θ is the roll angle, and ψ is the heading angle.
5. The geomagnetic vector measurement error adaptive compensation method based on the improved mayfly algorithm according to claim 2, wherein Step 3 is specifically implemented according to the following steps: Step 3.1: Establish a carrier interference model including the fixed magnetic field and the induced magnetic field without considering the installation error of the magnetic sensor; Step 3.2: Establish a magnetic field measurement error compensation model according to the carrier interference model; Step 3.3: Initialize and generate the male and female mayfly populations in the mayfly algorithm through the method of stratified-quasi-random hybrid sampling. Each mayfly is a 1-row 12-column vector, representing the compensation parameters in the induced magnetic field coefficient matrix and the fixed magnetic field; Step 3.4: Map the fixed magnetic field parameters to the parameter search range of the induced magnetic field coefficient matrix through parameter normalization; Step 3.5: Select a fitness function and evaluate the quality of the current position of the mayfly by calculating the size of the fitness function; Step 3.6: Calculate the corresponding fitness function according to the initial positions of the male and female mayflies, then select the optimal positions of the male and female mayfly populations and the historical optimal positions of the individuals according to the fitness values, then update the speed and position of the male mayflies, and then update the global optimal fitness; Step 3.7: Update the speed and position of the female mayflies, and then update the global optimal historical fitness; Step 3.8: Select some samples from the updated male and female mayfly populations, and select the optimal, second-best, etc. individuals for mating; Step 3.9: Apply perturbations to the mayfly individuals using a hybrid mutation strategy combining Gaussian mutation and Cauchy mutation, so that the algorithm takes into account both local optimization and global optimization; Step 3.10, calculate the population fitness, and update the global optimal fitness, the optimal position, the individual historical optimal fitness, and the optimal position; Step 3.11, repeatedly execute Steps 3.6 to 3.10 until the stop condition is met and end, and obtain the optimal position of the population as the optimal compensation parameter.
6. The adaptive compensation method for geomagnetic vector measurement error based on the improved mayfly algorithm according to claim 5, characterized in that In the said Step 3.1, the carrier interference model is: (2) Among them, B m is the measurement value of the magnetic sensor, B e is the standard geomagnetic field, K ic is the induction magnetic field coefficient, B p is the three components of the projection of the fixed magnetic field on the magnetic sensor; In Step 3.2, the magnetic field measurement error compensation model is: (3) Among them, K m =(I + K ic ) -1 , where I is the identity matrix.
7. The adaptive compensation method for geomagnetic vector measurement error based on the improved mayfly algorithm according to claim 5, wherein In the said Step 3.5, the calculation formula of the fitness function is as follows: (4) Wherein, N represents the number of data points collected by the magnetic sensor; In Step 3.6, the update formula of the male mayfly speed is as follows: (5) where t is the number of iterations, v ij represents the velocity of the i-th male mayfly in the j-th dimensional space, x ij represents the position of the i-th male mayfly in the j-th dimensional space, p best is the historical optimal position of the i-th male mayfly, g best is the optimal position of the mayfly population; a1 and a2 are the attraction coefficients of male mayflies; β is the visibility coefficient; r p represents the distance between the current position and the historical optimal position of the male mayfly; r g represents the distance between the current position and the optimal position of the population of male mayflies; d represents the dance coefficient, which is used to attract female mayflies; r is a random coefficient, and r ∈ [-1, 1]; The update formula of the position is as follows: (6)。 8. The adaptive compensation method for geomagnetic vector measurement error based on the improved mayfly algorithm according to claim 5, characterized in that In the said Step 3.7, the update formula of the female mayfly speed is as follows: (7) Among them, a3 represents the attraction coefficient of female mayflies; r m represents the distance between male mayflies and female mayflies; f l is the random walk coefficient; The update formula of the position is as follows: (8) In Step 3.8, the mating formula is as follows: (9) (10) In the formula, O1 and O2 are the generated offspring, m represents the male mayfly, f represents the female mayfly, and L is a random number and L ∈ [-1, 1].
9. The adaptive compensation method for geomagnetic vector measurement error based on the improved mayfly algorithm according to claim 5, wherein In the said Step 3.9, the specific mutation strategy is to sample Cauchy mutation for individuals with a lower fitness ranking and Gaussian mutation for individuals with a higher fitness ranking. The mixed mutation formula is as follows: (11) Among them, M is an individual of the mayfly population, is the Gaussian mutation step size, is the Cauchy mutation step size, rank(M) is the fitness ranking of the individual in the population, and a and b respectively represent the number of individuals using Gaussian mutation and Cauchy mutation.