Next Article in Journal
Validation of the Short Physical Performance Battery via Plantar Pressure Analysis Using Commercial Smart Insoles
Previous Article in Journal
Vibration-Based Recognition of Wheel–Terrain Interaction for Terramechanics Model Selection and Terrain Parameter Identification for Lugged-Wheel Planetary Rovers
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Customized Extended Kalman Filter for Removing the Impact of the Magnetometer’s Measurements on Inclination Determination

1
School of Microelectronics and Control Engineering, Changzhou University, Changzhou 213164, China
2
School of Mechanical Engineering and Rail Transit, Changzhou University, Changzhou 213164, China
*
Author to whom correspondence should be addressed.
Sensors 2023, 23(24), 9756; https://doi.org/10.3390/s23249756
Submission received: 21 September 2023 / Revised: 26 November 2023 / Accepted: 8 December 2023 / Published: 11 December 2023
(This article belongs to the Section Physical Sensors)

Abstract

:
Normally, a three-dimensional orientation determination algorithm that is used in a magnetic and inertial measurement unit calculates the inclination (including both the pitch and roll) of rigid bodies by fusing the measurements of the gyroscope, as well as the measurements of both the accelerometer and the magnetometer. The measurements of the magnetometer can be helpful in improving the inclination estimation accuracy; however, once the measurements of the magnetometer are disturbed by ferromagnetic materials, the inclination estimation accuracy could be significantly decreased. Hence, a better approach should be followed in terms of not employing the measurements of the magnetometer for inclination determination. In order to achieve this goal, the component of the measurement of the magnetometer that is used for the improvement of the inclination estimation accuracy, along with the measurement of the accelerometer at each sampling time instant, is abandoned. Consequently, the remaining component of the measurement of the magnetometer, which is perpendicular to the measurement of the accelerometer, is used for the azimuth determination. After applying this process, the extended Kalman filter (EKF) is proposed for the inclination and azimuth estimations. Through experiments, the EKF is compared with three algorithms that were recently proposed with the same objective as this work, and the extracted outcomes show that the EKF approach clearly outperforms these three algorithms.

1. Introduction

This paper focuses on the decoupling problem faced by three-dimensional (3D) orientation determination algorithms (ODAs). ODAs are employed in magnetic and inertial measurement units (MIMUs) for determining their orientation when attached on moving rigid bodies, which is achieved by fusing the outputs of their magnetic, angular rate, and gravity (MARG) sensors. In fact, the basic principle of ODAs can be explained in a few words: the orientation is first predicted by relying on the measurement of the angular rate sensor and is then revised (or we can say “updated”) by introducing the measurements of the magnetic and gravity sensors. ODAs mainly differ by their different orientation revision strategies. The word “coupling” indicates that the measurement of the magnetic sensor participates in the calculation of the inclination angles, which causes the magnetic disturbance imposed on the magnetic sensor to degrade the estimation accuracy for the pitch and roll. Hence, the decoupling problem refers to understanding how to eliminate the negative effect of magnetic disturbance on the determination of inclination angles, including the pitch and roll. We present some novel modifications to the standard extended Kalman filter (EKF) for problem solving, showing that the EKF is still the most promising, powerful, and reliable ODA.
MIMUs are widely used in several applications where the determination of the inclination (including the pitch and roll) and azimuth (also called yaw or heading) of rigid bodies is required. Among the above-mentioned applications, the most conventional is the movement analysis of human body segments [1,2], followed by the inclination and azimuth sensing of small and medium-sized machines (usually autonomous equipment) flying through the air but near the ground [3], sailing under water [4,5], and driving on the ground [6]. Despite the fact that other methods, such as vision-based methods and GNSS-based methods, can also be applied for determining the inclination and azimuth, MIMUs have their unique superiorities, including their low cost, small size, light weight, and non-reliance on external artificial sources.
As mentioned, the key sensors within MIMUs are the tri-axis gyroscope (angular rate sensor), the tri-axis accelerometer (gravity sensor), and the tri-axis magnetometer (magnetic sensor), in addition to some other components such as the analog-to-digital converter, the temperature sensor used for sensor temperature drift compensation, and the micro-processor. A sensor fusion algorithm, such as a 3D ODA, is required in order to calculate the inclination and azimuth of the rigid body to which an MIMU is attached. Quaternions are usually selected for 3D orientation representations and are estimated in real time by applying an ODA, whereas the Euler angles are usually preferred when a visual presentation is needed. On top of that, if the latter takes place, then the quaternions should be converted to Euler angles.
ODAs can be further classified into two categories, i.e., Kalman filters and complementary filters. As far as Kalman filters are concerned, several modifications can be employed. More specifically, the linear Kalman filter (LKF) [7,8] and its extended version [9,10,11] have been reported. The latter incorporates the estimation of the gyroscope drift, while the former does not. Some other configurations have also been actively examined, including the EKF [12,13,14,15], the multiplicative extended Kalman filter (MEKF) [16,17,18,19,20], the unscented Kalman filter (UKF) [21,22], the cubature Kalman filter (CKF) [23], and the particle filter (PF) [24]. The structures of the EKFs proposed by [12,13,14,15] are exactly the same, except that the EKFs in [12] and [13] estimate any sensor bias, while the EKF in [15] estimates the sensor bias in addition to the orientation, and the EKF in [14] simplifies the Kalman gain matrix to decrease the computation time without reducing the orientation estimation accuracy. Different from the EKF, which realizes the linearization by using the Taylor expansion, the UKF and CKF realize the linearization by using unscented transformation and cubature transformation, respectively. The authors of the UKF claim that the approximations given by the UKF are accurate to the third order for Gaussian inputs for all nonlinearities, while they are accurate to at least the second order for non-Gaussian inputs [25]. The authors of the CKF claim that the CKF is more accurate and more principled in mathematical terms than the UKF [26]. The UKF, CKF, and PF are rarely used in MIMUs due to their high computational burden and relatively poor performance improvement compared to the EKF [27,28]. On the other hand, the MEKF is usually considered a first-order approximation to the EKF, and hence its accuracy is lower than that of the EKF [29]. The main difference among the various complementary filters is their diverse selection of single-frame inclination and azimuth determination algorithms. For instance, various algorithms have been investigated, including the Levenberg–Marquard algorithm [30], the factored quaternion algorithm [31], and the gradient descent algorithm [32,33,34,35]. It is interesting to note that complementary filters do not take into account the noise characteristics of the sensor measurements. As a result, their accuracy is normally lower than that of Kalman filters [36,37,38]. Moreover, the LKF exhibits a similar structure to complementary filters, except for the noise characteristics of the sensor measurements. In recent years, deep neural networks have also been introduced for inclination and azimuth determination, showing remarkable performances in some cases [39] due to their great success in pattern recognition.
It is well known that the measurements of the accelerometer are only useful for inclination determination, while the measurements of the magnetometer are mainly employed for azimuth determination. However, most ODAs take into account the measurements of both the accelerometer and magnetometer for inclination determination. Therefore, the inclination determination accuracy could be severely affected by the magnetic disturbance induced by ferromagnetic materials around MIMUs. In on-ground environments, particularly indoor environments, various hard and soft magnetic materials and excitation sources can be found, especially around the objects whose inclination and azimuth angles need to be determined, such as cars, security doors, mobile phones, metal tables and desks, and even whole buildings, which are obviously supported by ferroconcrete. MIMUs also contain magnetic materials and excitation sources. All these magnetic materials and excitation sources can distort the geomagnetic field. This means that large unmodeled magnetic disturbances occur more frequently than unmodeled acceleration disturbances; therefore, preventing magnetic disturbances from influencing the calculation of inclination angles will hopefully improve the estimation performance and hence is of practical importance. As a result, the goal of this work is to solve this problem. In the literature, various algorithms have been proposed in order to deal with this issue [40,41,42]. The basic idea of the extended complementary filter proposed in Ref. [40] is to correct the gyroscope drift by using the calculation results of two error terms, which are derived from the cross product of the measured and reference vectors for gravity and the geomagnetic field before integrating the gyroscope measurement to obtain the final orientation estimate. The four-parameter complementary filter presented in Ref. [41] is based on a new attitude representation, where 4D parameters (a 3D unit vector and one angle quantity) are used. The authors claim that the proposed representation has an intuitive interpretation and that the proposed filter has a separation property (magnetic disturbance does not affect the pitch and roll angle estimation). The fast complementary filter designed in Ref. [42] is a two-step filter. The pitch and roll are estimated in the first step, while the azimuth is estimated in the second step. Once it is recognized that a magnetic disturbance has emerged and degraded the accuracy of the magnetometer, the second step will be skipped so as to prevent the magnetic disturbance from affecting the computation of the pitch and roll. Obviously, a recognizer should be included in the designed filter; however, the recognizer cannot recognize all magnetic disturbances; hence, if it incorrectly recognizes a disturbance, the magnetic disturbance can still heavily affect the estimation accuracy of the pitch and roll.
From our experimental analysis, we found that the above-mentioned algorithms still present significant problems. Along these lines, we present various creative modifications to the EKF for problem solving. With the newly formulated measurement model and its error covariance matrix, the creatively modified EKF is capable of solving the decoupling problem, so that the negative effect of magnetic disturbance on the calculation of the inclination is eliminated. Experiments were carried out demonstrating that the modified EKF outperforms recently published algorithms. From our analysis, we draw the conclusion that the EKF is still the preferred algorithm when various practical problems are encountered.
The remainder of this paper is organized as follows: Section 2 elaborates on the details of the state transition model, as well as the measurement model that was used for the EKF. Section 3 provides the experimental comparison results between the EKF and three other algorithms that also aim to overcome the impact of magnetic disturbance on the inclination determination. Finally, Section 4 concludes this paper.

2. Analysis of the State Transition and Measurement Models That Were Used for the Extended Kalman Filter

2.1. Sensor Model

The outputs of the three-axis gyroscope, three-axis accelerometer, and three-axis magnetometer at the time instant k T s (where T s is the sampling period) are denoted as follows:
ω k = ω k 0 + ε k ω g k = g k 0 + η k g + ε k g m k = m k 0 + η k m + ε k m
where k is a simple representation of “ k T s ”, ω k 0 is the true angular velocity, and ω k is its measurement provided by the gyroscope. Additionally, g k 0 is the true unnormalized gravity represented in the body coordinate system, g k is its respective measurement given by the accelerometer, m k 0 is the Earth’s true unnormalized magnetic field represented in the body coordinate system, and m k is its measurement value given by the magnetometer. Moreover, ε k ω , ε k g , and ε k m are assumed to be uncorrelated white Gaussian measurement noise, with a null mean and the covariance matrices Σ ω = σ ω 2 I , Σ g = σ g 2 I , and Σ m = σ m 2 I (where I is the identity matrix), respectively. Finally, η k g and η k m are the acceleration and magnetic disturbances, respectively.

2.2. State Transition Model

The continuous-time rigid-body angular motion is described by employing the following expression [43]:
q ˙ = 1 2 [ ω 0 × ] ω 0 ( ω 0 ) T 0 q
where ω 0 = [ ω x 0 , ω y 0 , ω z 0 ] T , and the anti-symmetric matrix [ ω 0 × ] is constructed as follows:
[ ω 0 × ] = 0 ω z 0 ω y 0 ω z 0 0 ω x 0 ω y 0 ω x 0 0
where ω x 0 , ω y 0 , and ω z 0 are the true angular velocities along the X, Y, and Z axes of the body coordinate system, respectively. Furthermore, q = [ e T , q 0 ] T = [ q 1 , q 2 , q 3 , q 0 ] T is the quaternion, whereas e and q 0 are its vector and scalar part, respectively.
By discretizing Equation (2), we obtain the following expression:
q k + 1 = exp 1 2 [ ω k 0 × ] ω k 0 ( ω k 0 ) T 0 q k
where q k = [ e k T , q 0 , k ] T = [ q 1 , k , q 2 , k , q 3 , k , q 0 , k ] T is defined as the quaternion at the time instant k T s .
After the measurement noise is taken into consideration, Equation (4) is rewritten as follows:
q k + 1 = exp 1 2 [ ω k × ] ω k ω k T 0 q k T s 2 Ξ k ε k ω
where Ξ k is expressed by the following equation:
Ξ k = [ e k × ] + q 0 k I e k T
Equation (5) is actually the desired state transition model.

2.3. Measurement Model

The first measurement vector used here is g k . The relation between g k and its reference unit vector r g = [ 0 , 0 , 1 ] T , which is represented in the global coordinate system (the local geographic coordinate system is selected, with its X, Y, and Z axes pointing north, west, and up, respectively), is expressed as follows:
g k = g k 0 + η k g + ε k g = g k 0 C ( q k 0 ) 0 0 1 + η k g + ε k g
where g k 0 is the norm of g k 0 , q k 0 is the true q k , and the rotation matrix C ( q ) is defined by the following expression:
C ( q ) = q 1 2 q 2 2 q 3 2 + q 0 2 2 ( q 1 q 2 + q 3 q 0 ) 2 ( q 1 q 3 q 2 q 0 ) 2 ( q 1 q 2 q 3 q 0 ) q 2 2 q 1 2 q 3 2 + q 0 2 2 ( q 2 q 3 + q 1 q 0 ) 2 ( q 1 q 3 + q 2 q 0 ) 2 ( q 2 q 3 q 1 q 0 ) q 3 2 q 1 2 q 2 2 + q 0 2
The second measurement vector is normally m k . However, in order to remove the influence of the magnetometer’s measurement on the inclination determination, its component along g k is not used. As a result, the second selected measurement vector is
m k = m k m k g k g k cos ( θ g m )
where θ g m is defined as the angle between g k and m k .
The relation between m k and its reference unit vector r m = [ 1 , 0 , 0 ] T , which is represented in the global coordinate system, is expressed as follows:
m k = m k 0 + η k m + ε k m = m k 0 sin ( θ g m 0 ) C ( q k 0 ) 1 0 0 + η k m + ε k m
where m k 0 , η k m , and ε k m are, respectively, the components of m k 0 , η k m , and ε k m , and all are perpendicular to g k . Furthermore, ε k m is assumed to be white Gaussian measurement noise, with a null mean and the covariance matrix Σ m = σ m 2 I ; θ g m 0 is the true θ g m .
The proposed measurement model is constructed by stacking Equations (7) and (10) into one equation while ignoring the disturbance, as illustrated in the following expression:
g k g k m k m k sin ( θ g m ) = C ( q k ) 0 3 × 3 0 3 × 3 C ( q k ) r g r m + ε k g g k ε k m m k sin ( θ g m )
In Equation (11), it is assumed that C ( q k 0 ) C ( q k ) , g k 0 g k , m k 0 m k , and θ g m 0 θ g m .

2.4. Calculation of the Error Covariance Matrices of the State Transition Model and the Measurement Model

The error covariance matrix of the state transition model given by Equation (5) is defined as follows:
Q k = T s 2 2 σ ω 2 Ξ k Ξ k T
By considering Equation (9), we can easily estimate that the error covariance matrix of the measurement model given by Equation (11) is formulated as follows:
R k = σ g 2 g k 2 I σ g 2 g k 2 cot ( θ g m ) I σ g 2 g k 2 cot ( θ g m ) I σ m 2 m k 2 sin ( θ g m ) 2 I
where σ m 2 = σ m 2 + m k 2 2 g k 2 2 σ g 2 cos θ g m 2 . In order to derive Equation (13), it is assumed that θ g m θ g m 0 . However, the off-diagonal elements of R k that are provided by Equation (13) still render the estimation of the inclination susceptible to the measurements of the magnetometer; therefore, the matrix R k must be set as follows:
R k = σ g 2 g k 2 I 0 3 × 3 0 3 × 3 σ m 2 m k 2 sin ( θ g m ) 2 I
By combining Equations (5), (11), (12) and (14), the EKF approach can then be used for the estimation of both the inclination and the azimuth [12,13,14,15].

3. Simulation, Experimental Results, and Discussion

Depending on the newly formulated measurement model and its error covariance matrix, shown in Equations (11) and (14), respectively, our creatively modified EKF now has the ability to solve the decoupling problem, that is, eliminating the negative effect of magnetic disturbance on the calculation of the inclination. According to the literature, the extended complementary filter (ECF) [40], the hybrid four-parameter complementary filter (FPCF) [41], and the fast complementary filter (FCF) [42] algorithms have the ability to prevent the magnetometer’s measurements from affecting the calculation of the inclination. In this section, the proposed EKF configuration will be compared with these three algorithms in order to assess the superiority of the former approach through the implementation of a thorough analysis.

3.1. Static Evaluation

In this test, the sensor outputs were given as follows:
ω k = ε k ω g k = ε k g m k = ε k m
where the covariance matrices Σ ω , Σ g , and Σ m were set to the values of 0.006 2 I , 0.008 2 I , and 0.001 2 I , respectively. Moreover, the sampling time period T s was set to 1 / 100   s , g k 0 = 9 . 8   m / s 2 , and m k 0 = 0 . 5   Gs ( Gauss ) , whereas the true angle between g k 0 and m k 0 was θ g m 0 = 32 ° , and the initial rotation matrix at time instant k T s = 0 was estimated using the following expression:
C ( q 0 ) = 0.9953 0.0772 0.0578 0.0543 0.9441 0.3252 0.0797 0.3206 0.9439
The filter gains of both the ECF and FPCF are the only parameters that need to be optimally determined. Figure 1 depicts the distribution of the standard deviations of the estimation errors of the three Euler angles in conjunction with the changes in the filter gains K norm and a of the ECF and FPCF, respectively. Moreover, Table 1 summarizes the minimal values of these standard deviations and their corresponding filter gains, which were obtained by implementing the ECF and FPCF algorithms. By setting the noise parameters of the EKF to σ ω 2 = 0.006 2 , σ g 2 g k 2 = 0.008 2 9.8 2 , and σ m 2 m k 2 sin ( θ g m ) 2 = 1.89 × 0.001 2 0.5 2 , the standard deviations provided by the EKF were calculated, as summarized in Table 1. As can be ascertained, although the static performances of both the ECF and FPCF were promising, they did not approach the respective outcomes of the EKF.

3.2. Rotational Test by Incorporating Magnetic Disturbance

In this evaluation process, the sensor outputs were given as follows:
ω k = ε k ω 1 k < k 1   or   k 2 < k k N α x ω sin [ β x ω ( k k 1 ) π T s ] α y ω sin [ β y ω ( k k 1 ) π T s ] α z ω sin [ β z ω ( k k 1 ) π T s ] + ε k ω k 1 k k 2 g k = ε k g 1 k k N m k = ε k m 1 k < k 3   or   k 4 < k k N μ k m + ε k m = α x m sin [ β x m ( k k 3 ) π T s ] α y m sin [ β y m ( k k 3 ) π T s ] α z m sin [ β z m ( k k 3 ) π T s ] + ε k m k 3 k k 4
In Equation (17), k 1 = 500 , k 2 = 2500 , k 3 = 1000 , k 4 = 3500 , k N = 4000 , β x ω = 3 , β y ω = 4 , β z ω = 5 , β x m = 1 , β y m = 2 , and β z m = 3 . The test was executed 2000 times, and in each run, α i ω ( i = x , y , z ) and α i m ( i = x , y , z ) were randomly selected from the uniform distributions bounded by [0, 3] and [0, 0.5], respectively. The initial rotation matrix at a time instant of k T s = 0 was derived using Equation (16). Additionally, the filter gains of both the ECF and FPCF were set to K n o r m = 2.4 and a = 6.6 .
Figure 2 shows the extracted curves of the average absolute error of the inclination and azimuth estimates, which is defined as follows:
ξ u ( k ) = 1 2000 I = 1 2000 u e s t ( k ) u t r u ( k ) 1 k k N
where the letter “u” denotes the pitch, the roll, or the azimuth angle, u e s t signifies the estimate of the given Euler angle, and u t r u represents the true value of this Euler angle.
From the calculated results presented in Figure 2, we can draw the conclusion that the inclination estimation accuracy achieved using both the ECF and FPCF approaches can still be affected by magnetic disturbance. Moreover, a deeper insight into this figure reveals that the magnetic disturbance effect may have a relationship with the rotational movement, since it can be clearly observed that magnetic-disturbance-induced accuracy degradation only occurred when a rotational movement took place (see the curves in the time interval 1000 k 2500 ). Additionally, in Figure 2, we can observe that the degradation of the inclination and azimuth estimation accuracy of the FPCF was also induced due to the impact of the rotational movements (see the curves in the time interval 500 k 1000 ).
In order to further explore the relationship between the inclination estimation accuracy, angular velocity, and magnetic disturbance, we employed Equation (17) in the following parts of this section by setting α x ω = α y ω = α z ω and α x m = α y m = α z m . The derived outcomes are shown in Figure 3.
As far as the ECF is concerned, it was found that the magnetic disturbance had a slight impact on its inclination estimation accuracy when the angular velocity was low, while the disturbance almost linearly decreased its inclination estimation accuracy when the angular velocity was high. This outcome implies that it may not be suitable to compensate the measurement error of the gyroscope by directly using the measurements of both the accelerometer and magnetometer. In other words, the normal practice, i.e., employing the measurements of both the accelerometer and the magnetometer in order to compensate for the prediction error of the inclination and azimuth calculated in the measurements of the gyroscope, may still be a better choice. As a result, different from the ECF approach, it is finally revealed that the rotational movement—not the magnetic disturbance—causes the degradation of the inclination estimation accuracy of the FPCF. Thus, as expected, magnetic disturbance does not affect the inclination estimation accuracy of the FPCF.
The authors of the FPCF method proposed a new inclination and azimuth representation, where 4D parameters (a 3D unit vector and one angle quantity) are used. However, the equation regarding the derivative of this new representation is nonlinear. Hence, in order to simply discretize the above-mentioned derivative equation, the authors used the first-order difference quotient to approximate the derivative equation, which explains why the inclination and azimuth estimations of the FPCF are susceptible to rotational movements.

3.3. Performance of FCF

The FCF is actually a two-step complementary filter, which fuses the measurements of the magnetometer in the second step for the update of the azimuth estimate. A comparative advantage of this algorithm is that, once a magnetic disturbance is recognized, the second step is not executed, and as a result, the influence of magnetic disturbance on the FCF can be suppressed.
Equation (19) is used in the FCF in order to determine whether a magnetic disturbance exists:
m k m k 0 α m
The authors of the FCF did not comment on the exact value of α m in their work; therefore, we set α m = 3 σ m , which is based on the PauTa criterion. The filter gain of the FCF was set to γ a = γ m = 0.1 .
We still employed Equation (17) in this section by setting α x ω = α y ω = α z ω = 3 and α x m = α y m = α z m = 0.5 . Figure 4 illustrates the change curves of ξ u for the inclination and azimuth estimates. It is apparent that the impact of the magnetic disturbance on the FCF significantly depends on the judgment accuracy due to the existence of the magnetic disturbance. On top of that, if the movements are complicated, then it is inevitable that the magnetic disturbance could affect the inclination estimation accuracy due to the inaccurate judgment of its existence, as shown in Figure 4.

3.4. Performance Evaluation Using Real Sensor Measurements

In this test, an MIMU named MTi-G, which was created by Xsens (Henderson, NV, USA), was placed on a wooden table and kept motionless. After a while, a mobile phone, which was used in order to introduce magnetic disturbance, was moved around the MTi-G with the assistance of the tester’s hand. The standard deviations of the measurement errors of the gyroscope, accelerometer, and magnetometer were 0 . 0065   rad / s , 0 . 01   m / s 2 , and 0 . 002   Gs , respectively. In addition, the sampling rate of the MTi-G was 10 Hz. Figure 5 depicts the inclination and azimuth estimation results provided by the EKF, ECF, and FPCF. The filter gains of the three algorithms were all optimally determined using the method explained in part A of this section. More specifically, they were set to the following values: σ ω 2 = 0.0065 2 , σ g 2 g k 2 = 0.01 2 9.8 2 , σ m 2 m k 2 sin ( θ g m ) 2 = 10 × 0.002 2 0.8 2 , K n o r m = 3.1 , and a = 4.38 .
Furthermore, the sensor measurements were down-sampled from 1 Hz to 9 Hz, and at each sampling rate, the filter gains of the EKF, ECF, and FPCF were optimally re-determined using the method explained in part A of this section. The standard deviations of the inclination estimation errors provided by the EKF, ECF, and FPCF at each sampling rate are highlighted in Figure 6. The standard deviation was computed as follows:
σ u = 1 k N 1 k = 1 k N u e s t ( k ) μ 2 1 k k N
where k N = 778 , and
μ = k = 1 k N u e s t ( k ) 1 k k N
The profiles of the inclination (pitch (upper left) and roll (upper right)) and azimuth (down middle) estimates provided by the EKF, ECF, and FPCF are given in Figure 5. As anticipated, it can be ascertained from Figure 5 that all three algorithms performed well, and only the azimuth estimation accuracy of these algorithms was affected by the magnetic disturbance. However, a deeper insight into the extracted data reveals that the azimuth estimation accuracy of the EKF seemed to be more immune to the magnetic disturbance compared with the other two algorithms.
As observed in Figure 6, after decreasing the sampling rate, the performances of both the ECF and FPCF deteriorated dramatically, while the performance of the EKF was only slightly affected. Hence, we can draw the conclusion that the EKF outperforms both the ECF and FPCF when the sampling rate is low.
Another MIMU, named MTi-300, was rotated almost periodically with the assistance of the tester’s hand. The rotation was performed around a computer case, which can distort the Earth’s magnetic field in the range of the rotation motion. An electromagnetic tracking system created by Polhemus (Colchester, CT, USA) was taken as the attitude reference. The standard deviations of the measurement errors of the gyroscope, accelerometer, and magnetometer were 0 . 002   rad / s , 0 . 008   m / s 2 , and 0 . 001   Gs , respectively. In addition, the sampling rate of the MTi-300 was 100 Hz. Figure 7 depicts the inclination and azimuth estimation results provided by the EKF, ECF, and FPCF. The filter gains of the three algorithms were all optimally determined using the method explained in part A of this section. More specifically, they were set to the following values: σ ω 2 = 0.002 2 , σ g 2 g k 2 = 0.008 2 9.8 2 , σ m 2 m k 2 sin ( θ g m ) 2 = 26 × 0.001 2 0.8 2 , K n o r m = 1.6 , and a = 7.1 .
Since linear disturbance is introduced during the rotation motion, the filter gains should be dynamically regulated for linear disturbance suppression, as follows.
σ ω 2 = 1 μ σ ω 2 σ g 2 g k 2 = μ σ g 2 g k 2 σ m 2 m k 2 sin ( θ g m ) 2 = μ σ m 2 m k 2 sin ( θ g m ) 2 K n o r m = μ K n o r m a = 1 μ a
The scalar μ is determined according to the following:
μ = 1 , i = k N + 1 k g i g k 0 3 3 σ g 10 100 , i = k N + 1 k g i g k 0 > 3 3 σ g
where N = 20 .
Obviously, the negative effect caused by the linear acceleration disturbance is suppressed, but the negative effect caused by the magnetic disturbance is completely remains. The profiles of the inclination (pitch (upper left) and roll (upper right)) and azimuth (down middle) estimates provided by the EKF, ECF, and FPCF are given in Figure 7.
As anticipated, it can be ascertained from Figure 7 that the EKF behaves basically the same as the ECF, except that the dynamic response of the EKF is a bit faster than that of the ECF. However, the azimuth estimation accuracy of the FPCF is significantly decreased. The FPCF heavily relies on the gyroscope measurements for attitude estimation when Equation (22) is employed. As mentioned above, the authors of the FPCF used the first-order difference quotient to approximate the derivative equation, which may explain the poor azimuth estimation performance. In addition, the magnetic disturbance further deteriorates the azimuth estimation performance. It is noted that the orientation (including the pitch, roll, and azimuth) estimation errors shown in Figure 7 are mostly caused by the gyroscope measurement error and the comparatively low sampling rate, and the azimuth estimation error is partly caused by the magnetic disturbance. Due to the similarity between the pitch and roll estimation accuracy, it is deduced that the magnetic disturbance does not negatively affect the pitch and roll calculation of the EKF, ECF, and FPCF.

4. Conclusions

In this work, we have demonstrated that the EKF is an important alternative solution in applications where the influence of magnetic disturbance on the inclination estimation is not acceptable. Despite the fact that three algorithms, i.e., ECF, FPCF, and FCF, have recently been proposed, there are still significant issues that should be addressed. The ECF is susceptible to magnetic disturbance when a large angular movement takes place. Moreover, the FPCF cannot perform well when only a large angular movement exists, regardless of whether a magnetic disturbance exists or not. Additionally, both the ECF and FPCF exhibit poor performance when the sampling rate is decreased. The impact of magnetic disturbance on the FCF strongly depends on the identification accuracy for the existence of magnetic disturbance. With some modifications, the EKF not only achieves the goal of removing the influence of the magnetometer’s measurements on the inclination determination, but also overcomes the above-mentioned issues faced by the ECF, FPCF, and FCF algorithms. Hence, it is concluded that the EKF can be selected for the related applications described in our work, and is still the preferred algorithm for determining the attitude of rigid bodies.

Author Contributions

Conceptualization, methodology and writing—original draft preparation, Y.C.; validation, formal analysis, and writing—review and editing, H.R. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Office of Science and Technology of Changzhou, Grant Number CJ20220100; Postdoctoral Foundation of Jiangsu Province, Grant Number 2021K187B; National Postdoctoral General Fund, Grant Number 2021M701042; Foundation of State Key La-boratory of Automotive Simulation and Control, Grant Number 20210241; the National Natural Science Foundation of China, Grant Number 61501061.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data generated and/or analyzed in the current study are not publicly available for legal/ethical reasons but are available from the corresponding author upon reasonable request.

Acknowledgments

The authors would like to express their gratitude to every reviewer of this paper.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Zmitri, M.; Fourati, H.; Vuillerme, N. Human activities and postures recognition: From inertial measurements to quaternion-based approaches. Sensors 2019, 19, 4058. [Google Scholar] [CrossRef] [PubMed]
  2. Sun, Y.; Xu, X.; Tian, X.; Zhou, L.; Li, Y. A quaternion-based sensor fusion approach using orthogonal observations from 9D inertial and magnetic information. Inf. Fusion 2023, 90, 138–147. [Google Scholar] [CrossRef]
  3. Cordoba, M.A. Inclination and heading reference system I-AHRS for the EFIGENIA autonomous unmanned aerial vehicles UAV based on MEMS sensor and a neural network strategy for inclination estimation. In Proceedings of the Mediterranean Conference on Control & Automation, Athens, Greece, 27–29 June 2007; pp. 1–8. [Google Scholar]
  4. Shi, L.; Xiao, R.; Guo, S.; Guo, P.; Pan, S.; He, Y. An inclination estimation system for amphibious spherical robots. In Proceedings of the IEEE International Conference on Mechatronics and Automation, Beijing, China, 2–5 August 2015; pp. 2076–2081. [Google Scholar]
  5. Sheng, G.; Liu, X.; Sheng, Y.; Cheng, X.; Luo, H. Cooperative navigation algorithm of extended Kalman filter based on combined observation for AUVs. Remote Sens. 2023, 15, 533. [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 inclination estimation of mobile robots. Sensors 2020, 20, 803. [Google Scholar] [CrossRef]
  7. Valenti, R.G.; Dryanovski, I.; Xiao, J.Z. A linear Kalman filter for MARG orientation estimation using the algebraic quaternion algorithm. IEEE Trans. Instrum. Meas. 2016, 65, 467–481. [Google Scholar] [CrossRef]
  8. Chen, X.; Xie, Z.; Eun, Y.; Bettens, A.; Wu, X. An observation model from linear interpolation for quaternion-based attitude estimation. IEEE Trans. Instrum. Meas. 2023, 72, 1–12. [Google Scholar] [CrossRef]
  9. Ren, H.; Kazanzides, P. Investigation of inclination tracking using an integrated inertial and magnetic navigation system for hand-held surgical instruments. IEEE/ASME Trans. Mechatron. 2012, 17, 210–217. [Google Scholar] [CrossRef]
  10. Alarcón, J.R.C.; Cortés, H.R.; Vivas, E.V. Extended Kalman filter tuning in inclination estimation from inertial and magnetic field measurements. In Proceedings of the 6th International Conference on Electrical Engineering, Computing Science and Automatic Control, Toluca, Mexico, 10–13 November 2009; pp. 1–6. [Google Scholar]
  11. Yun, X.P.; Bachmann, E.R. Design, implementation, and experimental results of a quaternion-based Kalman filter for human body motion tracking. IEEE Trans. Robot. 2006, 22, 1216–1227. [Google Scholar] [CrossRef]
  12. Fang, B.; Sun, F.; Liu, H.; Guo, D. Development of a wearable device for motion capturing based on magnetic and inertial measurement units. Sci. Program. 2017, 2017, 7594763. [Google Scholar] [CrossRef]
  13. Sessa, S.; Zecca, M.; Lin, Z.; Bartolomeo, L.; Ishii, H.; Takanishi, A. A methodology for the performance evaluation of inertial measurement units. J. Intell. Robot. Syst. 2013, 71, 143–157. [Google Scholar] [CrossRef]
  14. Rong, H.; Zhu, Y.; Lv, J.; Peng, C.; Zou, L. A simplified extended Kalman filter used for magnetic and inertial measurement units. IEEE Sens. J. 2020, 21, 6356–6366. [Google Scholar] [CrossRef]
  15. 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]
  16. Ghobadi, M.; Singla, P.; Esfahani, E.T. Robust inclination estimation from uncertain observations of inertial sensors using covariance inflated multiplicative extended Kalman filter. IEEE Trans. Instrum. Meas. 2018, 67, 209–217. [Google Scholar] [CrossRef]
  17. Hua, S.; Huang, H.Y.; Yin, F.F. Constant-gain EKF algorithm for satellite inclination determination systems. Aircr. Eng. Aerosp. Technol. 2018, 90, 1259–1271. [Google Scholar] [CrossRef]
  18. Tong, X.; Li, Z.; Han, G.; Liu, N.; Su, Y.; Ning, J.; Yang, F. Adaptive EKF based on HMM recognizer for inclination estimation using MEMS MARG sensors. IEEE Sens. J. 2018, 18, 3299–3310. [Google Scholar] [CrossRef]
  19. Youn, W.; Rhudy, M.B.; Cho, A.; Myung, H. Fuzzy adaptive inclination estimation for a fixed-wing UAV with a virtual SSA sensor during a GPS outage. IEEE Sens. J. 2020, 20, 1456–1472. [Google Scholar] [CrossRef]
  20. Yuan, Q.; Asadi, E.; Lu, Q.; Yang, G.; Chen, I.M. Uncertainty-based IMU orientation tracking algorithm for dynamic motions. IEEE/ASME Trans. Mechatron. 2019, 24, 872–882. [Google Scholar] [CrossRef]
  21. Chiella, A.C.B.; Teixeira, B.O.S.; Pereira, G.A.S. Quaternion-based robust inclination estimation using an adaptive unscented Kalman filter. Sensors 2019, 19, 2372. [Google Scholar] [CrossRef] [PubMed]
  22. Xu, X.; Tian, X.; Zhou, L.; Li, Y. A decision-tree based multiple-model UKF for inclination estimation using low-cost MEMS MARG sensor arrays. Measurement 2019, 135, 355–367. [Google Scholar] [CrossRef]
  23. Qiu, Z.B.; Qian, H.M.; Wang, G.Q. Adaptive robust cubature Kalman filtering for satellite inclination estimation. Chin. J. Aeronaut. 2018, 31, 806–819. [Google Scholar] [CrossRef]
  24. To, G.; Mahfouz, M.R. Quaternionic inclination estimation for robotic and human motion tracking using sequential Monte Carlo methods with von Mises-Fisher and nonuniform densities simulations. IEEE Trans. Biomed. Eng. 2013, 60, 3046–3059. [Google Scholar] [CrossRef] [PubMed]
  25. Wan, E.A.; Van Der Merwe, R. The unscented Kalman filter for nonlinear estimation. In Proceedings of the IEEE 2000 Adaptive Systems for Signal Processing, Communications, and Control Symposium (Cat. No.00EX373), Lake Louise, AB, Canada, 4 October 2000. [Google Scholar]
  26. Arasaratnam, I.; Haykin, S. Cubature Kalman Filters. IEEE Trans. Autom. Control 2009, 54, 1254–1269. [Google Scholar] [CrossRef]
  27. Garcia, R.V.; Pardal, P.C.; Kuga, H.K.; Zanardi, M.C. Nonlinear filtering for sequential spacecraft inclination estimation with real data: Cubature Kalman Filter, Unscented Kalman Filter and Extended Kalman Filter. Adv. Space Res. 2019, 63, 1038–1050. [Google Scholar] [CrossRef]
  28. Garcia, R.V.; Silva, W.R.; Pardal, P.C.; Kuga, H.K.; Zanardi, M.C. Sequential nonlinear estimation: Regularized particle filter applied to the inclination estimation problem with real data. Comput. Appl. Math. 2018, 37, S110–S121. [Google Scholar] [CrossRef]
  29. Li, K.; Hu, B.; Chang, L.; Li, Y. Comparison of direct navigation mode and indirect navigation mode for integrated SINS/GPS. Trans. Inst. Meas. Control 2016, 38, 3–13. [Google Scholar] [CrossRef]
  30. Fourati, H.; Manamanni, N.; Afilal, L.; Handrich, Y. Complementary observer for body segments motion capturing by inertial and magnetic sensors. IEEE/ASME Trans. Mechatron. 2014, 19, 149–157. [Google Scholar] [CrossRef]
  31. Yun, X.; Calusdian, J.; Bachmann, E.R.; McGhee, R.B. Estimation of human foot motion during normal walking using inertial and magnetic sensor measurements. IEEE Trans. Instrum. Meas. 2012, 61, 2059–2072. [Google Scholar] [CrossRef]
  32. Fan, B.; Li, Q.; Wang, C.; Liu, T. An adaptive orientation estimation method for magnetic and inertial sensors in the presence of magnetic disturbance. Sensors 2017, 17, 1161. [Google Scholar] [CrossRef]
  33. Yean, S.; Lee, B.S.; Yeo, C.K.; Vun, C.H.; Oh, H.L. Smartphone orientation estimation algorithm combining Kalman filter with gradient descent. IEEE J. Biomed. Health Inform. 2018, 22, 1421–1433. [Google Scholar] [CrossRef]
  34. Madgwick, S.O.H.; Harrison, A.J.; Vaidyanathan, R. Estimation of IMU and MARG orientation using a gradient descent algorithm. In Proceedings of the IEEE International Conference on Rehabilitation Robotics, Zurich, Switzerland, 29 June–1 July 2011; pp. 1–7. [Google Scholar]
  35. Liu, G.X.; Shi, L.F.; Xun, J.H.; Chen, S.; Zhao, L.; Shi, Y.F. An orientation estimation algorithm based on multi-source information fusion. Meas. Sci. Technol. 2018, 29, 115101–115111. [Google Scholar] [CrossRef]
  36. 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. [Google Scholar] [CrossRef] [PubMed]
  37. Brückner, H.P.; Krüger, B.; Blume, H. Reliable orientation estimation for mobile motion capturing in medical rehabilitation sessions based on inertial measurement units. Microelectron. J. 2014, 45, 1603–1611. [Google Scholar] [CrossRef]
  38. Harms, H.; Amft, O.; Winkler, R.; Schumm, J.; Kusserow, M.; Tröster, G. ETHOS: Miniature orientation sensor for wearable human motion analysis. In Proceedings of the IEEE Conference on Sensors, Waikoloa, HI, USA, 1–4 November 2010; pp. 1037–1042. [Google Scholar]
  39. Choi, J.S.; Lee, C.J.; Lee, J.K. A parallel recurrent neural network for robust inertial and magnetic sensor-based 3D orientation estimation. IEEE Access 2023, 11, 89685–89693. [Google Scholar] [CrossRef]
  40. Madgwick, S.O.; Wilson, S.; Turk, R.; Burridge, J.; Kapatos, C.; Vaidyanathan, R. An extended complementary filter for full-body MARG orientation estimation. IEEE/ASME Trans. Mechatron. 2020, 25, 2054–2064. [Google Scholar] [CrossRef]
  41. Suh, Y.S. Attitude estimation using inertial and magnetic sensors based on hybrid four-parameter complementary filter. IEEE Trans. Instrum. Meas. 2020, 69, 5149–5156. [Google Scholar] [CrossRef]
  42. Wu, J.; Zhou, Z.; Chen, J.; Fourati, H.; Li, R. Fast complementary filter for inclination estimation using low-cost MARG sensors. IEEE Sens. J. 2016, 16, 6997–7007. [Google Scholar] [CrossRef]
  43. Markley, F.L.; Crassidis, J.L. Fundamentals of Spacecraft Attitude Determination and Control; Microcosm Press: Cleveland, OH, USA; Springer: New York, NY, USA, 2014. [Google Scholar]
Figure 1. Distribution of the standard deviations of the estimation errors of the three Euler angles as a function of the modifications of the filter gain K norm of the ECF (left) and the filter gain a of the FPCF (right).
Figure 1. Distribution of the standard deviations of the estimation errors of the three Euler angles as a function of the modifications of the filter gain K norm of the ECF (left) and the filter gain a of the FPCF (right).
Sensors 23 09756 g001
Figure 2. Variation curves of the average absolute errors of the inclination (pitch (upper left) and roll (upper right)) and azimuth (down middle) estimates calculated using the EKF, ECF, and FPCF.
Figure 2. Variation curves of the average absolute errors of the inclination (pitch (upper left) and roll (upper right)) and azimuth (down middle) estimates calculated using the EKF, ECF, and FPCF.
Sensors 23 09756 g002
Figure 3. Curved surfaces describing the changes in the pitch and roll estimation errors of the proposed EKF, ECF, and FPCF, along with the changes in the magnitude of the angular velocity, and the magnetic disturbance.
Figure 3. Curved surfaces describing the changes in the pitch and roll estimation errors of the proposed EKF, ECF, and FPCF, along with the changes in the magnitude of the angular velocity, and the magnetic disturbance.
Sensors 23 09756 g003
Figure 4. Time-related change curves of the inclination and azimuth estimation errors of the FCF.
Figure 4. Time-related change curves of the inclination and azimuth estimation errors of the FCF.
Sensors 23 09756 g004
Figure 5. Profiles of the inclination (pitch (upper left) and roll (upper right)) and azimuth (down middle) estimates provided by the EKF, ECF, and FPCF when MTi−G is employed for a real test.
Figure 5. Profiles of the inclination (pitch (upper left) and roll (upper right)) and azimuth (down middle) estimates provided by the EKF, ECF, and FPCF when MTi−G is employed for a real test.
Sensors 23 09756 g005
Figure 6. Distribution of the standard deviations of the inclination (pitch (left) and roll (right)) estimation errors provided by the EKF, ECF, and FPCF.
Figure 6. Distribution of the standard deviations of the inclination (pitch (left) and roll (right)) estimation errors provided by the EKF, ECF, and FPCF.
Sensors 23 09756 g006
Figure 7. Profiles of the inclination (pitch (upper left) and roll (upper right)) and azimuth (down middle) estimates provided by the EKF, ECF, and FPCF when MTi−300 is employed for a real test.
Figure 7. Profiles of the inclination (pitch (upper left) and roll (upper right)) and azimuth (down middle) estimates provided by the EKF, ECF, and FPCF when MTi−300 is employed for a real test.
Sensors 23 09756 g007
Table 1. Minimal values of standard deviations of the estimation errors of the three Euler angles that were estimated using the EKF, ECF, and FPCF approaches.
Table 1. Minimal values of standard deviations of the estimation errors of the three Euler angles that were estimated using the EKF, ECF, and FPCF approaches.
EKFECFFPCF
pitch0.01290.0134 (Knorm = 7.3)0.0134 (a = 7.4)
roll0.01300.0134 (Knorm = 3.9)0.0134 (a = 7.2)
azimuth0.02130.0210 (Knorm = 2.4)0.0383 (a = 6.6)
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.

Share and Cite

MDPI and ACS Style

Chen, Y.; Rong, H. A Customized Extended Kalman Filter for Removing the Impact of the Magnetometer’s Measurements on Inclination Determination. Sensors 2023, 23, 9756. https://doi.org/10.3390/s23249756

AMA Style

Chen Y, Rong H. A Customized Extended Kalman Filter for Removing the Impact of the Magnetometer’s Measurements on Inclination Determination. Sensors. 2023; 23(24):9756. https://doi.org/10.3390/s23249756

Chicago/Turabian Style

Chen, Yang, and Hailong Rong. 2023. "A Customized Extended Kalman Filter for Removing the Impact of the Magnetometer’s Measurements on Inclination Determination" Sensors 23, no. 24: 9756. https://doi.org/10.3390/s23249756

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