Offline Magnetometer Calibration Using Enhanced Particle Swarm Optimization
Abstract
1. Introduction
2. Calibration Model and Ellipsoid Fitting Method
2.1. Magnetometer Calibration Model
2.2. Ellipsoid Fitting Method
3. DAEPSO-Based Ellipsoid Fitting Algorithm
3.1. Standard PSO
3.2. Improvement Strategies of DAEPSO Algorithm
- (1)
- Dynamic stratified elite guidance: Dynamically divides particles into elite and ordinary layers based on individual fitness and crowding distance, utilizing elite particles’ search experience to guide ordinary particles’ exploration direction.
- (2)
- Dynamic inertia weight adjustment: Adaptively adjusts inertia weight according to iteration progress.
- (3)
- Lévy flight-based relearning for inferior particles: Implements Lévy flight for resampling particles trapped in low-quality regions, guiding escape from local optima.
3.2.1. Dynamic Stratified Elite Guidance Mechanism
- (1)
- Elite Measurement and Dynamic Stratification
- (2)
- Differentiated Updates for Elite and Ordinary Layers
3.2.2. Dynamic Inertia Weight Adjustment Mechanism
3.2.3. Lévy Flight-Based Relearning for Inferior Particles
Algorithm 1: Pseudocode of DAEPSO. |
3.3. DAEPSO-Based Ellipsoid Fitting Algorithm
3.3.1. Fitness Function
3.3.2. DAEPSO Parameter Initialization
4. Simulation Experiment Verification
4.1. Simulated Data Generation and Experimental Setup
4.2. Comparison with LSM
4.3. Comparison with PSO Variants
5. Conclusions
- (1)
- Compared to the LSM, DAEPSO-based ellipsoid fitting demonstrates superior anti-interference capability and higher precision when processing outlier-contaminated data, effectively mitigating outlier impact while maintaining stability.
- (2)
- Compared to traditional PSO, TSLPSO, MPSO, and AWPSO, DAEPSO more efficiently locates global optima in ellipsoid fitting and exhibits enhanced reliability and consistency across repeated trials.
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Ding, Y.; Yue, X.; Chen, G.; Si, J. Review of control and guidance technology on hypersonic vehicle. Chin. J. Aeronaut. 2022, 35, 1–18. [Google Scholar] [CrossRef]
- Gao, Z.; Yi, W. Integrated guidance and control design based on optimized sparrow search algorithm for sliding mode pid controller parameters. Int. J. Aeronaut. Space Sci. 2025, prepublish. [Google Scholar] [CrossRef]
- Long, D.; Zhang, X.; Wei, X.; Luo, Z.; Cao, J. A fast calibration and compensation method for magnetometers in strap-down spinning projectiles. Sensors 2018, 18, 4157. [Google Scholar] [CrossRef] [PubMed]
- Li, X.; Li, L.; Tang, K.; Wang, Y.; Cheng, J.; Yan, Q.; Huang, Z. Numerical simulation of the sensor output on macau science satellite-1. Earth Planet. Phys. 2023, 7, 136–143. [Google Scholar] [CrossRef]
- Fang, J.; Sun, H.; Cao, J.; Zhang, X.; Tao, Y. A novel calibration method of magnetic compass based on ellipsoid fitting. IEEE Trans. Instrum. Meas. 2011, 60, 2053–2061. [Google Scholar] [CrossRef]
- Wang, M.; Wang, Y.; Peng, L.; Ye, C. Measurement of triaxial magnetocardiography using high sensitivity tunnel magnetoresistance sensor. IEEE Sens. J. 2019, 19, 9610–9615. [Google Scholar] [CrossRef]
- Li, Z.; Lai, J.; Lyu, P.; Zhang, Q. Experimental design for rapid calibration of three-axis magnetic sensors based on ellipsoidal fitting. Exp. Technol. Manag. 2023, 40, 42–47. [Google Scholar]
- Gong, X.; Song, Z.; Xi, X. Error calibration of three axis magnetometer based on global artificial fish swarm algorithm. In Proceedings of the 2013 IEEE International Conference of IEEE Region 10 (TENCON 2013), Xi’an, China, 22–25 October 2013; pp. 1–4. [Google Scholar]
- Yang, L.; Li, C.; Zhang, S.; Xu, C.; Chen, H.; Xiao, S.; Tang, X.; Li, Y. Correction method of three-axis magnetic sensor based on da–lm. Metals 2022, 12, 428. [Google Scholar] [CrossRef]
- Li, X.; Yan, S.; Liu, J.; Sun, Y.; Yan, Y. Partition beetles antennae search algorithm for magnetic sensor calibration optimization. IEEE Sens. J. 2021, 21, 5967–5974. [Google Scholar] [CrossRef]
- Hu, M.; Li, J.; Dong, Y.; Zhang, Z.; Liu, W.; Zhang, P.; Ping, Y.; Jiang, L.; Yu, Z. Mixed-ggnas: Mixed search-space nas based on genetic algorithm combined with gradient descent for medical image segmentation. Expert Syst. Appl. 2025, 289, 128338. [Google Scholar] [CrossRef]
- Pang, H.; Zhang, Q.; Wang, W.; Wang, J.; Li, J.; Luo, S.; Wan, C.; Chen, D.; Pan, M.; Luo, F. Calibration of three-axis magnetometers with differential evolution algorithm. J. Magn. Magn. Mater. 2013, 346, 5–10. [Google Scholar] [CrossRef]
- Huang, H.; Wang, P.; Shen, H. Magnetometer error compensation algorithm based on immune adaptation particle swarm optimization algorithm. In Proceedings of the 2021 International Conference on Sensing, Measurement & Data Analytics in the era of Artificial Intelligence (ICSMD), Xi’an, China, 21–23 October 2021; pp. 1–5. [Google Scholar]
- Wu, Z.; Wu, Y.; Hu, X.; Wu, M. Calibration of three-axis magnetometer using stretching particle swarm optimization algorithm. IEEE Trans. Instrum. Meas. 2013, 62, 281–292. [Google Scholar] [CrossRef]
- Lei, X.; Zhang, X.; Hao, Y. An intelligent ellipsoid calibration method based on the grey wolf algorithm for magnetic compass. J. Bionic Eng. 2021, 18, 453–461. [Google Scholar] [CrossRef]
- Shaikh, M.S.; Hua, C.; Jatoi, M.A.; Ansari, M.M.; Qader, A.A. Application of grey wolf optimisation algorithm in parameter calculation of overhead transmission line system. IET Sci. Meas. Technol. 2021, 15, 218–231. [Google Scholar] [CrossRef]
- Gao, Z.; Yi, W. Optimizing projectile aerodynamic parameter identification of kernel extreme learning machine based on improved dung beetle optimizer algorithm. Measurement 2025, 239, 115473. [Google Scholar] [CrossRef]
- Shaikh, M.S.; Raj, S.; Babu, R.; Kumar, S.; Sagrolikar, K. A hybrid moth–flame algorithm with particle swarm optimization with application in power transmission and distribution. Decis. Anal. J. 2023, 6, 100182. [Google Scholar] [CrossRef]
- Klingbeil, L.; Eling, C.; Zimmermann, F.; Kuhlmann, H. Magnetic field sensor calibration for attitude determination. J. Appl. Geod. 2014, 8, 97–108. [Google Scholar] [CrossRef]
- Hu, F.; Wu, Y.; Yu, Y.; Nie, J.; Li, W.; Gao, Q. An improved method for the magnetometer calibration based on ellipsoid fitting. In Proceedings of the 2019 12th International Congress on Image and Signal Processing, BioMedical Engineering and Informatics (CISP-BMEI), Huaqiao, China, 19–21 October 2019; pp. 1–5. [Google Scholar]
- Pang, H.; Pan, M.; Chen, J.; Li, J.; Zhang, Q.; Luo, S. Integrated calibration and magnetic disturbance compensation of three-axis magnetometers. Measurement 2016, 93, 409–413. [Google Scholar] [CrossRef]
- Cui, S.; Cui, L.; Du, Y.; Chai, S.; Zhang, B. Calibration of mems accelerometer using kaiser filter and the ellipsoid fitting method. In Proceedings of the 2018 37th Chinese Control Conference (CCC), Wuhan, China, 25–27 July 2018; pp. 4679–4684. [Google Scholar]
- Jain, M.; Saihjpal, V.; Singh, N.; Singh, S.B. An overview of variants and advancements of pso algorithm. Appl. Sci. 2022, 12, 8392. [Google Scholar] [CrossRef]
- Zhao, H.; Su, Z.; Liu, F.; Li, C.; Li, Q. Magnetometer-based phase shifting ratio method for high spinning projectile’s attitude measurement. IEEE Access 2019, 7, 22509–22522. [Google Scholar] [CrossRef]
- Guan, J.; Chen, Z.; Jiang, G. Research on calibration method of triaxial magnetometer based on improved pso-ellipsoid fitting algorithm. Electronics 2025, 14, 1778. [Google Scholar] [CrossRef]
- Gad, A.G. Particle swarm optimization algorithm and its applications: A systematic review. Arch. Comput. Methods Eng. 2022, 29, 2531–2561. [Google Scholar] [CrossRef]
- Li, X.; Zhang, Y.; Hu, W. Ensemble learning training strategy based on multi-objective particle swarm optimization and chasing method. Expert Syst. Appl. 2025, 281, 127777. [Google Scholar] [CrossRef]
- Liu, H.; Zhang, X.W.; Tu, L.P. A modified particle swarm optimization using adaptive strategy. Expert Syst. Appl. 2020, 152, 113353. [Google Scholar] [CrossRef]
- Liu, W.; Wang, Z.; Yuan, Y.; Zeng, N.; Hone, K.; Liu, X. A novel sigmoid-function-based adaptive weighted particle swarm optimizer. IEEE Trans. Cybern. 2021, 51, 1085–1093. [Google Scholar] [CrossRef] [PubMed]
Parameter | Symbol | Value/Range |
---|---|---|
Population size | 100 | |
Parameter dimension | 10 | |
Maximum iterations | T | 500 |
Inertia weight | 0.5, 0.7 |
Name | Value |
---|---|
Geomagnetic intensity/µT | 50 |
Magnetic declination/∘ | |
Magnetic inclination/∘ | |
Sensitivity coefficients | |
Non-orthogonal angles | |
Zero-offset error/µT | |
Soft-iron error | |
Hard-iron error/µT |
Algorithm | Parameters |
---|---|
PSO | |
TSLPSO | |
MPSO | |
AWPSO |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Huang, L.; Chen, Z.; Guan, J.; Huang, J.; Yi, W. Offline Magnetometer Calibration Using Enhanced Particle Swarm Optimization. Mathematics 2025, 13, 2349. https://doi.org/10.3390/math13152349
Huang L, Chen Z, Guan J, Huang J, Yi W. Offline Magnetometer Calibration Using Enhanced Particle Swarm Optimization. Mathematics. 2025; 13(15):2349. https://doi.org/10.3390/math13152349
Chicago/Turabian StyleHuang, Lei, Zhihui Chen, Jun Guan, Jian Huang, and Wenjun Yi. 2025. "Offline Magnetometer Calibration Using Enhanced Particle Swarm Optimization" Mathematics 13, no. 15: 2349. https://doi.org/10.3390/math13152349
APA StyleHuang, L., Chen, Z., Guan, J., Huang, J., & Yi, W. (2025). Offline Magnetometer Calibration Using Enhanced Particle Swarm Optimization. Mathematics, 13(15), 2349. https://doi.org/10.3390/math13152349