Next Article in Journal
A Stackelberg Security Game for Adversarial Outbreak Detection in the Internet of Things
Next Article in Special Issue
Human-In-The-Loop Assessment of an Ultralight, Low-Cost Body Posture Tracking Device
Previous Article in Journal
Detection Principles of Temperature Compensated Oscillators with Reactance Influence on Piezoelectric Resonator
Previous Article in Special Issue
Inertial Sensor-Based Lower Limb Joint Kinematics: A Methodological Systematic Review
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Novel Fuzzy-Adaptive Extended Kalman Filter for Real-Time Attitude Estimation of Mobile Robots

1
Department of Control Engineering and Information Technology, University of Dunaújváros, Táncsics Mihály u. 1, 2400 Dunaújváros, Hungary
2
Technical Department, Faculty of Engineering, University of Szeged, Moszkvai krt. 9, 6725 Szeged, Hungary
3
Department of Environmental Engineering, Faculty of Engineering and Information Technology, University of Pécs, Boszorkány út 2, 7624 Pécs, Hungary
4
Institute of Physiology, Medical School, University of Pécs, Szigeti út 12, 7624 Pécs, Hungary
*
Author to whom correspondence should be addressed.
Submission received: 21 December 2019 / Revised: 24 January 2020 / Accepted: 29 January 2020 / Published: 1 February 2020
(This article belongs to the Special Issue Inertial Sensors)

Abstract

:
This paper proposes a novel fuzzy-adaptive extended Kalman filter (FAEKF) for the real-time attitude estimation of agile mobile platforms equipped with magnetic, angular rate, and gravity (MARG) sensor arrays. The filter structure employs both a quaternion-based EKF and an adaptive extension, in which novel measurement methods are used to calculate the magnitudes of system vibrations, external accelerations, and magnetic distortions. These magnitudes, as external disturbances, are incorporated into a sophisticated fuzzy inference machine, which executes fuzzy IF-THEN rules-based adaption laws to consistently modify the noise covariance matrices of the filter, thereby providing accurate and robust attitude results. A six-degrees of freedom (6 DOF) test bench is designed for filter performance evaluation, which executes various dynamic behaviors and enables measurement of the true attitude angles (ground truth) along with the raw MARG sensor data. The tuning of filter parameters is performed with numerical optimization based on the collected measurements from the test environment. A comprehensive analysis highlights that the proposed adaptive strategy significantly improves the attitude estimation quality. Moreover, the filter structure successfully rejects the effects of both slow and fast external perturbations. The FAEKF can be applied to any mobile system in which attitude estimation is necessary for localization and external disturbances greatly influence the filter accuracy.

1. Introduction

1.1. Survey on Attitude Estimation

The microelectromechanical systems-based (MEMS-based) relative localization problem is a recent topic, which has been widely investigated in many areas including robotics and control [1,2,3,4,5,6,7,8], healthcare and rehabilitation [9,10,11], consumer electronics mobile devices [12,13,14], and automated driving and navigation [15,16,17,18], both in industry and in scientific research. Independent from the application, accurate and robust attitude estimation is a crucial task to be solved, especially if the results are to be incorporated into unstable closed-loop systems, such as the control algorithms of mobile robots and unmanned aerial vehicles (UAVs) [1].
The MEMS inertial measurement unit (IMU), composed of tri-axis MEMS accelerometer, gyroscope, and magnetometer sensors, also known as the measurement system of magnetic, angular rate, and gravity (MARG) sensor arrays, is the most commonly utilized device to track the real-time orientation of mobile platforms at present. The low-cost, low power consumption, and small size characteristics meet technological requirements, and therefore these devices have been widely utilized in embedded systems, where the filtering algorithm is executed by a microprocessor. As a result, an attitude and heading reference system (AHRS) has been formed, which provides the complete orientation measurement relative to the Earth’s gravitational and magnetic fields (global reference system), where the attitude denotes the roll and pitch angles, whereas heading refers to the yaw Euler angle [19]. The role of the aforementioned filtering algorithm is to combine the individual features of each sensor and provide both properly smoothed and robust attitude results with regard to the global reference system, in either Euler angles or quaternions. The most common method applied in sensor fusion techniques synthesizes the short-term accuracy of gyroscope-based attitude realizations and the accelerometer and magnetometer provide rough, low-frequency attitude corrections. This technique cancels the accumulated error (drift), smooths the signals, and produces long-term stable outputs if the IMU is in stationary states. Significant decrease in estimation performance arises when external disturbances are present, such as external accelerations, vibrations, and magnetic distortions, which prevent the utilization of the pure gravity and local magnetic field vectors in the calculation of the direction cosine matrix (DCM). The following paragraphs discuss the solutions provided in the literature.
Among recent developments, the Kalman filter (KF)—by different variants, such as stochastic approaches—and complementary filter (by frequency domain methods), both augmented with the intelligent use of deterministic techniques, have become the most popular methods for robust attitude determination [20]. Deterministic techniques have been shown to solve Wahba’s problem [21] and provide attitude estimation based on gravity and magnetic field observations. The fundamental solutions are three-axis attitude determination (TRIAD), which produces suboptimal attitude matrix estimation by the construction of two triads of orthonormal unit vectors, and the QUaternion ESTimator (QUEST), in which the quaternion is found by minimizing a quadratic gain function based on a set of reference and observation vectors. Improved approaches have utilized the fast optimal matrix algorithm (FOAM) [22], the factored quaternion algorithm (FQA) [23], the Gauss–Newton algorithm [24], Levenberg Marquardt algorithm [25], the gradient descent algorithm [26], and the super fast least-squares optimization-based algorithm [27]. Each approach estimates the attitude based on accelerometer and magnetometer measurements and is characterized by reduced computational complexity or more robust performance. As the estimation performance significantly decreases with disturbances (magnetic perturbation and/or external acceleration), the incorporation of gyroscope measurements has thus become a de facto standard for the state propagation.
Complementary filters (CF) use frequency domain information to synthesize signals that have complementary spectral components. This concept enables us to combine the slowly varying signals of the accelerometer and magnetometer with the fast signals of the gyroscope through low- and high-pass filters, respectively. The CF has been widely implemented in the robotics and control community, due to its simple structure and ease of implementation [28,29]. In [28], a nonlinear CF was developed for UAVs, which also employed first-order vehicle dynamics to cancel the effect of external acceleration. A quaternion-based nonlinear CF (qNCF) for attitude estimation was developed in [30] (hereafter referred to as the Mahony filter), which corrects the gyroscope measurements with a proportional and integral (PI) controller and provides attitude and gyroscope bias estimates. The popular Madgwick filter [26] is a computationally efficient constant gain filter, which was developed originally for human motion tracking applications. The filter has been improved recently in [7], employing the accelerometer and magnetometer measurements in a gradient descent algorithm to correct the quaternion obtained through the integration of rate measurements. Mahony and Madgwick filters are widely utilized algorithms and their performances have regularly been considered in comparative analyses [9,13,15,31,32,33]. In [34], an adaptive-gain CF was proposed to provide good estimates, even in dynamic or high-frequency situations. The filter gain was modified based on both the convergence and divergence rates of observation-based orientation realization and gyroscope-based orientation propagation, respectively. An improved qCF was designed in [32], in which two correction sequences were employed based on separating the quaternion into accelerometer- and magnetometer-based realizations. Moreover, the algorithm was augmented with an adaptive gain characterized by two thresholds to reduce the estimation error when dynamic motion is present. The filter performance was validated with experiments containing short external disturbances. This algorithm was adapted in [10], where its real-time performance was evaluated on a microprocessor-controlled lower limb prosthesis. An iteration-free variant of CF has been proposed for efficient attitude estimation calculation in [35], where a linear system was employed for the accelerometer-based attitude realization. The filter performance was evaluated under different conditions and the effects of vibration and magnetic distortion were examined as well. However, the developed CF was not as accurate as the benchmark KF, especially under highly dynamic conditions. In [36], a two-step qCF was implemented for human motion tracking applications. The algorithm was characterized by two separate tuning parameters; moreover, it contained a finite state machine-based adaptive strategy to cope with external disturbances. The two-step configuration made the attitude output more resistant to magnetometer measurements, as the attitude was obtained based on accelerometer and gyroscope data first, following which the heading angle was updated using both the estimate and magnetometer data.
The KF and its extension for nonlinear cases, the extended KF (EKF), are the most prevalent Bayesian state estimation algorithms utilized for attitude determination. These recursive algorithms deal with statistical descriptions and predict the state of the Gaussian stochastic model of MARG with minimum variance. The main performance, which includes both the filter dynamics and convergence, is determined with the proper covariance matrices that describe the stochastic system. In [37], a qEKF was developed for human movement tracking, in which the state of a rotation quaternion was augmented with the random walk processes of accelerometer and magnetometer bias vectors. Moreover, an adaptive strategy modified the noise covariance matrix if an external disturbance was identified. The filter was improved by modeling the magnetic variations with a Gauss–Markov vector random process, which aimed to reduce the effect of fluctuating magnetic environments [38]. Adaptive threshold-based switching strategies have been used to modify the covariance matrices based on the measured stationary-, low-, and high-acceleration modes in [39,40]. In [19], an acceleration model was incorporated in the stochastic model, and thus the KF both estimated and compensated for the external acceleration in an attitude determination process. The proposed method was evaluated under dynamic conditions and compared with a threshold-based KF; however, significant improvement in the estimation accuracy was not highlighted. In [14,41], smartphone-based human body orientation estimation was addressed with the application of a qAEKF. The proposed adaptive strategy modified the noise covariance matrix based on the variance of input signal. Moreover, the upper and lower bounds of covariance values were selected by numerical optimization. Comparison with both the Android OS algorithm and a simple CF highlighted the benefits of the proposed method. A similar qEKF structure without adaptation laws was proposed for the attitude estimation of UAVs in [42]. The filter was set up with experimentally tuned noise covariance matrices; however, its performance was evaluated without external dynamic effects on a multi-function turntable device. A reduced state vector-based qEKF approach was applied in [3], in which the measurement noise covariance was tuned in real-time, based on the angle between the predicted and measured gravitational accelerations. A two-step geometrically-intuitive quaternion correction was proposed for a linear KF, which enabled isolation of the pitch and roll estimation performance from magnetic distortion effects by decoupling the accelerometer and magnetometer data [43]. In [44], a linear KF was implemented for human motion tracking applications in dynamic environments. In their real-world experiments, the effects of long external accelerations were addressed and good overall performance was achieved by the filter; however, significant error peaks were present in the estimation as well. A smart detector augmented AEKF was proposed in [45] with similar filter efficiency. The adaptive strategy identified both static and dynamic body motions. Moreover, the effect of external acceleration was suppressed through filter gain tuning. The attitude estimation problem during sports activities was addressed in [46], where the proposed EKF considered the model uncertainty of active acceleration. Experiments highlighted the robustness of the approach, especially when large accelerations were present during the tests. In [47], the maneuvering target tracking problem was addressed and the application of both General Regression Neural Networks (GRNN) and an additional maneuver detector algorithm was proposed for the state estimation of manoeuvring objects. Moreover, a comparison of the GRNN-based neural filter and KF for target movement vector estimation was presented in [48,49], where the GRNN-based approach was characterized by superior estimation performance only during steady motions. In [50], a fuzzy inference system was proposed to tune the noise covariance matrix of the EKF based on the filter innovation sequence through a covariance-matching technique. The experimental results showed that the fuzzy rule-based adaptive strategy effectively improved the estimation accuracy with respect to the standard EKF algorithm. In [51], an adaptive analytical algorithm was presented for the determination of UAV orientation angles. The algorithm employed both MARG and GPS-based correction channels; moreover, an UAV maneuver intensity classification method was implemented to increase the orientation estimation performance.
Recent studies have proposed the use of unscented KF (UKF) over EKF [52,53], and stated that UKF-based approaches better deal with the high-order nonlinear terms of large attitude errors. Attitude estimation has been solved with computationally efficient geometric UKF [53], where a new formulation of the UKF algorithm was proposed in [52] to maintain fast and slow variations in the measurement uncertainty. The latter algorithm was augmented with both an adaptive strategy to tune the covariance matrices on-the-fly and an outlier detector to reject the effects of external disturbances. An industrial manipulator robot was used to conduct the experiments, where the algorithm provided superior performance over the standard UKF and Madgwick filters. Recent developments have considered the MARG as a non-Gaussian stochastic system and developed maximum correntropy KF (MCKF) for attitude estimation [54,55]. These algorithms employed the MC criterion, instead of the minimum mean square error, to estimate the state of the system corrupted by non-Gaussian impulsive noises. However, the comprehensive case study provided in [56] has not highlighted the superior state estimation performance of the MCC-based techniques in non-Gaussian noise environments.
Based on the methods discussed above, it can be concluded that the ultimate attitude estimation quality is determined by three main factors:
  • The first impact is related to the flexibility of the implemented algorithm (i.e., the observation models, equations defining the filter dynamics, and noise models jointly define the algorithm).
  • The filter performance heavily depends on properly selected filter gains (i.e., noise covariance matrices). In general, the statistics of system noise cannot be determined; moreover, external disturbances cause radical measurement noise during attitude realization, which make the assumed noise models inappropriate. As a result, the filter parameters are usually selected based on both experimental and engineering intuition, which result in a compromise between the accuracy and filter dynamics. To enhance the filter performance, numerical optimization-based filter tuning has been performed [1,14,40,57].
  • The papers above show that the common methods used to deal with external disturbances (dynamic motions and magnetic perturbations) either work by the application of intelligent adaptive strategies that on-the-fly modify the vector observation methods, filter gains, and covariance matrices; or the compensation is maintained with additional dynamic models that well-mimic the effects of the external forces and magnetic fluctuations.

1.2. Contribution of the Paper

This paper addresses the robust attitude estimation problem for mechatronic systems (robots) characterized by fast dynamics, unstable equilibria, and/or mechanical difficulties (e.g., the driving mechanism backlash). For these type of systems, reliable state estimation is both an essential and crucial task to be solved, as the unstable dynamics are stabilized in closed-loop with a control algorithm, in which the stabilizing system inputs are calculated based on the estimation results. If the state estimation contains significant errors, then these control signals will drive the system out of equilibrium to unwanted states, which may eventually damage the system and its environment [1,42].
The aforementioned discussion highlights that providing both reliable and robust attitude estimates, especially for extreme dynamic situations, remains an important issue. For this problem, our paper proposes a novel qAEKF, in which new methods are employed to measure the external disturbances and their effect is suppressed with adaptation laws described with fuzzy logic-based IF-THEN rules. The results show that the proposed methods significantly improve the robustness of the state estimation, both in static and extremely vibrating and accelerating environments. Moreover, to the author’s best knowledge, no study has yet investigated the attitude estimation problem in such dynamic environments. The basis of the proposed filter structure was presented in [1], where the techniques were validated for one-dimensional attitude estimation using a linear KF. That investigation showed promising results, thereby motivating us to extend the estimation problem to the complete orientation based on MARG systems. The novelties of the paper are summarized as follows.
  • Formulating a novel quaternion-based FAEKF structure that incorporates the magnitudes of vibration, external acceleration, and magnetic perturbation by a sophisticated heuristic knowledge-based fuzzy inference machine to provide robust attitude estimation in both static and dynamic environments.
  • Designing a 6 DOF test platform which enables both the execution of various dynamic (vibrating and accelerating) behaviors in the three-dimensional space and the measurement of true attitude angles along with the raw MARG data. An additional part of the test environment is a novel magnetic perturbation algorithm. This test environment contributes to the successful evaluation of state estimation quality.
  • Performing numerical optimization-aided tuning of filter parameters based on the collected training measurements in the test environment.
  • Providing a free-to-use Robot Operating System (ROS) package that enables both the generation of MARG-based measurements and the testing of filter performances. We made this package publicly available on our website [58], with the aim of helping other laboratory teams with both performing and developing similar experiments.
The proposed approaches can be advantageously applied in such mechatronic systems where accurate attitude determination is crucial for the closed-loop dynamics; moreover, where external disturbances are frequently present, due to fast maneuvers, collision, or unstable dynamics.
The remainder of the paper is organized as follows. Section 2 gives an introduction to quaternion representation and highlights the important relationships. In Section 3, the stochastic models of MARG sensor arrays are discussed and a suitable EKF formulation for attitude estimation is described. Section 4 presents the fuzzy adaptive strategy in detail, in which external disturbance magnitudes are measured with three novel methods; additionally, a sophisticated fuzzy inference machine is employed to manipulate the noise variances consistently. Section 5 introduces the test bench which was designed for estimation quality evaluation, the optimization-aided tuning of filter parameters, and the experimental results of the proposed approaches. Finally, in Section 6, the conclusions and recommendations for future studies are discussed.

2. Quaternion-Based Attitude Formulation

Let E and S denote the earth and sensor frames, also called the global non-moving inertial and local mobile frames, respectively. These frames can be defined with the conventional North-East-Down (NED) configuration often applied for robotic applications [3,5,42]. Namely, the x-axis points north and y is directed east, whereas z completes the right-handed coordinate system by pointing down in the inertial reference frame (see Figure 1). Additionally, the origin of the right-handed sensor frame is attached to the center of mass of the moving body, where the x-axis points forward and the y-axis is directed to the right of the body. The mapping between these frames E and S is described by a rotation matrix as
E x = S E R S x ,
where E x and S x denote the 3 × 1 vector observations in the earth and sensor frames, respectively. Moreover, S E R SO 3 indicates the 3 × 3 special orthogonal matrix, where the inverse transformation is defined as S E R 1 = S E R T = E S R .
A quaternion representation provides an effective way to both formulate the aforementioned rotation matrix and describe the attitude of the coordinate frames in three-dimensional space [59]. The advantageous structure both provides fast computation (compared to DCM) and completely avoids the well-known singularity problem of Euler angles (also known as the gimbal lock problem) [60]. The unit quaternion formulated by the four-dimensional vector S E q R 4 , S E q = 1 describes the attitude of frame E relative to frame S as a rotation by an angle μ about the unit vector e = e x , e y , e z T , which represents the rotation axis in S . This rotation quaternion is interpreted as S E q = cos μ 2 , e T · sin μ 2 T = q 0 , ϱ T , where q 0 and ϱ = ( q 1 , q 2 , q 3 ) T denote the scalar and vector part terms, respectively. Co-ordinate transformation is performed by the non-commutative quaternion product denoted by ⊗:
E x = S E q S x S E q * .
In Equation (2), S E q * = ( q 0 , ϱ ) T denotes the conjugate quaternion that describes the attitude of frame S relative to frame E (i.e., the inverse rotation is formulated as S E q * = E S q ). Moreover, E x and S x indicate the quaternions associated with the vector observations by their augmentation with zero scalar parts ( q 0 = 0 ) as x = 0 , x T T . The rotation can be rearranged into the initial Equation (1) with the quaternion-parameterized rotation matrix
S E R q = q 0 2 ϱ T ϱ I 3 + 2 ϱ ϱ T + 2 q 0 [ ϱ × ] = 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 ,
where I 3 is the identity matrix of size 3 and [ ϱ × ] denotes the antisymmetric matrix of ϱ , defined for the vector cross product ϱ × x = [ ϱ × ] x as
[ ϱ × ] = 0 q 3 q 2 q 3 0 q 1 q 2 q 1 0 .
Let S ω = 0 , ω x , ω y , ω z T denote the four-dimensional quaternion formed by the angular velocities about the x, y, and z axes in the sensor frame. The time derivative of the quaternion S E q represents the rate of change of attitude E relative to frame S , according to the vector differential equation
S E q ˙ = 1 2 S E q S ω = 1 2 Q q S ω , Q q = q 0 ϱ T ϱ q 0 I 3 + [ ϱ × ] ,
where the matrix-vector product is indicated by the quaternion matrix Q q . The attitude of frame E relative to S is obtained by integrating the quaternion derivative S E q ˙ . Thereforeforth, the sub- and super-scripts are omitted, for the sake of simplicity.
The authors used the Euler angles for the quality evaluation of attitude estimation, as their interpretation is straightforward for the reader. Euler angles (including yaw, pitch, and roll) describe the attitude as a sequence of three rotations, where ψ , θ , and ϕ denote the rotation angles about the z, y, and x axes, respectively. The quaternion output provided by the analyzed filters was converted to Euler representation as follows.
ϕ = arctan2 2 q 2 q 3 2 q 0 q 1 , 2 q 0 2 + 2 q 3 2 1 , θ = tan 1 2 q 0 q 2 + 2 q 1 q 3 1 2 q 0 q 2 + 2 q 1 q 3 2 , ψ = arctan2 2 q 1 q 2 2 q 0 q 3 , 2 q 0 2 + 2 q 1 2 1 .

3. Attitude Estimation with MEMS MARG Sensors

Each sensor of a MEMS-based MARG unit provides useful information of the instantaneous attitude; however, none of the sensors are capable of providing reliable attitude results alone. Gyroscopes measure angular velocities; therefore, gyroscope-based attitude realization is obtained through numerical integration, but both the temperature-dependent bias and noise contained in the measurements cause cumulative errors. An accelerometer measures the sum of gravitational and external accelerations. In stationary states, long-term stable attitude realization can be obtained based on the decomposition of the sensed gravity vector but, as external accelerations increase as a result of dynamic motion, the quality of attitude realization drastically deteriorates, making accelerometer-based realization highly unreliable. Magnetometers measure the geomagnetic field, which is used to determine heading information. However, the magnetic fluctuation of the environment caused by the perturbation of ferromagnetic objects highly disturbs the magnetometer output.
To provide reliable attitude estimation results, the individual features of each sensor are carefully addressed in the following.

3.1. Gyroscope Model

Let Ω k denote the raw measurement vector of a tri-axis MEMS gyroscope in the k th time instance. This measurement vector is composed of a 3 × 1 vector ω k of true angular velocities around the x, y, and z axes, a vector ω ¯ k containing the non-static bias terms, and a vector μ k of additive measurement noises. The imperfections of manufacturing results, in that the sensor model is extended with axis misalignment and scale factor errors, are represented by the 3 × 3 matrices M Ω and Δ S Ω , respectively. Moreover, the temperature sensitivity of the sensor makes the slowly varying bias vector ω ¯ k propagate as a random walk process characterized by a driving noise vector η k , and therefore [61]
Ω k = I + Δ S Ω M Ω ω k + ω ¯ k + μ k , ω ¯ k = ω ¯ k 1 + η k .
in the above measurement model, the rate noise vectors contain zero-mean white Gaussian variables for each axis (i.e., E μ k = E η k = 0 ) and the covariance matrices are defined as E μ k μ l T = Σ μ , k δ k l , Σ μ , k 0 , and E η k η l T = Σ η , k δ k l , Σ η , k 0 , where δ k l denotes the Kronecker delta.
Gyroscope-based (gyro-based) attitude realization is obtained by numerical integration of the true angular velocity vector ω k in Equation (7). Common calibration procedures performed in laboratories allow for the determination and compensation of the scale factor and misalignment errors. This process exceeds the scope of this article; therefore, we assume that the compensation has already been performed ( M Ω = I and Δ S Ω = 0 ) [22,41,62]. Based on Equation (5), the gyro-based attitude realization is given in quaternion form as
q k + 1 = q k + T s 2 Q q k 0 Ω k ω ¯ k ,
where T s = 1 / f s is the sampling time. However, this method yields only short-tem accuracy, due to the presence of bias and measurement noise terms ( ω ¯ k and μ k ) resulting in boundless drift in the attitude propagation.

3.2. Accelerometer and Magnetometer Models

The accelerometer and magnetometer sensors provide absolute reference observations, and therefore their measurements can be combined to determine the complete attitude of the sensor. The raw output A k of a tri-axis MEMS accelerometer consists of four main components: the gravitational and external acceleration vectors g k and α k measured in the sensor frame ( S ), the vector a 0 of bias terms, and the vector ν k of additive measurement noises. Additionally, the raw measurement vector H k of the tri-axis MEMS magnetometer model is composed of the true local magnetic field h k sensed in S , the sensor bias vector h 0 , and the measurement noise vector ϵ k :
A k = I + Δ S A M A α k + g k + a 0 + ν k , H k = I + Δ S H M H B s i h k + b h i + h 0 + ϵ k .
Similarly to the gyroscope model, Gaussian noises are considered in the aforementioned models; therefore, E ν k = E ϵ k = 0 and the covariance matrices are E ν k ν l T = Σ ν , k δ k l , Σ ν , k 0 and E ϵ k ϵ l T = Σ ϵ , k δ k l , Σ ϵ , k 0 . Beside the scaling and misalignment errors ( Δ S A , Δ S H , M A , and M H ), the magnetometer measurements are disturbed by magnetic soft iron and hard iron errors caused by the local environment, represented by the 3 × 3 matrix B s i and the 3 × 1 vector b h , respectively. These model errors are determined via self-calibration procedures which address the time-invariant nature of the vector fields and map the distribution of the measurements on an ellipsoid [63,64,65]. We assume that the compensation has already been performed (therefore, h k : = B s i 1 h k b h i ), the bias and scale errors are zero, and the misalignment errors are identity matrices.
If a mobile mechatronic system stays in stationary states (i.e., no external acceleration is performed; α k 0 ) and, moreover, if the local magnetic field is not perturbed by ferromagnetic objects, then the locally constant reference vectors can express the observations, with the help of the rotation matrix, as
S A k = E S R q k E g , S H k = E S R q k E h .
In the aforementioned configuration, the gravity vector is given as E g = 0 , 0 , 9 . 81 T , whereas the magnetic field vector is E h = b cos σ , 0 , b sin σ T in SI units, where b and σ denote the magnitude of the Earth’s geomagnetic field and inclination angle, respectively.
Let the components of an inertial frame in both S and E be expressed by constructing two triads of orthonormal unit vectors. The first triad is defined with the reference vectors in E as
s ^ 1 = E g E g , s ^ 2 = E g × E h E g × E h , s ^ 3 = s ^ 1 × s ^ 2 .
The second triad is constructed with the observation vectors in frame S , where
r ^ 1 = S A k S A k , r ^ 2 = S A k × S H k S A k × S H k , r ^ 3 = r ^ 1 × r ^ 2 .
Based on Equations (10)–(12), first the measurement (observation) and reference matrices are formed, then the rotation matrix is determined as:
M mea = r ^ 1 r ^ 2 r ^ 3 , M ref = s ^ 1 s ^ 2 s ^ 3 , E S R q k = M mea M ref T .
The determined rotation matrix E S R q k = r i j enables the calculation of the quaternion representing the attitude of the sensor frame:
q 0 = 1 2 1 + r 11 + r 22 + r 33 , q 1 = r 23 r 32 4 q 0 , q 2 = r 31 r 13 4 q 0 , q 3 = r 12 r 21 4 q 0 .
The aforementioned algorithm is the well-known TRIAD [22,66], which produces the raw attitude realization based on accelerometer and magnetometer measurements. The attitude realization, which is described by Equation (14), is denoted by q k , TRIAD = q 0 , q 1 , q 2 , q 3 T and can also be considered as the sum of the real attitude characterized by the quaternion q k in the k th time instance and an additive Gaussian white noise, v k , which represents the effects of ν k and ϵ k from Equation (9) after the TRIAD output is evaluated:
q k , TRIAD = q k + v k , E v k = 0 , E v k v l T = Σ v , k δ k l , Σ v , k > 0 .
This algorithm is characterized by a simple and straightforward implementation and, therefore, it is a popular choice for raw attitude determination [2,3]. However, it has a disadvantage in producing large errors when dynamic conditions are present or external magnetism disturbs the sensor readings. As a result, if external acceleration is performed ( α k 0 S A R E g ) or ferromagnetic materials distort the geomagnetic field ( S H R E h ), then the attitude realization becomes unreliable with drastically reduced accuracy. This implementation method does not include any explicit models of external disturbances. Instead, the effects of external disturbances are absorbed by v k in Equation (15); that is, the additive noise is characterized by a significantly larger noise variance in disturbed environments.

3.3. Attitude Estimation with Extended Kalman Filter

The MARG sensor-based attitude realizations described by Equations (8) and (15) are utilized in a sensor fusion algorithm, which both synthesize the individual advantages and features of each sensor and provides attitude results with higher reliability and accuracy. First, this sensor fusion algorithm utilizes the gyroscope-based realization to propagate the attitude results, then these results are updated with the most recent quaternion realization derived from accelerometer and magnetometer readings. This propagate-update mechanism provides both a smooth output and stability in the attitude results by compensating for the drift error generated in Equation (8). The fusion of the sensor models is executed with an EKF.
The EKF effectively combines the noisy measurements and dynamic model-based predictions; moreover, in a recursive filter structure, it provides an approximate maximum-likelihood state estimate x ^ of the stochastic nonlinear state-space model [22]. In fact, the filter linearizes the nonlinear dynamic model around the last estimated state vector using the Jacobian matrix and, for the linearized dynamics, the linear KF is utilized, which is an the optimal state estimator such that E x k x ^ k = 0 and E x k x ^ k x k x ^ k T inf .
The mathematical models and statistical assumptions of MARG sensors, as introduced in the previous subsections, fully match the process and measurement equations of a stochastic nonlinear state-space model. Namely, the process model describes the quaternion propagation with both the discrete-time integrated angular velocities (Equation (8)) and the random walk process of the bias term (Equation (7)). Therefore, the dynamic model is defined with the 7 × 1 state vector x k = q k , ω ¯ k T , the 3 × 1 input vector u k = Ω k , and the 7 × 1 process noise vector w k = μ k q , η k T , where μ k q represents the quaternion noise generated due to the gyroscope measurement noise μ k . For the sake of comprehensiveness and to foster a straightforward implementation, we give the full description of state propagation in Equation (16):
x k + 1 = f x k , u k , w k , x 0 q 0 q 1 q 2 q 3 ω ¯ x ω ¯ y ω ¯ z k + 1 = q 0 , k + T s 2 q 1 , k ω ¯ x , k Ω x , k + q 2 , k ω ¯ y , k Ω y , k + q 3 , k ω ¯ z , k Ω z , k + μ 0 , k q q 1 , k T s 2 q 0 , k ω ¯ x , k Ω x , k q 3 , k ω ¯ y , k Ω y , k + q 2 , k ω ¯ z , k Ω z , k + μ 1 , k q q 2 , k T s 2 q 3 , k ω ¯ x , k Ω x , k + q 0 , k ω ¯ y , k Ω y , k q 1 , k ω ¯ z , k Ω z , k + μ 2 , k q q 3 , k + T s 2 q 2 , k ω ¯ x , k Ω x , k q 1 , k ω ¯ y , k Ω y , k q 0 , k ω ¯ z , k Ω z , k + μ 3 , k q ω ¯ x , k + η x , k ω ¯ y , k + η y , k ω ¯ z , k + η z , k
According to Equation (15), the measurement model is characterized by a linear quaternion mapping. Therefore, it is formed with the 4 × 1 output vector z k = q k , TRIAD which provides the quaternion update as the TRIAD output, the measurement noise vector v k , and the output matrix H, as
z k = H x k + v k , q k , TRIAD = I 4 0 4 × 3 q k ω ¯ k + v k .
If the x 0 Gaussian vector in Equation (16) is known along with its mean and covariance matrix; that is, if
x ^ 0 = E x 0 , P 0 = E x 0 x ^ 0 x 0 x ^ 0 T ,
then the MARG sensor models fully satisfy the stochastic hypothesis. Namely, the process and measurement noise vectors are zero-mean white Gaussian variables, x 0 is uncorrelated to w k and v k , and, moreover,
E w k v l T = 0 , E w k w l T = Q δ k l , E v k v l T = R δ k l ,
where Q 0 and R > 0 are the process and measurement noise covariance matrices, respectively. The EKF algorithm provides a suboptimal state estimation x ^ k with minimized estimation error covariance. The state propagation, processing of the observations, and the covariance estimate update are performed through time and measurement update equations in the recursive filter structure; namely, the time update equations utilize the input variable u k , the state estimation and error covariance obtained in the previous step ( x ^ k 1 and P k 1 ), and the state dynamics f x ^ k 1 , u k to calculate the a priori state estimate ( x ^ k ) and the corresponding error covariance ( P k ):
x ^ k = f x ^ k 1 , u k , P k = Φ P k 1 Φ T + Q , Φ = f x | x ^ k 1 .
in Equation (20), the Jacobian Φ is applied in the a priori covariance matrix update. To foster straightforward implementation, we give its full form as follows,
Φ = 1 T s 2 ( ω ¯ x Ω x ) T s 2 ( ω ¯ y Ω y ) T s 2 ( ω ¯ z Ω z ) T s 2 q 1 T s 2 q 2 T s 2 q 3 T s 2 ( Ω x ω ¯ x ) 1 T s 2 ( Ω z ω ¯ z ) T s 2 ( ω ¯ y Ω y ) T s 2 q 0 T s 2 q 3 T s 2 q 2 T s 2 ( Ω y ω ¯ y ) T s 2 ( ω ¯ z Ω z ) 1 T s 2 ( Ω x ω ¯ x ) T s 2 q 3 T s 2 q 0 T s 2 q 1 T s 2 ( Ω z ω ¯ z ) T s 2 ( Ω y ω ¯ y ) T s 2 ( ω ¯ x Ω x ) 1 T s 2 q 2 T s 2 q 1 T s 2 q 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 .
The measurement update equations utilize the both the observation vector, z k (accelerometer and magnetometer-based attitude realization), and the measurement noise covariance, R, to correct the a priori state estimate. First, the Kalman gain matrix G k is obtained, then the state estimate x ^ k and its error covariance P k are corrected. The a posteriori estimation results are obtained in the following steps.
G k = P k H T H P k H T + R 1 , x ^ k = x ^ k + G k z k H x ^ k , P k = I G k H P k .
The estimation performance of EKF is mostly determined by the noise covariance matrices Q and R. Unfortunatelly, in practice, these parameters (i.e., the statistical description of the state and observation noises) are not fully measurable (or require time consuming, complex, and extensive verification and validation procedures); especially in the case of MARG sensors, as the effects of both different noise sources and disturbances are represented with general noise vectors v k and w k in Equations (16) and (17). Generally, the parameters Q and R are tuned based on engineering intuition through trial-and-error analysis; however, that method yields only a compromise solution between the estimation accuracy and filter dynamics. To overcome this compromise solution, numerical optimization-based approaches have been proposed in our earlier work. The proposed method both allows for evaluation of the best possible (achievable) estimation quality and provides the optimized parameters which maximize the filter performance [1]. We recall this approach to find the optimized parameters of EKF in Section 5.

4. Fuzzy-Adaptive Strategy

The adaptive approach varies the noise variances, according to both the instantaneous dynamical behavior and external distrubances, thus providing filter performance superior to that provided by the standard EKF. The instaneous dynamics are characterized by the magnitudes of vibration and external acceleration of the sensor frame. Moreover, the adaptive strategy incorporates the magnitude of the distorted geomagnetic field as an external disturbance. The following subsections present the structure of the adaptive strategy, in which both novel measurement methods of external disturbances and the novel sophisticated fuzzy logic-based inference machine are implemented for the real-time tuning of the noise covariances.
The measurement methods in Section 4.1 and Section 4.2 have been described in detail, with multiple examples and figures, in [1].

4.1. Measuring Vibration Magnitude

The system vibration magnitude is described by the oscillation frequency of the sensor frame. For estimation of the instantaneous oscillation frequency, gyroscope readings are utilized, as the sensors provides reliable angular rate measurements for both static and highly dynamic motions. The oscillation frequency is obtained by fast Fourier transform-based (FFT-based) evaluation of short angular rate measurement packets. Let L denote the length of these packets. Then, an oscillation frequency estimation f ^ is calculated, in three steps, as follows.
  • Collect a measurement packet x from the angular rate readings.
  • Obtain frequency domain information about the instantaneous vibration by calculating the discrete Fourier transform of x. Let f i , Ω i denote the output of FFT, where f i and Ω i represent the frequency components and amplitudes, respectively. The transform of L FFT length is calculated as
    W l = k = 0 L FFT 1 x k e j 2 π l k L FFT , l = 0 , , L FFT 1 ,
    and the output is given by
    f i , Ω i = f s i L FFT , 2 L W i , i = 0 , , L FFT 2 .
  • Obtain the oscillation frequency estimate f ^ by finding the highest-intensity frequency component, such that
    f max : f max , Ω max Ω max = max i , f i f thr Ω i , f ^ = 0 , if Ω max < Ω thr f max , otherwise ,
    where f thr denotes the maximum oscillation frequency the system is expected to be exposed to, while the threshold rate magnitude Ω thr cuts off the noise in the aforementioned evaluation.

4.2. Measuring External Acceleration and Magnetic Perturbation Magnitudes

The external acceleration magnitude is calculated based on the accelerometer measurements. The system stays in stationary states (non-accelerating mode) if the magnitude of accelerometer readings is approximately equal to the norm of the reference vector E g . Therefore, the external acceleration magnitude Δ α k can be calculated as the difference between the norms of S A k and E g in each sampling epoch. As the instantaneous difference does not provide an overall picture of the system dynamics, an accumulated measure is thus utilized to describe the external acceleration magnitude. The accumulated measure α ^ ext is formulated as the integrated scalar external acceleration for a window of length L (see Equation (26)). This average external acceleration measure provides both useful and broad information of the instantaneous system dynamics.
α ^ ext = 1 L k = 1 L Δ α k , Δ α k = S A k E g .
The magnetic perturbation magnitude is characterized based on the evaluation of the difference between the norms of S H k (instantaneous magnetometer measurement at epoch k) and E h (reference magnetic field). If no magnetic disturbance is present, then the magnitude of magnetometer measurement is approximately equal to the norm of the reference vector. Otherwise, the magnitude of their difference gives an instantaneous measure of the perturbation magnitude. As it is difficult to draw conclusions based on this brief and instantaneous result at each epoch, similarity to the accelerometer readings, an accumulated measure, is thus applied to quantify the magnetic perturbation magnitude h ^ ext .
h ^ ext = 1 L k = 1 L Δ h k , Δ h k = S H k E h .
Similarly to accelerometer and gyroscope sensors, the magnetic perturbation magnitude is determined by collecting data packets of length L from the magnetometer and computing the average magnetic field difference using Equation (27).

4.3. Fuzzy Inference Machine

The measures f ^ , α ^ ext , and h ^ ext fully characterize both the instantaneous system dynamics and disturbance magnitudes. These results can be utilized in an inference system in which the noise covariance manipulation of the EKF is described according to the external effects. As a result, an adaptive strategy is established that (online) tunes the noise covariances as a function of the measures f ^ , α ^ ext , and h ^ ext .
The relationships between the aforementioned measures and the EKF parameters are defined with fuzzy reasoning. Fuzzy logic does not require complex mathematical models from the system designer but, instead, it enables the implementation of deductions easily and effectively by using fuzzy sets and simple IF-THEN linguistic rules. Therefore, heuristic knowledge and a collection of deductions make such an inference system realizable. The fuzzy inference system is executed in three main steps: fuzzification determines the membership values of the crisp input variables, inference machine translates the heuristic knowledge and assigns a firing value to each fuzzy output, and defuzzification maps the fuzzy output to the crisp domain. The main parts of the algorithm are detailed in [67].
Observations related to the system behavior and human common-sense contribute to collecting the empirical IF-THEN rules (deductions) that define the fuzzy inference machine. In the case of attitude estimation with MARG sensors, the main deductions are as follows.
  • IF the sensor frame stays in stationary (non-accelerating and non-perturbed) mode, THEN a well-chosen ratio between the noise covariances Q and R yields satisfactory state estimation performance.
  • As the external disturbance effects are absorbed by the measurement noise v k in Equation (17), IF vibration, external acceleration, and magnetic perturbations disturb the MARG-based attitude realization, THEN the measurement noise covariance R should be increased according to the intensity of the measures f ^ , α ^ ext , and h ^ ext (i.e., higher noise variance characterizes the attitude realization q k , TRIAD with higher uncertainty).
The overall FAEKF structure is depicted in Figure 2, where a three-input one-output fuzzy inference machine executes the online tuning of noise variances. The inputs of the fuzzy system are the measures f ^ , α ^ ext , and h ^ ext , whereas weighting factors, denoted by K R , are output weights for the R parameter (i.e., the adaptive strategy varies the measurement noise covariance matrix in each epoch k as R k = K R , k R ). The ranges of the input variables f ^ ( Hz ) , α ^ ext ( g ) , and h ^ ext ( normalized unit , nu ) , as well as the output variable K R , were selected based on our earlier research results in [1]. Three Gaussian membership functions cover each input range, where the magnitudes of f ^ , α ^ ext and h ^ ext are characterized by Z (zero), S (small), and B (big) fuzzy sets. The output ranges were covered with seven singleton consequents ( K 1 , , K 7 ), which represent the scaling magnitudes. Both the applied membership functions and fuzzy inference system properties are depicted in Figure 3. The fuzzy surfaces expressing the relationships between the crisp inputs and outputs are depicted in Figure 4.
A sophisticated inference system was implemented, where the initial deductions described above were expanded into 27 rules. These simple IF-THEN linguistic rules completely describe the scaling of noise variances, according to the magnitudes of the external acceleration, vibration, and magnetic perturbation. The implemented rule base for K R is summarized in Table 1. Two examples describe the interpretation of the implemented inference system, as follows:
  • IF the oscillation frequency f ^ is zero (Z) and the external acceleration α ^ ext and magnetic perturbation h ^ ext magnitudes are big (B), THEN a fairly large scaling factor ( K R = K 5 ) is applied for the measurement noise covariance. This collocation of the system state means that the observation is expected to have rather large uncertainty and, therefore, the algorithm relies more heavily on the state propagation (left side, second row, second column).
  • IF f ^ is small (S) and the α ^ ext and h ^ ext measures are close to zero (Z), THEN a smaller weight of K R = K 2 is applied for R. Therefore, the algorithm considers the observation with higher reliability and maintains the correction of the state propagation by processing the measurements with higher significance (middle, first row, first column).
The crisp scaling factor is computed by weighted average-based defuzzification of the fuzzy output, in three steps:
  • Fuzzification of the observation vector χ = f ^ k , α ^ e x t , k , h ^ e x t , k f ^ × α ^ e x t × h ^ e x t and calculation of the firing values of the i th rule ( i = 1 , , 27 ). Let χ j denote the j th dimension of the observation vector ( j = 1 , 2 , 3 ), then the firing value γ j i represents the fitting degree of the observation χ j to the antecedent fuzzy set X j i in the j th dimension of the i th rule as
    γ j i = max χ j { min { X j * χ j , X j i χ j } } , X j * χ j = e χ j b i j 2 2 c i j 2 ,
    where X j * χ j is the fuzzified observation, moreover, b i j and c i j denote the mean and standard deviation of the Gaussian function antecedent defined in the j th dimension of the i th rule.
  • Calculation of the applicability measure of the i th rule, denoted by γ i , as the minimum of the aforementioned firing values. This weight determines the significance of the consequent fuzzy set κ i defined in the i th rule.
    γ i = min j = 1 3 γ j i
  • Computation of the crisp output K as the weighted average over all rule outputs:
    K = i = 1 27 κ i · γ i i = 1 27 γ i .
The proposed fuzzy inference machine is a zero-order Sugeno system. The complete inference for the adaptive measurement noise covariances in each epoch k can be given in a compact form as
K κ , f ^ , α ^ ext , h ^ ext = i = 1 27 κ i · min γ i f ^ , min γ i α ^ ext , γ i h ^ ext i = 1 27 min γ i f ^ , min γ i α ^ ext , γ i h ^ ext , R k = K R , k R , K R , k = K κ R , f ^ k , α ^ e x t , k , h ^ e x t , k , κ R = K 1 , , K 7 T ,
where γ i ( f ^ ) , γ i ( α ^ ext ) , and γ i ( h ^ ext ) are the i th -rule fired membership function values and κ i denotes the singleton value of the consequent weighting factor of the i th rule for scaling the noise covariance R (see Figure 2 and Figure 3).

5. Experimental Validation

This section describes the test platform employed in the evaluation of filter performance, the optimization approach utilized to tune the filter parameters, and the attitude determination results during different dynamic motions and external perturbations.

5.1. Test Environment

A comprehensive framework was designed, in which a 6 DOF test bench dynamically altered the pose (position and orientation) of a MARG unit. The 6 DOF test bench was utilized to both simulate various (accelerating, non-accelerating, and vibrating) dynamic behaviors and measure the real attitude of the sensor frame, along with the raw MARG data. The framework was based on the widely used ROS and the Gazebo open source dynamics simulator, which utilizes physics engines to consider the effects of gravity, friction, and forces [68]. As a result, this framework enabled the evaluation of state estimation error, quantification of the filter performance, and tuning of filter parameters.
The proposed test bench consisted of three prismatic joints and three revolute joints. The prismatic joints made the sensor frame slide back and forth, up and down in the three dimensional (3D) space by three 3 m long rails. The revolute joints set the instantaneous attitude (Euler angles) of the sensor frame. The MARG unit is attached to a plate at the end of this kinematic chain and, so, the 6 DOF system enabled both the spatial coordinates and orientation of the sensor frame to be set and measured. Moreover, this 6 DOF mechanism enabled the generation of external accelerations simultaneously with sensor frame oscillations. Therefore, a variety of dynamic (vibrating and accelerating) system conditions could be simulated, where both the raw sensor data and real joint states were be recorded. Figure 5 shows the model of the test environment in Gazebo.
Let x b , y b , and z b denote the spatial coordinates of the body plate (i.e., the origin of the MARG unit). Then, the total kinetic energy T of the test platform is given as
T = 1 2 q ˙ T M mass q ˙ , M mass = diag m j + I 3 × 1 m b , J b ,
where m j = m j , 1 , m j , 2 , m j , 3 T , m j , i denotes the mass of each prismatic joint for i = { 1 , 2 , 3 } , whereas m b and J b = J b , ϕ , J b , θ , J b , ψ T indicate the mass and moment of inertia of the body plate, respectively. Moreover, q = x b , y b , z b , ϕ , θ , ψ T denotes the vector of generalized coordinates. The potential energy stored in the system is approximated as P = m b + i 3 m j , i g h 0 + m b + m j , 3 g z b m j , 3 g h 1 , where the constants h 0 and h 1 denote the base height and distance between the body plate and third prismatic joint, respectively. The Lagrange function of the system is L = T P , where the motion of the system can be determined with the help of the Lagrange equations [69]. As a result, the equations of motion can be written in the following form,
M q q ¨ + V q , q ˙ = τ a τ f ,
where M q is the inertia matrix, V q , q ˙ , including the Coriolis, centrifugal, and potential force terms, whereas τ a and τ f indicate the generalized external torques and friction effects, respectively.
The aforementioned dynamics were implemented in an Unified Robot Description Format (URDF) file [70]. This file enables the specification of the whole geometric description of the system, including the robot kinematics, motion ranges, location of frames, mass properties, and collisions. Each joint (DOF) is driven in a closed-loop with an independent proportional-integral-derivative (PID) effort controller. Each effort controller was implemented, using the ros controllers meta-package, as a single-input single-output (SISO) low-level controller, in which torque control action was applied to the joint. The PID parameters were set up heuristically by iterative tuning in Gazebo. The true linear and angular positions of each joint were supplied by the joint state controller, a sensor controller that publishes the joint state information (i.e., true positions, velocities, and efforts are represented in double-precision floating-point format without measurement noise, discrepancy, or delay) [71,72]. In this application, the joint state information was obtained with a f s = 1 kHz sampling frequency. The sensor measurements were provided by independent Gazebo plugins, developed in [73]. These IMU and magnetic field sensor plugins were attached to the body plate of the 6 DOF test bench by including them in the URDF file.
To execute different acceleration and vibration dynamic motions, on one hand, random desired values were generated with random frequencies for the PID controllers of the three prismatic joints in their configuration space. On the other hand, different sinusoidal signals were supplied as reference values to the PID controllers of the three revolute joints, where both the amplitude and frequency were varied randomly. Therefore, the closed-loop system caused the 6 DOF mechanism to execute a wide variety of dynamic movements in the 3D space, with continously varying oscillations and accelerations. Simultaneously, the three prismatic joints made the sensor frame slidd back and forth, as well as up and down; simulating various external accelerations. The true joint states, along with the instantaneous MARG sensor data, were collected to evaulate the attitude estimation performance.
Video demonstrations of the closed-loop dynamics have been shared on our website. Moreover, as was described in Section 1, the whole ROS package, which includes the test bench properties, URDF files, applied effort controllers, and Gazebo configuration files, have been made publicly available in the supplementary online material, to help other lab teams evaluate similar experiments [58].

Magnetic Perturbations

Magnetic perturbations were generated artificially, as the Gazebo simulation environment does not contain such a feature. Therefore, based on the experimental results with magnetic disturbances conducted in [74,75,76,77], we developed a simple algorithm to generate magnetic perturbations. The algorithm is composed of three main steps, which are described as follows.
  • Generate a perfect artificial signal m of length L m as a mixture of square, saw-tooth, triangle, and two sinusoidal signals. Both the sequence of these signals and their parameters (i.e., the amplitude and frequency) are randomly selected.
  • Obtain the analytic signal m a from m, where the real part is the original signal, while the imaginary part contains the Hilbert transform (i.e., the original signal with a π / 2 phase shift [78]). Then, generate the artificial perturbation m p as the sum of the imaginary part and absolute value of the Hilbert transformed complex signal, where the sequence of absolute values is reversed in time:
    m a , k = m r , k + j m i , k , k = 1 , , L m , m p , k = m i , k + m a , l , k = 1 , , L m , l = L m , , 1 .
  • Remove the continuous linear trend of m p and low-pass filter the detrended signal with a first order Butterworth infinite impulse response (IIR) filter.
Each step of the aforementioned algorithm is depicted in Figure 6. Moreover, Figure 7 highlights the effect of the artificial perturbation on both the norm and each component of the raw magnetometer signal. The blue curves represent the raw (calibrated, undisturbed, and normalized) magnetometer measurements and the red curves show random sections, where the magnetometer had been disturbed artificially with the proposed algorithm. These figures illustrate that the algorithm enabled both generation of realistic magnetic perturbation effects and incorporation of effects of this type of disturbance into the analysis of attitude estimation.

5.2. Tuning of Filter Parameters

Tuning of the filter parameters was executed in MATLAB on a training data set collected in the aforementioned test environment. The heuristic particle swarm optimization (PSO) algorithm was utilized for the filter tuning problem, as it does not require gradient information, guides the search well even in nonlinear noisy systems, and has demonstrated greater effectiveness and robustness than other optimization methods [79,80,81]. Both the algorithm and applied PSO-based optimization procedure have been presented in detail in our earlier works [1,82,83]; therefore, only key information is described in the following paragraphs.
The inputs of the optimization problem are the real angular positions (i.e., the true Euler angles ϕ k , θ k , and ψ k provided by the 6 DOF test bench) and MARG sensor data (i.e., the acceleration, angular velocity, and magnetic field measurements), whereas its outputs are the estimation errors e ϕ , k = ϕ k ϕ ^ k , e θ , k = θ k θ ^ k , and e ψ , k = ψ k ψ ^ k , where ϕ ^ k , θ ^ k , and ϕ ^ k denote the estimated Euler angles (i.e., the outputs of the implemented filter algorithm). The PSO is a population-based search algorithm that guides the search in the search space by employing a fitness function. In our work, a complex fitness function was formulated for the problem to both quantify the differences between the true and estimated Euler angles and measure the overall filter performance. Three mean squared errors (MSE) were combined to evaluate the filtration quality. The PSO-based minimization of the following fitness function enabled the filter parameters to be successfully tuned:
F = j = 1 k sce k = 1 N j e ϕ , k 2 N j k = 1 N j e θ , k 2 N j k = 1 N j e ψ , k 2 N j 3 ,
where k sce denotes the number of scenarios taken into account in the optimization problem; N j is the measurement length in the k sce th scenario; and e ϕ , k , e θ , k , and e ψ , k indicate the roll, pitch, and yaw estimation errors, respectively. The optimization algorithm determined the optimal possible filter parameters, corresponding to the lowest possible fitness function value. The block diagram of the filter parameter optimization procedure is depicted in Figure 5.
The optimization could begin running once the parameters were initialized. The PSO parameters were selected based on earlier studies [84,85], whereas the filter parameters ( x ^ 0 , P 0 , Q, and R) were initialized by employing the results presented in [1]. As the sampling time in the ROS-based framework was relatively low ( T s = 1 ms ), the adaptive strategy could be executed with bigger window size of L = 400 ; moreover, the length of the transform was L FFT = 2 9 and the threshold oscillation frequency and amplitude were f thr = 10 Hz and Ω thr = 0.26 rad / s , respectively. The process noises μ k q and ν k in Equation (16) were considered to be statistically independent [1,19,41]; therefore, diagonal matrices were applied for both the process and measurement noise covariances with the following characteristics,
Q = I 4 · Q q 0 3 × 4 0 4 × 3 I 3 · Q ω ¯ , R = I 4 · ρ ,
where the Q q , Q ω ¯ , and ρ constant noise variances were tuned with PSO. Namely, the optimization converged the quaternion measurement noise variance to a higher value of ρ = 3.53 . This outcome was expected, as intense accelerations and vibrations were applied with the 6 DOF test bench and the effects of these external distrubances were absorbed in the measurement noise v k in Equation (17). This high-noise variance value indicates that the TRIAD-based attitude realization was significantly more unreliable than the gyro-based state propagation, especially in highly dynamic states of the system. At the same time, the process noise variances converged to noticeably small values (i.e., Q q = 1.45 × 10 6 and Q ω ¯ = 9.71 × 10 10 ), resulting in the state-space dynamics (Equation (16)) becoming much more reliable than the measurement correction equations. The successful optimization contributed to finding the tuned EKF parameters which provided satisfactory attitude estimation quality with the help of the adaptive strategy described in Section 4 for both static and extreme (vibrating and accelerating) dynamic conditions.

5.3. Results

The attitude estimation performance of the FAEKF was evaluated on three measurements performed in the test environment (Measurements 1–3 lasted for approximately 160 s, 210 s, and 315 s, respectively). The dynamic motions executed by the 6 DOF test bench during these measurements included stationary states, slow and fast changes in angular positions, mild and intense oscillations, and external accelerations. The dynamic circumstances in which the filter performance was investigated were characterized by the following ranges; 0 8 Hz for sensor frame oscillation frequency, ± 50 rad / s for angular velocity, ± 16 g for external spatial acceleration, and 0 5 nu for magnetic perturbation magnitude.
The robust filter performance in the highly disturbed (accelerating and vibrating) test environment is highlighted in Figure 8, Figure 9, Figure 10 and Figure 11. The first three rows of each figure show the roll ( ϕ ), pitch ( θ ), and yaw ( ψ ) angles, where the blue curve indicates the true Euler angles (obtained by the joint states ROS topic), whereas the red and yellow curves highlight the attitude estimation with and without the proposed fuzzy adaptive strategy, respectively. The fourth rows depict both the instantaneous external acceleration (blue curves) executed by the 6 DOF test bench and average dynamic acceleration (red curves) determined by Equation (26). Similarly, the blue curve of the fifth row of each figure shows the instantaneous magnetic perturbation generated by Equation (34), whereas the red curve indicates the average magnetic field difference calculated by Equation (27). Finally, the sixth row depicts both the instantaneous angular rate magnitude (blue curves) and the oscillation frequency of the sensor frame (red curves) determined by Equation (25). The last three rows illustrate that the employed measurement methods in the adaptive strategy provided useful information related to the external acceleration, vibration, and magnetic disturbance magnitudes.
The noticable performance improvement provided by the fuzzy-adaptive strategy is highlighted both by the figures and the results included in Table 2. The curves corresponding to the FAEKF output fit to the true Euler angles to a satisfactory degree, both in frequencies and amplitudes; even when extreme external perturbations were present. The effects of these disturbances drastically decreased the performance of the standard EKF. For example, Figure 8 highlights that, at approximately 50 s , an increased external acceleration and magnetic perturbation influenced the attitude estimation over a 15 s long period. During this period, the effects of these disturbances were effectively suppressed by the FAEKF; the adaptation laws enabled it to achieve satisfactory filter accuracy and convergence. It is also shown that, without the fuzzy-adaptive strategy, an unsatisfactory EKF performance was provided (Euler angles indicated with yellow curves). A similar outcome can be observed in Figure 9; namely, the external acceleration and magnetic perturbation effects in the high vibrating environment contributed to a significant decrease in the EKF estimation quality (e.g., see the yellow curves at ~ 140 s ). However, it is also shown that the adaptation laws enabled cancellation of these effects, even under diverse dynamic conditions. Under static conditions, both EKF and FAEKF provided approximately the same performance levels; these results are highlighted in Figure 10 and Figure 11. As low-frequency oscillations along with no magnetic perturbation nor external acceleration enabled the accelerometer- and magnetometer-based attitude realization (TRIAD output) to be characterized with high accuracy, the EKF could therefore provide satisfactory estimation quality based on the implemented state-space model. In these static cases, the adaptive strategy does not modify the noise variances, as the well-chosen ratio between the covariance parameters yields a satisfactory estimation quality.
The filter performance was quantified with the mean squared error (MSE) and standard deviation (STD) of the attitude estimation error. These results were calculated for each measurement (M1, M2, and M3) and are summarized in Table 2. Based on the results, a significant improvement in the overall filter performance can be observed. In each measurement case, the yaw angle estimation was characterized by the smallest errors, while slightly less robust outputs were provided for the roll and pitch angle estimation. This outcome was expected in our configuration and is related to the TRIAD algorithm’s characteristics. Namely, the impact of magnetometer readings relative to the vertical axis is eliminated in s ^ 2 and r ^ 2 (see Equations (11) and (12)), therefore the pitch and roll angles were determined based on only the accelerometer measurements [23]. As the accelerometer measurements were disturbed much more heavily (via both the measurement noise and frequent external accelerations) than the magnetometer readings, therefore the disturbances influenced slightly more the roll and pitch estimation performance of the filter. Based on both the figures and Table 2, it can be concluded that a superior estimation convergence was achieved with the introduced adaptive strategy, thereby validating the performance of the proposed FAEKF approach. Nevertheless, some potential improvements are left open for investigation in future studies:
  • Employing a more robust deterministic approach to determine the quaternion from accelerometer and magnetometer observations in the measurement update state of the EKF.
  • Partitioning the fuzzy inputs and outputs into additional fuzzy sets, thereby implementing a more advanced fuzzy inference system.
  • Tuning the shapes of the applied fuzzy sets, the ranges of input and output variables, and the weights of the IF-THEN rules with the aid of optimization.
  • Varying the window size in the determination of external disturbance magnitudes, thereby providing more accurate measures for the adaptation laws.
  • Extending the state space model with external acceleration and magnetic perturbation models, where the driving Gaussian variables vary according to the external disturbance magnitudes.
  • Applying an additional output in the fuzzy inference system which weights the process noise covariance matrix.
Throughout the results, it was demonstrated that the developed methods in the adaptive strategy provided relevant information of the environment in which attitude estimation was performed. The obtained external disturbance magnitudes enabled us to form an inference mechanism that effectively manipulated the noise variances on-the-fly, thereby providing superior filter performance. As external accelerations, magnetic perturbations, and vibration are common disturbance sources in motorized mechatronic systems, the proposed method can be advantegously applied in such mechatronic systems. The paper also demonstrated the benefits of fuzzy logic, as it provided an expert-oriented approach to implementing complex relations with the help of simple heuristic IF-THEN rules. The proposed adaptation laws can be universally applied for the online tuning of any filter structure. Moreover, both the measurement methods and fuzzy inference mechanism can be intelligently employed in adaptive control solutions for mechatronic systems performing motions in unknown and/or disturbed environments (e.g., wheeled/legged robots moving on uneven terrain or UAVs maneuvering in windy environments).

6. Conclusions

This paper proposed a novel qAEKF structure, FAEKF, in which both new measurement techniques were developed for the calculation of external disturbance magnitudes and novel adaptation laws were implemented with fuzzy logic. The EKF core incorporated a 7-dimensional state-space model for the estimation of both the quaternion and gyroscope bias vector. Three external disturbance measurement methods were fused to characterize the dynamic and/or perturbed environment in which attitude estimation was being performed. Namely, the external acceleration and magnetic disturbance magnitudes were represented with accumulated measures, which provided broad information of the instantaneous system circumstances. Moreover, the instantaneous oscillation frequency of the sensor frame was obtained as a measure of vibration magnitude. A sophisticated fuzzy inference machine was designed, which formed the relationship between these external disturbance magnitudes and the EKF parameters. The implemented fuzzy system incorporated simple heuristic IF-THEN rules, in order to consistently modify the noise variance values of the filter, thus providing accurate and robust attitude results. A novel test environment was designed for experimental validation of the proposed techniques, in which a 6 DOF test bench both executed various dynamic motions and measured the true Euler angles along with the raw MARG data. The tuning of EKF parameters was performed with the aid of the PSO algorithm. The experimental results showed that the proposed adaptive structure effectively suppresses the effects of external disturbances, thereby enabling the FAEKF to provide reliable attitude estimation results, even in extreme dynamic and/or perturbed situations. The proposed adaptive (dynamic-dependent) feature makes the FAEKF a suitable candidate for attitude estimation in mechatronic systems operating in variable conditions. Future work will involve the performance evaluation of the filter during the control of our Szabad(ka)-II hexapod robot in a disturbed environment.

Author Contributions

The proposed methodologies were developed, implemented, and experimentally verified by Á.O.; furthermore, he wrote this manuscript. I.K. and P.S. helped with planning and conducting the measurements. Z.V. and A.T. helped in analyzing the results. P.O. supervised the entire work. All authors have read and agreed to the published version of the manuscript.

Acknowledgments

This research has been supported and funded by projects EFOP-3.6.1-16-2016-00003 and TUDFO/51757-1/2019-ITM.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Odry, Á.; Fullér, R.; Rudas, I.J.; Odry, P. Kalman filter for mobile-robot attitude estimation: Novel optimized and adaptive solutions. Mech. Syst. Signal Process. 2018, 110, 569–589. [Google Scholar] [CrossRef]
  2. Wen, X.; Liu, C.; Huang, Z.; Su, S.; Guo, X.; Zuo, Z.; Qu, H. A First-Order Differential Data Processing Method for Accuracy Improvement of Complementary Filtering in Micro-UAV Attitude Estimation. Sensors 2019, 19, 1340. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  3. Roh, M.S.; Kang, B.S. Dynamic Accuracy Improvement of a MEMS AHRS for Small UAVs. Int. J. Precis. Eng. Manuf. 2018, 19, 1457–1466. [Google Scholar] [CrossRef]
  4. Battiston, A.; Sharf, I.; Nahon, M. Attitude estimation for collision recovery of a quadcopter unmanned aerial vehicle. Int. J. Robot. Res. 2019, 38, 1286–1306. [Google Scholar] [CrossRef] [Green Version]
  5. Liu, S.; Lyu, P.; Lai, J.; Yuan, C.; Wang, B. A fault-tolerant attitude estimation method for quadrotors based on analytical redundancy. Aerosp. Sci. Technol. 2019, 93, 105290. [Google Scholar] [CrossRef]
  6. Ahmad, I.; El Hadri, A.; Benziane, L.; Benallegue, A. Globally asymptotic attitude estimation for accelerated aerial vehicles. Aerosp. Sci. Technol. 2019, 84, 1175–1181. [Google Scholar] [CrossRef]
  7. Wilson, S.; Eberle, H.; Hayashi, Y.; Madgwick, S.O.; McGregor, A.; Jing, X.; Vaidyanathan, R. Formulation of a new gradient descent MARG orientation algorithm: Case study on robot teleoperation. Mech. Syst. Signal Process. 2019, 130, 183–200. [Google Scholar] [CrossRef]
  8. Dai, F.; Gao, X.; Jiang, S.; Guo, W.; Liu, Y. A two-wheeled inverted pendulum robot with friction compensation. Mechatronics 2015, 30, 116–125. [Google Scholar] [CrossRef]
  9. Baldi, T.L.; Farina, F.; Garulli, A.; Giannitrapani, A.; Prattichizzo, D. Upper Body Pose Estimation Using Wearable Inertial Sensors and Multiplicative Kalman Filter. IEEE Sens. J. 2019, 20, 492–500. [Google Scholar] [CrossRef] [Green Version]
  10. Duraffourg, C.; Bonnet, X.; Dauriac, B.; Pillet, H. Real Time Estimation of the Pose of a Lower Limb Prosthesis from a Single Shank Mounted IMU. Sensors 2019, 19, 2865. [Google Scholar] [CrossRef] [Green Version]
  11. Zhang, X.; Xiao, W. A Fuzzy Tuned and Second Estimator of the Optimal Quaternion Complementary Filter for Human Motion Measurement with Inertial and Magnetic Sensors. Sensors 2018, 18, 3517. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  12. Zhao, H.; Zhang, L.; Qiu, S.; Wang, Z.; Yang, N.; Xu, J. Pedestrian dead reckoning using pocket-worn smartphone. IEEE Access 2019, 7, 91063–91073. [Google Scholar] [CrossRef]
  13. Michel, T.; Genevès, P.; Fourati, H.; Layaïda, N. Attitude estimation for indoor navigation and augmented reality with smartphones. Pervasive Mob. Comput. 2018, 46, 96–121. [Google Scholar] [CrossRef] [Green Version]
  14. Gośliński, J.; Nowicki, M.; Skrzypczyński, P. Performance comparison of EKF-based algorithms for orientation estimation on Android platform. IEEE Sens. J. 2015, 15, 3781–3792. [Google Scholar] [CrossRef]
  15. Jouybari, A.; Amiri, H.; Ardalan, A.A.; Zahraee, N.K. Methods comparison for attitude determination of a lightweight buoy by raw data of IMU. Measurement 2019, 135, 348–354. [Google Scholar] [CrossRef]
  16. Nourmohammadi, H.; Keighobadi, J. Fuzzy adaptive integration scheme for low-cost SINS/GPS navigation system. Mech. Syst. Signal Process. 2018, 99, 434–449. [Google Scholar] [CrossRef]
  17. Xiong, L.; Xia, X.; Lu, Y.; Liu, W.; Gao, L.; Song, S.; Han, Y.; Yu, Z. IMU-Based Automated Vehicle Slip Angle and Attitude Estimation Aided by Vehicle Dynamics. Sensors 2019, 19, 1930. [Google Scholar] [CrossRef] [Green Version]
  18. Khankalantary, S.; Rafatnia, S.; Mohammadkhani, H. An adaptive constrained type-2 fuzzy Hammerstein neural network data fusion scheme for low-cost SINS/GNSS navigation system. Appl. Soft Comput. 2019, 86, 105917. [Google Scholar] [CrossRef]
  19. Lee, J.K.; Park, E.J.; Robinovitch, S.N. Estimation of attitude and external acceleration using inertial sensor measurement during various dynamic conditions. IEEE Trans. Instrum. Meas. 2012, 61, 2262–2273. [Google Scholar] [CrossRef] [Green Version]
  20. Wu, J.; Shan, S. Dot Product Equality Constrained Attitude Determination from Two Vector Observations: Theory and Astronautical Applications. Aerospace 2019, 6, 102. [Google Scholar] [CrossRef] [Green Version]
  21. Wahba, G. A least squares estimate of satellite attitude. SIAM Rev. 1965, 7, 409. [Google Scholar] [CrossRef]
  22. Markley, F.L.; Crassidis, J.L. Fundamentals of Spacecraft Attitude Determination and Control; Springer: New York, NY, USA, 2014; Volume 33. [Google Scholar]
  23. 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]
  24. Liu, F.; Li, J.; Wang, H.; Liu, C. An improved quaternion Gauss–Newton algorithm for attitude determination using magnetometer and accelerometer. Chin. J. Aeronaut. 2014, 27, 986–993. [Google Scholar] [CrossRef] [Green Version]
  25. Fourati, H.; Manamanni, N.; Afilal, L.; Handrich, Y. A nonlinear filtering approach for the attitude and dynamic body acceleration estimation based on inertial and magnetic sensors: Bio-logging application. IEEE Sens. J. 2010, 11, 233–244. [Google Scholar] [CrossRef] [Green Version]
  26. Madgwick, S.O.; Harrison, A.J.; Vaidyanathan, R. Estimation of IMU and MARG orientation using a gradient descent algorithm. In Proceedings of the 2011 IEEE International Conference on Rehabilitation Robotics, Zurich, Switzerland, 29 June–1 July 2011. [Google Scholar]
  27. Wu, J.; Zhou, Z.; Fourati, H.; Cheng, Y. A super fast attitude determination algorithm for consumer-level accelerometer and magnetometer. IEEE Trans. Consum. Electron. 2018, 64, 375–381. [Google Scholar] [CrossRef]
  28. Euston, M.; Coote, P.; Mahony, R.; Kim, J.; Hamel, T. A Complementary Filter for Attitude Estimation of a Fixed-Wing UAV. Available online: http://users.cecs.anu.edu.au/~Jonghyuk.Kim/pdf/2008_Euston_iros_v1.04.pdf (accessed on 30 January 2020).
  29. Tsagarakis, N.G.; Caldwell, D.G.; Negrello, F.; Choi, W.; Baccelliere, L.; Loc, V.; Noorden, J.; Muratore, L.; Margan, A.; Cardellino, A.; et al. WALK-MAN: A High-Performance Humanoid Platform for Realistic Environments. J. Field Robot. 2017, 34, 1225–1259. [Google Scholar] [CrossRef]
  30. Mahony, R.; Hamel, T.; Pflimlin, J.M. Nonlinear complementary filters on the special orthogonal group. IEEE Trans. Autom. Control 2008, 53, 1203–1218. [Google Scholar] [CrossRef] [Green Version]
  31. Cavallo, A.; Cirillo, A.; Cirillo, P.; De Maria, G.; Falco, P.; Natale, C.; Pirozzi, S. Experimental comparison of sensor fusion algorithms for attitude estimation. IFAC Proc. Vol. 2014, 47, 7585–7591. [Google Scholar] [CrossRef] [Green Version]
  32. 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]
  33. Mourcou, Q.; Fleury, A.; Franco, C.; Klopcic, F.; Vuillerme, N. Performance evaluation of smartphone inertial sensors measurement for range of motion. Sensors 2015, 15, 23168–23187. [Google Scholar] [CrossRef] [Green Version]
  34. Tian, Y.; Wei, H.; Tan, J. An adaptive-gain complementary filter for real-time human motion tracking with MARG sensors in free-living environments. IEEE Trans. Neural Syst. Rehabil. Eng. 2012, 21, 254–264. [Google Scholar] [CrossRef] [PubMed]
  35. Wu, J.; Zhou, Z.; Chen, J.; Fourati, H.; Li, R. Fast complementary filter for attitude estimation using low-cost MARG sensors. IEEE Sens. J. 2016, 16, 6997–7007. [Google Scholar] [CrossRef]
  36. Fan, B.; Li, Q.; Liu, T. Improving the accuracy of wearable sensor orientation using a two-step complementary filter with state machine-based adaptive strategy. Meas. Sci. Technol. 2018, 29, 115104. [Google Scholar] [CrossRef]
  37. 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]
  38. 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]
  39. Li, W.; Wang, J. Effective adaptive Kalman filter for MEMS-IMU/magnetometers integrated attitude and heading reference systems. J. Navig. 2013, 66, 99–113. [Google Scholar] [CrossRef] [Green Version]
  40. Mazza, C.; Donati, M.; McCamley, J.; Picerno, P.; Cappozzo, A. An optimized Kalman filter for the estimate of trunk orientation from inertial sensors data during treadmill walking. Gait Posture 2012, 35, 138–142. [Google Scholar] [CrossRef]
  41. Nowicki, M.; Wietrzykowski, J.; Skrzypczyński, P. Simplicity or flexibility? Complementary Filter vs. In EKF for orientation estimation on mobile devices. In Proceedings of the 2015 IEEE 2nd International Conference on Cybernetics (CYBCONF), Gdynia, Poland, 24–26 June 2015. [Google Scholar]
  42. Zhang, T.; Liao, Y. Attitude measure system based on extended Kalman filter for multi-rotors. Comput. Electron. Agric. 2017, 134, 19–26. [Google Scholar] [CrossRef]
  43. 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] [Green Version]
  44. Ligorio, G.; Sabatini, A.M. A novel Kalman filter for human motion tracking with an inertial-based dynamic inclinometer. IEEE Trans. Biomed. Eng. 2015, 62, 2033–2043. [Google Scholar] [CrossRef]
  45. Makni, A.; Fourati, H.; Kibangou, A.Y. Energy-aware adaptive attitude estimation under external acceleration for pedestrian navigation. IEEE/ASME Trans. Mechatron. 2015, 21, 1366–1375. [Google Scholar] [CrossRef] [Green Version]
  46. 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]
  47. Stateczny, A. Neural manoeuvre detection of the tracked target in ARPA systems. IFAC Proc. Vol. 2001, 34, 209–214. [Google Scholar] [CrossRef]
  48. Stateczny, A.; Kazimierski, W. A comparison of the target tracking in marine navigational radars by means of GRNN filter and numerical filter. In Proceedings of the 2008 IEEE Radar Conference, Rome, Italy, 26–30 May 2008. [Google Scholar]
  49. Kazimierski, W.; Łubczonek, J. Verification of marine multiple model neural tracking filter for the needs of shore radar stations. In Proceedings of the 2012 13th International Radar Symposium, Warsaw, Poland, 23–25 May 2012. [Google Scholar]
  50. Assad, A.; Khalaf, W.; Chouaib, I. Novel Adaptive Fuzzy Extended Kalman Filter for Attitude Estimation in Gps-Denied Environment. Gyroscopy Navig. 2019, 10, 131–146. [Google Scholar] [CrossRef]
  51. Al Mansour, M.; Chouaib, I.; Jafar, A.; Potapov, A. Analytical Algorithm for Attitude and Heading Estimation Aided by Maneuver Classification. Gyroscopy Navig. 2019, 10, 77–89. [Google Scholar] [CrossRef]
  52. Chiella, A.C.; Teixeira, B.O.; Pereira, G.A. Quaternion-Based Robust Attitude Estimation Using an Adaptive Unscented Kalman Filter. Sensors 2019, 19, 2372. [Google Scholar] [CrossRef] [Green Version]
  53. Kang, D.; Jang, C.; Park, F.C. Unscented Kalman Filtering for Simultaneous Estimation of Attitude and Gyroscope Bias. IEEE/ASME Trans. Mechatron. 2019, 24, 350–360. [Google Scholar] [CrossRef]
  54. Xi, L.; Chen, B.; Zhao, H.; Qin, J.; Cao, J. Maximum Correntropy Kalman Filter With State Constraints. IEEE Access 2017, 5, 25846–25853. [Google Scholar]
  55. Habbachi, S.; Sayadi, M.; Fnaiech, F.; Rezzoug, N.; Gorce, P.; Benbouzid, M. Estimation of IMU orientation using linear Kalman filter based on correntropy criterion. In Proceedings of the 2018 IEEE International Conference on Industrial Technology (ICIT), Lyon, France, 20–22 February 2018. [Google Scholar]
  56. Kulikov, G.Y.; Kulikova, M. Estimation of maneuvering target in the presence of non-Gaussian noise: A coordinated turn case study. Signal Process. 2018, 145, 241–257. [Google Scholar] [CrossRef]
  57. Kownacki, C. Optimization approach to adapt Kalman filters for the real-time application of accelerometer and gyroscope signals’ filtering. Digital Signal Process. 2011, 21, 131–140. [Google Scholar] [CrossRef]
  58. Odry, Á. Fuzzy-Adaptive Extended Kalman Filter Supplementary Material. Available online: http://appl-dsp.com/faekf/ (accessed on 31 January 2020).
  59. Kuipers, J.B. Quaternions and Rotation Sequences; Princeton University Press: Princeton, NJ, USA, 1999; Volume 66. [Google Scholar]
  60. Diebel, J. Representing attitude: Euler angles, unit quaternions, and rotation vectors. Matrix 2006, 58, 1–35. [Google Scholar]
  61. Aggarwal, P. MEMS-Based Integrated Navigation; Artech House: Norwood, MA, USA, 2010. [Google Scholar]
  62. Höflinger, F.; Müller, J.; Zhang, R.; Reindl, L.M.; Burgard, W. A wireless micro inertial measurement unit (IMU). IEEE Trans. Instrum. Meas. 2013, 62, 2583–2595. [Google Scholar] [CrossRef]
  63. Kok, M.; Hol, J.D.; Schön, T.B.; Gustafsson, F.; Luinge, H. Calibration of a magnetometer in combination with inertial sensors. In Proceedings of the 2012 15th International Conference on Information Fusion, Singapore, 9–12 July 2012. [Google Scholar]
  64. Papafotis, K.; Sotiriadis, P.P. MAG. IC AL.–A Unified Methodology for Magnetic and Inertial Sensors Calibration and Alignment. IEEE Sens. J. 2019, 19, 8241–8251. [Google Scholar] [CrossRef]
  65. Sarcevic, P.; Kincses, Z.; Pletl, S. Online human movement classification using wrist-worn wireless sensors. J. Ambient Intell. Humaniz. Comput. 2019, 10, 89–106. [Google Scholar] [CrossRef]
  66. Shuster, M.D.; Oh, S.D. Three-axis attitude determination from vector observations. J. Guidance Control 1981, 4, 70–77. [Google Scholar] [CrossRef]
  67. Wang, L.X. A Course in Fuzzy Systems and Control; Prentice Hall: Upper Saddle River, NJ, USA, 1997. [Google Scholar]
  68. Koenig, N.; Howard, A. Design and use paradigms for gazebo, an open-source multi-robot simulator. In Proceedings of the 2004 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS) (IEEE Cat. No.04CH37566), Sendai, Japan, 28 September–2 October 2004. [Google Scholar]
  69. Bloch, A.M. Nonholonomic mechanics. In Nonholonomic Mechanics and Control; Springer: New York, NY, USA, 2003; pp. 207–276. [Google Scholar]
  70. Furrer, F.; Burri, M.; Achtelik, M.; Siegwart, R. Robot Operating System (ROS): The Complete Reference; Springer: Cham, Switzerland, 2016; pp. 595–625. [Google Scholar]
  71. Quigley, M.; Gerkey, B.; Smart, W.D. Programming Robots with ROS: A Practical Introduction to the Robot Operating System; O’Reilly Media, Inc.: Sebastopol, CA, USA, 2015. [Google Scholar]
  72. Koubâa, A. Robot Operating System (ROS); Springer: Cham, Switzerland, 2017. [Google Scholar]
  73. Meyer, J.; Sendobry, A.; Kohlbrecher, S.; Klingauf, U.; Von Stryk, O. Comprehensive simulation of quadrotor uavs using ros and gazebo. In Proceedings of the International Conference on Simulation, Modeling, and Programming for Autonomous Robots, Tsukuba, Japan, 5–8 November 2012; pp. 400–411. [Google Scholar]
  74. Sarcevic, P.; Pletl, S. False detection filtering method for magnetic sensor-based vehicle detection systems. In Proceedings of the 2018 IEEE 16th International Symposium on Intelligent Systems and Informatics (SISY), Subotica, Serbia, 13–15 September 2018. [Google Scholar]
  75. Borbás, K.; Kiss, T.; Klincsik, M.; Kvasznicza, Z.; Máthé, K.; Vér, C.; Vizvári, Z.; Odry, P. Process and Measuring System for Data Acquisition and Processing in Soft-Tomography Studies. U.S. Patent App. 16,062,319, 27 December 2018. [Google Scholar]
  76. Wu, J.; Zhou, Z.; Fourati, H.; Li, R.; Liu, M. Generalized Linear Quaternion Complementary Filter for Attitude Estimation From Multisensor Observations: An Optimization Approach. IEEE Trans. Autom. Sci. Eng. 2019, 16, 1330–1343. [Google Scholar] [CrossRef]
  77. Wu, J. Real-time Magnetometer Disturbance Estimation via Online Nonlinear Programming. IEEE Sens. J. 2019, 19, 4405–4411. [Google Scholar] [CrossRef] [Green Version]
  78. Marple, L. Computing the discrete-time” analytic” signal via FFT. IEEE Trans. Signal Process. 1999, 47, 2600–2603. [Google Scholar] [CrossRef]
  79. Kecskés, I.; Odry, P. Optimization of PI and Fuzzy-PI Controllers on Simulation Model of Szabad (ka)-II walking robot. Int. J. Adv. Robot. Syst. 2014, 11, 186. [Google Scholar] [CrossRef]
  80. Modares, H.; Alfi, A.; Sistani, M.B.N. Parameter estimation of bilinear systems based on an adaptive particle swarm optimization. Eng. Appl. Artif. Intell. 2010, 23, 1105–1111. [Google Scholar] [CrossRef]
  81. Kennedy, J.F.; Kennedy, J.; Eberhart, R.C.; Shi, Y. Swarm Intelligence; Morgan Kaufmann: Burlington, MA, USA, 2001. [Google Scholar]
  82. Odry, Á.; Kecskés, I.; Burkus, E.; Odry, P. Protective Fuzzy Control of a Two-Wheeled Mobile Pendulum Robot: Design and Optimization. WSEAS Trans. Syst. Control 2017, 12, 297–306. [Google Scholar]
  83. Odry, À.; Fullér, R. Comparison of Optimized PID and Fuzzy Control Strategies on a Mobile Pendulum Robot. In Proceedings of the 2018 IEEE 12th International Symposium on Applied Computational Intelligence and Informatics (SACI), Timisoara, Romania, 17–19 May 2018; pp. 207–212. [Google Scholar]
  84. Kecskés, I.; Burkus, E.; Bazsó, F.; Odry, P. Model validation of a hexapod walker robot. Robotica 2017, 35, 419–462. [Google Scholar] [CrossRef]
  85. Odry, Á.; Kecskes, I.; Burkus, E.; Kiraly, Z.; Odry, P. Optimized Fuzzy Control of a Two-Wheeled Mobile Pendulum System. Int. J. Control Syst. Robot. 2017, 2, 73–79. [Google Scholar]
Figure 1. Relative orientation between the earth frame ( E ) and sensor frame ( S ).
Figure 1. Relative orientation between the earth frame ( E ) and sensor frame ( S ).
Sensors 20 00803 g001
Figure 2. Structure of the FAEKF.
Figure 2. Structure of the FAEKF.
Sensors 20 00803 g002
Figure 3. Properties of the applied fuzzy inference machine.
Figure 3. Properties of the applied fuzzy inference machine.
Sensors 20 00803 g003
Figure 4. Generated surfaces related to the fuzzy rule base.
Figure 4. Generated surfaces related to the fuzzy rule base.
Sensors 20 00803 g004
Figure 5. Block diagram of the test environment and filter tuning procedure (video of the closed-loop in [58]).
Figure 5. Block diagram of the test environment and filter tuning procedure (video of the closed-loop in [58]).
Sensors 20 00803 g005
Figure 6. Demonstration of the proposed magnetic perturbation generator algorithm.
Figure 6. Demonstration of the proposed magnetic perturbation generator algorithm.
Sensors 20 00803 g006
Figure 7. Magnetic field measurements before and after the application of the magnetic perturbation generator algorithm.
Figure 7. Magnetic field measurements before and after the application of the magnetic perturbation generator algorithm.
Sensors 20 00803 g007
Figure 8. First time slot from the measurements.
Figure 8. First time slot from the measurements.
Sensors 20 00803 g008
Figure 9. Second time slot from the measurements.
Figure 9. Second time slot from the measurements.
Sensors 20 00803 g009
Figure 10. Third time slot from the measurements.
Figure 10. Third time slot from the measurements.
Sensors 20 00803 g010
Figure 11. Fourth time slot from the measurements.
Figure 11. Fourth time slot from the measurements.
Sensors 20 00803 g011
Table 1. Rule base of the fuzzy inference machine.
Table 1. Rule base of the fuzzy inference machine.
Vibration
f ^ = Z
Mag. pert.
h ^ ext
Vibration
f ^ = S
Mag. pert.
h ^ ext
Vibration
f ^ = B
Mag. pert.
h ^ ext
ZSB ZSB ZSB
Ext. acc.
α ^ e x t
Z K 1 K 2 K 3 Ext. acc.
α ^ e x t
Z K 2 K 3 K 4 Ext. acc.
α ^ e x t
Z K 3 K 4 K 5
S K 2 K 3 K 4 S K 3 K 4 K 5 S K 4 K 5 K 6
B K 3 K 4 K 5 B K 4 K 5 K 6 B K 5 K 6 K 7
Table 2. Mean squared error (MSE) and standard deviation (STD) results of the investigated filters.
Table 2. Mean squared error (MSE) and standard deviation (STD) results of the investigated filters.
Conditionroll ( ϕ )pitch ( θ )yaw ( ψ )
MSE ( rad 2 )STD (rad)MSE ( rad 2 )STD (rad)MSE ( rad 2 )STD (rad)
M1FAEKF0.00100.03010.00260.04210.00040.0188
EKF0.00370.06050.01270.09270.00990.0688
M2FAEKF0.00200.04330.00400.05360.00070.0261
EKF0.00890.09370.02520.12610.00850.0916
M3FAEKF0.00500.06950.00560.05480.00160.0405
EKF0.00460.06690.01020.06500.00890.0944

Share and Cite

MDPI and ACS Style

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. https://0-doi-org.brum.beds.ac.uk/10.3390/s20030803

AMA Style

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(3):803. https://0-doi-org.brum.beds.ac.uk/10.3390/s20030803

Chicago/Turabian Style

Odry, Ákos, Istvan Kecskes, Peter Sarcevic, Zoltan Vizvari, Attila Toth, and Péter Odry. 2020. "A Novel Fuzzy-Adaptive Extended Kalman Filter for Real-Time Attitude Estimation of Mobile Robots" Sensors 20, no. 3: 803. https://0-doi-org.brum.beds.ac.uk/10.3390/s20030803

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