Next Article in Journal
Theoretical Calculation of the Gas-Sensing Properties of Pt-Decorated Carbon Nanotubes
Next Article in Special Issue
Design and Implementation of a Micromechanical Silicon Resonant Accelerometer
Previous Article in Journal
Towards Memory-Aware Services and Browsing through Lifelogging Sensing
Previous Article in Special Issue
Fabrication and Characterization of CMOS-MEMS Magnetic Microsensors
Article Menu

Export Article

Sensors 2013, 13(11), 15138-15158; doi:10.3390/s131115138

A Robust Nonlinear Observer for Real-Time Attitude Estimation Using Low-Cost MEMS Inertial Sensors
José Fermi Guerrero-Castellanos 1,*, Heberto Madrigal-Sastre 1, Sylvain Durand 2, Lizeth Torres 3 and German Ardul Muñoz-Hernández 1
Faculty of Electronic, Autonomous University of Puebla (BUAP), Ciudad universitaria, Puebla 72570, Mexico
Control Systems Department, GIPSA-lab laboratory, CNRS-University of Grenoble, ENSE3 BP 46, St Martin d'Hères Cedex 38402, France
Engineering Institute, Autonomous University of Mexico (UNAM), Circuito Escolar, Ciudad Universitaria, Mexico D.F. 04510, Mexico
Author to whom correspondence should be addressed; E-Mail: Tel.: +52-222-229-5500; Fax: +52-222-229-5631.
Received: 7 September 2013; in revised form: 22 October 2013 / Accepted: 22 October 2013 / Published: 6 November 2013


: This paper deals with the attitude estimation of a rigid body equipped with angular velocity sensors and reference vector sensors. A quaternion-based nonlinear observer is proposed in order to fuse all information sources and to obtain an accurate estimation of the attitude. It is shown that the observer error dynamics can be separated into two passive subsystems connected in “feedback”. Then, this property is used to show that the error dynamics is input-to-state stable when the measurement disturbance is seen as an input and the error as the state. These results allow one to affirm that the observer is “robustly stable”. The proposed observer is evaluated in real-time with the design and implementation of an Attitude and Heading Reference System (AHRS) based on low-cost MEMS (Micro-Electro-Mechanical Systems) Inertial Measure Unit (IMU) and magnetic sensors and a 16-bit microcontroller. The resulting estimates are compared with a high precision motion system to demonstrate its performance.
nonlinear attitude observer; quaternion; MEMS IMU; Attitude and Heading Reference System (AHRS); real-time implementation

1. Introduction

1.1. Motivations and Background

The attitude control problem of a rigid body has attracted a strong interest during the past few decades, and it has been extensively studied. This interest comes from the fact that many aerospace systems, such as spacecrafts, satellites, tactical missiles and many others, enter within the framework of a rigid body with the requirement of precise attitude information [1]. In the last decade, the application of micro-electro-mechanical systems (MEMS) has gained a strong interest. Therefore, the attitude estimation problem has been tackled within new areas, such as terrestrial and aerial robotics [2,3], virtual reality [4], biomechanics [5] and wearable robots [6]. In these cases, the attitude information is obtained from inertial and magnetic sensors, namely, three rate gyros, three accelerometers and three magnetometers, orthogonally mounted, such that the sensor frame axes coincide with the principal axes of the rigid body. Since the attitude is not directly measured, it must be estimated via the measurements of the mentioned sensors. In general, these sensors can be classified into two main categories: Angular velocity sensors that measure the angular velocity of the body with respect to some inertial frame and reference vector sensors that give the coordinates of a fixed vector in the mobile frame.

Rate gyros are angular velocity sensors, and they provide continuous attitude information with good short-term stability when their measurements are integrated by means of the rigid body kinematic Equation. However, since rate gyro measurements are affected by drifts and noise, the attitude estimation based on these sensors diverges slowly from the real attitude. On the other hand, when reference vector sensors measurements, known as vector observations, are available, the attitude can be determinated by algebraic or optimization techniques [7]. Therefore, in order to decrease the effect of noise induced by the vector observations, as well as the attitude divergence provoked by the rate gyro drifts, it is important to fuse both information sources.

To this effect, various estimators have been proposed, using the quaternion attitude parametrization [8]. The Extended Kalman Filter (EKF) [9] and new alternatives to the standard EKF have been applied extensively (see [10] and the references therein). However, the divergence problem [11], the non-Gaussian noise induced [12] and the computational cost render difficult the embedded implementation of the Extended Kalman Filter (EKF). In recent years, significant research efforts have been addressed toward the synthesis of nonlinear attitude observers in order to tackle the previously mentioned issues. The first work on this topic was presented in [13]. Subsequently, in [1416], quaternion-based nonlinear observers and gyro bias observers are proposed in the framework of satellite sensors calibration and marine vehicle navigation, respectively. Furthermore, the formulation of nonlinear attitude observers based on the the orthogonal group, SO(3), have been proposed in the few last years [1720]. Recently, an excellent overview of rigid body attitude estimation and comparative study was given in [21,22]. Nevertheless, it is well known that a nonlinear observer is generally vulnerable to measurement disturbance, in the sense that a small arbitrary disturbance can lead to the divergence of the error state [23]. The above mentioned nonlinear attitude observers (with the exception of [20]) do not consider either the present noise in the gyro measurements nor a time-varying gyro bias term. Furthermore, the computational complexity in these approaches is a drawback, since the algorithms work with 3 × 3 matrices and they have to preserve orthogonality properties. The singular value decomposition (SVD) is a well-known approach and an extremely powerful and useful tool in linear control theory and signal processing. However, few works have exploited this approach in the framework of attitude estimation. In [24], the authors use the SVD method to estimate the attitude matrix minimizing Wahba's cost function. In the work reported in [25], the authors use the SVD approach for finding the relative orientation of a robotic manipulator. Nevertheless, the problem of attitude estimation from magnetic and inertial sensors using an SVD approach has not been addressed in the literature. Furthermore, unlike sensors and computer systems used in the marine and aerospace community, the signal output of the low-cost sensors is subject to high levels of noise and a time-varying bias term. These problems must be addressed, since, in a practical framework, the design of efficient and embedded attitude estimator using low-cost sensors is an important issue.

1.2. Contributions

In the present work, a quaternion-based attitude observer/estimator of a rigid body is presented. In the proposed approach, the attitude estimation problem is solved in two parts. Firstly, a quaternion attitude is estimated by means of vector observations. In this first step, the attitude estimation is performed using an SVD (singular value decomposition) approach. Then, the quaternion obtained in this step is considered an attitude measurement. Contrary to conventional techniques, the SVD maintains the quaternion's unit constraint naturally. Furthermore, the numerical robustness and numerical stability are guaranteed [26]. The second part of the proposed method consists of the design of a nonlinear observer in order to produce an estimate of the time-varying gyro bias and the attitude quaternion. This observer is driven by an attitude error obtained by means of the quaternion propagated by the observer, and this one obtained from the SVD technique. Asymptotic convergence of the estimation error is proven. Moreover, it is shown that the error dynamics can be decomposed in two passive subsystems connected in “feedback”. This result is exploited to prove that the observer is input-to-state stable (ISS) [27,28] when the rate gyro noise is seen as the input and the error as the state. In this sense, using the small gain theorem, one claims that the observer is “robustly stable”. To evaluate the proposed attitude observer behavior in real-time, a complete Attitude and Heading Reference System (AHRS) based on low-cost inertial and magnetic sensors and a 16-bit microcontroller is designed and implemented. A comparison with a high precision motion system is carried out, in order to demonstrate the observer performance.

The ISS paradigm in an attitude observer, the problem of estimating the attitude from vector observations using an SVD approach, as well as a real-time implementation have never been addressed in the literature. These facts show the originality of the present work.

The document is organized as follows. In Section 2, a mathematical background of the attitude parametrization and sensors modeling is given. The main problem is formulated in Section 3. The formulation of the nonlinear attitude observer and stability analysis is presented in Sections 4-6. The AHRS implementation and experimental results are given in Section 7. Finally, conclusions and further research are mentioned in Section 8.

2. Mathematical Background

2.1. Unit Quaternions and Attitude Kinematics

Consider two orthogonal, right-handed coordinate frames: the body coordinate frame, E b = [ e 1 b , e 2 b , e 3 b ], located at the center of mass of the rigid body, and the inertial coordinate frame, E f = [ e 1 f , e 2 f , e 3 f ], located at some point in the space. The rotation of the body frame, Eb, with respect to the fixed frame, Ef, is represented by the attitude matrix RSO(3) = { R ∈ ℝ3×3 : RTR = I, det R = 1}.

The cross product between two vectors, χ⃗, ξ⃗ ∈ ℝ3, is represented by a matrix multiplication [ξ⃗×]χ = ξ⃗ × χ⃗, where:

[ ξ × ] = ( 0 ξ 3 ξ 2 ξ 3 0 ξ 1 ξ 2 ξ 1 0 )

The n-dimensional unit sphere embedded in ℝ n+1 is denoted as Sensors 13 15138i1n = {x ∈ ℝn+1: xTx = 1}. Members of SO(3) are often parametrized in terms of a rotation, β ∈ ℝ, about a fixed axis, e⃗ Sensors 13 15138i12, by the map, Sensors 13 15138i2 : ℝ × Sensors 13 15138i12SO(3), defined as:

u ( β , e ) : = I + sin ( β ) [ e × ] + ( 1 cos ( β ) ) [ e × ] 2

Hence, a unit quaternion, q Sensors 13 15138i13, is defined as:

q : = ( cos β 2 e sin β 2 ) = ( q 0 q ) S 3
q⃗ = [q1 q2 q3]T ∈ ℝ3 and q0 ∈ ℝ are known as the vector and scalar parts of the quaternion, respectively. q represents an element of SO(3) through the map, Sensors 13 15138i3 : Sensors 13 15138i13SO(3), defined as:
: = I + 2 q 0 [ q × ] + 2 [ e × ] 2

Note that R = ( Sensors 13 15138i3) (q) = ( Sensors 13 15138i3) (—q) for each q Sensors 13 15138i13, i.e., quaternions q and –q represent the same physical attitude. The inverse unit quaternion is given by q−1 := [q0q⃗T]T , and the quaternion product is defined by:

q 1 q 2 : = ( q 1 0 q 1 T q 1 I 3 q 1 0 + [ q 1 × ] ) ( q 2 0 q 2 )

Denoting by ω⃗ = [ω1 ω2 ω3]T the angular velocity vector of the the body coordinate frame, Eb, relative to the inertial coordinate frame, Ef, expressed in Eb, the kinematics equation is given by:

( q ˙ o q ˙ ) = 1 2 ( q T I 3 q 0 + [ q × ] ) ω = 1 2 Ξ ( q ) ω

The attitude error is used to quantify the mismatch between two attitudes. If q defines the true attitude quaternion and is the estimated quaternion, then the error quaternion that represents the attitude error between the true orientation and the estimated one is given by [8]:

q e : = q ^ 1 q = ( q e 0 q e T ) T

In the case that the true quaternion and the estimated one coincide, the quaternion error becomes:

q e = ( ± 1 0 T ) T

2.2. Sensor Modeling

The sensors in the rigid body are classified into the two following categories.

2.2.1. Angular Velocity Sensors

The angular velocity ω⃗ = (ω1 ω2 ω3)T is measured by three rate gyros orthogonally mounted. The output signal of a rate gyro is influenced by noise and by a slowly varying function, v, called bias [29], that is:

ω G = ω + v + η G
v ˙ = T 1 v + η v
where η⃗G and η⃗v ∈ ℝ3 are bounded noises and T = τI3 is a diagonal matrix of time constants.

2.2.2. Reference Vector Sensors

Let us consider the representation of a vector, x⃗i, with respect to Ef and Eb and denoted by r⃗i and b⃗i, respectively. The vectors, r⃗i, are also called the “reference vectors” and, in general, are known quite accurately. The body vectors, b⃗i, are known as “vector observations” and are obtained from on-board sensors (for instance, magnetometers, star trackers, accelerometers). Let biq and riq be the associate quaternion to the vectors, b⃗i and ri:

b i q = ( 0 b i T ) T r i q = ( 0 r i T ) T
these quaternions are related by the quaternion rotation, q, such that:
b i q = q 1 r i q q

From Equation (4) and using quaternion algebra, the following measure model can be obtained [25]:

( 0 ( b i r i ) T b i r i [ ( b i + r i ) × ] ) q = H q = 0
with H ∈ ℝ4×4. Note that Equation (12) is a well-structured linear system of equations.

3. Problem Statement

The objective is to design an attitude observer that estimates the rigid body attitude doing a trade-off between a good short-term precision given by rate gyro integration and a reliable long-term accuracy provided by vector observations.

If at least two vector observations are non-collinear, the quaternion can be estimated using these simultaneous vector measurements. For this purpose, the measurement Equation (12) is exploited. The observation matrix in a function of m pair vectors (b⃗i, r⃗i) with i ∈ {1, 2,…, m} is written as follows:

H ¯ = ( H 1 H m ) = ( 0 ( b 1 r 1 ) T ( b 1 r 1 ) [ ( b 1 + r 1 ) × ] 0 ( b m r m ) T b m r m [ ( b m + r m ) × ] ) 4 m × 4

In the case of perfect measurements, the measure Equation q = 0 is always satisfied. However, in practice, the measurements are polluted with perturbations originated from noise, vibrations, etc. Therefore, the problem consists of estimating the attitude quaternion from a perturbed observation matrix, , that is:

q p s = arg min q { 1 2 H ¯ q 2 2 } subject to q p s 2 = 1

On the other hand, if the initial value, q(t0), is known and the angular velocity measurements are perfect, i.e., ω⃗ = ω⃗G, it is possible to obtain q(t) by integrating the kinematics Equation (5). Nevertheless, q(t0) is, in general, unknown, furthermore, the angular velocities are polluted with bias and noise (see Equation (8)), which results in slow divergence of attitude over time. Therefore, the observation idea can be used to on-line correct the integration, (t), of some erroneous (t0) and attitude errors caused by the bias, and the noise presents in the rate gyro measurements. This correction can be carried out according to the measurable error qe = -1qps, where qps is considered an attitude measure obtained by the vector observations.

The observation problem 1can then be formulated as follows: Given the kinematic equation of the rigid body and the model of time-varying bias evolution, find an estimate (t) and (t) from the knowledge of ωG(t) and qps(t) for all tt0 ∈ ℝ≥ 0.

4. Nonlinear Observer Formulation

4.1. Attitude Estimation from Vector Observations

Assumption 1. There are at least two linearly independent vectors, b⃗i and b⃗j, with ij, that is, rank(H̄) ≥ 3.

Lemma 1. Let H̄ ∈ ℝ4m×4 be the observation matrix formed by the m pair of vectors (b⃗i, r⃗i) with i ∈ {1, 2, …,m}. Then, there is an orthonormal matrix U = (U1 U2U4m) ∈ ℝ4m×4m, an orthonormal matrix V = (V1 V2 V3 V4) ∈ ℝ4×4 and an orthonormal matrix S ∈ ℝ4m×4, with elements σk along the diagonal and zeros everywhere else, where k = 1 : 4, such that:

H ¯ = U S V T

Then, the attitude quaternion is given by the last column of the matrix, V, that is:

q p s = V 4
furthermore, the normality conditionqps2 = 1 is satisfied.

Proof. The proof follows the standard least squares solution of homogeneous equations via the SDV approach [30].

4.2. Nonlinear Attitude Observer with Bias Estimation

The proposed attitude nonlinear observer that includes the bias and the error update is given by:

O A : { q ^ ˙ = 1 2 Ξ ( q ^ ) ( ω G v ^ + K 1 q e ) v ^ ˙ = T 1 v ^ K 2 q e
where T ∈ ℝ3×3 has been defined in Equation (9) and K1, K2 are positive constant parameters. is the prediction of the attitude at time t. It is obtained via the integration of the kinematics Equation (17), using the measured angular velocity, ω⃗G, the bias estimate, ν̂ and q⃗e, which is the vector part of the quaternion error, qe, that measures the discrepancy between and the measured attitude, qps, obtained by means of Lemma 1, that is:
q e = q ^ 1 q p s = ( q e o q e T ) T

Actually, the observer Equation (17) allows one to fuse the data that arise from the vector observations and the rate gyro measurements. The observer structure is shown in Figure 1.

Note that the attitude quaternion, qps, can be expressed by:

q p s = q Δ q
where q denotes the true attitude and Δq represents a perturbation quaternion, which is caused by the sensor measurement noise encountered in practice.

For the first time, a Lyapunov stability analysis is carried out. As is always done, the error dynamic is obtained in a noise-free context; then, the following hypotheses are made:

η⃗G = η⃗v= 0. The measurement rate gyro noise is not included in the error dynamics.

Δq = (1 0 0 0)T, i.e., q = qps. This is a good assumption for the case of static attitudes and for quasistatic movements [17].

Combining Equations (5)-(9) and (17), the error dynamics is expressed as:

e : { q ˙ e = 1 2 ( 0 γ T γ [ 2 ω × ] + [ γ × ] ) ( q e 0 q e ) v ˜ ˙ = T 1 v ˜ + K 2 q e
where γ⃗ = + K1q⃗e and v ̃ = v v ^.

The system Equation (20) admits a set of equilibrium points Sensors 13 15138i4 := {pe+, pe}, where:

pe+ :=(1 0T 0T)T Sensors 13 15138i13 × ℝ3

pe := (-1 0T 0T)T Sensors 13 15138i13 × ℝ3

In both scenarios, one shows that the following stability property is ensured with respect to different sets.

Definition 1. (Asymptotic Stability in the Large) [31]. Let χ ⊂ ℝn be given. The trivial solution x = 0 of ẋ = f(t, x) is called asymptotically stable in the large with respect to χ if it is stable in the sense of Lyapunov and every other solution x(t, t0, x0) → 0 as t → ∞ for any initial states, x0χ, and for any initial times, t0∈ ℝ ≥0.

One considers that the state space of Equation (20) corresponds to either χ+ = {qe Sensors 13 15138i13|qe0 ∈ [0, 1]} × ℝ3 or χ_ = {qe Sensors 13 15138i13|qe0 ∈ [-1, 0]} × ℝ3, depending on which target equilibrium is chosen.

Proposition 1. Assume that all trajectories with initial conditions, ( q e o ( t 0 ) q e T ( t 0 ) v ˜ T ( t 0 ) ) T χ +, satisfy sgn(qe0(t)) = sgn(qe0(t0)) ≥ 0 for all t > t0 (mutatis mutandis for χ). Then, the equilibrium point, pe+ (respectively, the equilibrium point, pe) of the system Equation (20) is asymptotically stable in the large with respect to χ+ (respectively, with respect to χ).

Proof. Consider the candidate Lyapunov function, V : Sensors 13 15138i13 × ℝ3 → ℝ, which is proper and positive definite:

V = K 2 ( ( 1 q e 0 ) 2 + q e T q e ) + 1 2 v ˜ T v ˜ = 2 K 2 ( 1 q e 0 ) + 1 2 v ˜ T v ˜

The derivative of Equation (21), together with Equation (20), is given by:

V ˙ = 2 K 2 q ˙ e 0 + v ˜ T v ˜ ˙ = K 2 γ T q e + v ˜ T ( T 1 v ˜ + K 2 q e ) = K 2 ( v ˜ T + K 1 q e T ) q e v ˜ T T 1 v ˜ + K 2 v ˜ T q e = K 2 K 1 q e T q e v ˜ T T 1 v ˜ 0

Thus, q⃗e 0 and → 0 and, due to the normality condition, qe0 → 1. Hence, solutions of the system Equation (20) whose initial conditions are in χ+ converge asymptotically to pe+ := (1 0T 0T)T . That concludes the proof.

Remark 1. In a practical context, one aims at improving the convergence speed of the observer. Since, physically, the set of equilibrium points, Sensors 13 15138i4 := {pe+,pe}, corresponds to the same attitude error, it is necessary to establish the desired equilibrium point to be achieved, depending on the given initial condition. This improvement can be ensured by choosing the equilibrium point corresponding to the sign of qe0(t0). The point, pe+, is chosen if qe0(t0) ≥ 0 and the point, pe, otherwise. Then, a slight modification on the observer Equation (17) is done, obtaining

O A d i s : { q ^ ˙ = 1 2 Ξ ( q ^ ) ( ω G v ^ + sign ( q e o ) K 1 q e ) v ^ ˙ = T 1 v ^ sign ( q e o ) K 2 q e

This fact can be shown adapting the proof of Proposition 1 using the following Lyapunov function instead:

V = { K 2 ( ( 1 q e 0 ) 2 + q e T q e ) + 1 2 v ˜ T v ˜ , i f q e 0 ( t 0 ) 0 K 2 ( ( 1 + q e 0 ) 2 + q e T q e ) + 1 2 v ˜ T v ˜ , i f q e 0 ( t 0 ) < 0

5. Passivity Interpretation of the Attitude Nonlinear Observer

Lemma 2. (Kalman-Yakubovich-Popov (KYP) lemma) Let Z(s) = C(sI – A)−1B be a p × p transfer function matrix, where A is Hurwitz, (A, B) is controllable and (A, C) is observable. Then, Z(s) is strictly positive real (SPR) if and only if there exist a positive definite symmetric matrix P = PT > 0 and Q = QT > 0, such that:

A T P + P A = Q
B T P = C

Since K2 is a scalar, the dynamics error Equation (20) for the bias observer can be written as:

v ˜ ˙ = T 1 v ˜ + K 2 I 3 q e

Although the error system Equation (27) has no output, it is possible to define the following virtual output:

y e = K 2 I 3 v ˜

Using Equation (28), the error dynamics Equation (20) can be structured as the one shown in Figure 2.

Proposition 2. The transfer function matrix of the error system Equations (27) and (28) is SPR. That is, the mapping, q⃗ey⃗e, satisfies the KYP lemma.

Proof. Since the matrix, –T−1, is symmetric and a Hurwitz, one has for all Q symmetric positive definite matrices a P symmetric positive definite matrix, such that:

( T 1 ) T P + P ( T 1 ) = Q

If the Q matrix is specified as Q = 2T−1, one gets:

P = I 3
B T P = ( K 2 I 3 ) T I 3 = K 2 I 3 = C
which satisfies the equality Equation (26).

Proposition 3. The dynamics of the quaternion error, represented by the system, Sensors 13 15138i51, is state strictly passive.

Proof. Consider the candidate Lyapunov function, Vq, which is positive, definite and proper:

V q = { K 2 ( ( 1 q e 0 ) 2 + q e T q e ) = 2 K 2 ( 1 q e 0 ) , s i q e 0 0 K 2 ( ( 1 + q e 0 ) 2 + q e T q e ) = 2 K 2 ( 1 + q e 0 ) , s i q e 0 < 0

Analyzing for qe0 ≥ 0, the derivative of Equation (32) along the trajectories of qe (Equation (20)), is given by:

V ˙ q = 2 K 2 q ˙ e 0 = K 2 γ T q e = K 2 ( v ˜ T + K 1 q e T ) q e = K 2 K 1 q e T q e K 2 v ˜ T q e
or, similarly:
K 2 v ˜ T q e = V ˙ q + K 2 K 1 q e T q e

Since qe0 ∈ [0, 1], one obtains:

q e T q e = 1 q e 0 2 1 q e 0 ( 1 q e 0 ) 2
K 2 v ˜ T q e Power Flow V ˙ q Rate of change of energy stored + K 2 K 1 ( 1 q e 0 ) 2 State dissipation rate

Theorem 1. The attitude nonlinear observer Equation (17) is passive.

Proof. Propositions 2 and 3 establish that the systems, Sensors 13 15138i52 and Sensors 13 15138i51, are SPR and state strictly passive, respectively. Since the two systems are connected in feedback (see Figure 2), the attitude nonlinear observer Equation (17) is passive.

6. Input to State Stability (ISS) of the Attitude Nonlinear Observer

Note that the convergence and the passivity interpretation of the observer were accomplished within a context free from noise and perturbation. However, the rate gyro measurements are corrupted by measurements noise and bias components that are time-varying. Owing to the nonlinearity of the observer, this type of disturbance can cause instability or even the finite time escape of the estimate.

In this section, the robustness of the proposed observer is discussed, which follows from passivity propriety. It will be shown that the error dynamics is input-to-state stable when the disturbances are viewed as the input and the error quaternion as the state.

In the case that noise is included, the error dynamics Equation (20) becomes:

e noise : { q ˙ e = 1 2 ( 0 γ T + η G T γ + η G [ 2 ω × ] + [ ( γ + η G ) × ] ) ( q e 0 q e ) v ˜ ˙ = T 1 v ˜ + K 2 q ˜ e + η v

This equation can be described as illustrated in Figure 3, where the inputs, d⃗1 and d⃗2, are such that:

d 1 = v ˜ + η G , d 2 = K 2 q e + η v

It is assumed that the noise components are bounded. That is:

sup s [ t 0 , t ] η G ( s ) 2 < c 1 sup s [ t 0 , t ] η v ( s ) 2 < c 2

However, neither the bounds nor the noise distribution are necessarily known.

Proposition 4. The system, Sensors 13 15138i52, is input-to-state stable (ISS) with respect to the input, d⃗2. Then, the output of Sensors 13 15138i52 (y⃗e = K2I3ṽ) is always bounded.

Proof. Consider the second equation of the system Equation (37). Since the matrix, –T−1, is a Hurwitz, one obtains:

v ˜ ( t ) 2 = e T 1 ( t t 0 ) v ˜ ( t 0 ) 2 + t 0 t e T 1 ( t s ) ) d 2 ( s ) d s = e T 1 ( t t 0 ) v ˜ ( t 0 ) 2 + t 0 t e T 1 ( t s ) ( K 2 q e ( s ) + η v ( s ) ) d s e T 1 ( t t 0 ) v ˜ ( t 0 ) 2 + K 2 sup s [ t 0 , t ] { q e ( s ) 2 } + sup s [ t 0 , t ] { η v ( s ) 2 }
v ˜ ( t ) 2 max { ζ 2 ( v ˜ ( t 0 ) 2 , t t 0 ) , sup s [ t 0 , t ] ς 21 ( q e ( s ) 2 ) , sup s [ t 0 , t ] ς 2 ( η v ( s ) 2 ) }
where: ζ(‖(t0)‖2,(tt0) = eT−1(tt0)(t0)‖2 is a Sensors 13 15138i6 function and ς21 (‖q⃗e(s)‖2) = K2q⃗e(s)‖2 and ς2(‖η⃗v(s)‖2) = ‖η⃗v(s)‖2 are Sensors 13 15138i6 functions. Then, the bias estimation error, (t), is input-to-state stable, and the output y⃗e(y⃗e = K2I3) is always bounded.

Proposition 5. The system, Sensors 13 15138i51, is input-to-state stable with respect to d⃗2.

The key to showing the ISS of the system, Sensors 13 15138i51, is the fact that a system is input-to-state stable if it admits an ISS-Lyapunov function. In this sense, a Lyapunov function will be proposed; then, it will be shown that this function is a ISS-Lyapunov function.

Proof. Consider the candidate Lyapunov function, V, which is proper and positive definite:

V q = { K 2 ( ( 1 q e 0 ) 2 + q e T q e ) = 2 K 2 ( 1 q e 0 ) , s i q e 0 0 K 2 ( ( 1 + q e 0 ) 2 + q e T q e ) = 2 K 2 ( 1 + q e 0 ) , s i q e 0 < 0

Analyzing for qe0 ≥ 0, the derivative of Equation (32) along the trajectories of qe (Equation (37)) is given by:

V ˙ q = 2 K 2 q ˙ e 0 = K 2 ( γ T + η G T ) q e = K 2 ( ν ˜ T + K 1 q e T + η G T ) q e = K 2 K 1 q e T q e K 2 ( ν ˜ T + η G T ) q e = K 2 K 1 q e T q e K 2 d 1 T q e
since qe0 ∈ [0,1], one obtains:
q e T q e = q e 2 2 = 1 q e 0 2 1 q e 0 ( 1 q e 0 ) 2
V ˙ q K 2 K 1 ( 1 q e 0 ) 2 d 1 T q e K 2 K 1 ( 1 q e 0 ) 2 + d 1 2 q e 2 K 2 K 1 ( 1 q e 0 ) 2 + d 1 2 α 3 ( ( 1 q e 0 ) 2 ) + α 4 ( d 1 2 )
since Vq is proper ∃ α1, α2 Sensors 13 15138i6 functions, such that:
α 1 ( q ( t 0 ) 2 ) V q ( q ( t 0 ) ) α 2 ( q ( t 0 ) 2 )

Furthermore, α3 ((1 – qe0)2) = K1K2((1 – qe0)2 and α3((1−qe0)2 = K1K2)((1−qe0)) are Sensors 13 15138i6 functions. Then, the Lyapunov function, Vq, is a ISS-Lyapunov function (see [27]), and this fact implies that the system, Sensors 13 15138i51, is ISS.

Since the system, Sensors 13 15138i51, is ISS, the following inequality is accomplished:

q e ( t ) 2 max { ζ 1 ( q e ( t 0 ) 2 , t t 0 ) , sup s [ t 0 , t ] ς d ( d 1 ( s ) 2 ) } max { ζ 1 ( q e ( t 0 ) 2 , t t 0 ) , sup s [ t 0 , t ] ς 12 ( ν ˜ ( s ) 2 ) , sup s [ t 0 , t ] ς 1 ( η G ( s ) 2 ) }
where ζ1 is a Sensors 13 15138i6 function and ζ12(‖2) = K22 and ζ1(‖η⃗G2) = K2η⃗G2 are Sensors 13 15138i6 functions. That is, every trajectory of the attitude error dynamics asymptotically approaches a ball around the origin, whose radius is a function of supremum norm of the bias estimation error and of the measure noise of the rate gyro.

Using the interesting properties of ISS systems, the stability of the entire error dynamics is studied. Then, one has the following result.

Theorem 2. Let K2 be a positive constant, such that K2 < 1. Then, the attitude nonlinear observer is robust towards to measurement disturbance of the rate gyro.

Proof. The claim follows from the small gain theorem for the interconnection of nonlinear systems that are input-to-state stable [32]. The error dynamics of a nonlinear observer (Equation (37)) is composed of the feedback interconnection of the systems Sensors 13 15138i51- Sensors 13 15138i52). From Propositions 4 and 5, it follows that:

q e ( t ) 2 max { ζ 1 ( q e ( t 0 ) 2 , t t 0 ) , sup s [ t 0 , t ] ς 12 ( ν ˜ ( s ) 2 ) , sup s [ t 0 , t ] ς 1 ( η G ( s ) 2 ) }
ν ˜ ( t ) 2 max { ζ 2 ( ν ˜ ( t 0 ) 2 , t t 0 ) , sup s [ t 0 , t ] ς 21 ( q e ( s ) 2 ) , sup s [ t 0 , t ] ς 2 ( η ν ( s ) 2 ) }

The composition of the functions, ς12 and ς21, is given by:

ς 12 ς 21 ( q e ( s ) 2 ) = K 2 ( K 2 q e 2 )

Since K2 < 1, it follows that:

K 2 2 q e 2 < q e 2 q e 2 > 0

Then, the system ( Sensors 13 15138i51- Sensors 13 15138i52) is ISS, when the measurements disturbances, η⃗G and η⃗v, are seen as the input and the error state, [q⃗eTT]T, as the state. This means that the attitude observer is robust with respect to measurement disturbance.

7. Experimental Results

The estimation methodology proposed in this work is implemented and evaluated in real time, in order to assess its effectiveness. For this purpose, an embedded system was designed and developed. Special attention was paid to the low power consumption requirements and weight, leading to the selection of the digital signal controller (DSC), dsPIC33FJ128MC802, which was used with a clock speed of 4 MHz. It contains extensive digital signal processor (DSP) functionality with a high performance, 16-bit microcontroller (MCU) architecture, but without a floating point unit. The sensor suite is based on a sensor board equipped with a tri-axis accelerometer (ADXL135), a dual axis gyro (LPR530AL), a single axis gyro (LY530ALH) and a tri-axis magnetometer (Micromag 3). All sensors outputs are analog, except for the Micromag 3, which is digital and uses the serial peripheral interface (SPI) bus system as the underlying physical communication layer. The aim was to test the DSC implementation with an update rate of the estimation of at least 55 Hz.

Furthermore, the system is equipped with a Bluetooth module (BlueSMiRF Silver), which provides wireless capabilities. The total system supply voltage is 3.3 V. The dimension and weight are 60 × 40 × 15 mm and 60 g, respectively. The system is depicted in Figures 4 and 5.

In order to experimentally evaluate the performance of the proposed AHRS, the experiments were carried out with a two degrees-of-freedom high accuracy system. Actually, this system is the Twin Rotor System [33] (see Figure 6). This system has two rotational joints, which allow for movement about two orthogonally axes with a resolution of 0.35° considered a true attitude for performance evaluation. In order to test the complete attitude estimation, two trials were carried out. In the first one, the axes, e 1 b and e 3 b, of the AHRS coordinate frame (body coordinate frame E b = [ e 1 b , e 2 b , e 3 b ]) coincide with the axes, e 1 t and e 3 t, of the Twin Rotor System. Thus, θ (pitch) and Ψ (yaw) angles were evaluated. In order to evaluate the angle, Φ (roll), the AHRS was rotated π/2 about the axis, e 1 b, such that e 1 b coincides with e 1 t and e 2 b with e 3 t. Note that the attitude is estimated with respect to the inertial coordinate frame E f = [ e 1 f , e 2 f , e 3 f ]. Ef is chosen to be the NED (north, east, down) coordinate frame. In this case, the reference vectors are the gravitational and magnetic vectors. The vector observations, i.e., the gravitational and magnetic vectors expressed in the body frame, Eb, are obtained from the mentioned tri-axis accelerometer and tri-axis magnetometer. The angular velocity is obtained from three rate gyros.

The attitude and gyro bias observer is implemented at 55 Hz using a fourth-order Runge-Kutta method, with tuning parameters, K1 = 3.2 and K2 = 0.9, such that the restriction of Theorem 2 is accomplished. No particular emphasis was given on the tuning process, since the resulting performance with these simple parameters is very acceptable. The attitude is maintained as a quaternion, which is normalized at each time step to compensate for numerical errors. After that, the quaternion is converted to Euler Angles, since they are more intuitive, and it allows for comparing with the angles obtained from the Twin Rotor System. For the entire experimentation time span, the vector v⃗f = v⃗o + v⃗r was added to the vector of the rate gyro measurements, in order to test the ability to estimate and compensate for the rate gyro bias. In this case, one has v⃗o = 0.1(1 – 1 1)T and v⃗r = 0.0001k(1 1 1)T, where k represents the iteration index.

For the first trial, the initial condition for the quaternion estimate is q⃗(t0) = (0.85 0.06 0.11 – 0.49)T, i.e., (ϕ̂ = 0°, θ̂ = 15°, ψ̂ = −60°). For the second trial, the initial condition for the quaternion estimate is (t0) = (0.76 0 0 - 0.64)T, i.e., (ϕ̂ = 0°, θ̂ = 0°, ψ̂ = −80°). In both cases, the rate gyro bias initial estimate was set to zero. The observer angle estimates are compared with the ones obtained from the encoders of the Twin Rotor System. In Figure 7, the evolution of θ (pitch) and Ψ (yaw) angles is depicted. Figure 8 shows the evolution of the second trial, i.e., Φ (roll) and Ψ (yaw) angles. Finally, the convergence of the rate gyros bias estimates is shown in Figure 9. These results indicate that the observer faces up to the slowly time-varying nature of the rate gyro biases.

It is worth mentioning that the algorithm itself uses only 81% of the 55 Hz cycle time. This is depicted in Figure 10. Finally, we invite the readers to watch the following video: https://www.dropbox.eom/s/r3pq57rwlf0pxuv/

8. Conclusions

This paper presented an original quaternion-based strategy for the attitude estimation of a rigid body equipped with angular velocity sensors and reference vector sensors. To accomplish the objective, a robust nonlinear observer for attitude estimation was developed. This observer ensures the asymptotic estimation convergence and local exponential estimation convergence. Furthermore, by means of an ISS analysis, it was shown that the observer is robust towards noise and the disturbance of the rate gyro sensors. Thus, an embedded AHRS was designed and developed. Experimental results were presented, where the AHRS outputs are compared with a two degrees-of-freedom high accuracy motion system. This illustrates the achievable performance of the proposed estimation schema.


The authors wish to thank W. Fermín Guerrero-Sánchez, Facultad Ciencias Físico-Matemáticas (BUAP), for providing us with the Twin Rotor System and for many valuable discussions. German Ardul Muñoz-Hernández wishes to thank the Instituto Tecnologico de Puebla, who supported him with a sabbatical year that made the participation in this work possible.

Conflict of Interest

The authors declare no conflict of interest.


  1. Wertz, J. Spacecraft Attitude Determination and Control; Kluwer Academic Publisher: Alphen aan den Rijn, The Netherlands, 1990. [Google Scholar]
  2. Roumeliotis, S.; Sukhatme, G.; Bekey, G. Smoother based 3D Attitude Estimation for Mobile Robot Localization. Proceedings of IEEE International Conference on Robotics and Automation (ICRA 1999), Detroit, MI, USA, 10–15 May 1999.
  3. Guerrero-Castellanos, J.; Marchand, N.; Hably, A.; Lesecq, S.; Delamare, J. Bounded attitude control of rigid bodies: Real-time experimentation to a quadrotor mini-helicopter. Control. Eng. Pract. 2011, 19, 790–797. [Google Scholar]
  4. Hol, J.D.; Schn, T.B.; Gustafsson, F.; Slycke, P.J. Sensor Fusion for Augmented Reality. Proceedings of the 9th International Conference on Information Fusion (FUSION 2006), Florence, Italy, 10–13 July 2006.
  5. Luing, H.; Veltink, P. Measuring orientation of human body segments using gyroscopes and accelerometers. Med. Biol. Eng. Comput. 2005, 43, 273–281. [Google Scholar]
  6. Mohammed, S.; Amirat, Y.; Rifai, H. Lower-limb movement assistance through wearable robots: State of the art and challenges. Adv. Robot. 2012, 26, 1–22. [Google Scholar]
  7. Whaba, G. A least squares estimate of spacecraft attitude. SIAM Rev. 1965, 7, 409. [Google Scholar]
  8. Shuster, M. A survey of attitude representations. J. Astronaut. Sci. 1993, 41, 439–517. [Google Scholar]
  9. Guerrero-Castellanos, J.; Lesecq, S.; Marchand, N.; Delamare, J. A Low-Cost Air Data Attitude Heading Reference System for the Tourism Airplane Applications. Proceedings of 2005 IEEE Sensors, Irivine, CA, USA, 31 October–3 November 2005; pp. 1388–1391.
  10. Markley, F.; Crassidis, J.; Cheng, Y. Nonlinear Attitude Filtering Methods. Proceedings of Conference on AIAA Guidance, Navigation, and Control (GNC 2005), San Francisco, CA, USA, 15–18 August 2005.
  11. Bensançon, G. Nonlinear Observers and applications. In Control and Information Science 363; Springer-Verlag: Berlin, Germany, 2007. [Google Scholar]
  12. Gning, A.; Bonnifait, P. Constraints propagation techniques on intervals for a guaranteed localization using redundant data. Automatica 2006, 42, 1167–1175. [Google Scholar]
  13. Salcudean, S. A globally convergent velocity obsever for rigid body motion. IEEE Trans. Autom. Control. 1991, 36, 1493–1497. [Google Scholar]
  14. Thienel, J.; Sanner, R. A coupled nonlinear spacecraft attitude controller and observer with an unknown constant gyro bias and gyro noise. IEEE Trans. Autom. Control. 2003, 48, 2011–2014. [Google Scholar]
  15. Vik, B.; Fossen, T. An Nonlinear Observer for GPS and INS Integration. Proceedings of 40th IEEE Conference on Decision and Control (CDC 2001), Orlando, FL, USA, 4–7 December 2001.
  16. Grip, H.; Fossen, T.; Johansen, T.; Saberi, A. Attitude estimation using biased gyro and vector measurements with time-varying reference vectors. IEEE Trans. Autom. Control. 2012, 57, 1332–1338. [Google Scholar]
  17. Mahony, R.; Hamel, T.; Pflimlin, J. Complementary Filter Design on the Special Orthogonal Group SO(3). Proceedings of 44th IEEE Conference on Decision and Control and the European Control Conference (CDC-ECC 2005), Seville, Spain, 12–15 December 2005.
  18. Mahony, R.; Hamel, T. Intelligent Systems, Control, and Automation: Science and Engineering. In Advances in Unmanned Aerial Vehicles; Springer: Amsterdam, The Netherlands, 2007. [Google Scholar]
  19. Vasconcelos, J.F.; Silvestre, S.; Olveira, P. A Nonlinear Observer for Rigid Body Attitude Estimation Using Vector Observations. Proceedings of 2008 IFAC World Congress, Seoul, Korea, 6–11 July 2008; pp. 8599–8604.
  20. Vasconcelos, J.F.; Cunha, R.; Silvestre, S.; Olveira, P. Stability of a Nonlinear Attitude Observer on SO(3) with Nonideal Angular Velocity Measurements. Proceedings of European Control Conference (ECC 2009), Calgary, AB, Canada, 24–26 August 2009.
  21. Madinehi, N. Rigid Body Attitude Estimation: An Overview and Comparative Study. Ms.C Thesis, University of Western Ontario, London, ON, Canada, 2013. [Google Scholar]
  22. Tayebi, A.; Roberts, A.; Benallegue, A. Inertial vector measurements based velocity-free attitude stabilization. IEEE Trans. Autom. Control. 2013, 58, 2893–2898. [Google Scholar]
  23. Shim, H.; Seo, J.; Teel, A. Nonlinear observer design via passivation of error dynamics. Automatica 2003, 39, 885–892. [Google Scholar]
  24. Markley, F. Attitude determination using vector observations and the singular value decomposition. J. Astronaut. Sci. 1988, 38, 245–258. [Google Scholar]
  25. Chou, J.; Kamel, M. Quaternion Approach to Solve the Kinematic Equation of Rotation, AaAx= AzAb of A Sensor-Mounted Robotic Manipulator. Proceedings of IEEE International Conference on Robotics and Automation (ICRA 1998), Lueven, Belgium, 16–20 May 1998.
  26. Barraud, A. Outils d'Analyse Numerique pour l'Automatique; Lavoisier: Paris, France, 2002. [Google Scholar]
  27. Sontag, E.; Wang, Y. On charactrization of the input-to-state stability property. Sys. Control. Lett. 1995, 24, 351–359. [Google Scholar]
  28. Arcak, M.; Sontag, E. Passivity-Based Stability of Interconnection Structures. In Recent Advances in Learning and Control; Blondel, V., Boyd, S., Kimura, H., Eds.; Springer-Verlag: London, UK, 2008. [Google Scholar]
  29. Brown, R.; Hwang, P. Introduction to Random Signal and Applied Kalman Filtering; Wiley: New Work, NY, USA, 1997. [Google Scholar]
  30. Hartley, R.I.; Zisserman, A. Multiple View Geometry in Computer Vision, 2nd ed.; Cambridge University Press: Cambridge, UK, 2004. [Google Scholar]
  31. Schlanbusch, R.; Loria, A.; Nicklasson, P.J. On the stability and stabilization of quaternion equilibria of rigid bodies. Automatica 2012, 48, 3135–3141. [Google Scholar]
  32. Jiang, Z.P.; Teel, A.; Praily, P. Small-gain theorems for ISS systems and applications. Math. Control. Signal Sys. 1994, 7, 104–130. [Google Scholar]
  33. Feedback Instruments. Available online: (accessed on 23 October 2013).
Figure 1. Block diagram of the nonlinear observer (⊗ quaternion multiplication, ⊗ matrix multiplication.)
Figure 1. Block diagram of the nonlinear observer (⊗ quaternion multiplication, ⊗ matrix multiplication.)
Sensors 13 15138f1 1024
Figure 2. Block diagram of the dynamics of attitude and bias error.
Figure 2. Block diagram of the dynamics of attitude and bias error.
Sensors 13 15138f2 1024
Figure 3. Block diagram of the dynamics of attitude and bias error with measurement disturbances.
Figure 3. Block diagram of the dynamics of attitude and bias error with measurement disturbances.
Sensors 13 15138f3 1024
Figure 4. Block diagram for the Attitude and Heading Reference System (AHRS) prototype.
Figure 4. Block diagram for the Attitude and Heading Reference System (AHRS) prototype.
Sensors 13 15138f4 1024
Figure 5. The AHRS prototype.
Figure 5. The AHRS prototype.
Sensors 13 15138f5 1024
Figure 6. Experimental setup.
Figure 6. Experimental setup.
Sensors 13 15138f6 1024
Figure 7. Estimation of θ (pitch) and ψ (yaw) angles.
Figure 7. Estimation of θ (pitch) and ψ (yaw) angles.
Sensors 13 15138f7 1024
Figure 8. Estimation of Φ (roll) and Ψ (yaw) angles.
Figure 8. Estimation of Φ (roll) and Ψ (yaw) angles.
Sensors 13 15138f8 1024
Figure 9. Evolution of the rate gyro bias estimate.
Figure 9. Evolution of the rate gyro bias estimate.
Sensors 13 15138f9 1024
Figure 10. Algorithm CPU usage.
Figure 10. Algorithm CPU usage.
Sensors 13 15138f10 1024
Sensors EISSN 1424-8220 Published by MDPI AG, Basel, Switzerland RSS E-Mail Table of Contents Alert
Back to Top