# Accuracy Improvement of Attitude Determination Systems Using EKF-Based Error Prediction Filter and PI Controller

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Related Works

#### 2.1. EKF Model and Parameters

## 3. Materials and Methods

#### 3.1. Attitude Error Prediction Filter

#### 3.2. PI Controller and Regulator

## 4. Experimental Results and Discussion

#### 4.1. Static Tests and Results

#### 4.2. Dynamic Test and Results

## 5. Conclusions

## Author Contributions

## Funding

## Conflicts of Interest

## References

- Sheng, A.H.; Zhang, T. MEMS-based low-cost strap-down AHRS research. Measurement
**2015**, 59, 63–72. [Google Scholar] [CrossRef] - Doostdar, P.; Keighobadi, J. Design and implementation of SMO for a nonlinear MIMO AHRS. Mech. Syst. Signal Process.
**2012**, 32, 94–115. [Google Scholar] [CrossRef] - Wang, Y.; Li, N.; Chen, X.; Liu, M. Design and implementation of an AHRS based on MEMS sensors and complementary filtering. Adv. Mech. Eng.
**2014**, 6, 214726. [Google Scholar] [CrossRef] [Green Version] - Islam, M.S.; Shajid-Ul-Mahmud, M.; Islam, T.; Amin, M.S.; Hossam-E-Haider, M. A low-cost MEMS and complementary filter based Attitude Heading Reference System (AHRS) for low speed aircraft. In Proceedings of the 2016 3rd International Conference on Electrical Engineering and Information Communication Technology (ICEEICT), Dhaka, Bangladesh, 22–24 September 2016. [Google Scholar]
- 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] [Green Version] - Li, W.; Zhang, Z.; Sun, P. Quaternion-based kalman filter for AHRS using an adaptive-step gradient descent algorithm. Int. J. Adv. Robot. Syst.
**2015**, 12, 131. [Google Scholar] - Guerrero-Castellanos, J.F.; HMadrigal-Sastre, S.; Durand, N.; Marchand, W.F.; Guerrero-Sanchez; Salmeron, B.B. Design and implementation of an Attitude and Heading Reference System (AHRS). In Proceedings of the 2011 8th International Conference on Electrical Engineering, Computing Science and Automatic Control, Merida City, Mexico, 26–28 October 2011; pp. 1–5. [Google Scholar]
- Rodrigo, M.; Grau, A. An Attitude and Heading Reference System (AHRS) based in a dual filter. In ETFA2011; IEEE: Toulouse, France, 2011; pp. 1–8. [Google Scholar]
- Johansen, T.A.; Brekke, E. Globally exponentially stable Kalman filtering for SLAM with AHRS. In Proceedings of the 2016 19th International Conference on Information Fusion (FUSION), Heidelberg, Germany, 5–8 July 2016; pp. 909–916. [Google Scholar]
- Ko, N.Y.; Choi, H.T.; Lee, C.M.; Moon, Y.S. Attitude estimation using depth measurement and AHRS data for underwater vehicle navigation. In OCEANS 2016—Shanghai; IEEE: Shanghai, China, 2016; pp. 1–4. [Google Scholar]
- Pourtakdoust, S.H.; Ghanbarpour Asl, H. An adaptive unscented kalman filter for quaternion-based orientation estimation in low-cost AHRS. Aircraft Eng. Aerosp. Technol.
**2007**, 79, 485–493. [Google Scholar] [CrossRef] - Min-Shik, R.; Beom-Soo, K. Dynamic accuracy improvement of a MEMS AHRS for small UAVs. Int. J. Precis. Eng. Manuf.
**2018**, 19, 1457–1466. [Google Scholar] - Lu, J.; Xie, L.; Li, B. Applied quaternion optimization method in transfer alignment for airborne AHRS under large misalignment angle. IEEE Trans. Instrum. Meas.
**2016**, 65, 346–354. [Google Scholar] [CrossRef] - Madgwick, S.O.H.; Harrison, A.J.L.; Vaidyanathan, R. Estimation of IMU and MARG orientation using a gradient descent algorithm. In Proceedings of the 2011 IEEE International Conference on Rehabilitation Robotics, Zurich, Switzerland, 27 June–1 July 2011; pp. 1–7. [Google Scholar]
- Nagesh, Y.; Bleakley, C. Accurate orientation estimation using AHRS under conditions of magnetic distortion. Sensors
**2014**, 14, 20008–20024. [Google Scholar] - Paola, P.; Belli, A.; Maurizi, L.; Palma, L.; Pernini, L.; Paniccia, M.; Valenti, S. A wearable fall detector for elderly people based on AHRS and barometric sensor. IEEE Sens. J.
**2016**, 16, 6733–6744. [Google Scholar] - Adesida, Y.; Papi, E.; McGregor, A.H. Exploring the role of wearable technology in sport kinematics and kinetics: A systematic review. Sensors
**2019**, 19, 1597. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Rawashdeh, S.A.; Rafeldt, D.A.; Uhl, T.L. Wearable IMU for shoulder injury prevention in overhead sports. Sensors
**2016**, 16, 1847. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Nak Yong, K.; Jeong, S. Attitude estimation and DVL based navigation using low-cost MEMS AHRS for UUVs. In Proceedings of the 2014 11th International Conference on Ubiquitous Robots and Ambient Intelligence (URAI), Kuala Lumpur, Malaysia, 12–15 November 2014; pp. 605–607. [Google Scholar]
- Diaz, E.M.; de Ponte Muller, F.; Jimenez, A.R.; Francisco, Z. Evaluation of AHRS algorithms for inertial personal localization in industrial environments. In Proceedings of the 2015 IEEE International Conference on Industrial Technology (ICIT), Seville, Spain, 17–19 March 2015; pp. 3412–3417. [Google Scholar]
- Gebre-Egziabher, D.; Hayward, R.C.; Powell, J.D. A low-cost GPS/inertial Attitude Heading Reference System (AHRS) for general aviation applications. In Proceedings of the IEEE 1998 Position Location and Navigation Symposium (Cat. No.98CH36153), Palm Springs, CA, USA, 20–23 April 1998; pp. 518–525. [Google Scholar]
- Hayward, R.; Powell, J.D. Single baseline GPS based Attitude Heading Reference System (AHRS) for Aircraft Applications. In Proceedings of the 1999 American Control Conference (Cat. No. 99CH36251), San Diego, CA, USA, 2–4 June 1999; Volume 5, pp. 3655–3659. [Google Scholar]
- Hian-Kun, T.; Shau-Shiun, J.; Fei-Bin, H. Pitch and roll attitude estimation of a small-scaled helicopter using single antenna GPS with gyroscopes. GPS Solut.
**2009**, 13, 209–220. [Google Scholar] - Weideman, J.A.C. Numerical integration of periodic functions: A few examples. Am. Math. Mon.
**2002**, 109, 21–36. [Google Scholar] [CrossRef] - 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] - Shuster, M.D.; Oh, S.D. Three-axis attitude determination from vector observations. J. Guid. Control Dyn.
**1981**, 4, 70–77. [Google Scholar] [CrossRef] - Yun, X.; Bachmann, E.R.; McGhee, R.B. A simplified quaternion-based algorithm for orientation estimation from earth gravity and magnetic field measurements. IEEE Trans. Instrum. Meas.
**2008**, 57, 638–650. [Google Scholar] - Stovner, B.N.; Johansen, T.A.; Fossen, T.I.; Schjølberg, I. Attitude estimation by multiplicative exogenous kalman filter. Automatica
**2018**, 95, 347–355. [Google Scholar] [CrossRef] [Green Version] - Zhu, X.; Ma, M.; Cheng, D.; Zhou, Z. An optimized triad algorithm for attitude determination. Artif. Satell.
**2017**, 52, 41–47. [Google Scholar] [CrossRef] [Green Version] - Mohammed, M.S.; Bellar, A.; Adnane, A.; Boussadia, H. Performance analysis of attitude determination and estimation algorithms applied to low earth orbit satellites. In Proceedings of the 11th International Conference on Control (CONTROL), Belfast, UK, 31 August–2 September 2016; pp. 1–6. [Google Scholar]
- Titterton, D.H.; Weston, J.L. Strapdown Inertial Navigation Technology, 2nd ed.; IEE Radar, Sonar, Navigation, and Avionics Series 17; Institution of Electrical Engineers: Stevenage, UK, 2004. [Google Scholar]
- Mourcou, Q.; Fleury, A.; Franco, C.; Klopcic, F.; Vuillerme, N. Performance evaluation of smartphone inertial sensors measurement for range of motion. Sensors
**2015**, 15, 23168–23187. [Google Scholar] [CrossRef] [PubMed] [Green Version]

**Figure 1.**Overview of the attitude and heading reference system (AHRS) method with error prediction filter, proprtional integral (PI) controller, and regulator.

**Figure 2.**Block diagram of attitude error prediction, PI controller, and regulator. (

**1**) Attitude error prediction; (

**2**) PI controller; (

**3**) regulator.

**Figure 3.**Module MPU-9250 and smartphone iPhone 11 rotation trajectory for heading test: (

**a**) 180 heading degree; (

**b**) 135 heading degree; (

**c**) 90 heading degree.

**Figure 4.**Estimated attitude before and after proposed method compared to the iPhone reference: (

**a**) roll; (

**b**) pitch.

**Figure 6.**Absolute error before and after performing the proposed filter: (

**a**) roll; (

**b**) pitch; (

**c**) heading.

**Figure 8.**Estimated orientation before and after performing the propsed method compared to the true reference orientation: (

**a**) roll; (

**b**) pitch; (

**c**) heading.

**Figure 9.**Absolute attitude error before and after performing the method for each orientation channel: (

**a**) roll; (

**b**) pitch; (

**c**) heading.

**Figure 10.**(

**a**) Roll error and roll error prediction signal; (

**b**) pitch error and pitch error prediction signal; (

**c**) heading error and heading error prediction signal.

Angle | Samsung S10 | iPhone 11 |
---|---|---|

Roll’s RMSE | 0.3801° | 0.2312° |

Pitch’s RMSE | 0.4117° | 0.3993° |

Yaw’s RMSE | 1.2313° | 0.7388° |

Experiment | Proportional Gain (${\mathit{K}}_{\mathit{P}}$) | Integral Gain (${\mathit{K}}_{\mathit{I}}$) | Regulation Constant ($\mathit{\epsilon}$) |
---|---|---|---|

Roll experiment | ${K}_{P\_1}=-19$ | ${K}_{I\_1}=0.002$ | ${\epsilon}_{1}=-2$ |

Pitch experiment | ${K}_{P\_2}=-75$ | ${K}_{I\_2}=0.5$ | ${\epsilon}_{2}=2$ |

Heading experiment | ${K}_{P\_3}=-2250$ | ${K}_{I\_3}=0.002$ | ${\epsilon}_{3}=24$ |

Channel | Before Performing the Filter | After Performing the Filter | Static Accuracy Improvement |
---|---|---|---|

Roll’ RMSE | 1.7603° | 0.4298° | 75.58% |

Pitch’s RMSE | 3.7735° | 0.7268° | 80.74% |

Heading’s RMSE | 1.1232° | 0.3720° | 66.88% |

Dynamic Accuracy (Heading) | Dynamic Accuracy (Roll and Pitch) | Attitude Output Rate | Operation Temperature | Baud Rate |
---|---|---|---|---|

2.0° RMS | 1.0° RMS | 400 Hz | –40°C to 85 °C | Up to 921,600 |

**Table 5.**Parameters of PI controller and regulator for each orientation experiment in the dynamic test.

Channel | Proportional Gain (${\mathit{K}}_{\mathit{P}}$) | Integral Gain (${\mathit{K}}_{\mathit{I}}$) | Regulation Constant ($\mathit{\epsilon}$) |
---|---|---|---|

Roll | ${K}_{P\_1}=-19$ | ${K}_{I\_1}=0.002$ | ${\epsilon}_{1}=-0.7$ |

Pitch | ${K}_{P\_2}=50$ | ${K}_{I\_2}=0.05$ | ${\epsilon}_{2}=-1.1$ |

Heading | ${K}_{P\_3}=-4000$ | ${K}_{I\_3}=-0.001$ | ${\epsilon}_{3}=-17$ |

**Table 6.**Root mean square error (RMSE) of roll, pitch, and heading before and after proposed filter in dynamic test.

Experiment | Before Performing the Filter | After Performing the Filter | Static Accuracy Improvement |
---|---|---|---|

Roll’s EMSE | 0.9220° | 0.1880° | 79.61% |

Pitch’s RMSE | 0.8611° | 0.4889° | 43.22% |

Heading’s RMSE | 22.6029° | 7.6072° | 66.34% |

© 2020 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**

Farhangian, F.; Landry, R., Jr.
Accuracy Improvement of Attitude Determination Systems Using EKF-Based Error Prediction Filter and PI Controller. *Sensors* **2020**, *20*, 4055.
https://doi.org/10.3390/s20144055

**AMA Style**

Farhangian F, Landry R Jr.
Accuracy Improvement of Attitude Determination Systems Using EKF-Based Error Prediction Filter and PI Controller. *Sensors*. 2020; 20(14):4055.
https://doi.org/10.3390/s20144055

**Chicago/Turabian Style**

Farhangian, Farzan, and Rene Landry, Jr.
2020. "Accuracy Improvement of Attitude Determination Systems Using EKF-Based Error Prediction Filter and PI Controller" *Sensors* 20, no. 14: 4055.
https://doi.org/10.3390/s20144055