Open access peer-reviewed chapter

Attitude Control of a Quadcopter Using Adaptive Control Technique

Written By

Ramiro Ibarra Pérez, Gerardo Romero Galvan, Aldo Jonathan Muñoz Vázquez, Silvia Florida Melo and David Lara Alabazares

Submitted: 09 August 2017 Reviewed: 02 October 2017 Published: 20 December 2017

DOI: 10.5772/intechopen.71382

From the Edited Volume

Adaptive Robust Control Systems

Edited by Le Anh Tuan

Chapter metrics overview

2,442 Chapter Downloads

View Full Metrics

Abstract

This chapter presents an adaptive control technique to stabilize the attitude dynamics of unmanned aerial vehicle (UAV) type quadrotor in the presence of disturbances and/or uncertainties in the parameters due to changes in the payload, nonlinear actuators, and change in environmental conditions. To address the above problem, MRAC (model reference adaptive control) strategy is used. In this schema, a cost function is defined as a function of the error between the output of the system and a desired response from a reference model. Based on this error, the controller parameters are updated. To guarantee the global asymptotic stability of the system, Lyapunov’s theory is applied. Simulation results using MATLAB-Simulink platform are presented to demonstrate the convergence of the controller parameters.

Keywords

  • Quadrotor UAV
  • adaptive control
  • Lyapunov’s method
  • aircraft
  • attitude control

1. Introduction

Unmanned aerial vehicles (UAVs) are aircrafts that do not require a pilot on board to be controlled. In the beginning, they were solely used for military purposes. One of the first applications of these vehicles was aerial photography. In the 1883, an Englishman named Douglas Archibald provided one of the world’s first reconnaissance UAVs. However, it was not until the World War I that UAVs became recognized systems. Since then, they are being widely used in military missions such as surveillance of enemy activity, airfield base security, airfield damage assessment, elimination of unexploded bombs, etc.

In the last decades, advances in technology and costs reduction permitted to adopt this technology in civil applications such as aerial photography, video and mapping, pollution and land monitoring, powerline inspection, fire detection, agriculture, and among other applications [1].

Quadrotors are a kind of mini-UAV’s with vertical take-off and landing, controlled completed through four rotors mounted on each end of the crossed axes, which provide lift forces for the quadrotor move, this vehicle is very popular in the research community due to their special features like strong coupling subsystems, unknown physical parameters, and nonparametric uncertainties in inputs and external disturbances. Therefore, a suitable control system for stabilizing the closed loop control system is required; to do this, various control techniques, linear and nonlinear, have been implemented such as control PD [2, 3], control PID [4, 5], control of position and orientation by vision [6], sliding mode control [1, 7], fuzzy logic [8, 9], and adaptive control in [10].

The dynamic behavior of quadrotor has been published in varying complexity [11, 12]; particularly, the model we used is based on [13], where an extended mathematical description by the full consideration of nonlinear coupling between the axes is presented. We assume elastic deformations sufficient stiffness and realistic flight maneuvers were omitted, mass distributions of the quadrotor are symmetrical in the x-y plane, drag factor and thrust factor of the quadrotor are constant, and air density around the quadrotor is constant.

In this work, we develop an adaptive control strategy to stabilize the attitude dynamics of a quadrotor UAV. The adaptive control permit deals with modeling errors and disturbance uncertainty, variations of the mass, inertia, actuators faults, nonlinear aerodynamics, etc.

This chapter is organized as follows: Section 2 presents the mathematical model of the quadrotor obtained using Newton-Euler equations. Section 3 provides brief introduction about the adaptive control theory and the methodology used is based to obtain the adaptive law equations. In Section 4, simulations and analysis are presented to verify the performance of MRAC schema, and finally in Section 5, conclusions of this work are presented.

Advertisement

2. Mathematical model

2.1. ESC + motor + propeller

The rotors of quadrotor are modeled by

T i = K ω M s + ω M u i E1
v i = ω M s + ω M u i E2

For i = (1, 2…, 4), where ui represents the PWM input, the gain K > 0 and ωM are the rotor bandwidth, vi is the actuator dynamics. We assume K and ωM are the same for all rotors [5].

2.2. Description of Quadrotor system

The configurations of quadrotor are described in Figure 1 and consist of a body-fixed frame denoted by Fb = {Fbx , Fby  , Fbz }, the center mass that coincident with the body-frame origin denoted by Cm , the earth-fixed inertial frame is denoted by Fe = {Fex, Fey , Fez}, the position in earth-fixed inertial frame is given by a vector rI  = (x, y, z) T , four rotors denoted each one as Mi with i = (1, 2, …, 4).

Figure 1.

Quadrotor configuration.

To obtain the position of CM in the NED (North-East-Down) coordinate system with respect to the inertial frame Fe , we use the Euler angles (roll ϕ, pitch θ, yaw ψ) combined in a vector Ω = (ϕ, θ, ψ)T, where roll angle is generated by differential thrust betweet M 2 and M 4, pitch angle is generated by differential thrust between M 1 and M 3, and yaw angle is generated by diferential torque between clock wise and anticlock wise rotors, i.e., (M 1 − M 2 + M 3 − M 4). This kind of device is considered an underactuated system with six degree of freedom (DOF). Rotation matrix R is used to map from Fb to Fe, applying three consecutive rotations denoted by

R z = C ψ S ψ 0 S ψ C ψ 0 0 0 1 R y = C θ 0 S θ 0 1 0 S θ 0 C θ R x = 1 0 0 0 C ϕ S ϕ 0 S ϕ C ϕ R = R z R y R x = C ψ C θ C ψ S θ S ϕ S ψ C ϕ C ψ S θ C ϕ + S ψ S ϕ S ψ C θ S ψ S θ S ϕ + C ψ C ϕ S ψ S θ C ϕ C ψ S ϕ S θ C θ S ϕ C θ C ϕ E3

where S and C refer to sin and cos function, respectively.

2.3. Rigid body dynamics

The dynamics of a rigid body under external forces and moments in the f b can be formulated as follows [14]

m v ̇ = F i E4
J W ̇ + W × JW = M i E5

where i = (1, 2, …, 4), ∑Fi  ∈  R 3 represent the sum of thrust forces from each rotor, ∑Mi  ∈  R 3 represent the sum of moments acting on the vehicle, v is the velocity in the Fb , m is the quadrotor mass, W = (wx, wy, wz) T determines the angular velocity vector which has its origin in at the center of mass of the rigid body, and J is the inertial tensor of the symmetric rigid body around its center of mass.

To obtain the thrust force contribution of each rotor applied to Fb , we use the following formula

F i = f xi + f yi + f zi = k ω i 2 E6

with fxi force from rotor i applied in Fb respect x axes, fyi force from rotor i applied in Fb respect y axes and fzi force from rotor i applied in Fb respect z axes, ωi as rotor’s angle speed, k as proportional gain related with air density, the geometry of the rotor blade and its pitch angles. As fxi and fyi is zero, since they form an angle of 90 degrees respect to the rotor thrust, rewriting Eq. (6), we have

F i = k ω i 2   0 0 1 T E7

By transforming Fi to F e and making use of the principle of linear momentum, the following equations can be introduced for a quadrotor of mass m under gravity g :

r ¨ = 0 0 g T + R 1 4 F i m E8

The rotatory moment of the body is described by Eq. (4) can be rewrite as

J W ̇ + W × JW = M B M G E9

where MB is the vector of external torques and is composed of the thrust differences and drag moments of the individual rotors and under considerations of the rotatory directions and can be calculated by

M B = Lb ω 2 2 ω 4 2 Lb ω 1 2 ω 3 2 d ω 1 2 ω 2 2 + ω 3 2 ω 4 2 E10

where d is called drag factor and it is related with the air resistance, L is a parameter which represents the length of the lever between center of mass and the four rotors. MG is the vector of gyroscopic torques generated due to the propellers rotational movements and can be calculated by the follow formula

M G = J R W × 0 0 1 ω 1 ω 2 + ω 3 ω 4 E11

where JR represents the inertia of rotating rotors. The follow equations permit us to determine the rate of change of the Euler angles in the inertial frame Fe

Ω ̇ = H Φ W = 1 tan θ sin ϕ tan θ cos ϕ 0 cos ϕ sin ϕ 0 sin ϕ cos θ cos ϕ cos θ W E12

The relationship that maps rotor angular velocities to forces and moments on the vehicle is

u = u 1 u 2 u 3 u 4 = b b b b 0 b 0 b b 0 b 0 d d d d ω 1 2 ω 2 2 ω 3 2 ω 4 2 E13

where the variable u 1 = F 1 + F 2 + F 3 + F 4. The variables u 2 and u 3 correspond the forces from rotors necessary to generate the pitch and roll moments, and u 4 represents the yaw moment.

The translation motion is obtained combining Eqs. (3), (7), (8), and (13), as a result, we have the follow equations

r ¨ = x ¨ y ¨ z ¨ = C ψ S θ C ϕ + S ψ S ϕ u 1 m S ψ S θ C ϕ C ψ S ϕ u 1 m g C θ C ϕ u 1 m E14

On the other hand, if we assume small perturbations in hover flight, Ω ̇ W and combining Eqs. (9), (11), and (13), we obtain the follow equations

ϕ ¨ = θ ̇ ψ ̇ J y J z J x J r J x θ ̇ h u + L Jx u 2 θ ¨ = ϕ ̇ ψ ̇ J z J x J y + J r J y ϕ ̇ h u + L Jy u 3 ψ ¨ = ϕ ̇ θ ̇ J x J y J z 1 J z u 4 E15

2.4. Linearization of quadrotor dynamics

To simplify the earlier equations, we have linearized the rotatory system around hover state assuming small change in Euler angles, u 1 ≈ mg in x and y directions, cos(α) = 1, sin(α) = α and neglected the gyroscopic torques; therefore,

x ¨ = θ θ g y ¨ = ϕ g z ¨ = u 1 m g ϕ ¨ = L J x u 2 θ ¨ = L J y u 3 ψ ¨ = 1 J z u 4 E16

This work only considers the angular momentum corresponding to the orientation of the vehicle, so that the displacement in (x, y, z) axes will not be used for mathematical analysis.

Therefore, the transfer function for dynamic correspondence of orientation is expressed as

ϕ s = L s 2 J x u 2 θ s = L s 2 J y u 3 ψ s = 1 s 2 J z u 4 E17

and adding rotor’s model, we have

G s e τs = K p 1 s 2 s + a ϕ 0 0 0 K p 2 s 2 s + a θ 0 0 0 K p 3 s 2 s + a ψ E18

where K p1 = Lkϕ /Jx , K p2 = Lkθ /Jy , K p3 = Lkψ /Jz . These parametres were computed for a X4-flyer and have the following values: K p1 = K p2 = 33.23, K p3 = 16.95, aϕ  = aθ  = aψ  = 4.1 and τ = 0.017. This mathematical model will be used to synthesize the control law to stabilize the closed-loop system [15].

The overall control schema is showed in Figure 2 , where position and attitude control are presented. This schema consist in two loops, first one is used to perform the quadrotor tracking of desired trajectory rd , while the second one is used to achieve the desired Euler (ϕd , θd , ψd ). Due that we are only interested in attitude control, the above schema is redrawn as is showed in Figure 3 .

Figure 2.

Overall control system.

Figure 3.

Attitude control system of a quadrotor.

Advertisement

3. Adaptive controller design

The adaptive control is an advance control technique which provides a systematic approach for automatic adjustment of controllers in real time, in order to achieve or to maintain a desired level of control system performance, when the parameters of the plant dynamic model are unknown and/or change in time [16]. Two different approaches can be distinguished: indirect and direct approaches. In the first approach, the plant parameters are estimate online and used to calculate the controller parameters. In the second, the plant model is parameterized in terms of the controller parameters that are estimated directly without intermediate calculations involving plant parameter estimates [17].

The model reference adaptive control or MRAC is a direct adaptive strategy which consists of some adjustable controller parameters and an adjusting mechanism to adjust them. The goal of the MRAC approach is adjusting the controller parameters so that the output of the plant tracks the output of the reference model having the same reference input. The MRAC schema is combine two loops: the inner or primary loop where controller and plant are feedback as in normal loop and outer loop or also called adjustment loop where some adaptive mechanisms and a model reference are used to obtain the some performance [18]. In Figure 4 , an overall MRAC schema is presented.

Figure 4.

MRAC control schema.

This section presents the design of an adaptive controller MRAC using the Lyapunov‘s stability theory. This allows us to ensure the tracking trajectory of an X4 to our reference model and makes the system insensitive to parameter variation and external disturbances, leading the state error to zero. Based on this, the process model can be represented by state space as follows:

x ̇ = A p x + B p u E19
y = Cx E20

where Ap and Bp represent the matrix and the vector of unknown constant parameters of the system, u is the output signal of the controller, and x is the state vector.

The reference model is defined as follows:

x ̇ m = A m x m + B m u c E21
y = C m x m E22

Then, the control law is selected as:

u = L r u c Lx = θ 4 u c θ 1 x 1 θ 2 x 2 θ 3 x 3 E23

where Lr and L are the matrix containing the parameters of the controller, which can be freely selected, and uc is the reference signal.

Substituting (Eq. (22)) in (Eq. (18)), the closed loop system is expressed as follows:

x ̇ = A p B p L x + B p L r u c = A θ x + B θ u c E24

Now we introduce the error equation as follows

e = x x m E25

Differentiating the error with respect to time, we obtain:

de dt = dx dt d x m dt = Ax + Bu A m x m B m u c E26

and adding Amx and subtracting to the left side of the equation

de dt = A m e + A A m x + B B m u c E27

The error goes to zero if Am is stable and

A θ A m = 0 E28
B θ B m = 0 E29

If we assume that the closed-loop system can be described by (Eq. (14)), where the matrices A and B depend on the parameter θ, and it is some combination of Lr and L, then we can define the following Lyapunov function for the parameter adaptation law:

V = e T Pe + tr A θ A m T Q a A θ A m + tr B θ B m T Q b B θ B m E30

where P R 3 x 3 is a positive definite matrix and V is a positive definite function. If its first derivative to time V is not positive definite, then V is Lyapunov function. Now we can solve the derivative of V to time t.

dV dt = e T P A m e + e T A m T Pe + 2 tr A A m T Q a A ̇ + Pe x T + 2 tr B B m T Q b B ̇ + Pe u c T E31

where Q is a positive definite matrix such that meet the follow equation:

A m T P + P A m = Q E32

Therefore, if we choose a stable Am matrix, we will get always a P and Q positive definite matrix.

Accordingly, the derivative to time of function V is

dV dt = e T Qe E33

Where the function V is a Lyapunov function negative semi-definite ensures the output error between the real system and the reference model will tend to be zero, and the system is asymptotically stable.

Thus, we obtain the following parameter adaptation laws

d θ 1 dt = p 11 e 1 x 1 + p 12 e 2 x 1 + p 13 e 3 x 1 E34
d θ 2 dt = p 11 e 1 x 2 + p 12 e 2 x 2 + p 13 e 3 x 2 E35
d θ 3 dt = p 11 e 1 x 3 + p 12 e 2 x 3 + p 13 e 3 x 3 E36
d θ 4 dt = p 11 e 1 r + p 12 e 2 r + p 13 e 3 r E37

Then, the resulting control diagram is shown in Figure 5 .

Figure 5.

MRAC control of quadrotor: block diagram.

Advertisement

4. Simulation and analysis

This section presents several simulations test made to prove the performance of MRAC controller to stabilize a mini-UAV quadrotor. As mentioned before, only orientation dynamic (angle position, angular velocity and acceleration) are considered. Analyzing Eq. (18), it is easy to see that roll, pitch, and yaw dynamics are very similar; for this reason, only roll moment is used as example in simulation.

The test begins considering controller parameters are unknown and by using an online adaptive mechanism to determine the values that permit the convergence of plant response to reference model response. It is important to note that the MRAC approach seeks to keep the tracking error (x − xm ) equal to zero by an adjustment of the controller parameters and do not to seek to identify the real parameters of the plant.

Figures 6 8 shows a comparative between the states response of the plant and the state response of the model reference, where can be observer than all states of the plant converge asymptotical to the reference model states. To verify this, the Figures 9 11 are presented; these figures show the tracking error of states goes to zero. Additionally, in Figure 12 , the reference input is compared to the plant and model reference output.

Figure 6.

Comparison between x 1 and x m1.

Figure 7.

Comparison between x 2 and x m2.

Figure 8.

Comparison between x 3 and x m3.

Figure 9.

Error between x 1 to x m1.

Figure 10.

Error between x 2 to x m2.

Figure 11.

Error between x 3 to x m3.

Figure 12.

Roll response.

Figure 13.

Tuning of controller parameters.

Figure 14.

Simulink diagram.

Figure 13 shows the variations of the controller parameters during the adjustment process. This mechanism started many times is necessary to assure the perfect tracking of the plant to the desire response. Finally, in Figure 14 , the simulation diagram is presented.

Advertisement

5. Conclusions

This work presents an adaptive control technique to stabilize the attitude of a quadrotor UAV using MRAC schema, which requires no information of the plant model. The asymptotic stability was demonstrated using the well-known Lyapunov’s theory, obtaining in this way the adaptation law of the controller parameters. Simulations results demonstrate that the adaptive control approach proposed have a good performance to perform the asymptotic tracking of model reference output. It is important to note that the adaptive mechanism is started only when it is needed.

References

  1. 1. Austin R. Unmanned Aircraft Systems: UAVS Design, Development and Deployment. John Wiley & Sons. United Kingdom; 2010. p. 372 DOI: 10.1002/9780470664797
  2. 2. Jeong S et al. Position Control of a Quad-Rotor System. In: Kim J-H, Matson ET, Myung H, Xu P, editors. Robot Intelligence Technology and Applications. Berlin Heidelberg: Springer-Verlag; 2013; 2012. p. 971-981. DOI: doi.org/10.1007/978-3-642-37374-9_94
  3. 3. Bouabdallah S, editor. Design and control of quadrotor with application to autonomous flying [dissertation]. École Polytechnique Fédérale de Lausanne; 2007
  4. 4. Jithu G, Jayasree PR. Quadrotor modelling and control. International Conference on Electrical, Electronics, and Optimization Techniques (ICEEOT)—2016
  5. 5. Jun L, Yuntang Li. Dynamic analysis and PID control for a quadrotor. In: Proceedings of the 2011 IEEE. 2011
  6. 6. Changlong L, Jian P, Chang Y. PID and LQR trajectory tracking control for an unmanned quadrotor helicopter: Experimental studies. In: Proceedings of the 35th Chinese Control Conference. 2016; DOI: 10.1109/ChiCC.2016.7555074
  7. 7. Salazar S, Romero H, et al. Real-time stereo visual serving control of an UAV having eight rotors, In: 6th International Conference on Electrical engineering, computing science and automatic control, CCE 2009. DOI: 10.1109/ICEEE.2009.5393423
  8. 8. Bouabdallah S, Siegwart R. Backstepping and sliding-mode techniques applied to an indoor micro quadrotor. In: Proceedings of the 2005 IEEE International Conference on Robotics and Automation, ICRA 2005. DOI: 10.1109/ROBOT.2005.1570447
  9. 9. Abeywardena DMW, Amaratunga LAK, Shakoor SAA, Munasinghe SR. A velocity feedback fuzzy logic controller for stable hovering of a quadrotor UAV. In: International Conference on Industrial and Information Systems (ICIIS), 2009. DOI: 10.1109/ICIINFS.2009.5429800
  10. 10. Theerasak S, Pined L, Wonlop C, et al. Path tracking of UAV using self-tuning PID controller based on fuzzy logic, In: Proceedings of SICE Annual Conference 2010
  11. 11. M Imran R, Akhtar S. Adaptive control of a quadrotor with unknown model parameters In: 9th International Bhurban Conference on Applied Sciences and Technology (IBCAST) 2012. DOI: 10.1109/IBCAST.2012.6177518
  12. 12. Bouabdallah S, Murrieri P, Siegwart R. Design and control of an indoor micro quadrotor. Proceedings of IEEE International Conference on Robotics and Automation, ICRA '04. 2004. DOI: 10.1109/ROBOT.2004.1302409
  13. 13. Sanca AS, Alsina PJ, Cerqueira JJ. Dynamic modelling of a quadrotor aerial vehicle with nonlinear inputs. In: IEEE Latin American Robotic Symposium, 2008. LARS '08. 2009. DOI: 10.1109/LARS.2008.17
  14. 14. Schreier M. Modeling and adaptive control of a quadrotor. International Conference on Mechatronics and Automation (ICMA), 2012. 2012; DOI: 10.1109/ICMA.2012.6282874
  15. 15. Tao G, Selfridge Justin M. A multivariable adaptive controller for a Quadrotor with guaranteed matching conditions. In: American Control Conference (ACC) Portland, Oregon, USA. 2014. DOI: 10.1109/ACC.2014.6859355
  16. 16. Lara D, Romero G. Onboard system for flight control of a small UAV. In: World Automation Congress (WAC), 2012. 04 October 2012. Puerto Vallarta, Mexico. Mexico: IEEE. 2012
  17. 17. Landau ID, Lozano R, M’Saad M, Karimi A. Introduction to adaptive control. In: Adaptive Control: Algorithms, Analysis and Applications. London: Springer; 2011. p. 1-33. DOI: 10.1007/978-0-85729-664-1
  18. 18. Ioannou P, Sun J. Robust Adaptive Control. Mineola, New York: Dover Publications; 2013. p. 848

Written By

Ramiro Ibarra Pérez, Gerardo Romero Galvan, Aldo Jonathan Muñoz Vázquez, Silvia Florida Melo and David Lara Alabazares

Submitted: 09 August 2017 Reviewed: 02 October 2017 Published: 20 December 2017