Next Article in Journal
Microwave Spoof Surface Plasmon Polariton-Based Sensor for Ultrasensitive Detection of Liquid Analyte Dielectric Constant
Previous Article in Journal
SFA-MDEN: Semantic-Feature-Aided Monocular Depth Estimation Network Using Dual Branches
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Improved Attitude and Heading Accuracy with Double Quaternion Parameters Estimation and Magnetic Disturbance Rejection

Department of Aerospace Engineering, Pusan National University, Busan 46241, Korea
*
Author to whom correspondence should be addressed.
Sensors 2021, 21(16), 5475; https://doi.org/10.3390/s21165475
Submission received: 5 July 2021 / Revised: 6 August 2021 / Accepted: 10 August 2021 / Published: 13 August 2021
(This article belongs to the Section Remote Sensors)

Abstract

:
The use of unmanned aerial vehicle (UAV) applications has grown rapidly over the past decade with the introduction of low-cost microelectromechanical system (MEMS)-based sensors that measure angular velocity, gravity, and magnetic field, which are important for an object orientation determination. However, the use of low-cost sensors has also been limited because their readings are easily distorted by unwanted internal and/or external noise signals such as environmental magnetic disturbance, which lead to errors in attitude and heading estimation results. In an extended Kalman filter (EKF) process, this study proposes a method for mitigating the effect of magnetic disturbance on attitude determination by using a double quaternion parameters for representation of orientation states, which decouples the magnetometer from attitude computation. Additionally, an online measurement error covariance matrix tuning system was implemented to reject the impact of magnetic disturbance on the heading estimation. Simulation and experimental tests were conducted to verify the performance of the proposed methods in resolving the magnetic noise effect on attitude and heading. The results showed that the proposed method performed better than complimentary, gradient descent, and single quaternion-based EKF.

1. Introduction

The attitude and heading reference system (AHRS) plays a significant role in navigation applications. Vehicles with any degree of navigation autonomy require an AHRS to continuously monitor their orientations with respect to a specific reference system [1]. One of the most important applications of an AHRS is the flight control of unmanned aerial vehicles (UAVs). Evidently, UAVs’ global market size has rapidly increased over the last decade owing to their intriguing applications in entertainment, transportation, rescue operations, navigation, military, and other fields. Thus, there is a growing need for an accurate and dependable AHRS.
An AHRS consists of MEMS-based tri-axis sensors, including gyroscopes, accelerometers, and magnetometers, to collect important information about the angular rotation speed, gravity, and Earth’s magnetic field, respectively. The AHRS can potentially determine the 3D orientation of a sensor device by integrating the gyroscope output from known initial conditions with gravity and magnetic field measurements from the accelerometer and magnetometer [2]. However, a precise calculation of sensor orientation is still an onerous task, and the effect of magnetic interference on the magnetometer is one of the barriers [3]. Several researchers have devised algorithms for calculating sensor orientation using low-cost microelectromechanical system (MEMS) sensors. One of the most well-known and preferred algorithms for attitude estimation is the Kalman filter. For instance, a two-step geometrically intuitive correction algorithm is combined with a quaternion-based Kalman filter to estimate attitude in real time [4]. Similarly, a quaternion-based Kalman filter with an adaptive-step gradient descent algorithm was presented in [5], with the goal of offsetting the effect of magnetic distortion. Both studies mentioned earlier focused on reducing magnetic disturbances to improve attitude accuracy by decoupling the attitude and heading calculation. Other studies, such as [6], also attempted to overcome the extended Kalman filter (EKF) estimation accuracy problem by varying the measurement error covariance matrix using a fuzzy-adaptive method. In other words, the device vibration, external acceleration, and magnetic disturbance were considered to make a fuzzy judgment about the selection of the measurement error covariance. In addition, the problem of finding the best measurement error covariance based on sensor data history was addressed using an analytical technique that included transform-based and learning-based approaches for determining the optimal measurement error covariance matrix [7]. In another study, Fan et al. [8] performed a thorough evaluation of various approaches used by different researchers to overcome the challenges associated with the MEMS sensors mentioned earlier, and they presented a comparative performance assessment of the approaches in readily understandable way to spot the problems easily. In particular, the study provided a performance comparison between attitude estimation and magnetic disturbance decoupling, magnetic disturbance compensation, online gyroscope bias compensation, and sensor fusion algorithms.
Poulose et al. [9] addressed five main algorithms in depth: linear Kalman filter (LKF), extended Kalman filter (EKF), unscented Kalman filter (UKF), particle filters (PF), and complementary filters (CF). Furthermore, the mathematical formulation of each algorithm was explained well, and the algorithm performances were compared. However, aside from pointing out the output differences between them, the influence of magnetic interference on attitude estimation and the adequacy of the results obtained by each algorithm were not specified clearly. To boost the attitude estimation accuracy, Farhangian et al. [10] proposed an EKF-based error prediction and PI controller system. The algorithm in this study predicts the attitude error by considering the measurement data profile of the gyroscope and uses that error as feedback for the PI controller to constructively change the determined attitude value, but the improvement is not sufficient. Youn [11] also presented a magnetometer error-tolerant method for UAV applications. This study presented a magnetometer-free AHRS during magnetometer failure. The effort put forward in this research to address the problem caused by magnetometer is commendable. However, in the absence of environmental magnetic disturbances or tamper with the magnetometer, no solution avoided the impact of an imprecise magnetometer on attitude estimation.
Despite the findings of the previously mentioned studies, some problems remain. One of the most serious concerns in the UAV industry is the lack of accurate and reliable information about attitude and heading, especially in environments where external magnetic fields may present such as in warehouses, tunnels and other indoor environments. In such an environment, the magnetometer’s reading of the Earth’s magnetic field is tempered by unexpected magnetic fields in its surroundings [12,13,14]. Therefore, this study proposes a method for avoiding the effects of magnetic disturbance on attitude estimation using double quaternion parameters estimation techniques that decouple attitude and heading calculations. In addition, the conditional magnetic disturbance due to the dynamic environment is mitigated by applying magnetic disturbance detection methods and using alternative strategies in the disturbance state. In addition, other related algorithms are thoroughly evaluated and tested for verification. The algorithm was also verified with experimentation and computer simulation.

2. Quaternion-Based Attitude and Heading Representation

Different methods are used to represent a rigid body orientation in three dimensions (3D). Euler used three sets of angles (roll, pitch, and yaw) to describe the definite rotation of an object frame, which is called the body frame, with respect to a given reference frame (inertial frame). Unlike the Euler representation, four parameters are used in quaternion representation for 3D rotation quantification, with the constraint that the sum of squares for each parameter equals unity [15,16,17].
The rotated object final orientation is determined based on Euler angles or quaternion parameters, as given in Equations (2) and (3). Let V be a vector pointing to the initial front direction of the object and let the final object orientation be represented by V as shown in Figure 1. Then, V is computed from V and the Euler rotation angles, as indicated in Equation (2).
V = v 1 v 2 v 3 , V = v 1 v 2 v 3
V = c o s ψ c o s θ c o s θ s i n ψ s i n θ c o s ψ s i n ϕ s i n θ c o s ϕ s i n ψ c o s ϕ c o s ψ + s i n ϕ s i n ψ s i n θ c o s θ s i n ϕ s i n ϕ s i n ψ + c o s ϕ c o s ψ s i n θ c o s ϕ s i n ψ s i n θ c o s ψ s i n ϕ c o s ϕ c o s θ v 1 v 2 v 3
where ϕ , θ and ψ represent the Euler rotation angles roll, pitch, and yaw, respectively, for the rotation sequence XYZ. Similarly, V is obtained from the quaternion parameters and V, as shown in Equation (3).
V = q 0 2 + q 1 2 q 2 2 q 3 2 2 ( q 1 q 2 + q 0 q 3 ) 2 ( q 1 q 3 q 0 q 2 ) 2 ( q 1 q 2 q 0 q 3 ) q 0 2 q 1 2 + q 2 2 q 3 2 2 ( q 2 q 3 + q 0 q 1 ) 2 ( q 1 q 3 + q 0 q 2 ) 2 ( q 2 q 3 q 0 q 1 ) q 0 2 q 1 2 q 2 2 + q 3 2 v 1 v 2 v 3
where q = q 0 q 1 q 2 q 3 is the quaternion representation of rotation.

2.1. Attitude and Heading Identification from Accelerometer and Magnetometer Measurements

2.1.1. Finding Euler Angles

The strength of the gravitational field measured by the accelerometer along its vertical and horizontal axes can help determine the vehicle’s roll and pitch angles if the accelerometer’s and the vehicle’s axes are aligned in the same direction. The direction of gravity is always vertically downward, and its magnitude is constant. Therefore, depending on the current orientation of the sensor, the component of the gravitational field detected along the sensor axes varies, and this change is used as input to calculate the roll and pitch angles [4,12]. The acceleration components detected by the accelerometer were related to the orientation angles in Equation (4).
a x a y a z = c o s ψ c o s θ c o s θ s i n ψ s i n θ c o s ψ s i n ϕ s i n θ c o s ϕ s i n ψ c o s ϕ c o s ψ + s i n ϕ s i n ψ s i n θ c o s θ s i n ϕ s i n ϕ s i n ψ + c o s ϕ c o s ψ s i n θ c o s ϕ s i n ψ s i n θ c o s ψ s i n ϕ c o s ϕ c o s θ ( g a r )
If there is no linear acceleration (i.e., a r 0 ), then the normalized gravity vector is substituted by 0 0 1 T :
1 a N a x a y a z = c o s ψ c o s θ c o s θ s i n ψ s i n θ c o s ψ s i n ϕ s i n θ c o s ϕ s i n ψ c o s ϕ c o s ψ + s i n ϕ s i n ψ s i n θ c o s θ s i n ϕ s i n ϕ s i n ψ + c o s ϕ c o s ψ s i n θ c o s ϕ s i n ψ s i n θ c o s ψ s i n ϕ c o s ϕ c o s θ 0 0 1 a N = a x 2 + a y 2 + a z 2
Simplifying:
1 a N a x a y a z = s i n θ c o s θ s i n ϕ c o s ϕ c o s θ
Solving for ϕ and θ :
ϕ = t a n 1 a y a z θ = t a n 1 a x a y 2 + a z 2
After determining the attitude angles, the heading angle was computed from the attitude and magnetometer readings [18]. The magnetometer measures the ambient magnetic field, which is a composition of the Earth’s geomagnetic field and local magnetic disturbance. We used H to represent the vector of the geomagnetic field in the north-east-down (NED) frame. Its magnitude is H 0 , and its direction deviates from geographic north by the declination angle α and from the surface of the Earth by inclination angle β . It is mathematically described in Equation (8).
H = H x H y H z = H 0 * c o s β c o s α c o s β s i n α s i n β
The value of declination angle α and inclination angle β depend on geographical location. Assuming that sensor frame is rotated relative to the NED frame by the three Euler angles ( ϕ , θ , ψ ) , one can express the geomagnetic field vector in the sensor frame as shown in Equation (9).
m x m y m z = c o s ψ c o s θ c o s θ s i n ψ s i n θ c o s ψ s i n ϕ s i n θ c o s ϕ s i n ψ c o s ϕ c o s ψ + s i n ϕ s i n ψ s i n θ c o s θ s i n ϕ s i n ϕ s i n ψ + c o s ϕ c o s ψ s i n θ c o s ϕ s i n ψ s i n θ c o s ψ s i n ϕ c o s ϕ c o s θ H x H y H z
Substituting Equation (8) into Equation (9), then normalizing and solving for the heading angle ψ ,
m x N m y N m z N = 1 H 0 m x m y m z ψ = t a n 1 s i n ϕ * m z N c o s ϕ * m y N c o s θ * m x N + s i n θ s i n ϕ * m y N + s i n θ c o s ϕ * m z N + α
where m x N , m y N , and m z N represent the normalized magnetometer readings of the magnetic field with respect to the sensor frame, respectively.

2.1.2. Finding Quaternion Parameters

The Earth gravitational field vector measured with respect to the sensor frame and NED frame is related to the vector rotation formula presented in Equation (3). The gravity vector in the NED frame is normalized for simplicity, that is, g = 0 0 1 T .
a x a y a z = q 0 2 + q 1 2 q 2 2 q 3 2 2 ( q 1 q 2 + q 0 q 3 ) 2 ( q 1 q 3 q 0 q 2 ) 2 ( q 1 q 2 q 0 q 3 ) q 0 2 q 1 2 + q 2 2 q 3 2 2 ( q 2 q 3 + q 0 q 1 ) 2 ( q 1 q 3 + q 0 q 2 ) 2 ( q 2 q 3 q 0 q 1 ) q 0 2 q 1 2 q 2 2 + q 3 2 0 0 1
Equation (11) has infinite solutions because the number of unknown variables is greater than the number of equations. However, the gravitational vector does not provide any information about rotation around the Z-axis. Therefore, the quaternion parameter q 3 can be set to zero. Consequently, finding a finite solution for Equation (11) becomes possible. After a mathematical derivation, the quaternion parameters are represented in terms of the acceleration measured by the accelerometer. The derivation was taken from [1].
q a t t = a z + 1 2 a y 2 ( a z + 1 ) a x 2 ( a z + 1 ) 0 T , a z 0 a y 2 ( 1 a z ) 1 a z 2 0 a x 2 ( 1 a z ) T , a z < 0
Similarly, the equation that relates the heading quaternion representation to the magnetometer readings can be derived. It is clear that the heading component of the orientation quaternion parameter is independent of any rotation about the X- and Y-axes. Therefore, the quaternion parameters representing the axis of the rotation vector should be constrained only in the vertical direction. As a result, quaternion q h d g has the following form:
q h d g = q 0 0 0 q 3 T
The magnetic field measured by the magnetometer can be mapped to the horizontal and vertical components of the Earth’s magnetic field using Equation (14)
m x m y m z = q 0 2 + q 1 2 q 2 2 q 3 2 2 ( q 1 q 2 + q 0 q 3 ) 2 ( q 1 q 3 q 0 q 2 ) 2 ( q 1 q 2 q 0 q 3 ) q 0 2 q 1 2 + q 2 2 q 3 2 2 ( q 2 q 3 + q 0 q 1 ) 2 ( q 1 q 3 + q 0 q 2 ) 2 ( q 2 q 3 q 0 q 1 ) q 0 2 q 1 2 q 2 2 + q 3 2 H x H y H z R T ( q h d g ) m x m y m z = B h 0 m z , when the x - axis of the sensor is aligned to the north
where B h = ( H x 2 + H y 2 ) . The complete solution that avoids singularity is presented next.
q h d g = B h + m x B h 2 B h 0 0 m y 2 B h + m x B h T , m x 0 m y 2 B h m x B h 0 0 B h m x B h 2 B h T , m x < 0
Finally, a single quaternion representing both attitude and heading is the product of the two quaternions q a t t d and q h d g , as shown in Equation (16).
q = q a t t q h d g

2.2. Attitude and Heading Computation from Gyroscope Reading

The gyroscope measures the rate of orientation change about each axis of the sensor frame. The relative orientation at the time of interest is obtained by integrating the raw measurement data for all rotational axes. The Euler angles are updated based on the gyroscope readings as follows:
θ k = θ k 1 + ω y k T s ϕ k = ϕ k 1 + ω x k T s ψ k = ψ k 1 + ω z k T s
where ω x k , ω y k , and ω z k are the gyroscope readings of the angular rotation rate about the X-, Y-, and Z-axes, respectively, and T s is the sampling time. On the other hand, the quaternion parameter time update equations based on gyroscope readings are also formulated as follows. From the quaternion identity,
( p q ) * = q * p *
The time derivative of quaternion is
d ( q * q ) d t = q ˙ * q * + q * q ˙ = 0
It follows that
q * q ˙ = ( q ˙ * q ) = ( q * q ˙ ) *
This means that q * q ˙ is a pure quaternion (i.e., it is equal to the negative of its conjugate; therefore, its real part is zero). Thus, we take a pure quaternion Ω and write:
q * q ˙ = Ω = 0 Ω
Left multiplication by q yields the differential equation
q ˙ = q Ω = 1 2 q ω
Converting Equation (22) to discrete time with sample time Δ T and taking the first order approximation of its Taylor series expansion yields Equation (23)
q k = I 4 x 4 + 1 2 Ω k T s q k 1
where
Ω k = 1 2 0 ω T ω [ ω x ] = 1 2 0 ω x ω y ω z ω x 0 ω z ω y ω y ω z 0 ω x ω z ω y ω x 0 , [ ω x ] = 0 ω z ω y ω z 0 ω x ω y ω x 0
and
ω = ω x ω y ω z T

3. Attitude and Heading Estimation with EKF-Based Sensor Fusion

As discussed in Section 2, Euler’s and quaternion parameters are used to express attitudes and heading. The Euler representation of angular rotation is quite intuitive to use but the quaternion representation is generally used in UAV applications. This is because 3D rotation expression with quaternion numbers does not cause gimbal lock problem [19], and conversely, the 3D rotation expression with Euler angles is susceptible to the gimbal lock problem. As a result, a quaternion-based approach for attitude and heading estimation was preferred for this study.
In Section 2, the direct computation of attitude and heading from the gyroscope, accelerometer, and magnetometer data is presented. However, the results that were based on gyroscope measurements accumulated errors over each calculation, leading to more severe drift over time. On the other hand, the values that were based on the accelerometer and magnetometer readings were also distorted by noise signals but were not affected by drift over time. Both of these methods have their drawbacks, but when used together, they can correct one another. Therefore, it is essential to predict the attitude and heading with the gyroscope in advance and to use the accelerometer and magnetometer as correctors to obtain reliable results using the EKF algorithm.

3.1. EKF Formulation

The EKF is an iterative prediction/correction approach for estimating the state of a discrete time process or measurement. Before moving on to the algorithm, it is important to select either the quaternion or Euler representation method. In this work, the quaternion-based approach is preferred because this approach does not introduce the gimbal lock problem. The EKF process relies on a state prediction model that mathematically defines how the state variable x k is related to the input variable and time, and an observation model that establishes a mathematical connection between the measured values z k and the predicted states x k .
x k = F k x k 1 + ω k z k = H k x k + ν k , w h e r e x k : state at sampling time k z k : measurement at sampling time k ( or observation ) F k : state transition model applied to x k 1 H k : observation model
The EKF algorithm follows three major sequential steps: initialization, prediction and correction.

3.1.1. Initialization

At this stage, the state values are set to their original orientations, which in most cases start at zero rotation about all axes, described with quaternions q = 1 0 0 0 T .
q 0 ^ = 1 0 0 0 T P 0 = E ( q 0 q 0 ^ ) ( q 0 q 0 ^ ) T
The measurement noise covariance matrix (R) and the process noise covariance matrix (Q) can be time-varying or time-invariant. The heading estimation is highly sensitive to magnetic noise. Therefore, in this study, simulations and practical experiments were conducted to determine how to minimize magnetic disturbances in heading estimation by using a disturbance-dependent measurement covariance matrix; this topic is further discussed in Section 3.3. The initializations of Q and R are given in Equation (26)
R = σ ν I m x m , Q = σ ω I n x n
where I, n, and m are the identity matrix, number of states, and number of measurements, respectively. σ ν and σ ω are the variance of the measurement noise and the variance of the process noise, respectively.

3.1.2. Prediction

A mathematical model of quaternion-based orientation estimation is presented in Section 2.2. Based on previous sensor states, the sample period, and current gyroscope measurements, the prediction equation helps to calculate the sensor’s attitude and heading. The outcome of this stage is then used in the EKF fusion process. The model given in Equation (23) is eventually reformulated in the standard state-space model form, as shown in Equation (27).
q k = F k q k 1 , w h e r e , F k = 1 ω x T s 2 ω y T s 2 ω z T s 2 ω x T s 2 1 ω z T s 2 ω y T s 2 ω y T s 2 ω z T s 2 1 ω x T s 2 ω z T s 2 ω y T s 2 ω x T s 2 1
Additionally, the prediction error covariance is
P k = F k P k 1 F k T + Q
The observation model, as shown in Equations (9) and (11) for the accelerometer and magnetometer, respectively, can easily be defined in a combination form.
z k = a x a y a z m x m y m z = 2 ( q 1 q 3 q 0 q 2 ) 2 ( q 2 q 3 + q 0 q 1 ) q 0 2 q 1 2 q 2 2 + q 3 2 ( q 0 2 + q 1 2 q 2 2 q 3 2 ) H x + 2 ( q 1 q 2 + q 0 q 3 ) H y + 2 ( q 1 q 3 q 0 q 2 ) H z 2 ( q 1 q 2 q 0 q 3 ) H x + ( q 0 2 q 1 2 + q 2 2 q 3 2 ) H y + 2 ( q 2 q 3 + q 0 q 1 ) H z 2 ( q 1 q 3 + q 0 q 2 ) H x + 2 ( q 2 q 3 q 0 q 1 ) H y + ( q 0 2 q 1 2 q 2 2 + q 3 2 ) H z = h ( q k )
Then,
H k = h q | q = q k 1 = 2 q 2 2 q 3 2 q 0 2 q 1 2 q 0 2 q 3 2 q 0 2 q 1 2 q 2 2 q 0 H x + 2 q 3 H y 2 q 2 H z 2 q 1 H x + 2 q 2 H y + 2 q 3 H z 2 q 2 H x + 2 q 1 H y 2 q 0 H z 2 q 3 H x + 2 q 0 H y + 2 q 1 H z 2 q 2 H x 2 q 1 H y + 2 q 0 H z 2 q 1 H x + 2 q 2 H y + 2 q 3 H z 2 q 2 H x 2 q 1 H y + 2 q 0 H z 2 q 3 H x 2 q 0 H y 2 q 1 H z 2 q 0 H x + 2 q 3 H y 2 q 2 H z 2 q 1 2 q 2 2 q 3 2 q 3 H x + 2 q 0 H y + 2 q 1 H z 2 q 0 H x 2 q 3 H y + 2 q 2 H z 2 q 1 H x + 2 q 2 H y + 2 q 3 H z

3.1.3. Correction

This is the last step of every single iteration of the EKF. The states and covariance matrix were corrected using the Kalman gain.
K = P k H k T ( H k P k H k T + R ) 1 q k + = q k + K ( z k h ( q k ) ) P k + = ( I K H k ) P k

3.2. Double Quaternion Approach

In this study, a double quaternion configuration was proposed to represent the attitude and heading separately. A single quaternion consists of four parameters ( q = [ q 0 q 1 q 2 q 3 ] T ). However, the proposed double quaternion is, set to have eight parameters that are represented as ( q = q 0 q 1 q 2 q 3 q w q x q y q z T ); the first four parameters are assigned to represent attitude, while the last four are assigned to represent heading information.

3.2.1. Double Quaternion-Based EKF (DQEKF) Formulation

Many studies dealing with quaternion-based attitude and heading estimation use a single quaternion to denote both attitude and heading during the EKF updating process [1,4,20]. The update process for a single quaternion value, which can be seen in Equations (27) and (29), depends on three sensor values: gyroscope, accelerometer, and magnetometer. The information from the gyroscope is essentially used to predict attitude and heading, whereas the accelerometer and magnetometer are used to correct the prediction. However, magnetometer readings are more susceptible to environmental disturbances and can induce attitude errors if used for correction. Therefore, this study proposes an independent updating mechanism for attitude and heading to overcome the aforementioned problem. The EKF is formulated such that the attitude solely depends on accelerometer readings, whereas the heading relies on both the accelerometer as a tilt compensator and the magnetometer as a prediction error corrector.

Prediction

Owing to the independent updates of attitude and heading, the number of states is doubled.
q d = [ q 0 q 1 q 2 q 3 q a t t q w q x q y q z q h d g ] T
where q d , q a t t , and q h d g represent the double quaternion, quaternion corresponding to attitude, and quaternion corresponding to heading, respectively. Following the increase in the number of states, the prediction and observation models also change. The state transition matrix in Equation (27) is modified to
F k = 1 ω x T s 2 ω y T s 2 ω z T s 2 0 0 0 0 ω x T s 2 1 w 2 T s 2 ω y T s 2 0 0 0 0 ω y T s 2 ω z T s 2 1 ω x T s 2 0 0 0 0 ω z T s 2 ω y T s 2 ω x T s 2 1 0 0 0 0 0 0 0 0 1 ω x T s 2 ω y T s 2 ω z T s 2 0 0 0 0 ω x T s 2 1 w 2 T s 2 ω y T s 2 0 0 0 0 ω y T s 2 ω z T s 2 1 ω x T s 2 0 0 0 0 ω z T s 2 ω y T s 2 ω x T s 2 1
and the observation model in Equation (30) expands to Equation (34)
H k = H a 1 0 3 x 4 0 3 x 4 H a 2 0 3 x 4 H m
where
H a 1 = 2 q 2 2 q 3 2 q 0 2 q 1 2 q 1 2 q 0 2 q 3 2 q 2 2 q 0 2 q 1 2 q 2 2 q 3 , H a 2 = 2 q y 2 q z 2 q w 2 q x 2 q x 2 q w 2 q z 2 q y 2 q w 2 q x 2 q y 2 q z a n d
H m = 2 q w H x + 2 q z H y 2 q y H z 2 q x H x + 2 q y H y + 2 q z H z 2 q y H x + 2 q x H y 2 q w H z 2 q z H x + 2 q w H y + 2 q x H z 2 q y H x 2 q x H y + 2 q w H z 2 q x H x + 2 q y H y + 2 q z H z 2 q y H x 2 q x H y + 2 q w H z 2 q z H x 2 q w H y 2 q x H z 2 q w H x + 2 q z H y 2 q y H z 2 q z H x + 2 q w H y + 2 q x H z 2 q w H x 2 q z H y + 2 q y H z 2 q x H x + 2 q y H y + 2 q z H z
The measurement and processing of noise covariance matrices obviously changes according to the current number of measurement and state variables.

3.2.2. Observability Analysis

An observability analysis approach was applied to test the impact of faulty readings of the magnetometer sensor on attitude estimation. The observability of the quaternion parameters by the magnetometer sensor was analyzed by considering the observation model and state model given in Equations (14) and (27), respectively. For a single quaternion representation, when all states (quaternion parameters) are observable, interference with the magnetometer readings affects the attitude and heading output. However, in the case of a double quaternion, when the first four states (attitude quaternion parameters) are unobservable by the magnetometer sensor, no interference in the magnetometer measurement can affect the attitude outputs. Equations (37) and (38) show the observability analysis for both scenarios. The observability of nonlinear system is commonly addressed by a Lie derivative approach [21,22]. For a generic nonlinear system represented in state space as
Σ : x ˙ ( t ) = f ( x ( t ) , u ( t ) ) = f 0 ( x ( t ) ) + i = 1 l f i ( x ( t ) ) u i ( t ) y = h ( x ) ,
where x = [ x 1 , x 2 , , x n ] T , u = [ u 1 , u 2 , , u l ] T and y = [ y 1 , y 2 , , y m ] T represent state, input and output measurements, respectively. The Lie derivative is
L f i ( h ) = h ; for i = 0 x [ L f i 1 ( h ) ] f ; for i = 1 , 2 , 3 , , n
For a single quaternion representation case, by using the system state model in Equation (27) and the magnetometer sensor state observation model in Equation (14), the observability matrix can be derived, as presented in Equation (37). Detailed derivations for Equations (37) and (38) are provided in Appendix A.
O 1 = q L f 0 ( h ) q L f 1 ( h ) q L f 2 ( h ) q L f 3 ( h ) T
Similarly, for the double quaternion representation case, based on the state model from Equation (33) and the observation model from Equation (14), the observability matrix is formulated as Equation (38).
O 2 = q d L f 0 ( h ) q d L f 1 ( h ) q d L f 2 ( h ) q d L f 3 ( h ) q d L f 4 ( h ) q d L f 5 ( h ) q d L f 6 ( h ) q d L f 7 ( h ) T
The observability matrix O 1 is full rank, implying that all single quaternion parameters are observable so that attitude values are susceptible to magnetic interference. The rank of O 2 is four, which is less than the number of states by half. Therefore, four of the quaternion parameters out of eight are unobservable, which is a good indication that magnetic interference-immune quaternion parameters exist.

3.3. Magnetic Disturbance Tolerant Heading Estimation Mechanism

A magnetic sensor measures the strength of Earth’s magnetic field in the sensor frame. Earth’s magnetic field varies across geographic locations. According to the literature, the approximate magnetic field of the Earth can be referenced from the world magnetic model [23]. Therefore, identifying the magnitude of the magnetic disturbance at a specific location qualifies mathematically. In this subsection, a mathematical methods for identifying magnetic disturbances and for taking appropriate action will be discussed.
Assume that H k = [ H x H y H z ] T represents the Earth’s magnetic field at a given time and at geographic location P = [ l a t l o n a l t ] T . Then, the magnetic disturbance distribution at a given location is estimated as
d m = k n k ( | H k | | B k | ) 2
where | H | , | B | , and n represent the magnitude of the Earth’s magnetic field at a location, the magnitude of the magnetic field measured by the magnetometer, and the number of samples considered, respectively. The number of samples was decided based on how fast the system should respond and how long the disturbance should last, as considered by the system.
Based on the error calculated in Equation (39), a rule was created to determine the error condition for switching to different values of the measurement error covariance. The covariance value of the measurement error indicates the degree to which the system relies on the gyroscope prediction or magnetometer data to estimate the heading [24]. If a severe magnetic disturbance is detected, a big measurement error covariance value is selected to prevent the effect of erroneous sensor data on the estimate. The magnetic field disturbance detector compares Earth’s magnetic field measured by a magnetometer sensor with Earth’s magnetic field referred from a lookup table that contains Earth’s magnetic field based on location and projected onto the sensor frame. The proposed algorithm for magnetic disturbance detection and rejection, as well as the decoupling of attitude calculation from heading, is shown in Figure 2.

4. Hardware Design

For functional verification of the proposed algorithm, an embedded inertial navigation system (INS) prototype was developed in this study. The prototype was equipped with an ICM-20948 9-axis MEMS TDK InvenSense M o t i o n T r a c k i n g T M device, and a Texas Instruments TMS320F28377S MCU for the proposed EKF algorithm computation and communication with peripheral devices.
Table 1 and Table 2 summarize the specifications of the ICM-20948 and TMS320F28377S MCUs, respectively.
The PCB of the prototype included a sensor board with sensor chips and a main board with an MCU, a power source, and external interface connectors. Figure 3 shows the configuration of the INS prototype.
The sensor board and the main board are connected by a flexible flat cable and are designed to be physically secured with double-sided tape made of a soft ethylene propylene diene monomer (EPDM) sponge material. This is to minimize the effect of vibration due to the actuator operation of the INS mounted targets, such as drones and ground robots. Figure 4 shows the designed assembly configuration of the inner PCB parts and the outer cover of the prototype, and Figure 5 shows the actual sensor board and main board.

5. Computer Simulation and Experimentation

5.1. Sensor Data Generation

Simulated IMU sensor data were generated to compare the performance of complementary, gradient descent proposed by Madgwick, EKF, and the proposed double quaternion-based EKF algorithms in estimating attitude and heading, and in eliminating environmental magnetic disturbance. MATLAB software was used to generate the IMU sensor data using the parameters listed in Table 3.
Figure 6 shows the IMU sensor data generated using MATLAB code by considering the specification given in Table 3. In Figure 7, an emulated external magnetic interference signal that was applied at the ninth second and lasted until the 18th second is shown.

5.2. Experimental Setup

In order to carry out a validation experiment for the proposed algorithm, an experimental environment was set up as shown in Figure 8. A six D.O.F motion table, computer, spirit level, and permanent magnetic bar were used for the experiment. The usage of these tools is described briefly as follows.
  • Motion table: This machine was used to rotate the sensor around the X-, Y-, and Z-axes to an orientation angle required by the computer software. The software was developed as real-time harware-in-the-loop simulation (HILS) testing tool for small UAVs [25]. The specifications of the motion table are given in Table 4;
  • Computer: A command is sent to the motion table from the computer. The raw data measured by the sensors and the estimated orientation angles are also logged into a file on the computer;
  • Permanent magnet: We used a permanent magnetic bar to create a magnetic disturbance in the environment.
In the experiment, the magnetometer was carefully calibrated, as the workplace area was filled with different tools that could contain metallic materials that would create magnetic interference and affect the output of the experiment. Then, the motion table was operated to rotate around the X-, Y-, and Z-axes in sequence for specific times, under conditions with no significant magnetic disturbance, and in a magnetically disturbed environment by placing a magnetic bar in close vicinity to the motion table. Experiments were also carried out when the motion table was not moving to compare performance under static and dynamic conditions. Simultaneously, all raw measurement data from the sensors and estimated rotation trajectories were recorded.

6. Results

6.1. Simulation Result

In this simulation experiment, comparisons of the complementary [26], gradient descent [27], EKF, and DQEKF algorithms were carried out. Two major concerns were examined while comparing the performances of the aforementioned algorithms. The first issue deals on the decoupling of attitude and heading estimation in order to eliminate the effect of magnetometer reading on attitude (roll and pitch) computation. Second, an environmental magnetic disturbance rejection system was considered for comparison. The performance of each algorithm in response to the injected magnetic disturbance shown in Figure 9 and Table 5.

6.2. Experimental Result

The validation procedure was carried out using the experimental setup specified in Section 5.2. A high-precision motion table was utilized to rotate the developed sensor around the inertial axes and serve as a ground truth reference. The performance of the built AHRS with the proposed algorithm and other commonly used algorithms was carefully examined in this experiment, for avoiding the influence of environmental magnetic disturbance on attitude and heading estimation. A permanent magnet was utilized to create an artificial magnetic disturbance in the surroundings. Figure 10 and Figure 11 show the raw sensors measurement data and the Euler angles estimated by the respective algorithms: complementary, gradient descent, EKF, and DQEK, respectively, while the INS sensor was stationary and magnetic disturbance was injected for small period of times. Furthermore, the same experimental scenario followed while the INS sensor was rotating by the motion table and the recorded results depicted in Figure 12 and Figure 13. Table 6 presents the empirical data analysis of the algorithms.

7. Discussion

This study covered all of the processes needed to create a fully working AHRS sensor, including algorithm development and simulation validation, as well as sensor hardware design, manufacturing, and experimental verification. Furthermore, the common algorithms complementary, gradient descent, and EKF were examined with the identical magnetic disturbance conditions as the double quaternion-based EKF to confirm the required performance by the developed algorithm and hardware.

7.1. Simulation Results Discussion

As seen in the simulation results demonstrated in Figure 9 and Table 5, complementary and DQEKF outperformed the other algorithms in terms of excluding the effect of magnetometer measurement on attitude estimation during magnetic disturbance condition, whereas gradient descent and EKF attitude estimation were directly affected by magnetometer noise because the attitude computation was not independent of the magnetometer readings. According to the analysis of observability of attitude by the magnetometer sensor discussed in Section 3.2.2, when employing the single quaternion-based EKF method, all four quaternion parameters were completely observable. This means that any changes in the magnetometer sensor data could have an effect on the attitude values. Therefore, the low performance of EKF and gradient descent approaches, during magnetic disturbance, was attributed to the coupling of magnetometer data and attitude in their mathematical models. Though complementary filter attitude estimation was unaffected by magnetic noise, its accuracy was lower than that of DQEKF since DQEKF was based on an efficient and advanced EKF algorithm.
Regarding heading estimation, DQEKF performed better than EKF in rejecting the magnetic disturbance, even if the same magnetic disturbance rejection algorithm was used in both cases. This is because the error in attitude due to disturbance also affects the heading. As the magnetic disturbance algorithm developed in this study could not be directly applied to the complementary and gradient descent algorithms, only the EKF and DQEKF comparisons were performed. Overall, it can be concluded that the EKF and DQEKF algorithms surpass the complementary and gradient descent algorithms in terms of the accuracy and reliability of the attitude and heading estimation. DQEKF is better than EKF in preventing the effect of magnetometer noise in both attitude and heading estimation.

7.2. Experimental Results Discussion

The experiments were carried out for static and dynamic statuses of the INS sensor. The results of the two experimental scenarios were consistent with one another and also with the simulation results discussed in Section 7.1. When the INS sensor is in a stationary state, all Euler angle values should remain in their initial states if the gyroscope biases are completely removed by calibration. In other words, the Euler angles will drift over time if the gyroscope sensor biases are not zero, particularly if the applied algorithm places more reliance on the gyroscope data. In the dynamic condition, the same issue arises. Nevertheless, corrective action based on accelerometer measurements can reduce drift in attitude angle (roll and pitch) estimation over time. Similarly, the heading drift is expected to be compensated using magnetometer sensor readings but the magnetometer itself is vulnerable to magnetic noise from the environment. As a consequence, reducing heading estimation inaccuracy is a tradeoff. Therefore, the solution strategy should be focused on determining when gyroscope or magnetometer reading data are more relevant.
The divergence of the heading (yaw) value from the reference value in Figure 11 and Figure 13 after the introduction of magnetic flux demonstrated that everything that happens to the magnetometer directly affects the heading estimated output, independent of the algorithms utilized, which included complementary, gradient descent, EKF, and DQEK. When the magnetic disturbance rejection (MDR) technique is applied with the EKF and DQEK algorithms, the degree to which the heading value is affected by the surrounding magnetic flux considerably reduced for both static and dynamic conditions. In terms of avoiding the environmental magnetic flux on heading estimated output, DQEKF surpasses EKF. The roll and pitch estimates of the gradient descent and EKF algorithms, however, are impacted by magnetic disturbance. The complementary and DQEKF algorithms proved to be unaffected by magnetic disturbances in the environment for attitude estimation. Owing to the overall accuracy, reliability, and simplicity of applying the magnetic disturbance rejection method, DQEKF was the best among the algorithms considered in this experiment. Generally, the severity of the magnetic flux effect on the roll and pitch depends on the accuracy of the gyroscope. If the gyroscope sensor used is of poor quality or not properly calibrated, magnetic disturbance will negatively affect the attitude value in addition to heading, and DQEKF should be used to solve the problem.

8. Conclusions

In this work, two complementary methods are presented for rejecting the effect of magnetic disturbance in determining a reliable 3-D orientation of a moving object such as a UAV. The first method addressed the issue of attitude estimation error due to the magnetic noise by using a double quaternion representation of an object orientation in the EKF algorithm process. With this method, the attitude and heading are set to update with independent quaternion parameters, where the quaternion parameters correspond to the attitude calculation decoupled from magnetometer readings. In the second method, the inaccuracy of the heading under magnetic interference is reduced by an online adjustment of the measurement error covariance matrix. The experimental tests proved that the deviation of attitude and heading values from the ground truth better reduced with the proposed methods than commonly used algorithms: complementary, gradient descent, and the conventional use of EKF, during the period of magnetic disturbance. Thus, in an environment where magnetic interference has a significant impact on the performance of attitude and heading sensors, the suggested approaches are solutions.

Author Contributions

Conceptualization, A.W. and J.-S.J.; methodology, A.W. and J.-S.J.; software, A.W.; validation, A.W., S.-K.K. and Y.D.; formal analysis, A.W.; investigation, A.W. and S.-K.K.; resources, J.-S.J. and S.-K.K.; data curation, S.-K.K.; writing—original draft preparation, A.W.; writing—review and editing, A.W. and J.-S.J.; visualization, A.W. and Y.D.; supervision, B.-S.K. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the Korea Institute for Advancement of Technology (KIAT) grant funded by the Korean Government (MOTIE) (N0002431, The Competency Development Program for Industry Specialist).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
MEMSMicroElectroMechanical Systems
EKFExtended Kalman Filter
DQEKFDouble Quaternion-based EKF
LKFLinear Kalman Filter
UKFUnscented Kalman Filter
PFParticle Filter
CFComplementary Filter
IMUInertial Measurement Unit
INSInertial Navigation System
MCUMicrocontroller Unit
AHRSAttitude Heading and Reference System
UAVUnmanned Aerial Vehicle
3DThree Dimensional
PIProportional Integral
NEDNorth, East and Down
DLPFDigital Low Pass Filter
RMSRoot Mean Square

Appendix A. Observability Matrix Derivation

Single quaternion prediction model:
q k = f ( q , ω ) = F k q k 1 = q 0 0.5 * T s ( ω x q 1 + ω y q 2 + ω z q 3 ) q 1 + 0.5 * T s ( ω x q 0 + ω z q 2 ω y q 3 ) q 2 + 0.5 * T s ( ω y q 1 ω z q 2 + ω x q 3 ) q 3 + 0.5 * T s ( ω z q 1 + ω y q 2 ω x q 3 ) F k = 1 2 2 ω x T s ω y T s ω z T s ω x T s 2 w z T s ω y T s ω y T s ω z T s 2 ω x T s ω z T s ω y T s ω x T s 2 q = q 0 q 1 q 2 q 3 T
where ω is the angular rotation rate measured by the gyroscope sensor, T s is the sample time, and k is the time stamp.
Magnetometer observation model:
z = h ( q ) = ( q 0 2 + q 1 2 q 2 2 q 3 2 ) H x + 2 ( q 1 q 2 + q 0 q 3 ) H y + 2 ( q 1 q 3 q 0 q 2 ) H z 2 ( q 1 q 2 q 0 q 3 ) H x + ( q 0 2 q 1 2 + q 2 2 q 3 2 ) H y + 2 ( q 2 q 3 + q 0 q 1 ) H z 2 ( q 1 q 3 + q 0 q 2 ) H x + 2 ( q 2 q 3 q 0 q 1 ) H y + ( q 0 2 q 1 2 q 2 2 + q 3 2 ) H z
Lie derivative for single quaternion state representation (i.e., n = 4):
L f i ( h ) = h ( q ) ; for i = 0 q L f i 1 ( h ) q k ; for i = 1 , 2 , 3
Then,
L f 0 ( h ) = h ( q ) L f 1 ( h ) = q L f 0 ( h ) q k L f 2 ( h ) = q L f 1 ( h ) q k L f 3 ( h ) = q L f 2 ( h ) q k
O 1 = q L f 0 ( h ) q L f 1 ( h ) q L f 2 ( h ) q L f 3 ( h ) T R 1 = r a n k ( O 1 )
O 1 is a 12 × 4 matrix. The rank of O 1 should be four for all parameters of a single quaternion (i.e., q 0 , q 1 , q 2 and q 3 ) to be observable by the magnetometer sensor.
Double quaternion prediction model:
q k d = f ( q d , ω ) = A k q k 1 d = q 0 0.5 * T s ( ω x q 1 + ω y q 2 + ω z q 3 ) q 1 + 0.5 * T s ( ω x q 0 + ω z q 2 ω y q 3 ) q 2 + 0.5 * T s ( ω y q 0 ω z q 1 + ω x q 3 ) q 3 + 0.5 * T s ( ω z q 0 + ω y q 1 ω x q 2 ) q w 0.5 * T s ( ω x q x + ω y q y + ω z q z ) q x + 0.5 * T s ( ω x q w + ω z q y ω y q z ) q y + 0.5 * T s ( ω y q w ω z q x + ω x q z ) q z + 0.5 * T s ( ω z q w + ω y q x ω x q y ) A k = F k z 4 x 4 z 4 x 4 F k q d = [ q 0 q 1 q 2 q 3 q a t t q w q x q y q z q h d g ] T
where F k , z 4 × 4 and q d represent the system matrices used in Equation (A1), zero matrix, and double quaternion states, respectively.
Magnetometer observation model corresponding to heading quaternion:
z = h ( q h d g ) = ( q w 2 + q x 2 q y 2 q z 2 ) H x + 2 ( q x q y + q w q z ) H y + 2 ( q x q z q w q y ) H z 2 ( q x q y q w q z ) H x + ( q w 2 q x 2 + q y 2 q z 2 ) H y + 2 ( q y q z + q w q x ) H z 2 ( q x q z + q w q y ) H x + 2 ( q y q z q w q x ) H y + ( q w 2 q x 2 q y 2 + q z 2 ) H z
Lie derivative for double quaternion state representation (i.e., q = q d , n = 8):
L f 0 ( h ) = h ( q h d g ) L f 1 ( h ) = q d L f 0 ( h ) q k d L f 2 ( h ) = q d L f 1 ( h ) q k d L f 3 ( h ) = q d L f 2 ( h ) q k d L f 7 ( h ) = q d L f 6 ( h ) q k d
O 2 = q d L f 0 ( h ) q d L f 1 ( h ) q d L f 2 ( h ) q d L f 3 ( h ) q d L f 4 ( h ) q d L f 5 ( h ) q d L f 6 ( h ) q d L f 7 ( h ) T R 2 = r a n k ( O 2 )
O 2 is a 24 × 8 matrix. The rank of O 2 should be eight for all parameters of the double quaternion (i.e., q 0 , q 1 , q 2 , q 3 , q w , q x , q y and q z ) to be observable by the magnetometer sensor.

References

  1. Valenti, R.G.; Dryanovski, I.; Xiao, J. Keeping a Good Attitude: A Quaternion-Based Orientation Filter for IMUs and MARGs. Sensors 2015, 15, 19302–19330. [Google Scholar] [CrossRef] [Green Version]
  2. Savage, P.G. Strapdown Inertial Navigation Integration Algorithm Design Part 1: Attitude Algorithms. J. Guid. Control. Dyn. 1998, 21, 19–28. [Google Scholar] [CrossRef]
  3. Yadav, N.; Bleakley, C. Accurate Orientation Estimation Using AHRS under Conditions of Magnetic Distortion. Sensors 2014, 14, 20008–20024. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  4. Feng, K.; Li, J.; Zhang, X.; Shen, C.; Bi, Y.; Zheng, T.; Liu, J. A New Quaternion-Based Kalman Filter for Real-Time Attitude Estimation Using the Two-Step Geometrically-Intuitive Correction Algorithm. Sensors 2017, 17, 2146. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  5. Wang, L.; Zhang, Z.; Sun, P. Quaternion-Based Kalman Filter for AHRS Using an Adaptive-Step Gradient Descent Algorithm. Int. J. Adv. Robot. Syst. 2015. [Google Scholar] [CrossRef]
  6. Odry, Á.; Kecskes, I.; Sarcevic, P.; Vizvari, Z.; Toth, A.; Odry, P. A Novel Fuzzy-Adaptive Extended Kalman Filter for Real-Time Attitude Estimation of Mobile Robots. Sensors 2020, 20, 803. [Google Scholar] [CrossRef] [Green Version]
  7. Park, S.; Gil, M.-S.; Im, H.; Moon, Y.-S. Measurement Noise Recommendation for Efficient Kalman Filtering over a Large Amount of Sensor Data. Sensors 2019, 19, 1168. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  8. Fan, B.; Li, Q.; Liu, T. How Magnetic Disturbance Influences the Attitude and Heading in Magnetic and Inertial Sensor-Based Orientation Estimation. Sensors 2018, 18, 76. [Google Scholar] [CrossRef] [Green Version]
  9. Poulose, A.; Senouci, B.; Han, D.S. Performance Analysis of Sensor Fusion Techniques for Heading Estimation Using Smartphone Sensors. IEEE Sens. J. 2019, 19, 12369–12380. [Google Scholar] [CrossRef]
  10. Farhangian, F.; Landry, R., Jr. Accuracy Improvement of Attitude Determination Systems Using EKF-Based Error Prediction Filter and PI Controller. Sensors 2020, 20, 4055. [Google Scholar] [CrossRef] [PubMed]
  11. Youn, W. Magnetic Fault–Tolerant Navigation Filter for a UAV. IEEE Sens. J. 2020, 20, 13480–13490. [Google Scholar] [CrossRef]
  12. 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]
  13. Wöhle, L.; Gebhard, M. SteadEye-Head—Improving MARG-Sensor Based Head Orientation Measurements Through Eye Tracking Data. Sensors 2020, 20, 2759. [Google Scholar] [CrossRef] [PubMed]
  14. Manos, A.; Klein, I.; Hazan, T. Gravity-Based Methods for Heading Computation in Pedestrian Dead Reckoning. Sensors 2019, 19, 1170. [Google Scholar] [CrossRef] [Green Version]
  15. Shuster, M.D. Survey of Attitude Representations. J. Astronaut. Sci. 1993, 41, 439–517. [Google Scholar]
  16. Markley, L. Attitude Error Representations for Kalman Filtering. J. Guid. Control Dyn. 2003, 26, 311–317. [Google Scholar] [CrossRef]
  17. Guo, S.; Wu, J.; Wang, Z.; Qian, J. Novel MARG-Sensor Orientation Estimation Algorithm Using Fast Kalman Filter. J. Sens. 2017, 2017, 1–12. [Google Scholar] [CrossRef] [Green Version]
  18. 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]
  19. Deibe, Á.; Antón Nacimiento, J.A.; Cardenal, J.; López Peña, F. A Kalman Filter for Nonlinear Attitude Estimation Using Time Variable Matrices and Quaternions. Sensors 2020, 20, 6731. [Google Scholar] [CrossRef]
  20. 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] [CrossRef]
  21. Sabatini, A.M. Kalman-Filter-Based Orientation Determination Using Inertial/Magnetic Sensors: Observability Analysis and Performance Evaluation. Sensors 2011, 11, 9182–9206. [Google Scholar] [CrossRef] [PubMed]
  22. Martínez, N.; Villaverde, A.F. Nonlinear Observability Algorithms with Known and Unknown Inputs: Analysis and Implementation. Mathematics 2020, 8, 1876. [Google Scholar] [CrossRef]
  23. Laundal, K.M.; Richmond, A.D. Magnetic Coordinate Systems. Space Sci. 2017, 27–59. [Google Scholar] [CrossRef] [Green Version]
  24. Nez, A.; Fradet, L.; Marin, F.; Monnet, T.; Lacouture, P. Identification of Noise Covariance Matrices to Improve Orientation Estimation by Kalman Filter. Sensors 2018, 18, 3490. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  25. Cha, H.; Jinseok, J.; Shi, H.; Yoon, J.; Beomsoo, K. Establishment of Real-Time HILS Environment for Small UAV using 6DOF Motion Table. Korean Soc. Aeronaut. Space Sci. 2019, 47, 326–334. [Google Scholar] [CrossRef]
  26. Mahony, R.; Hamel, T.; Pflimlin, J. Nonlinear Complementary Filters on the Special Orthogonal Group. IEEE Trans. Autom. Control 2008, 53, 1203–1218. [Google Scholar] [CrossRef] [Green Version]
  27. Madgwick, S.O.H. An Efficient Orientation Filter for Inertial and Inertial/Magnetic Sensor Arrays. Magn. Sens. Arrays 2010, 25, 113–118. [Google Scholar]
Figure 1. Illustration of Euler and quaternion rotations.
Figure 1. Illustration of Euler and quaternion rotations.
Sensors 21 05475 g001
Figure 2. Attitude and heading estimation algorithm block diagram.
Figure 2. Attitude and heading estimation algorithm block diagram.
Sensors 21 05475 g002
Figure 3. Block diagram of the INS prototype.
Figure 3. Block diagram of the INS prototype.
Sensors 21 05475 g003
Figure 4. Configuration of the INS prototype.
Figure 4. Configuration of the INS prototype.
Sensors 21 05475 g004
Figure 5. Picture of developed INS module.
Figure 5. Picture of developed INS module.
Sensors 21 05475 g005
Figure 6. Accelerometer, gyroscope and magnetometer simulated data.
Figure 6. Accelerometer, gyroscope and magnetometer simulated data.
Sensors 21 05475 g006
Figure 7. Magnetometer simulated data after injecting external disturbance.
Figure 7. Magnetometer simulated data after injecting external disturbance.
Sensors 21 05475 g007
Figure 8. Experimental setup.
Figure 8. Experimental setup.
Sensors 21 05475 g008
Figure 9. Attitude and heading estimation by complementary, gradient descent, EKF, and double quaternion-based EKF for three cases (Case 1: no magnetic disturbance (MD OFF), Case 2: with magnetic disturbance and no magnetic disturbance rejection (MD ON, MDR OFF), Case 3: with both magnetic disturbance and magnetic disturbance rejection enabled (MD ON, MDR ON)).
Figure 9. Attitude and heading estimation by complementary, gradient descent, EKF, and double quaternion-based EKF for three cases (Case 1: no magnetic disturbance (MD OFF), Case 2: with magnetic disturbance and no magnetic disturbance rejection (MD ON, MDR OFF), Case 3: with both magnetic disturbance and magnetic disturbance rejection enabled (MD ON, MDR ON)).
Sensors 21 05475 g009
Figure 10. The gyroscope, accelerometer and magnetometer measurement data when INS sensor was stationary, and disturbed by temporary magnetic noise signal for a short time.
Figure 10. The gyroscope, accelerometer and magnetometer measurement data when INS sensor was stationary, and disturbed by temporary magnetic noise signal for a short time.
Sensors 21 05475 g010
Figure 11. Euler angle estimation output by complementary, gradient descent, EKF and DQEKF algorithms when temporary magnetic field was introduced in the environment for a short period of time and the INS sensor was stationary.
Figure 11. Euler angle estimation output by complementary, gradient descent, EKF and DQEKF algorithms when temporary magnetic field was introduced in the environment for a short period of time and the INS sensor was stationary.
Sensors 21 05475 g011
Figure 12. The gyroscope, accelerometer and magnetometer measurement data when the INS sensor was rotated by the motion table and disturbed by temporary magnetic noise signal for a short time.
Figure 12. The gyroscope, accelerometer and magnetometer measurement data when the INS sensor was rotated by the motion table and disturbed by temporary magnetic noise signal for a short time.
Sensors 21 05475 g012
Figure 13. Euler angle estimation output by complementary, gradient descent, EKF and DQEKF algorithms when temporary magnetic field was introduced in the environment for a short period of time, and the INS sensor was rotating by the motion table.
Figure 13. Euler angle estimation output by complementary, gradient descent, EKF and DQEKF algorithms when temporary magnetic field was introduced in the environment for a short period of time, and the INS sensor was rotating by the motion table.
Sensors 21 05475 g013
Table 1. Specification of the ICM-20948.
Table 1. Specification of the ICM-20948.
ParameterGyroscopeAccelerometerMagnetometer
Range±2000 dps±16 g±4900 μ T
Output Data Rate1.125 kHz1.125 kHz100 Hz
Spectral noise density0.015 dps/ H z 230 μ g/ H z
Interface I 2 C : 400 kHz, SPI: 7 MHz
ADC word length16 bits
Table 2. Specification of the TMS320F28377S CPU.
Table 2. Specification of the TMS320F28377S CPU.
ParameterValueParameterValue
Total Processing (MIPS)400 MHzADC resolution16-bit, 12-bit
Communication peripherals2-CAN, 4-UART, 3-high
speed SPI (up to 50 MHz), I 2 C
Flash memory1024 KB
Mechanical dimension256 mm 2 16 × 16
Table 3. Specification of simulated sensors.
Table 3. Specification of simulated sensors.
BiasNoise Density
Gyroscope[0.0428 −0.0327 0.0209] rad/s[0.0100 0.0100 0.0100] rad/s/ H z
Accelerometer[−0.0599 −0.0042 −0.1780] m/ s 2 [0.0730 0.0730 0.0730] m/s 2 / H z
Magnetometer[0.1000 0.1000 0.1000] μ T[0.0600 0.0600 0.0900] μ T/ H z
Table 4. Specification of motion table.
Table 4. Specification of motion table.
SpecificationExcursionVel.Acc.
Roll±30°45°/s1520°/s 2
Pitch±30°45°/s1520°/s 2
Yaw±60°45°/s5146°/s 2
Table 5. RMS error of complementary, gradient descent, EKF, and double quaternion-based EKF algorithms comparison for attitude and heading estimation. MD and MDR stand for magnetic disturbance and magnetic disturbance rejection, respectively.
Table 5. RMS error of complementary, gradient descent, EKF, and double quaternion-based EKF algorithms comparison for attitude and heading estimation. MD and MDR stand for magnetic disturbance and magnetic disturbance rejection, respectively.
AlgorithmEuler AnglesRMS of Euler Angles Estimation Error in Degree
for Three Different Magnetic Disturbance Cases
MD OFFMD ON, MDR OFFMD ON, MDR ON
Complementary
( α = 0.9 )
Roll1.40851.4085
Pitch1.34131.3413
Yaw1.829527.9305
Gradient descent
( β = 0.9 )
Roll0.64102.4940
Pitch0.55210.9618
Yaw1.864828.0109
EKFRoll0.57964.97870.6267
Pitch0.85185.53000.7289
Yaw0.964626.68881.6488
DQEKF
(Proposed)
Roll0.59330.59330.5933
Pitch0.65790.65790.6579
Yaw1.027926.49271.2574
Table 6. RMS error of comparison of complementary, gradient descent, EKF and double quaternion-based EKF algorithms for attitude and heading estimation. MD and MDR stand for magnetic disturbance and magnetic disturbance rejection, respectively.
Table 6. RMS error of comparison of complementary, gradient descent, EKF and double quaternion-based EKF algorithms for attitude and heading estimation. MD and MDR stand for magnetic disturbance and magnetic disturbance rejection, respectively.
AlgorithmEuler Angles
Error RMS
(degree)
Attitude and Heading Estimation When the Magnetic
Disturbance Rejection (MDR) was ON or OFF
Static ConditionDynamic Condition
MDR OFFMDR ONMDR OFFMDR ON
Complementary
( α = 0.9 )
Roll0.6446 0.8521
Pitch0.0765 0.4586
Yaw34.4490 12.9683
Gradient Descent
( β = 0.9 )
Roll3.2341 1.9019
Pitch4.0225 3.2809
Yaw33.2160 19.5133
EKFRoll0.80570.15250.84050.8347
Pitch0.55480.08780.37690.3757
Yaw38.66321.772112.38551.3562
DQEKF
(Proposed)
Roll0.15230.15230.80440.8044
Pitch0.08670.08670.37380.3738
Yaw38.66841.741512.35450.9892
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Wondosen, A.; Jeong, J.-S.; Kim, S.-K.; Debele, Y.; Kang, B.-S. Improved Attitude and Heading Accuracy with Double Quaternion Parameters Estimation and Magnetic Disturbance Rejection. Sensors 2021, 21, 5475. https://doi.org/10.3390/s21165475

AMA Style

Wondosen A, Jeong J-S, Kim S-K, Debele Y, Kang B-S. Improved Attitude and Heading Accuracy with Double Quaternion Parameters Estimation and Magnetic Disturbance Rejection. Sensors. 2021; 21(16):5475. https://doi.org/10.3390/s21165475

Chicago/Turabian Style

Wondosen, Assefinew, Jin-Seok Jeong, Seung-Ki Kim, Yisak Debele, and Beom-Soo Kang. 2021. "Improved Attitude and Heading Accuracy with Double Quaternion Parameters Estimation and Magnetic Disturbance Rejection" Sensors 21, no. 16: 5475. https://doi.org/10.3390/s21165475

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop