Mathematical Problems in Engineering

Volume 2013 (2013), Article ID 328974, 12 pages

http://dx.doi.org/10.1155/2013/328974

## Second-Order Geometric Sliding Mode Attitude Observer with Application to Quadrotor on a Test Bench

College of Mechatronics Engineering and Automation, National University of Defense Technology, Changsha, Hunan 410073, China

Received 18 March 2013; Revised 14 May 2013; Accepted 3 June 2013

Academic Editor: Rongni Yang

Copyright © 2013 Honglei An et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

A sliding mode observer design framework is proposed based on the Lie group method of numerical integration on manifolds, and a Second-Order Geometric Sliding Mode Attitude Observer (SOGSMAO) is designed for angular velocity estimation of quadrotor attitude. The algorithm constructs feedback in the angular velocity space and the space of equivalent Lie algebra of unit quaternion space, respectively. It avoids not only the complexity of constructing feedback in unit quaternion space but also the process of mandatory rescaling which is seen to deteriorate the accuracy of the angular velocity estimates during sliding. The performance of SOGSMAO is compared with traditional quaternion based sliding mode observer in which multiplicative quaternion correction is used and the results show that SOGSMAO gains better tracking performance. Then SOGSMAO is realized on a test bed and the effectiveness of the observer algorithm is verified by experimental studies.

#### 1. Introduction

The rotational motion of a rigid body describes the orientation (attitude) of the rigid body with respect to inertial reference. And attitude control is the process of orienting the rigid body in a specified predetermined direction. Attitude control system is an important subsystem in aircrafts, spacecrafts, and satellites and is responsible for pointing and slewing [1–5]. In the case of quadrotor control, translational outer loop is usually realized on the basis of rotational inner loop, as a result of its property of underactuatation [6–9]. Compared with fixed-wing aircraft, rotorcraft has special advantages in the city and indoor environment due to the ability of VTOL (vertical take-off and landing) and hovering flight. As a new kind of rotorcraft, quadrotor has some unique advantages over other traditional rotorcrafts. Firstly, it is more convenient that swash plate and mechanical linkages are not necessary. Secondly, it is much safer in the indoor flying because its propellers are smaller and can be wrapped up. In addition, it has greater thrust-weight ratio and better maneuver performance. Therefore, a great deal of work has been done in quadrotor control.

Most of the attitude control algorithms require the attitude and angular rate. These measurements are obtained from a variety of sensors and estimation techniques. However, the tendency of building smaller satellites and aircrafts limits the number of sensors and the on-board processing capability. So attitude control system requires computationally simple yet effective algorithms without sophisticated measurement instrumentation, particularly gyroscopes [10–14]. Gyroscopes provide direct angular rate measurements but are costly and heavy require significant power consumption, and have high failure tendencies. Lizarralde and Wen use a velocity filter to stabilize attitude without angular velocity [12]. Another solution is to estimate the angular velocity using an extended Kalman filter [15] or a nonlinear observer [13, 14]. In this paper the problem of estimating angular velocities of quadrotor is addressed by nonlinear observers. Estimating angular velocities eliminates the use of gyros and can also confirm the accuracy of gyro readings in case of possible gyro failure and attitude estimates when sensor measurements are not available.

In all kinds of nonlinear observers, sliding mode observer has special advantages. Sliding mode technique is widely known because of its high accuracy and robustness with respect to various internal and external disturbances [16]. Its application is not limited to mechanical systems. Wu and Ho design an SMC for singular systems which can be a natural representation of economic systems, power systems and circuits systems [17]. In addition, there are a wide range of analysis methods such as the Lyapunov method, equivalent control method and dissipativity based method [18, 19]. In the area of observer application, the sliding mode observer has the feature of finite-time convergence, so it is not needed to prove the separation principle when implementing a sliding mode observer in a control system.

In all representations of the attitude, the unit quaternion is a pervasive one [20–22]. Different from minimal attitude representations, such as Euler angles, which have the disadvantages of singularities and complicated trigonometric expressions, the unit quaternion provides a globally nonsingular representation of the attitude. Compared with classical direction cosine matrix, it has only 4 numbers so that the multiplication and propagation rule can be calculated more efficiently. However, unit quaternion is regarded only as an algebraic tool in traditional sliding mode observer algorithms without considering its geometric structure [9, 10]. The classical discrete integral method is used directly on each element of unit quaternion, and the quaternion vector must be normalized in each estimation cycle. In [11, 23] the multiplicative quaternion correction is used instead of the additive quaternion correction, but the discontinuous feedback term is applied in unit quaternion space and it must be normalized too.

Actually, unit quaternion keeps the structure of , the special unitary group, which is a 2 to 1 cover of [21]. The add operation is not a group operation of unit quaternion, so the group structure is not conserved when additive discrete integral method is used. And the normalization is seen to deteriorate the accuracy of the angular velocity estimates during sliding [10]. So a main motivation of this work is to construct an observer design frame from the geometric point of view, such that it is unnecessary to construct sliding mode feedback in unit quaternion space directly or the process of mandatory rescaling can be avoided.

Inspired by the ideological of equivariant mapping in the Lie group method of numerical integration, this work extends the design method of sliding mode observer based on unit quaternion. The kinematic equation in unit quaternion space is transformed to an equivalent differential equation evolving in the Lie algebra space of unit quaternion, and the feedback is constructed in the Lie algebra space. An appealing feature of Lie algebra space is that it is a vector space in which the classical numerical method can be applied in approximately solving the transformed equation. So it is unnecessary to construct sliding mode feedback in unit quaternion space directly in the proposed algorithm. In addition, the process of mandatory rescaling which the traditional methods need in each integration step can be also avoided.

The main contributions of this work are the following. First, a sliding mode observer design framework is proposed based on the Lie group method of numerical integration on manifolds. In this frame work, the feedback is constructed in vector spaces, so traditional sliding mode observer can be extended easily. Second, a Second-Order Geometric Sliding Mode Attitude Observer (SOGSMAO) is designed for angular velocity estimation of quadrotor attitude. The effectiveness of SOGMAO algorithm is exemplified by simulation and experiment.

This paper is organized as follows. Based on the assumptions of single rigid body and symmetrical structure, a mathematical model of quadrotor on the attitude platform is given in Section 2. Then SOGSMAO is designed using Lie group method of numerical integration and sliding mode technique in Section 3. Section 4 conducts a simulation in which a comparison is made between SOGSMAO and traditional quaternion based sliding mode observer with multiplicative quaternion correction. In Section 5, the performance of the proposed method is evaluated with real experimental data. At last, the conclusion is outlined in Section 6.

#### 2. Attitude Dynamics of Quadrotor

In this section the mathematical model of quadrotor on the test bench is given. The model consists of the kinematics of unit quaternion and the dynamics of single rigid body. In simulation this model is used for providing ideal attitude and angular velocity. And in the process of observer design, the model is a necessity.

##### 2.1. Unit Quaternion Kinematics

A unit quaternion is a complex with four parameters. It has the norm of constant one and can be considered as a point of the unit sphere

Let represent its vector part, that is, . Then unit quaternion can be written in the following form:

Given a unit quaternion, there is a correspondence between unit quaternion and rotation transformation where

Noticing that , so the unit sphere represented by unit quaternion is a double cover of the attitude space . The phenomenon is more clearly using the angle form of unit quaternion. Euler’s theorem states that any rotation in space can be achieved through rotating angle around an eigenaxis of , then unit quaternion can be written as

It is obvious that rotating angle around eigenaxis is equivalent to a rotation of angle around eigenaxis of . In Figure 1, point and point are different by quaternion representation but have the same physical meaning. Actually, and have the same physical meaning.

The conjugate of a unit quaternion is

Given two unit quaternion and , the multiplication is defined as

Unit quaternion multiplication is equivalent to the multiplication of rotation matrix. If and correspond to rotation matrices and in , then there are the following correspondences: where .

When a rigid body is rotating with angular velocity vector , the time derivative of unit quaternion can be given by the unit quaternion propagation rule as follows:

##### 2.2. System Model

Two coordinate frames, the inertial coordinate frame and the body coordinate frame, are employed for modeling the quadrotor attitude system. As seen in Figure 2, the origin of the body coordinate frame is located in the center of the crossbeam of quadrotor, axis points towards propeller 1, axis is perpendicular to the crossbeam plane, and axis three is to form a right-handed coordinate system.

The quadrotor dynamics are based on two assumptions.(1)Quadrotor is a rigid body.(2)The small errors in manufacturing and installing the vehicle bodies are not considered, so the quadrotor is assumed to be symmetric.

Based on assumption one, the following mathematical model can be derived from Newton-Euler equations and quaternion kinematics:where represents attitude quaternion of body coordinate frame with respect to inertial coordinate frame, is angular velocity in body coordinate frame, and is the torque acting on the quadrotor.

From the second assumption, the correspondence between four propeller thrusts and the torques acting on the quadrotor is given as follows: where is the total thrust, is the distance between axis of propeller and the center of crossbeams, and is the propeller torque thrust ratio.

Our model does not include the propeller gyroscopic torque and flapping dynamic term, thus consists of three axis control torque , ,

Considering the low-speed characteristic of quadrotor, the following simplified equation is used to derive the propeller thrust: where is a constant coefficient.

#### 3. Angular Rates Observer Design on Lie Group

Unit quaternion space is a nonlinear manifold . In , classical numerical methods cannot conserve the geometric structure of the original manifold, so a rescaling process must be added which reduces the accuracy of the algorithm and increases the cost of computation. Actually, since the add operation is not a group operation of unit quaternion, it is meaningless in geometric point of view to apply classical numerical methods in .

To solve this problem, a frame work of designing sliding mode observer is proposed using the Lie group method of numerical integration. On the basis of equivariant mapping ideological, the kinematic equation in unit quaternion space is transformed to an equivalent differential equation evolving on the Lie algebra space of unit quaternion, and the feedback is constructed in the Lie algebra space.

##### 3.1. Lie Group Method of Numerical Integration

In this section, only main results of the approach are given, and more detailed material and proofs could be found in [24].

*Definition 1 (equivariant map). *Let and be manifolds and let be a Lie group which acts on by and on by . A smooth map is called equivariant with respect to these actions if, for all

That is, the following diagram commutes:
(15)

From the definition of an action of on , we can get an equivariant map with respect to the left translation action of on itself and an action of on

It is known that there is a local coordinate map on where is the Lie algebra space of , the most typical is exponential map . At this point, we need to find an action of on such that will be an equivariant map with and the left action of on itself

In the case where is the exponential map, is nothing else than the well-known Baker-Campbell-Hausdorff (BCH) formula
where is called the logarithm map.

Since composition of two equivariant maps is an equivariant map, we can construct an equivariant map from to with respect to the action on and on . That is, the following diagram commutes
(19)

*Definition 2 (relatedness of vector fields). *Let be a smooth map between manifolds. The vector fields on and on are called -related, denoted by , if .

The definition means that the following diagram commutes:
(20)

Let and be two flows on and , respectively, generated by the elements and the action on and on of the Lie group . The main idea is to solve for a flow on a simpler manifold so that the effect is the same as if one solved for the flow on .

Theorem 3.6 of [25] stated that if and only if is an equivariant map, then the infinitesimal generators of the action with respect to the same element are-related vector fields. Thus, the infinitesimal generators of the flows of and are -related, that is,

That is, the following diagram commutes:
(22)

Now, since the infinitesimal generators and on and respectively is -related, the differential equation on can be translated to a equivalent system on with the selected . So the differential equation in Lie algebra space can be solved firstly, and the solution of differential equation in corresponding manifold space can be gained.

##### 3.2. Cayley Transform

The kinematics of unit quaternion can be rewritten as where is the Lie algebra of unit quaternion

Then the solution of the differential equation (23) is

From the ideological of equivariant mapping, the Lie algebra space of unit quaternion is equivalent to unit quaternion space through equivariant mapping . And satisfies the following differential equation:

In every integral step, the maps of and must be solved. But in engineering practice the exact numerical solution of the two maps cannot be computed, and it is usually replaced by some approximate solution. This paper develops integration based on Cayley transform which would entail savings with respect to computational costs because of the less expense in computing the Cayley transform as compared to the exponential map.

The Cayley transform, , is defined as

The corresponding vector field on the Lie algebra is calculated to be where denotes the matrix commutator and “” denotes matrix multiplication.

##### 3.3. Second-Order Geometric Sliding Mode Observer Design

The system model is

Define the error of attitude between estimated attitude and the actual one

When estimated value is equivalent to the actual one, that is, , , and when , represent a rotation of angle around axis , then is considered as feedback variable. Since the attitude of quadrotor is the only measurable output, the sliding manifold is taken as .

Consider the first derivative of the sliding manifold

It should be noted that is not included explicitly. But is included in the first derivative of the sliding manifold, so will be included in the second derivative of the sliding manifold, and its sliding order is 2.

The Second-Order Sliding Mode Observer structure in [22] is where

Then the structure of unit quaternion based SOGSMAO can be designed as where

The function is an extended sign function for multidimensional situation. Since the sign function can be seen as the direction function of one dimension, that is, we extend it to the situation of three dimensions as

Based on the Lie group method of numerical integration, the algorithm of SOGSMAO can be transformed to the discrete form as follows: where represents time interval between integral steps.

#### 4. Simulation

In this section, the performance of the SOGSMAO is examined in the environment of MATLAB/Simulink. And a comparison is made between SOGSMAO and traditional quaternion based sliding mode observer with multiplicative quaternion correction.

The ideal attitude and angular velocity data is obtained from the model of quadrotor. The inertial parameters used in the simulation are

The ideal curves are gained from a simulation model in which the initial states are

And the torques acting on the model are

The sampled data of system states is shown in Figure 3 (the sample time is 0.02 second).

Observers use attitude data to estimate angular velocity of the quadrotor. The algorithm of SOGSMAO rewritten here is

And the simulation result of SOGSMAO algorithm is shown in Figure 4.

The traditional quaternion based sliding mode observer algorithm with multiplicative quaternion correction can be given as

And the simulation result of traditional algorithm is shown in Figure 5.

Comparing the results of SOGSMAO algorithm and traditional algorithm for estimating the angular velocity in Figures 4 and 5, it is clear that SOGSMAO algorithm has a better tracking performance while it avoided the process of mandatory rescaling.

Since the sign function would cause a high frequency oscillation, a low pass filter must be added for removing chattering while applying the SOGSMAO algorithm. The filtered data of estimated angular velocity is compared with the ideal angular velocity in Figure 6.

#### 5. Experiment on the Test Bench Quadrotor

A real test was carried out to evaluate the performance of the proposed SOGSMAO. The test configuration is shown in Figure 7. The equipped devices include a posture platform, aircraft body, onboard controller, attitude and heading reference system (AHRS), wireless serial communication interface, remote control and receiver, and a computer.

Aircraft body is selected to be the XAircraft X-650 quadrotor which is made by carbon fiber material, equipped with four brushless DC motor and motor speed control device. The empty weight is 800 g, and maximum single propeller thrust is 4N. Attitude and Heading Reference System is the Xsens MTi inertial measurement unit (IMU) which can provide 3 axes drift-less orientation and 3 axes calibrated angular velocity. Its maximum update rate is 100 Hz with 0.5 degree attitude measure accuracy, 1 degree heading measure accuracy, and 300 degrees per second maximum measurable angular velocity. Remote control and receiver are WFLY FT06-A with 5-way continuous pulse channel and a switching channel. TI’s TMS320F2809 chip with 100 MHz core frequency is the core of onboard controller.

The connection diagram of the experimental devices is shown in Figure 8. In every control cycle (20 ms) F2809 chip is interrupted to receive orientation and angular velocity from IMU, then calculate the control pulse width and transfer it to motor speed control devices. Outside the control loop, F2809 is interrupted to turn parameters and send a set of state data to the computer every 100 ms. The remote control instruction is received in the same interrupter program.

In the experiment, the sampled data of attitude and angular velocity is gained through wireless serial port with a sample time of 0.02 second (Figures 9 and 10).

The filtered data of estimated angular velocity is compared with the actual angular velocity in Figure 11. The results show good tracking performance of the observer, which can meet the requirements of control applications in computational burden.

#### 6. Conclusions

The problem of estimating angular velocities of quadrotor is addressed with only attitude measurement in this work. Different from other quaternion based sliding mode observers in which the unit quaternion is considered as an algebraic tool, the proposed sliding mode observer uses the unit quaternion as a nonlinear manifold. Based on the ideological of equivariant mapping, the kinematic equation in unit quaternion space is transformed to an equivalent differential equation evolving on the Lie algebra space of unit quaternion, and the feedback is constructed in the Lie algebra space. The designed algorithm avoids not only the complex sliding mode feedback in unit quaternion space but also the process of mandatory rescaling which the traditional methods need in each integration step. The simulation and experimental results show that the algorithm of Second-Order Geometric Sliding Mode Observer is effective, and can meet the requirements of control applications in computational burden.

The proposed observer design framework has a wide range of applications. A variety of nonlinear observers can be designed based on the framework. In addition, the proposed observer design framework cannot only design the angular rates observer but also design disturbance observer for feedforward compensation.

#### Acknowledgments

The authors would like to thank Mr. Wanli Li in NUDT for providing advices and Dr. Tao Shen and Baoquan Song in NUDT for the help of constructing the test bench.

#### References

- R. Ahmed, D.-W. Gu, and I. Postlethwaite, “A case study on spacecraft attitude control,” in
*Proceedings of the 48th IEEE Conference on Decision and Control held jointly with 28th Chinese Control Conference (CDC/CCC '09)*, pp. 7345–7350, Shanghai, China, December 2009. View at Publisher · View at Google Scholar · View at Scopus - R. Zhang, Q. Quan, and K.-Y. Cai, “Attitude control of a quadrotor aircraft subject to a class of time-varying disturbances,”
*IET Control Theory & Applications*, vol. 5, no. 9, pp. 1140–1146, 2011. View at Publisher · View at Google Scholar · View at MathSciNet - A. Inoue, M. Deng, T. Harima, S. Nakao, and N. Ueki, “Attitude control system design of a helicopter experimental system,” in
*Proceedings of the IEEE International Conference on Industrial Technology (ICIT '05)*, pp. 1240–1245, December 2005. View at Publisher · View at Google Scholar · View at Scopus - N. M. Horri, P. L. Palmer, and M. R. Roberts, “Optimal satellite attitude control: a geometric approach,” in
*Proceedings of the IEEE Aerospace Conference*, Big Sky, Mont, USA, March 2009. View at Publisher · View at Google Scholar · View at Scopus - J. T.-Y. Wen and K. Kreutz-Delgado, “The attitude control problem,”
*IEEE Transactions on Automatic Control*, vol. 36, no. 10, pp. 1148–1162, 1991. View at Publisher · View at Google Scholar · View at Zentralblatt MATH · View at MathSciNet - Z. Fang, X.-Y. Wang, and J. Sun, “Design and nonlinear control of an indoor quadrotor flying robot,” in
*Proceedings of the 8th World Congress on Intelligent Control and Automation (WCICA '10)*, pp. 429–434, Jinna, China, July 2010. View at Publisher · View at Google Scholar · View at Scopus - E. Stingu and F. Lewis, “Design and implementation of a structured flight controller for a DoF quadrotor using quaternions,” in
*Proceedings of the 17th Mediterranean Conference on Control & Automation*, Thessaloniki, Greece, June 2009. - T. Madani and A. Benallegue, “Control of a quadrotor mini-helicopter via full state backstepping technique,” in
*Proceedings of the 45th IEEE Conference on Decision and Control (CDC '06)*, pp. 1515–1520, San Diego, Calif, USA, December 2006. View at Scopus - D. Lee, H. J. Kim, and S. Sastry, “Feedback linearization vs. adaptive sliding mode control for a quadrotor helicopter,”
*International Journal of Control, Automation and Systems*, vol. 7, no. 3, pp. 419–428, 2009. View at Publisher · View at Google Scholar · View at Scopus - K. Köprübasi and M.-W. L. Theint, “Attitude and angular rate estimation using the Sliding Mode Observer with additive quaternion corrections,” in
*Proceedings of the American Control Conference*, pp. 3302–3307, Minneapolis, Minn, USA, June 2006. View at Scopus - K. Köprübasi and M.-W. L. Thein, “Attitude and angular rate estimation using the sliding mode observer with multiplicative quaternion corrections for the Cooperative Astrophysics Technology SATellite (CATSAT),” in
*Proceedings of the American Control Conference*, pp. 1736–1741, Minneaolis, Minn, USA, June 2006. View at Scopus - F. Lizarralde and J. T. Wen, “Attitude control without angular velocity measurement: a passivity approach,”
*IEEE Transactions on Automatic Control*, vol. 41, no. 3, pp. 468–472, 1996. View at Publisher · View at Google Scholar · View at Zentralblatt MATH · View at MathSciNet - U. Jorgensen and J. T. Gravdahl, “Observer based sliding mode attitude control: theoretical and experimental results,”
*Modeling, Identification and Control*, vol. 32, no. 3, pp. 113–121, 2011. View at Google Scholar - J. F. Vasconcelos, R. Cunha, C. Silvestre, and P. Oliveira, “A landmark based nonlinear observer for attitude and positiong estimation with bias compensation,” in
*Proceedings of the 17th World Congress, The International Federation of Automatic Control*, Seoul, Republic of Korea, July 2008. - B. O. Sunde,
*Sensor modeling and attitude determination for micro-satellite [M.S. thesis]*, NTNU, 2005. - C. Edwards and S. K. Spurgeon,
*Sliding Mode Control: Theory and Applications*, Taylor & Francis, 1998. - L. Wu and D. W. C. Ho, “Sliding mode control of singular stochastic hybrid systems,”
*Automatica*, vol. 46, no. 4, pp. 779–783, 2010. View at Publisher · View at Google Scholar · View at Zentralblatt MATH · View at MathSciNet - L. Wu, W. X. Zheng, and H. Gao, “Dissipativity-based sliding mode control of switched stochastic systems,”
*IEEE Transactions on Automatic Control*, vol. 58, no. 3, pp. 785–791, 2013. View at Google Scholar - V. I. Utkin,
*Sliding Modes in Control and Optimization*, Springer, Berlin, Germany, 1992. View at MathSciNet - D. Fragopoulos and M. Innocenti, “Stability considerations in quaternion attitude control using discontinuous Lyapunov functions,”
*IEE Proceedings: Control Theory and Applications*, vol. 151, no. 3, pp. 253–258, 2004. View at Publisher · View at Google Scholar · View at Scopus - H. Dapeng, W. Qing, and L. Zexiang, “Attitude control based on the lie-group structure of unit quaternions,” in
*Proceedings of the 26th Chinese Control Conference (CCC '07)*, pp. 326–331, Zhangjiajie, Hunan, China, July 2007. View at Publisher · View at Google Scholar · View at Scopus - J. C. K. Chou, “Quaternion kinematic and dynamic differential equations,”
*IEEE Transactions on Robotics and Automation*, vol. 8, no. 1, pp. 53–64, 1992. View at Publisher · View at Google Scholar · View at Scopus - H. Fourati, N. Manamanni, A. B. Jemaa, L. Afilal, and Y. Handrich, “A quaternion-based complementary sliding mode observer for attitude estimation: application in free-ranging animal motions,” in
*Proceedings of the 49th IEEE Conference on Decision and Control (CDC '10)*, pp. 5056–5061, Atlanta, Ga, USA, December 2010. View at Publisher · View at Google Scholar · View at Scopus - A. Iserles, H. Z. Munthe-Kaas, S. P. Nørsett, and A. Zanna, “Lie-group methods,” in
*Acta Numerica, 2000*, vol. 9, pp. 215–365, Cambridge University Press, Cambridge, UK, 2000. View at Publisher · View at Google Scholar · View at Zentralblatt MATH · View at MathSciNet - K. Engo, “On the construction of geometric integrators in the RKMK class,” Tech. Rep. 158, Department of Computer Science, University of Bergen, 1998. View at Google Scholar