Attitude Control of a Quadrotor İ. Can Dikmen Air Force Academy ASTIN Istanbul/TURKEY
[email protected]
Aydemir Arısoy Air Force Academy Dept. of Electronics Eng. Istanbul/TURKEY
[email protected]
Abstract— This study includes altitude stabilization, hovering control any desired position and attitude control of quadrotor. Classically PD controller derived and applied to this system. Inverse dynamic control, feedback linearization control and sliding mode control methods have used to derive as nonlinear controllers. Linear and nonlinear control techniques applied to attitude control of this vehicle. Derived control methods have been performed using computer simulations and compared the results according to this study objective.
Hakan Temeltaş Istanbul Technical University Electrical-Electronics Faculty, Istanbul/TURKEY
[email protected] II.
QUADROTOR’S DYNAMICS
A. Modelling: By design, the quadrotor is only controlled by independently varying the speed of the four rotors [1], [2], [3], [4], [5], [6], [7].
V
4
τ1
τ4
Keywords-quadrotor; robust control; back stepping; sliding mode; inverse dynamic control.
I.
1
V
U1 Φ
INTRODUCTION
l
Autonomous Unmanned Aerial Vehicles (UAV) are getting very popular on commercial, military and τ2 τ3 θ m academic platforms. Military applications currently represent the biggest part of the unmanned flying Ψ 3 2 vehicle market, and this industrial sector is growing V V strongly. Because of the structural simplicity but the complexity on controls, quadrotor are getting most Figure 1. Quadrotor. of the interest. Different control techniques tested By changing the rotor speeds torques and moments can be even on simulation and on real systems before [1], created on the system. Let Vi is the speed and τi is the trust of [2], [3], [4] and [5]. This study has been focused on ith rotor. So that total trust applied to the system is (1) U1=τ1+τ2+τ3+τ4 understanding the basics of the Quadrotor, mathematical model for simulation and control of the speed of rotors number 2 and 4 roll moment like this system. Consequently four different control can Varying be achieved techniques studied in this paper and compared (2) U2=l(τ4 – τ2) τ4 under the aim of the study. So varying the speed of rotors 1 and 3 will result pitch This study includes altitude stabilization, hovering control any desired position and attitude control of moment (3) U3=l(τ3 – τ1) τ4 quadrotor. Classically PD controller derived and applied to this system. Inverse dynamic control, And varying rotors speed dually will result a yaw moment feedback linearization control and sliding mode (4) U4=(τ1 – τ2 + τ3 – τ4) control methods have used to derive as nonlinear controllers. Linear and nonlinear control techniques We can write trust and moment in square of rotor speed applied to attitude control of this vehicle. Derived because it is shown to be a positive function of trust [5]. control methods have been performed using Ti = bΩi2 ⎪⎫ computer simulations and compared the results ⎬ (b,d: constant) Di = d Ωi2 ⎪⎭ according to this study objective.
978-1-4244-3628-6/09/$25.00 ©2009 IEEE
722
A. PD Control In PD control the system can be forced to the desired attitude. This is achieved by calculating error and adding it to the input after multiplying with a constant. As to schematize;
So moments and disturbance on the system becomes
U1 = l (Ω 42 - Ω 22 ) U 2 = l (Ω32 - Ω12 ) U 3 = (Ω12 - Ω 22 + Ω32 - Ω 42 )
(5)
Ω r = Ω1 − Ω 2 + Ω3 − Ω 4 U1,2,3 will be our inputs. Figure 1. PD control sheme
The dynamic model is derived using Euler-Lagrange formalism [5], [6], [7]. under the following assumptions: • The structure is supposed to be rigid. • The structure is supposed symmetrical. • The center of mass and the body fixed frame origin are assumed to coincide. • The propellers are supposed rigid. • The thrust and drag are proportional to the square of the propeller speed. Using the Lagrangian and the derived formula for the equations of motion: ψ
Lψ=Tψ• ←Vψψ Γ i =
d ⎛ ∂L ⎞ ∂L ψ ⎜ ⎟− dt ⎝ ∂qi ⎠ ∂qi
U1 = C pφ (φd − φ ) + Cdφ (φd − φ) U 2 = C pθ (θ d − θ ) + Cdθ (θd − θ)
(10)
U 3 = C pψ (ψ d −ψ ) + Cdψ (ψ d −ψ ) Basic equations used at [7], [8], [9], [10].
6ψ
B. Inverse Control In this method it’s tried to drive the system by its inverse dynamics. The underlying idea is to precalculating systems reaction and inversing it [11].
ψ where qi are the generalized coordinates and Γiψthe generalized forces. Then equation of motion can be written as
( I - I ) + J θΩ + U I xxφ = θψ yy zz R r 1 I yyθ = φψ ( I zz - I xx ) + J RφΩ r + U 2 ( I - I ) + U I ψ = φθ zz
xx
Symbol Φ θ Ψ τ Ω Ωr m L b,d
yy
3
(7) (8) Figure 2. Inverse Control sheme.
(9)
If constants are renamed and equations rewritten as matrix form
Definition roll angle pitch angle yaw angle trust rotor speed disturbance mass arm length trust, drug factors
TABLE I.
III.
⎡ φ ⎤ ⎡ 0 ⎢ ⎥ ⎢ ⎢θ ⎥ = ⎢ a3 + a4 Ω r ⎢ψ ⎥ ⎣⎢ a5 ⎣ ⎦
a1 + a2 Ω r 0 a5
a1 ⎤ ⎡ φ ⎤ ⎡b1 ⎢ ⎥ a3 ⎥⎥ ⎢θ ⎥ + ⎢⎢ 0 0 ⎦⎥ ⎢⎣ψ ⎥⎦ ⎣⎢ 0
0 b2 0
0 ⎤ ⎡U 2 ⎤ 0 ⎥⎥ ⎢⎢U 3 ⎥⎥ b3 ⎦⎥ ⎣⎢U 4 ⎦⎥
Where a1 a2 a3 a4 a5 b1 b2 b3
LIST OF VARIABLES
CONTROL
In this section the control algorithms applied to the angular subsystem of quadrotor will be presented. These are PD control, inverse control, backstepping control and sliding mode control.
(Iy-Iz)/Ix -Jr/Ix (Iz-Ix)/Iy Jr/Iy (Ix-Iy)/Iz 1/Ix 1/Iy 1/Iz TABLE II.
LIST OF CONSTANTS
Assuming that Ωr is constant on equilibrium near hover conditions; Inverse of the dynamic system is then
978-1-4244-3628-6/09/$25.00 ©2009 IEEE
723
⎡U 2 ⎤ ⎡b1 ⎢ ⎥ ⎢ ⎢U 3 ⎥ = ⎢ 0 ⎢⎣U 4 ⎥⎦ ⎢⎣ 0 ⎡b1 − ⎢⎢ 0 ⎣⎢ 0
0 b2 0 0 b2 0
0⎤ 0 ⎥⎥ b3 ⎥⎦
−1
0⎤ 0 ⎥⎥ b3 ⎦⎥
system into first-order system. In that way, simple control algorithm can be applied [14], which is very straightforward and robust. Our system can be defined as
⎡ φ ⎤ ⎢ ⎥ ⎢θ ⎥ ⎢ψ ⎥ ⎣ ⎦
−1
0 ⎡ ⎢a + a Ω 4 r ⎢ 3 a5 ⎣⎢
a1 + a2 Ω r 0 a5
x1 = x2 x2 = f ( x) + g ( x)U
a1 ⎤ ⎡ φ ⎤ ⎢ ⎥ a3 ⎥⎥ ⎢θ ⎥ 0 ⎦⎥ ⎢⎣ψ ⎥⎦
Define coordinate with respect to the stable manifold s = x2 + Cx1 s = x2 + Cx1 = f ( x) + g ( x)U + Cx2
C. Backstepping Control In this control algorithm, as presented [12] and [13] control law forces the system to follow a desired trajectory.
Then a Lyapunov candidate function is chosen as
For the first step error is calculated
V=
z1 = x1d − x1
(11)
1 V ( z1 ) = z12 2
(12)
and its time derivative is, V = ss = s[ f ( x) + g ( x) + Cx2 ] stability is insured if
Time derivative of (12) V ( z1 ) = z1 ( x1d − x2 )
1 2 s 2
⎧< β ( x) for s > 0 ⎪ U ⎨= β ( x) for s = 0 ⎪ > β ( x) for s < 0 ⎩
(13)
Then a virtual input created x2 = x1d + α1 z1 with α1 >0
(14)
V ( z1 ) = −α1 z12
(15)
z2 = x2 − x1d − α z1
(16)
V ( z1 , z2 ) =
1 2 ( z1 + z22 ) 2
while
β ( x) = −
f ( x) + Cx2 g ( x)
This is insured by using the control law
(17)
U = β ( x) − Ksign( s ) , K>0
(22)
V ( z1 z2 ) = z2 (a1 x4 x6 + a2 x4 Ω r + b1U 2 ) − z1 z2 − α z
2 1 1
− z 2 ( x1d − α1 ( z2 + α1 z1 ))
In application of our system
(18)
σ φ = (φd − φ ) S1 + (φd − φ) x1,2,3d = 0 Satisfying V ( z1 z2 ) < 0
β ( x) = −
So U2 can be extracted as U1 =
1 ( z1 − a1 x4 x6 − a2 x4 Ω r − α1 ( z 2 + α1 z1 ) − α 2 z2 b1
U1 = −
(19)
1 U 3 = ( z5 − a5 x2 x4 − α 5 ( z6 + α 5 z5 ) − α 6 z6 b3
(20) (21)
D. Sliding Mode Control For sliding mode controller, Lyapunov stability method is applied to keep the nonlinear system under control. The sliding mode approach is method which transformed a higher-order
978-1-4244-3628-6/09/$25.00 ©2009 IEEE
+ a θΩ + S φ a1θψ 2 r 2 − K1 s ign(σ φ ) b1
(24)
(25)
U2 and U3 can be calculated with the same steps
U2 and U3 can be calculated with the same steps [12],
[13]
1 U 2 = ( z3 − a3 x2 x6 − a4 x2 Ω r − α 3 ( z4 + α 3 z3 ) − α 4 z4 b2
+ a θΩ + S φ a1θψ 2 r 2 b1
(23)
724
U2 = −
+ a φΩ + S θ a3φψ 4 r 4 − K 2 s ign(σ θ ) b2
(26)
U3 = −
+ S ψ a5θφ 6 − K3 s ign(σψ ) b3
(27)
IV.
SIMULATION RESULTS
B. Inverse Dynamics By using Simulink Signal Constraint block Cinv1,2,3,4,5,6 constants optimized with thresholds;
A. PD Control By using Simulink Signal Constraint block Cp and Cd constants optimized with thresholds; Without Noise
Without Noise
With Noise
With Noise
Time(sec)
Value(deg)
Time(sec)
Value(deg)
phi
0.1
5.73
0.2
5.73
Time(sec)
Value(deg)
Time(sec)
Value(deg)
theta
0.1
5.73
0.2
5.73
phi
0.1
5.73
0.2
5.73
psi
0.1
5.73
0.2
5.73
theta
0.1
5.73
0.2
5.73
psi
0.1
5.73
0.2
5.73
TABLE III.
TABLE IV.
CONSTRAINTS
Without noise
CONSTRAINTS
Without noise
Cinv1 = 11.3537 , Cinv2 = 2.0359
C pφ = 15.4765 , Cdφ = 0.5578
Cinv 3 = 11.2894 , Cinv4 = 2.0969 Cinv 5 = 7.0429 , Cinv6 = 0.2953
C pθ = 7.0685 , Cdθ = 0.4078 C pψ = 5.0379 , C dψ = 0.2438
pi/10
Angle (rad)
Angle (rad)
pi/10
0 0 0
0.2
0.4
0.6
0.8
1
Time (sec) 0
0.2
0.4
0.6
0.8
Figure 5. INV control results with initial conditions of π/10; without noise.
1
Time (sec)
Figure 3. PD control results with initial conditions of π/10; without noise.
with gaussian noise of mean=0, variance=0.01 rad. With gaussian noise of mean=0, variance=0.01 rad.
Cinv1 = 6.0012 , Cinv2 = 1.2902
C pφ = 15.3529 , Cdφ = 2.1557
Cinv 3 = 5.8267 , Cinv4 = 2.3858
C pθ = 7.0314 , Cdθ = 0.7961
Cinv 5 = 6.2079 , Cinv6 = 0.3028
C pψ = 5.0170 , C dψ = 0.5169 pi/10
Angle (rad)
Angle (rad)
pi/10
0
0 0
1
2
3
4
5
Time (sec) 0
1
2
Time (sec)
3
4
Figure 6. INV control results with initial conditions of π/10; with noise.
5
Figure 4. PD control results with initial conditions of π/10; with noise.
978-1-4244-3628-6/09/$25.00 ©2009 IEEE
725
C. Backstepping Control
D. Sliding mode Control
Optimization constraints are
Optimization constraints are
Without Noise
With Noise
Time(sec)
Value(deg)
Time(sec)
Value(deg)
phi
0.15
5.73
0.2
5.73
theta
0.15
5.73
0.2
psi
0.15
5.73
0.2
TABLE V.
Without Noise
With Noise
Time(sec)
Value(deg)
Time(sec)
Value(deg)
phi
0.1
5.73
0.2
5.73
5.73
theta
0.1
5.73
0.2
5.73
5.73
psi
0.1
5.73
0.2
5.73
TABLE VI.
CONSTRAINTS
CONSTRAINTS
Without noise optimized constants are as shown below.
Without noise optimized constants are as shown below.
α1 = 17.2615 , α 2 = 15.1757 α 3 = 15.4668 , α 4 = 15.4668 α 5 = 15.6415 , α 6 = 15.6415
S1 = 13.0695 , S2 = 0.2061
K1 = 1.2279
S3 = 15.0095 , S4 = 0.2066
K 2 = 0.7130
S5 = 12.7414 , S6 = 2.0252
K 3 = 2.8838
pi/10
Angle (rad)
Angle (rad)
pi/10
0
0
0
0.2
0.4
0.6
0.8
1
0
Time (sec)
0.2
0.4
0.6
0.8
1
Time (sec)
Figure 7. Backstepping control results with initial conditions of π/10; without noise
Figure 9. Sliding mode control results with initial conditions of π/10; without noise
Constants optimized with gaussian noise of mean=0, variance=0.01 rad. are
Constants optimized with gaussian noise of mean=0, variance=0.01 rad. Are
α1 = 17.2615 , α 2 = 15.1757 α 3 = 15.4668 , α 4 = 15.4668 α 5 = 15.6415 , α 6 = 15.6415
S1 = 13.7401 , S2 = 0.0301
K1 = 1.9621
S3 = 15.0000 , S4 = 0.1686
K 2 = 0.8593
S5 = 13.5617 , S6 = 1.9976
K 3 = 3.5613
pi/10
Angle (rad)
Angle (rad)
pi/10
0
0 0
1
2
3
4
5
Time (sec)
Figure 8. Backstepping control results with initial conditions of π/10; with noise
0
1
2
3
4
5
Time (sec)
Figure 10. Sliding mode control results with initial conditions of π/10; with noise
978-1-4244-3628-6/09/$25.00 ©2009 IEEE
726
V.
CONCLUSION
REFERENCES
In this study different control techniques applied on quadrotor dynamics. Thus we could observe the basic advantages and disadvantages of these techniques. So we are one step closer to our aim of finding optimum controller for the quadrotor project of Control Lab in TuAF Academy (Turkish Air Force). As seen in Fig. 12 sliding mode technique has better performance especially on high initial conditions. This is encouraging us for further studies on real system including full autonomous control and trajectory tracking.
Patrick Adigbli, “Nonlinear Attitude and Position Control of a Micro Quadrotor using Sliding Mode and Backstepping Techniques,” 3rd US-EuropeanCompetitionandWorkshoponMicroAirVehicle Systems (MAV07) & European Micro Air Vehicle Conference and Flight Competition (EMAV2007), 2007, Toulouse, France
[2]
Muriel Labadille, Non-linear Control of a Quadrotor,MS thesis, School of Engineering Cranfield University,2007 Randal W. Beard, Quadrotor Dynamics and Control, Brigham Young University,2008 Advances in Unmanned Aerial Vehicles State of the Art and the Road to Autonomy, Springer, 2007 Samir Bouabdallah, Design And Control Of Quadrotors With Application To Autonomous Flying, Phd Thesis, École Polytechnique Fédérale De Lausanne, 2007 http://www.asl.ethz.ch/education/master/aircraft/ C.Ballas, Modellıng and Lınear Control Of A Quadrotor, Ms Thesis, Cranfield University, 2007 Samir Bouabdallah, Andr´e Noth and Roland Siegwart, PID vs LQ Control Techniques Applied to an Indoor Micro Quadrotor Tommaso Bresciani, Modelling, Identification and Control of a Quadrotor Helicopter, Master Thesis, Lund University, 2008 Gabriel M. Hoffmann, Haomiao Huang, Steven L. Waslander, Claire J. Tomlin, Quadrotor Helicopter Flight Dynamics and Control: Theory and Experiment, AIAA Guidance, Navigation and Control Conference and Exhibit 2007 Sciavicco L. and Siciliano B., Modelling and Control of Robot Manipulators., Springer, 2000. Lorenzo Pollini, Alessandra Metrangolo, Simulation and Robust Backstepping Contro of a Quadrotor Aircraft AIAA Modeling and Simulation Technologies Conference and Exhibit, 2008 Samir Bouabdallah, Backstepping and Sliding-mode Techniques Applied to an Indoor Micro Quadrotor, IEEE International Conference on Robotics and Automation Barcelona, Spain, April 2005 http://www.control.lth.se/~fusyntes/lectures/lec34_2004/SlidingMode_ martin_kjaer.pdf
[3] [4]
PD Inverse Backstepping Sliding Mode
3
[1]
[5]
Total Error
[6] [7] [8] [9] 0 -0.5 0
[10] 0.2
0.4
0.6
0.8
1
Time
Figure 11. Total error with initial condition of π/3 rad.
[11] [12]
ACKNOWLEDGMENT [13]
Authors would like to thank to our commanders at TuAF Academy and ASTIN (Aviation And Space Technologies Institute). For their contribution and supports on encouraging us.
978-1-4244-3628-6/09/$25.00 ©2009 IEEE
[14]
727