# An Adaptive Orientation Estimation Method for Magnetic and Inertial Sensors in the Presence of Magnetic Disturbances

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Materials and Methods

#### 2.1. Sensor Orientation Representation

#### 2.2. Sensor Fusion Algorithm: Gradient Descent Algorithm

#### 2.3. The Proposed Adaptive Method

#### 2.3.1. Stationary State Detection

#### 2.3.2. Magnetic Disturbance Severity Determination

#### 2.4. Accuracy Evaluation Based on Quaternion

#### 2.5. Testing Apparatus

#### 2.5.1. Magnetic/Inertial Measurement Unit

#### 2.5.2. Customized Instrumented Gimbal

#### 2.5.3. Sensor Configuration

#### 2.6. Parameters Determination for the Proposed Method

## 3. Experimental Method

#### 3.1. Stationary State with Magnetic Disturbance Experimental Protocol

#### 3.2. Dynamic State without Magnetic Disturbance Experimental Protocol

#### 3.3. Dynamic State with Magnetic Disturbance Experimental Protocol

## 4. Results

#### 4.1. Results under Stationary State with Magnetic Disturbance

#### 4.2. Results under Dynamic State without Magnetic Disturbance

#### 4.3. Results under Dynamic State with Magnetic Disturbance

## 5. Discussion and Conclusions

## Acknowledgments

## Author Contributions

## Conflicts of Interest

## References

- Yang, S.Z.; Li, Q.G. Inertial sensor-based methods in walking speed estimation: A systematic review. Sensors
**2012**, 12, 6102–6116. [Google Scholar] [CrossRef] [PubMed] - Kortier, H.G.; Antonsson, J.; Schepers, H.M.; Gustafsson, F.; Veltink, P.H. Hand pose estimation by fusion of inertial and magnetic sensing aided by a permanent magnet. IEEE Trans. Neural Syst. Rehabil. Eng.
**2015**, 23, 796–806. [Google Scholar] [CrossRef] [PubMed] - Kortier, H.G.; Sluiter, V.I.; Roetenberg, D.; Veltink, P.H. Assessment of hand kinematics using inertial and magnetic sensors. J. Neuroeng. Rehabil.
**2014**, 11, 70. [Google Scholar] [CrossRef] [PubMed] - Kun, L.; Inoue, Y.; Shibata, K.; Enguo, C. Ambulatory estimation of knee-joint kinematics in anatomical coordinate system using accelerometers and magnetometers. IEEE Trans. Biomed. Eng.
**2011**, 58, 435–442. [Google Scholar] [CrossRef] [PubMed] - Iosa, M.; Picerno, P.; Paolucci, S.; Morone, G. Wearable inertial sensors for human movement analysis. Expert Rev. Med. Devices
**2016**, 13, 641–659. [Google Scholar] [CrossRef] [PubMed] - Olivares, A.; Gorriz, J.M.; Ramirez, J.; Olivares, G. Using frequency analysis to improve the precision of human body posture algorithms based on Kalman filters. Comput. Biol. Med.
**2016**, 72, 229–238. [Google Scholar] [CrossRef] [PubMed] - Metge, J.; Megret, R.; Giremus, A.; Berthoumieu, Y.; Decamps, T. Calibration of an inertial-magnetic measurement unit without external equipment, in the presence of dynamic magnetic disturbances. Meas. Sci. Technol.
**2014**, 25, 125106. [Google Scholar] [CrossRef] - Sabatini, A.M. Estimating three-dimensional orientation of human body parts by inertial/magnetic sensing. Sensors
**2011**, 11, 1489–1525. [Google Scholar] [CrossRef] [PubMed] - Yuan, X.; Yu, S.; Zhang, S.; Wang, G.; Liu, S. Quaternion-based unscented kalman filter for accurate indoor heading estimation using wearable multi-sensor system. Sensors
**2015**, 15, 10872–10890. [Google Scholar] [CrossRef] [PubMed] - Combettes, C.; Renaudin, V. Delay kalman filter to estimate the attitude of a mobile object with indoor magnetic field gradients. Micromachines
**2016**, 7, 79. [Google Scholar] [CrossRef] - Zhang, S.Z.; Yu, S.; Liu, C.J.; Yuan, X.B.; Liu, S. A dual-linear kalman filter for real-time orientation determination system using low-cost MEMS sensors. Sensors
**2016**, 16, 264. [Google Scholar] [CrossRef] [PubMed] - Mahony, R.; Hamel, T.; Pflimlin, J.-M. Nonlinear complementary filters on the special orthogonal group. IEEE Trans. Autom. Control
**2008**, 53, 1203–1218. [Google Scholar] [CrossRef] - Madgwick, S.; Harrison, A.; Vaidyanathan, R. Estimation of IMU and MARG orientation using a gradient descent algorithm. In Proceedings of the 2011 IEEE International Conference on Rehabilitation Robotics (ICORR), Zurich, Switzerland, 29 June–1 July 2011; pp. 1–7. [Google Scholar]
- Huang, Y.; Jirattigalachote, W.; Cutkosky, M.R.; Zhu, X.; Shull, P.B. Novel foot progression angle algorithm estimation via foot-worn, magneto-inertial sensing. IEEE Trans. Biomed. Eng.
**2016**, 63, 2278–2285. [Google Scholar] [CrossRef] [PubMed] - Zhongyan, L.; Mengchun, P.; Ying, T.; Qi, Z.; Yunling, G.; Chengbiao, W.; Dixiang, C.; Wugang, T. A new method for distortion magnetic field compensation of a geomagnetic vector measurement system. Meas. Sci. Technol.
**2016**, 27, 125005. [Google Scholar] - Yadav, N.; Bleakley, C. Accurate orientation estimation using AHRS under conditions of magnetic distortion. Sensors
**2014**, 14, 20008–20024. [Google Scholar] [CrossRef] [PubMed] - Lee, J.K.; Park, E.J. Minimum-order kalman filter with vector selector for accurate estimation of human body orientation. IEEE Trans. Rob.
**2009**, 25, 1196–1201. [Google Scholar] - Roetenberg, D.; Luinge, H.J.; Baten, C.T.M.; Veltink, P.H. Compensation of magnetic disturbances improves inertial and magnetic sensing of human body segment orientation. IEEE Trans. Neural Syst. Rehabil. Eng.
**2005**, 13, 395–405. [Google Scholar] [CrossRef] [PubMed] - Daponte, P.; De Vito, L.; Rapuano, S.; Riccio, M.; Picariello, F. Compensating magnetic disturbances on MARG units by means of a low complexity data fusion algorithm. In Proceedings of the 2015 IEEE International Symposium on Medical Measurements and Applications (MeMEA), Turin, Italy, 7–9 May 2015; pp. 157–162. [Google Scholar]
- Sabatini, A.M. Quaternion-based extended kalman filter for determining orientation by inertial and magnetic sensing. IEEE Trans. Biomed. Eng.
**2006**, 53, 1346–1356. [Google Scholar] [CrossRef] [PubMed] - Valenti, R.G.; Dryanovski, I.; Xiao, J.Z. Keeping a good attitude: A quaternion-based orientation filter for IMUs and MARGs. Sensors
**2015**, 15, 19302–19330. [Google Scholar] [CrossRef] [PubMed] - Ligorio, G.; Sabatini, A.M. Dealing with magnetic disturbances in human motion capture: A survey of techniques. Micromachines
**2016**, 7, 43. [Google Scholar] [CrossRef] - Diebel, J. Representing Attitude: Euler Angles, Unit Quaternions, and Rotation Vectors; Stanford University: Stanford, CA, USA, 2006. [Google Scholar]
- Bergamini, E.; Ligorio, G.; Summa, A.; Vannozzi, G.; Cappozzo, A.; Sabatini, A.M. Estimating orientation using magnetic and inertial sensors and different sensor fusion approaches: Accuracy assessment in manual and locomotion tasks. Sensors
**2014**, 14, 18625–18649. [Google Scholar] [CrossRef] [PubMed] - Nocedal, J.; Wright, S.J. Numerical Optimization; Springer: New York, NY, USA, 2006. [Google Scholar]
- Skog, I.; Handel, P.; Nilsson, J.-O.; Rantakokko, J. Zero-velocity detection—An algorithm evaluation. IEEE Trans. Biomed. Eng.
**2010**, 57, 2657–2666. [Google Scholar] [CrossRef] [PubMed] - Madgwick, S. AHRS Algorithms and Calibration Solutions to Facilitate New Applications Using Low-Cost MEMS. Ph.D. Thesis, University of Bristol, Bristol, UK, 2014. [Google Scholar]
- Faber, G.S.; Chang, C.-C.; Rizun, P.; Dennerlein, J.T. A novel method for assessing the 3-D orientation accuracy of inertial/magnetic sensors. J. Biomech.
**2013**, 46, 2745–2751. [Google Scholar] [CrossRef] [PubMed] - x-IMU User Manual 5.2. X-io Technologies. Available online: http://www.x-io.co.uk (accessed 20 August 2016).
- Song, N.F.; Cai, Q.Z.; Yang, G.L.; Yin, H.L. Analysis and calibration of the mounting errors between inertial measurement unit and turntable in dual-axis rotational inertial navigation system. Meas. Sci. Technol.
**2013**, 24, 115002. [Google Scholar] [CrossRef] - Brennan, A.; Zhang, J.; Deluzio, K.; Li, Q. Quantification of inertial sensor-based 3D joint angle measurement accuracy using an instrumented gimbal. Gait Posture
**2011**, 34, 320–323. [Google Scholar] [CrossRef] [PubMed] - De Vries, W.H.K.; Veeger, H.E.J.; Baten, C.T.M.; van der Helm, F.C.T. Magnetic distortion in motion labs, implications for validating inertial magnetic sensors. Gait Posture
**2009**, 29, 535–541. [Google Scholar] [CrossRef] [PubMed] - Widodo, R.B.; Wada, C. Attitude estimation using kalman filtering: external acceleration compensation considerations. J. Sens.
**2016**, 10, 6943040. [Google Scholar] [CrossRef] - Lebel, K.; Boissy, P.; Hamel, M.; Duval, C. Inertial measures of motion for clinical biomechanics: Comparative assessment of accuracy under controlled conditions—Changes in accuracy over time. PLoS ONE
**2015**, 10, e0118361. [Google Scholar] [CrossRef] [PubMed] - Tao, W.J.; Zhang, J.Y.; Li, G.Y.; Liu, T.; Liu, F.P.; Yi, J.G.; Wang, H.S.; Inoue, Y. A wearable sensor system for lower-limb rehabilitation evaluation using the GRF and CoP distributions. Meas. Sci. Technol.
**2016**, 27, 6943040. [Google Scholar] [CrossRef] - Ligorio, G.; Sabatini, A.M. A novel kalman filter for human motion tracking with an inertial-based dynamic inclinometer. IEEE Trans. Biomed. Eng.
**2015**, 62, 2033–2043. [Google Scholar] [CrossRef] [PubMed]

**Figure 3.**The geomagnetic field in the Earth frame. $g$ is the gravity acceleration. h is the geomagnetic field. The length of h represents the magnitude. The angle $\alpha $ between the horizontal and magnetic field is defined as the dip angle.

**Figure 6.**The magnetic field measured by a well calibrated MIMU. (

**a**) The measured 3D magnetic field; (

**b**) the magnitude of the magnetic field.

**Figure 7.**The diagram of stationary state test. The magnet was held over the MIMU, and moved around between boundary A and B.

**Figure 8.**Comparison of Euler angles estimated by different fusion algorithms under stationary state. (

**a**) Three-axis magnetic field measured by the magnetometer; The roll (

**b**), pitch (

**c**) and yaw (

**d**) angle estimated by original MIMU gradient descent algorithm and the proposed method.

**Figure 9.**The orientation estimated by original MIMU algorithm (solid) and proposed method (dotted) in dynamic state. (

**a**,

**c**,

**e**) Euler angles; (

**b**,

**d**,

**f**) The error of Euler angles.

**Figure 11.**Euler angles converted from quaternion error among IMU algorithm, MIMU algorithm and proposed method from one example trial. (

**a**) Roll angle; (

**b**) Pitch angle; (

**c**) Yaw angle.

**Figure 12.**The mean and standard deviation of RMSEs of Euler angles and orientation error of all the ten trials. The bars represent the 95% confidence intervals.

© 2017 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 (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Fan, B.; Li, Q.; Wang, C.; Liu, T. An Adaptive Orientation Estimation Method for Magnetic and Inertial Sensors in the Presence of Magnetic Disturbances. *Sensors* **2017**, *17*, 1161.
https://doi.org/10.3390/s17051161

**AMA Style**

Fan B, Li Q, Wang C, Liu T. An Adaptive Orientation Estimation Method for Magnetic and Inertial Sensors in the Presence of Magnetic Disturbances. *Sensors*. 2017; 17(5):1161.
https://doi.org/10.3390/s17051161

**Chicago/Turabian Style**

Fan, Bingfei, Qingguo Li, Chao Wang, and Tao Liu. 2017. "An Adaptive Orientation Estimation Method for Magnetic and Inertial Sensors in the Presence of Magnetic Disturbances" *Sensors* 17, no. 5: 1161.
https://doi.org/10.3390/s17051161