Mathematical Problems in Engineering

Volume 2016, Article ID 8573235, 11 pages

http://dx.doi.org/10.1155/2016/8573235

## Attitude Optimal Backstepping Controller Based Quaternion for a UAV

^{1}Preparatory School Oran, Lahn Laboratory, 31000 Oran, Algeria^{2}University of Sciences and Technology Oran MB, Lahn Laboratory, BP 1505, El M’naouer, 31000 Oran, Algeria^{3}Laboratoire d’Ingénierie des Systèmes de Versailles, UVSQ, 10-12 avenue de l’Europe, 78140, France

Received 27 July 2015; Revised 7 November 2015; Accepted 11 February 2016

Academic Editor: Qingling Zhang

Copyright © 2016 Kaddouri Djamel 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 hierarchical controller design based on nonlinear theory and backstepping technique is developed for a nonlinear and coupled dynamic attitude system using conventional quaternion based method. The derived controller combines the attractive features of optimal controller and the advantages of the backstepping technique leading to a control law which avoids winding phenomena. Performance issues of the controller are illustrated in a simulation study made for a four-rotor vertical take-off and landing (VTOL) aerial robot prototype known as the quadrotor aircraft.

#### 1. Introduction

Control of aerial robots is highly complex and has been the subject of many research papers. The research on Mobile Robots with high degree of autonomy becomes possible, due to the development and reduction of costs on computer, electronic, and mechanic systems [1]. Euler-angle based and conventional quaternion based methods have been extensively employed for spacecraft attitude control. However, the first method suffers from singularity that prohibits large orientation maneuvers, while the second exhibits ambiguity and unwinding phenomena; hence the advantage of a four-parameter attitude representation such as quaternions is the avoidance of singular points in the representation, together with better numerical properties. The attitude control problem of a rigid body has been investigated by several researchers and a wide class of controllers has been developed. In this context Fortuna et al. [2] propose an approach based on two parallel controllers derived in quaternion algebra; a PD (proportional and derivative) feedback controller and a feedforward controller implemented by means of a hypercomplex multilayer perceptron neural network. The proposed controller in [3] is based upon the compensation of the Coriolis and gyroscopic torques and the use of a feedback structure, where the proportional action is in terms of the vector quaternion and the two derivative actions are in terms of the airframe angular velocity and the vector quaternion velocity. Wang et al. in [4] treat how to improve attitude control performances of roll and pitch channels under both small and large amplitude manoeuvre flight conditions. Zhao et al. in [5] discuss trajectory tracking control for vertical take-off and landing (VTOL) Unmanned Aerial Vehicles (UAVs) using the command filtered backstepping technique and a second-order quaternion filter are developed to filter the quaternion and automatically compute its derivative, which determines the commanded angular rate vector. In Fresk and Nikolakopoulos approach in [6] both the quadrotor’s attitude model and the proposed nonlinear proportional squared (P2) control algorithm have been implemented in the quaternion space, without any transformations and calculations in Euler’s angle space or Direct Cosine Matrix. Moreover Honglei et al. [7] derive a backstepping-based inverse optimal attitude controller which has the property of a maximum convergence rate in the sense of a control Lyapunov function under input torque limitation and the inverse optimal approach is employed to circumvent the difficulty of solving the Hamilton-Jacobi-Bellman (HJB) equation. Likun and Qingchao in [8] construct a Lyapunov function based on attitude tracking errors and angular rates. The stabilizing feedback control law is deduced via Lie derivation of the Lyapunov function. A virtual controller and some command references are introduced by Sun et al. in [9] to asymptotically stabilize the system of the tracking error dynamics. Then, the actual controller and command references are derived by solving a system of linear algebraic equations, such as attitude stabilization, and [10] develops a control law that uses both optimal control and finite-time control techniques which can globally stabilize the attitude of spacecraft system to a set of equilibria. A solution for robust spacecraft attitude control using a nonlinear control law to stabilize the maneuver in the presence of external disturbance is investigated by [11]. Moreover, a nonlinear output feedback controller is proposed and coupled to a high-order sliding mode estimator to regulate a UAV (Unmanned Aerial Vehicle) in the presence of the unmatched perturbations [12]. Many searchers like [13] used the globally non-singular unit quaternion representation in a Lyapunov function candidate. Guilherme et al. perform a control structure through a nonlinear controller to stabilize the rotational movements and a control law based on backstepping approach to track the reference trajectory [14].

Combining the backstepping technique with technique and using the conventional quaternion based methods to stabilize the attitude of spacecraft system to a set of equilibria is the goal of this work. The control strategy must overcome some difficulties such as the highly nonlinear and coupled dynamics more over the dynamic, complex, and unstructured environments which may cause unpredictable disturbances to the control system. So dealing with some states in each step will reduce difficulties and make them restrained. Using the optimal condition of Pontryagin and the optimal control approach to design a robust control law for attitude motion control it has been shown that the resulting control law has excellent performance, as demonstrated by simulations. The paper is outlined as follows. The formulation of the problem is developed in Section 2. Optimal attitude control /backstepping with some mathematical preliminaries are developed in Section 3. Simulation results applied for the quadrotor are discussed in Section 4. Finally, Section 5 presents some conclusions.

#### 2. Problem Formulation

Let be the quaternion and the dynamic attitude system represented aswhere denotes the inertia matrix of the body and satisfies , , and is the angular velocity vector of the body in the body-fixed frame, is the control torque vector, and is the external disturbance vector. The attitude quaternion is defined by and the Euclidean norm , . If is the desired quaternion written in dynamic form as with , is the desired angular velocity. The quaternion error in multiplicative form isor

Then the derivative of the above equation giveswhich leads tothen, LetwithUsing Rodriguez formula one can define the rotation matrix in quaternion representation [15, 16]:Let an auxiliary angular velocity be defined as so the system in quaternion error can be represented asfrom (9) one can write is skew-symmetric which satisfies the condition . From (11) we get is the cross product. Finallyusing the skew matrix we obtainLetthen (16) can be written asIn that case (18) can be written aswithtaking , the development of (12) will lead to the kinematic equation of the rigid body motion described in terms of the attitude quaternion: is the kinematics Jacobian matrix (see [17]) defined asand the matrix denotes a skew-symmetric matrix given by

Let

with

So the system in hierarchical form based on (22) and (20) will be presented asThe performance specification in steady state must lead to the equilibrium pointThis section is a necessary introduction for the following section which deals with the optimal backstepping technique based on the model presented in (26), leading to an optimization problem with constraints and a backstepping controller. The Hamiltonian equation and Riccati formula solution is developed meanwhile.

#### 3. Optimal Attitude Control

In this section we are interested in optimal control of systems modeled by differential equations, in finite dimension, defined as follows:where is the state vector, is the time variable, and is the control input. For such systems, the goal is to determine a controller to bring the system from an initial set to a final set, by minimizing criterion called the cost. In this case, we define the optimal control problem, as

Let the cost function with constraint be presented as Withwhere , is a normed space. Here, is the space of continuous functions with continuous derivatives and is the space of continuous functions defined on . We consider a new function , , where is the space of differentiable functions and the vector is known as the costate vector. This new function allows us to move from solving an optimization problem with constraints to an optimization problem without constraints. Consider the cost function of the formWe note the Hamiltonian function as follows:

The key point of this theory is the Pontryagin Maximum principle formulated in 1956, according to which the optimal control minimizes the function with the following optimality condition:The principle goal in designing an optimal control law is to make the steady state converge to the closer equilibrium. The controller is established into two steps (as classical backstepping) passing through a virtual controller and a matrix positive definite computed through Riccati equation. The local stabilizability and detectability are then ensured by the existence of a proper solution of the algebraic Riccati equations. Assuming that system (26) is stabilizable, then the following theorem is established.

Theorem 1. *Consider the hierarchical system (26) with the assumption that pair has to be stabilizable; then there exists a virtual control and a positive semidefinite matrix such that the subsystem can be represented in the form to . is the degree of differentiability of the system (; in our case), with the new variable defined asand the virtual backstepping controller which asymptotically stabilizes the disturbance free system*

*Proof. *In backstepping controller each step will be treated as a submodel. The link between different submodels is made using backstepping technique. So let model (26) be represented in error form asdifferentiating (38) givesand for every , and thenSince the variable of differential depends essentially on the variable (actual virtual control) and (past virtual control), then one can introduce by analogy the variable in model (40). Let the model with the new variable controlwith the new variable control defined asChosing as with represents the step number. The for will be computed by using recurrence formula; hence the Hamiltonian function will be defined as replacing from (41) givesUsing the optimality conditions for control law leads tosince thenequaling (42) and (48) will give So the virtual control can now be computed:Equation (38) will help to extract the past from recurrence techniquereplacing from (50) givesusing (40) leads to then is evaluated:by recurrence isIntroducing the new computed variables in the Hamiltonian (45) will giveTaking the worst case for in linear form [18]:So (56) becomesApplying the optimality conditions from (58) leads toFor the final step is computed:Taking (47) and differentiating for and : comparing with (60) and (62) leads totaking thenfinally the Riccati equation before the final step will beLet us compute the Riccati equation for the final step using the computed value :replacing the value of from (48): then Finally the Riccati equation is formulated asand the equation of becomesthis will conclude the proof.

*Step 1. *The algorithm (hierarchical) for computing control law needs initialization. Let ; ; ; ; ; ; and taking the virtual control then the submodel will be Let the model with the new variable controlwith Taking the Hamiltonian will be for this caseapplying the optimality conditions:control law is deduced from Hamiltonian equation which reflects the control law (optimality condition): for ;differentiating (78) and comparing with (77) lead tothe Riccati equation becamewith being a symmetric matrix and being a diagonal matrix; then the control law is calculated asfinally the control law is computed:

*Step 2. *Taking the second submodelthe model presented in variable form isthis equation can be written:taking the worst case for withLet by recurrence the past is calculated:the Hamiltonian will beApplying the optimality conditions for and will giveknowing thatthen the control law is deduced from Hamiltonian equation (optimality condition):thenhence Similarly, Hence the Riccati equation is determined. is chosen to be a symmetric matrix. So the control law is in other way So replacing by its value the real control is finally computed:

#### 4. Simulation Results

The parameters of the model are , the parameters of the controller are , , , and . Note the quaternion can be represented as , , and hence the initial location can be easily seen through .

*Case 1. *Let the initial condition of the quaternion error be , which corresponds to an angle ; the matrices and are computed through Riccati equation and is chosen to achieve good performances. For that case and will be stabilized to . Figures 1, 2, and 3 show the attitude responses and the control inputs, which gives a convergence in short time. These results are nearby the normal reflect when analyzing the initial location of which lies in the first quadrant.