Quadrotor Trajectory Tracking Using PID Cascade Control
Quadrotor Trajectory Tracking Using PID Cascade Control
Abstract. Quadrotors have been applied to collect information for traffic, weather monitoring,
surveillance and aerial photography. In order to accomplish their mission, quadrotors have to
follow specific trajectories. This paper presents proportional–integral–derivative (PID) cascade
control of a quadrotor for path tracking problem when velocity and acceleration are small. It is
based on near hover controller for small attitude angles. The integral of time-weighted absolute
error (ITAE) criterion is used to determine the PID gains as a function of quadrotor modeling
parameters. The controller is evaluated in three-dimensional environment in Simulink. Overall,
the tracking performance is found to be excellent for small velocity condition.
1. Introduction
Recently, a growing interest in unmanned aerial vehicles (UAVs) has been shown among the research
community. Quadcopters are flying vehicles that can be equipped with cameras and sensors to perform
many complex tasks. Due to their high maneuverability and small size, quadrotors have been widely
used. Their potential applications include search-and-rescue, homeland security, military surveillance,
and earth sciences [1-3]. In general, quadrotors are naturally unstable, under-actuated, under damped,
coupled and nonlinear systems that need to be controlled. Several control techniques can be utilized to
control a quadrotor including proportional–integral–derivative (PID) [4, 5], linear quadratic regulator
(LQR) [6], and backstepping and sliding mode control [7, 8]. Because of its simple structure and good
stability, PID plays an important role in quadrotor control.
In this study, a PID controller is used for attitude and position control. Assuming small acceleration
and small attitude angles, the corresponding control laws are derived. A Simulink model is developed
where the performance of the controller is tested for different path-tracking cases.
2. Methodology
Figure 1 illustrates the quadrotor dynamic model with world (earth fixed) frame (𝑥𝑤 , 𝑦𝑤 , 𝑧𝑤 ), body-
fixed frame (𝑥𝐵 , 𝑦𝐵 , 𝑧𝐵 ), rotor forces, 𝐹𝑖 and rotor moments, 𝑀𝑖 . The corresponding dynamic model is
represented by Equation 1 to Equation 5 [4, 9], where r is the position vector of the center of mass of
the quadrotor, Fi is the thrust force from rotor ‘i’, R is the transformation matrix from body frame to
earth frame, p, q and r are the three components of angular velocity corresponding to roll, pitch and yaw
motions, L is the distance from the center of mass to the axis of rotation of rotors, Mi is moment of rotor
‘i’ about center of mass, I is the inertia matrix, ωi is rotor angular speed, ωdes is the desired rotor angular
speed and kF, kM and km are constants.
Content from this work may be used under the terms of the Creative Commons Attribution 3.0 licence. Any further distribution
of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.
Published under licence by IOP Publishing Ltd 1
AEROS Conference 2017 IOP Publishing
IOP Conf. Series: Materials Science and Engineering 270 (2017) 012010 doi:10.1088/1757-899X/270/1/012010
1234567890
0 0
𝑚 𝒓̈ = [ 0 ] + 𝑅 [ 0 ] (1)
−𝑚𝑔 ∑ 𝐹𝑖
𝑝̇ 𝐿(𝐹2 − 𝐹4 ) 𝑝 𝑝
𝐼 [𝑞̇ ] = [ 𝐿(𝐹3 − 𝐹1 ) ] − [𝑞 ] × 𝐼 [𝑞 ] (2)
𝑟̇ 𝑀1 − 𝑀2 + 𝑀3 −𝑀4 𝑟 𝑟
𝐼𝑥𝑥 0 0 (3)
𝐼=[0 𝐼𝑦𝑦 0]
0 0 𝐼𝑧𝑧
Figure 2 shows the cascade control loops [4, 9]. Position controller determines the required change
in motor speed, ∆𝜔𝐹 to follow the hovering height, rT,3 (t)and the required attitude angles: 𝜙 𝑑𝑒𝑠 , 𝜃 𝑑𝑒𝑠
and 𝜓 𝑑𝑒𝑠 based on position error, rT (t) − r(t). The attitude controller then determines the required
change in the motor speeds: ∆ωϕ, ∆ωθ and ∆ωψ in order to achieve the desired attitude angles. Thus the
quadrotor will follow the specified trajectory, rT (t).
ψT (t),
The vector of desired rotor speeds can be written as a linear combination of four terms as in Equation 6
[4, 9], where 𝜔ℎ is the nominal rotor speed required to hover in steady state: 𝜔ℎ = √𝑚 𝑔/(4 𝑘𝐹 ) and
the deviations from this nominal value are ∆𝜔𝐹 , ∆𝜔𝜙 , ∆𝜔𝜃 and ∆𝜔𝜓 . ∆𝜔𝐹 results in a net force along
the z-axis direction in the earth frame while ∆𝜔𝜙 , ∆𝜔𝜃 and ∆𝜔𝜓 produce moments causing roll, pitch
and yaw, respectively.
𝜔1𝑑𝑒𝑠 1 0 −1 1 𝜔ℎ + ∆𝜔𝐹
𝜔2𝑑𝑒𝑠 1 1 0 −1 ∆𝜔𝜙
=[ ] (6)
𝜔3𝑑𝑒𝑠 1 0 1 1 ∆𝜔𝜃
𝑑𝑒𝑠
[𝜔4 ] 1 −1 0 −1 [ ∆𝜔𝜓 ]
Equation 7 is obtained by linearizing Equation 2 about the hovering operating point (assuming small
attitude angles) [4, 9].
4 𝑘𝐹 𝐿 𝜔ℎ 4 𝑘𝐹 𝐿 𝜔ℎ 8 𝑘𝑀 𝜔ℎ
𝑝̇ 𝑑𝑒𝑠 = ∆𝜔𝜙 , 𝑞̇ 𝑑𝑒𝑠 = ∆𝜔𝜃 , 𝑟̇ 𝑑𝑒𝑠 = ∆𝜔𝜓 (7)
𝐼𝑥𝑥 𝐼𝑦𝑦 𝐼𝑧𝑧
Near the hovering operating point, it is assumed that 𝜙̇ ≈ 𝑝, 𝜃̇ ≈ 𝑞 and 𝜓̇ ≈ 𝑟. Subsequently, the
deviations from hovering required for attitude PD control are given by Equation 8. Since the position
PID controller will generate angle references for the attitude controller, integral action is not necessary
2
AEROS Conference 2017 IOP Publishing
IOP Conf. Series: Materials Science and Engineering 270 (2017) 012010 doi:10.1088/1757-899X/270/1/012010
1234567890
for the latter. The integral term is needed to ensure steady state error, which is not required for the
internal attitude loop.
∆𝜔𝜙 = 𝑘𝑝,𝜙 (𝜙 𝑑𝑒𝑠 − 𝜙) + 𝑘𝑑,𝜙 (𝑝𝑑𝑒𝑠 − 𝑝)
∆𝜔𝜃 = 𝑘𝑝,𝜃 (𝜃 𝑑𝑒𝑠 − 𝜃) + 𝑘𝑑,𝜃 (𝑞 𝑑𝑒𝑠 − 𝑞) (8)
∆𝜔𝜓 = 𝑘𝑝,𝜓 (𝜓 𝑑𝑒𝑠 − 𝜓) + 𝑘𝑑,𝜓 (𝑟 𝑑𝑒𝑠 − 𝑟)
Pitch and roll angles are used to control position in the horizontal plane, ∆𝜔𝜓 to control yaw angle
and ∆𝜔𝐹 to control hover height. Assume a tracking trajectory with 𝑟𝑇 (𝑡) and 𝜓 𝑇 (𝑡). PID controller is
used to calculate the commanded acceleration (𝑟̈𝑖𝑑𝑒𝑠 ) as in Equation 9 [4, 9].
(𝑟̈𝑖,𝑇 − 𝑟̈𝑖𝑑𝑒𝑠 ) + 𝑘𝑝,𝑖 (𝑟𝑖,𝑇 − 𝑟𝑖 ) + 𝑘𝑖,𝑖 ∫(𝑟𝑖,𝑇 − 𝑟𝑖 )𝑑𝑡 + 𝑘𝑑,𝑖 (𝑟̇𝑖,𝑇 − 𝑟̇𝑖 ) = 0 (9)
For near hover condition, 𝑟̈𝑖,𝑇 ≈ 𝑟̇𝑖,𝑇 ≈ 0. Therefore, this algorithm is only successful in following a
track with small velocity and acceleration. Linearizing Equation 1 about the hovering operating point
leads to Equation 10 [4, 9].
By linearizing Equation 1 and Equation 2 around hovering operating point, plant transfer functions
𝐾
for position, roll, pitch, and yaw by P(s) = 𝑠2 are approximated [4, 9]. In this case study, 𝐾 = 1/𝑚 for
4 𝑘𝐹 𝐿 𝜔ℎ 8 𝑘𝑀 𝜔ℎ
position, 𝐾 = 𝐼𝑥𝑥
for roll and pitch, and 𝐾 = 𝐼𝑧𝑧
for yaw.
Ki
In reference to Figure 3, with C(s) = K p + + K d s, the closed loop transfer function is given by
s
Equation 11.
𝑦(𝑠) 𝐾(𝑘𝑑 𝑠 2 + 𝑘𝑝 𝑠 + 𝑘𝑖 )
= 3 (11)
𝑟(𝑠) 𝑠 + 𝐾(𝑘𝑑 𝑠 2 + 𝑘𝑝 𝑠 + 𝑘𝑖 )
PID controller is designed using minimization of integral of time-weighted absolute error (ITAE)
criterion [10]. The 𝜔𝑛 of the closed loop system is selected based on the desired settling time (𝑇𝑠 =
4
and 𝜉 ≈ 0.8). PID parameters are then determined by comparing the characteristic equation of the
𝜉𝜔𝑛
closed loop system with the optimum characteristic equation for ITAE as shown in Equation 12 [10].
The resulting PID controller parameters serve as the starting values for later tuning by trial and error.
𝑠 3 + 1.75 𝜔𝑛 𝑠 2 + 2.15 𝜔𝑛2 𝑠 + 𝜔𝑛3 (12)
3
AEROS Conference 2017 IOP Publishing
IOP Conf. Series: Materials Science and Engineering 270 (2017) 012010 doi:10.1088/1757-899X/270/1/012010
1234567890
Figure 4 shows the step response for step input of 2m in x, y or z. Desired track and obtained track
are plotted, where an overshoot of 15% (x and y) and 25% (z). The rise time is 2s and the settling time
is 15 s. A compromise is made for fast response (small rise time) at the expense of high overshoot. The
tracking of the ramp trajectory in x, y, or z with a slope (velocity) equals to 1 is demonstrated in Figure
5. The Root Mean Square Error (RMSE) is about 0.0001.
4
AEROS Conference 2017 IOP Publishing
IOP Conf. Series: Materials Science and Engineering 270 (2017) 012010 doi:10.1088/1757-899X/270/1/012010
1234567890
The quadrotor is also commanded to move in a circle (radius = 6m and velocity = 2m/s) in x-y plane,
x-z plane or y-z plane as shown in Figure 6. It has been shown that the tracking performance is excellent
with RMSE of 0.0002.
The quadrotor has been commanded to move in a sinusoidal path in one direction (x, y or z) with 1m
amplitude and different time periods (80s, 20s and 10s) as shown in Figure 7. The RMSE increases as
the period decreases (velocity increases) from 0.0002 for period = 80s to 0.045 for period = 10s. This
demonstrates the limitation of the current algorithm to the small velocity trajectories as it is an
assumption in the development of this control method.
4. Conclusions
The PID cascade control method is implemented for quadrotor tracking of a specified trajectory. The
controllers are based on near hover condition. The PID gains are obtained as the function of quadrotor
modeling parameters using ITAE criterion. Tracking performance has been tested for ramp, circular and
sinusoidal trajectories. The performance is found to be acceptable as long as velocity is small. For the
future work, tracking of large angle and large velocity trajectories will be considered, which entail the
modification of control algorithm.
Acknowledgement
The authors acknowledge the financial support for this study from the International Islamic University
Malaysia (IIUM).
References
[1] Ghazbi S N, Aghli Y, Alimohammadi M and Akbari A A 2016 International Journal of Smart
Sensing and Intelligent Systems 9 309-33
[2] Gupte S, Mohandas P and Conrad J 2012 IEEE Southeastcon
[3] Sarris Z 2001 9th IEEE Mediterranean Conference on Control and Automation
5
AEROS Conference 2017 IOP Publishing
IOP Conf. Series: Materials Science and Engineering 270 (2017) 012010 doi:10.1088/1757-899X/270/1/012010
1234567890
[4] Mellinger D 2012 Trajectory Generation and Control for Quadrotors PhD Thesis, University of
Pennsylvania
[5] Kugelberg I 2016 Black-Box Modeling and Attitude Control of a Quadcopter Master Thesis,
Linköping University
[6] Hoffmann G, Rajnarayan D G, Waslander S L, Dostal D, Jang J and Tomlin C J 2004 23rd
Digital Avionics Systems Conference
[7] Bouabdallah S and Siegwart R 2005 IEEE International Conference of Robotic and Automatic
[8] Hao N D, Mohamed B and Rafaralah H 2014 European Control Conference
[9] Mustapha O 2017 Modeling, Control and Navigation of Quadrotor Master Thesis, International
Islamic University Malaysia
[10] Dorf R C and Bishop R H 2011 Modern Control Systems Prentice Hall