A Comparative Study on the Tuning of the PID Flight Controllers Using Swarm Intelligence

Aziz Kaba
1. azizkaba@eskisehir.edu.tr Faculty of Aeronautics and Astronautics
F IJAST 2020; 1 (2) : 80-91; 10.23890/IJAST.vm01is02.0205; Language: EN
Time Scale of Article

Received 21 December 2020
Revised until 25 December
Accepted 27 December 2020
Online date 30 December 2020


QUAVs have some shortcomings in terms of nonlinearities, coupled dynamics, unstable open–loop characteristics, and they are prone to internal and external disturbances. Therefore, control problem of the QUAVs is still an open issue. Designed controllers based on the linear dynamics have limited operating ranges. Therefore, nonlinear dynamics of the QUAVs must be derived and used in the control problem. Although some advanced controllers are presented for QUAV control, PID controllers are the most employed, well–known controllers with the simple structure, ease of implementation, solid functionality and robustness amongst the variations up to a degree. In this paper, PID based controllers are proposed for the nonlinear attitude dynamics to overcome the control problem of the QUAVs. However, since optimality and tuning of the PID controllers are fuzzy because of trial and error approaches, swarm intelligence based meta-heuristic algorithms (ABC, ACO and PSO) are employed to optimize the PID coefficients. Results are compared in terms of transient analysis and MC analysis to cover the rise time, settling time, percentage overshoot, steady–state error for the former and stochastic fitness evaluation for the latter, respectively.


  • UAV
  • Quadrotor
  • PID Control

1. Introduction

1.1. Background

PID controllers can treat both the transient and steady–
state responses of a plant. PID can be considered as the
simplest yet the most efficient controller. As the name
implies, it has just a three–parameter configuration
space to fit the control specifications. First applications
of the PID controllers date back to the beginning of the
20th century, and they gain more popularity with the
proposition of the ZN tuning method [1]. Although many
novel and advanced controller designs have being
proposed, PID controllers are still the most widely–used
control method in industrial systems [2]. There are many
advantages of the PID controllers such as low–
implementation efforts, wide operating range, simple
structural design and robustness against disturbance
sources [3, 4]. PID and its variants (PI, PD, etc.) are being
employed as the standard controller at the lowest level
of the process controllers and at the higher level of the
engineering areas with over 90% ratio [5, 6].

1.2. Related Works

There are so much research efforts that went into the
modern extensions of the PID controllers. Among them,
some recent high–level implementations of the PID
controllers can be given as follows. PID control design
for an inverted pendulum is given in [7]. A fuzzy self–
tuning PID algorithm for three–dimensional bio–
printing temperature control system is proposed in [8].
An adaptive PID control algorithm for the second order
nonlinear systems is derived in [9]. Extremum seeking
nonlinear PID based pressure control algorithm is given in [10]. Fuzzy PID attitude control of a vehicle is
considered in [11]. An adaptive PID controller is
presented in [12] for controlling speed of a brushless DC
motor. Another speed control application is proposed in
[13] using intelligent PID control with applications to an
ultrasonic motor. Z–axis position control of a servo
system for laser processing is achieved via fuzzy PID
control in [14]. PID control of a flexible manipulator is
presented in [15] with an opposition based spiral
dynamic method. A double fuzzy RBF-NN based PID
control for 7-dof manipulator is proposed in [16].
Extensions and improvements of the PID controllers are
also applied as the flight controllers because of
aforementioned many advantages. A data driven PID
controller implemented on a FPGA with applications to
UAV is detailed in [17]. According to the work, the
presented controllers can control the new generation of
intelligent UAVs that can perform their assigned tasks
with no human intervention. A fused PID control
strategy is presented in [18] for a tilt–rotor VTOL
aircraft. There are two different PID controllers that
comprise fixed–wing and rotary–wing parts according to
the mode of flight. According to the results, the
proposed fused PID controllers make a smooth
transition between the flight modes. A simple adaptive
PID based fault–tolerant flight controller is proposed in
[19]. The method is validated with a numerical example
and a flight test. According to the results, performance
of the system can be improved compared to the classical
PID controllers. A PID speed controller is proposed in
[20] for a small–scale turbojet engine where a
modification is added to the classical controller scheme.
A low–pass filter is added to the differential term to
reduce the noise in case of high frequencies. Results
show that the controller is effective for steady–state
loading changes. An enhanced PID controller for fault
tolerant control of a quadrotor is proposed in [21]. The
controller is tested against the actuator faults of the
quadrotor. Enhanced PD structure is based on the
saturation of the integral term to overcome the anti
wind–up. An attitude controller based on PD and KF is
proposed in [22] for a quadrotor. The measurement and
modelling errors are eliminated by KF and system states
are controlled by the PD controller, respectively. Results
show that the proposed method overcome the
disturbances with a small residual error rate.
PID and its variant controllers are prone to some
shortcoming such as parameter tuning and uncertainty
about it [23]. There are some works devoted to the
tuning of the PID controllers. A PSO based PD flight
control system is proposed in [24] for an aircraft. The
results of the method are compared with that of P, PD,
PI, and fuzzy controller. Analysis show that with the
proposed method much better results can be obtained
compared to classical approaches. Another application
of PSO optimized PID flight controller is given in [25] for
altitude control of a quadrotor. Better altitude control
responses are achieved with implementing the PSO
based PID controller. An improved BP based NN PID
control is presented in [26] with application to flight
tracking control of a UAV. Both the BP based NN and the
PID controller are optimized with GA to obtain the ideal
parameters. Results show that the proposed method
handled the attitude tracking control with robustness. A
DE based PID control is presented in [27] for hover
position of a quadrotor. A hybrid performance index is
proposed in the paper where the proposed method
improved the performance index with faster rise time
and minimum overshoot, respectively.
Based on the above discussion, it can easily be said that
the PID controllers have being employed for over
decades in process control and they have being
improved with the developing technology. Applications
of PID controllers are also widely employed in aircraft
and UAV control problems. However, because of
complexity of the flight dynamics such as coupled
translational and rotational motions on quadrotors, it is
getting harder to tune the PID parameters by trial-anderror approaches. There are some works devoted to this
area. So, in this work, a comparative study that is based
on the swarm intelligence methods, namely particle, bee
and ant swarms, is conducted. Optimality, performance
and analyses are validated for a nonlinear quadrotor UAV
Organization of the paper as follows. The mathematical
model of the quadrotor is derived in Section 2. The
swarm intelligence and implemented algorithms (ant
colony optimization, artificial bee colony and particle
swarm optimization) are given in Section 3. PID
controller structure is given in Section 4. Results and
Discussions are covered in Section 5. Last, conclusions
are given in Section 6.

2. Mathematical Model

Quadrotor UAVs have being employed in a wide range of
applications from search and rescue, surveillance, aerial
photography, to climate forecasting by military,
industry, and also hobbyists, respectively. QUAV
comprises four rotors that are placed on the corners of
the rigid cross–type frame as seen in Figure 1.where
| 𝑖 = 1,2,3,4} is the set of net forces that are produced
by the each rotor, B is the body–fixed frame, E is the
earth–fixed (inertial) frame, {𝑥𝑏, 𝑦𝑏, 𝑧𝑏} ∈ ℝ
3 are the axis
elements of the B, {𝑥𝑖
, 𝑦𝑖
, 𝑧𝑖
} ∈ ℝ
3 are the axis elements
of the E, {𝜃,𝜙, 𝜓 } is the set Euler angles defined in E, and
lastly 𝑚𝑔 is the weight of the QUAV, respectively.
The curved arrows show the directions of the rotors.
Two rotors are rotated at clockwise direction while
others rotate at counter–clockwise direction,
respectively. In a balanced flight, the rotor pairs rotate
at the same speed. Since QUAVs do not have any servo
based flight surface controllers, both translational and
rotational motions are created with the difference
between the rotors. However, it is worth to mention that
since QUAVs are under-actuated vehicles because of
inequality between inputs and outputs of the MIMO system, translational motions of the {𝑋, 𝑌} states are
achieved through employing the attitude angles. Roll
angle 𝜙 is generated by the difference of rpm between
the 2
nd and 4th rotors, pitch angle 𝜃 is generated by the
difference of rpm between the 1
st and 3rd rotors, and
lastly yaw angle 𝜓 is generated by the difference of rpm
between the rotor pairs, respectively. The translational
motion set {𝑋, 𝑌, 𝑍} is in [𝑚] and attitude angles {𝜃,𝜙, 𝜓 }
are in [𝑟𝑎𝑑]. 

Fig. 1: Coordinates and forces acted on a QUAV
In order to transform a set of vector 𝑣 defined in one
reference frame (𝑣 ∈ ℝ
) to another reference frame
(𝑣́ ∈ ℝ
), three sequential rotation is needed. A
transformation between B and E frames via ( 𝜓, 𝜃,𝜙 )
rotation sequence can be obtained by Eqs. (1-3).

where 𝑅 is the rotation. By multiplying the orthogonal
rotation matrices given in equations. (1-3), the final
rotation matrix is obtained in Eq. (4) as follows.

where 𝑐 is the abbreviation of cosine and 𝑠 is the
abbreviation of sine, respectively. The multiplication of orthogonal matrices is also an orthogonal matrix and
reverse transformation can easily be obtained with the
following equation.


where subscript 𝑹𝒊 denotes the inverse rotation, 𝒕 is the
transpose operator and (−1) is the inverse operation
defined in matrices. Since body rates {𝑃,𝑄, 𝑅} are
measured at B but Euler rates {𝜙̇
, 𝜃̇
, 𝜓̇ } are defined in E,
a coordinate transformation is needed and can be
obtained by using Eq. (6) and reverse transformation can
also be achieved with Eq. (7).



The angular acceleration equations can be obtained
through the moment equation and given in Eq. (8).


where 𝐼𝑥, 𝐼𝑦,𝐼𝑧 are the moment of inertias of the QUAV, 𝑏
is the thrust coefficient of the propellers and 𝑃̇, 𝑄̇
, 𝑅̇ are
angular accelerations. There are four inputs for the
QUAVs comprise of roll, pitch, yaw and altitude control
which are defined in Eqs. (9-12), respectively





where 𝑙 is distance between the center of the gravity of
quadrotor and center of propeller, 𝑑 is the ratio between
the drag and the thrust coefficients of the propeller, 𝑢𝑧
is control input of the altitude 𝑢𝜙 is control input of the
roll angle, 𝑢𝜃 is control input of the pitch angle, and lastly
𝑢𝜓 is control input of the yaw angle, respectively.
Nonlinear attitude dynamics of the QUAV regarding
angular rates (without disturbances) are given in Eqs.







3.Swarm Intelligence

Swarm Intelligence is a concept that deals with the designing of algorithms or distributed problem solvers inspired by the collective behaviour of social insect and animal societies [28]. The swarm term is used not only for social insect species but also used in a common meaning that focus on any restrained population of interacting individuals [29]. Typical examples of swarms can be bee colonies, ant colonies, flock of birds, swarm of cells, and fish swarms. By inspiring from aforementioned colonies, researchers proposed many swarm intelligence methods to deal with the engineering problems. Some well–known swarm intelligence algorithms are PSO [30], ABC [31] and ACO [32].

According to the [29], necessary and sufficient properties for the swarm intelligence methods are self–organization and division of labour. Self–organization property can be defined as the reflections of the interactions from the lowest–level to the global scale. The property must ensure that the interactions must be executed with local information with no governing relation from the global level. Self–organization property relies on the following properties [28].

stronger pheromone trace behind it. Thus, other ants will instinctively follow this shorter route because of stronger pheromone properties. When more ants used the route, the more pheromone is added, which leads attraction of more ants [34]. This effect is called as stigmergy that has two main distinct characteristics from other forms of communications as follows.

  • Stigmergy is an indirect form of communication that its media is environment,

  • Stigmergy is a local form of communication that only the nearby insects can access.

    Stigmergic communication in the ant colonies depends on the concentration of the pheromone. If ants perceive higher concentration of pheromone, they follow this path thus ant colony can transport food sources into the nest efficiently [35].

    Another important property that ACO simulate from real ant swarms is autocatalysis. Since the pheromone deposited by the ants is decayed over time, if the path between the nest and food source is shorter than more pheromone is deposited, which leads more ants to use the shorter path [36]. This behaviour belongs to the exploitation of positive feedback, in which more ants will produce higher pheromone concentration results with more ants in that shortest or optimal path.

    The pheromone updating rules of ACO for the TSP problem can be given in Eqs. (19-21) [37].

Scroll to Top