Nomenclature
-
$\text{d}$
-
Arm lenght of quadrotor
-
$\text{DOF}$
-
Degrees of freedom
-
$\text{FOU}$
-
Footprint of uncertainty
-
$\text{IT2FLC}$
-
Interval type-2 fuzzy logic controller
-
$\text{ITAE}$
-
Integral Time Absolute Error
-
$\text{J}$
-
Inertia matrix
-
$\text{m}$
-
Mass
-
$\text{MF}$
-
Membership function
-
$\text{NSGA-II}$
-
Non-dominated Sorting Genetic Algorithm
- Ø
-
Roll angle
-
$\text{O}_{\text{ABC}}$
-
Fixed body frame
-
$\text{O}_{\text{FI}}$
-
Earth-based Global Inertial Frame
-
$\text{p}$
-
Roll angular velocity in the body-fixed frame with.respect to the inertial frame
-
$\text{PID}$
-
Proportional integral derivative
-
$\text{PSO}$
-
Particle swarm optimization
-
$\text{PWM}$
-
Pulse width modulation
-
$\text{q}$
-
Pitch angular velocity in the body-fixed frame with.respect to the inertial frame
-
$\text{r}$
-
Yaw angular velocity in the body-fixed frame with.respect to the inertial frame
-
$\text{RPM}$
-
Revolutions per minute
-
$\text{u}$
-
X linear velocity of Center of gravity in the body-fixed frame with.respect to the inertial frame
-
$\text{UAV}$
-
Unmanned aerial vehicles
-
$\text{v}$
-
Y linear velocity of Center of gravity in the body-fixed frame with.respect to the inertial frame
-
$\text{w}$
-
Z linear velocity of Center of gravity in the body-fixed frame with.respect to the inertial frame
-
$\text{x}$
-
X position of Center of gravity in the inertial frame
-
$\text{y}$
-
Y position of Center of gravity in the inertial frame
-
$\text{z}$
-
Z position of Center of gravity in the inertial frame
-
$\theta$
-
Pitch angle
-
$\psi$
-
Yaw angle
1.0 Introduction
Unmanned aerial vehicles (UAVs) are stations equipped with sensors and wireless connection features, have outdoor or indoor applications, perform a special task assigned to them, do not carry a human operator, can perform flight tasks guided by remote control or autonomously through wireless communication. They are flying robotic aerial vehicles that can be used in hard-to-reach and dangerous places [Reference Alladi, Chamola, Sahu and Guizani1–Reference Mourtzis, Angelopoulos and Panopoulos12]. Nowadays, due to the rapidly growing market of UAVs, numerous application potential, and intensity of military and civilian applications, the use and research of UAVs has increased intensively [Reference Cajo, Mac, Plaza, Copot, De Keyser and Ionescu13–Reference Eliker and Zhang15]. UAV application and research; air control [Reference Wang and Zhang16], area patrol [Reference Chen, Wu, Shen, Chen and Ramchurn17], air traffic management and cargo transportation [Reference Zhao, Hu, Yin, Ang, Liu, Wang, Dong, Lin, Chen and Lee18], remote detection of agricultural products [Reference Costa, Ueyama, Braun, Pessin, Osorio and Vargas19], forest fire monitoring [Reference Casbeer, Kingston, Beard and McLain20], search and rescue [Reference Almurib, Nathan and Kumar21], border monitoring [Reference Beard, McLain, Nelson, Kingston and Johanson22], transmission. It appears in many forms such as line control [Reference Li, Wang, Liu, Tian, Zheng and Zhang23]. Flight control system design is a problem not only for quadrotor UAV, a popular rotary wing, but also for aircraft in general [Reference Chen, Wang and Lee14, Reference Kayacan and Maslim24]. From a quadrotor UAV perspective, it is described as an underactuated system due to its four actuators and six degrees of freedom (6DOF), three in the fixed frame of the Earth and three in the fixed body of the UAV. This is because the number of actuators is less than the number of DOFs [Reference Vashisht, Jain and Aujla6, Reference Chen, Wang and Lee14]. In addition, there are factors that negatively affect control such as lack of modeling, nonlinear dynamic models, aerodynamic damping, noise-induced internal uncertainties in sensors and actuators and wind-induced external uncertainties [Reference Kayacan and Maslim24–Reference Sarabakha, Fu, Kayacan and Kumbasar26]. As a result, a robust controller design is required for the four-rotor rotary wing UAV to successfully perform the defined tasks [Reference Eltayeb, Rahmat, Basri and Mahmoud27]. Many linear and nonlinear controllers have been developed that include control strategies. The most widely used of these is the Proportional Integral Derivative (PID) controller due to its simplicity, applicability and low cost. Easy parameter gain adjustment and good robustness are the main advantages of PID controller [Reference Bayrak, Demirezen and Efe28]. Some of the studies in the literature include position control, altitude and attitude control of quadrotors [Reference Li and Li29–Reference Bolandi, Rezaei, Mohsenipour, Nemati and Smailzadeh31]. On the one hand, it is observed that the PID controller is used extensively in most industrial processes; on the other hand, it has a negative impact on quadcopter control because it uses linear control methods when reaching the solution and also makes dynamic model linearisation without taking into account some variables of the controlled quadcopter. Therefore, its control response to uncertainties and disruptions in the system it controls is not good enough [Reference Bayrak, Demirezen and Efe28, Reference Lopez-Sanchez and Moreno-Valenzuela32–Reference Zhang, Li, Zhang, Pavlova and Zhang37].
Fuzzy logic controllers have an extraordinary ability in systems with many uncertainties and nonlinearities, such as quadrotor control [Reference Runkler, Chen and John38, Reference Gaidhane, Nigam, Kumar and Pradhan39]. Many researchers recommend fuzzy PID controllers for quadrotor control [Reference Tiep and Ryoo40–Reference Al-Fetyani, Hayajneh and Alsharkawi45]. Type-2 fuzzy logic controllers show higher performance than Type-1 fuzzy logic controllers in expressing uncertainties. While type-2 fuzzy logic controllers provide effective solutions to uncertainties and nonlinear situations, the negative aspect of these controllers is that there are many parameters that need to be adjusted, and this adjustment process takes a lot of time [Reference Oh, Jang and Pedrycz46]. These problems can be solved using optimisation methods [Reference Oh, Jang and Pedrycz46, Reference Castillo47].
Many studies on this subject have been presented in the literature. In Ref. (Reference Fan, Cao, Guo and Wang48), self-adaptive fuzzy parameter tuning for PID used in an attitude control is given in a simulation environment. In Ref. (Reference Fahmizal, Budiyanto and Arrofiq49), they proposed a self-tuning fuzzy PID controller in a simulation environment. In Ref. (Reference Dong and He50), a new fuzzy PID type iterative learning control for quadrotors is presented. In Ref. (Reference Housny, Chater and Fadil51), an adapted multidimensional PSO algorithm for improving the performance of a fuzzy PID for stabilisation in the trajectory tracking of a quadrotor is presented. In Ref. (Reference Carvalho, Guedes, Pinto, Zachi, Almeida, Andrade and Melo52), a self-parameter-adjusting fuzzy PID is presented for the stabilisation and control of the height of a quadrotor. In Ref. (Reference Abdelmaksoud, Mailah and Hing53), they developed an intelligent controller consisting of fuzzy logic, PID and active force control. There are also many recent studies comparing IT2FLC controllers with traditional control methods [Reference Moali, Mezghani, Mami, Oussar and Nemra54–Reference Dong and Duan60].
Optimisation results show that the optimised IT2FLC-NSGA-PID structure with more complexity and formation parameters performs better than the optimised NSGA-PID controller structure in terms of ITAE performance criterion. The IT2FLC-NSGA-PID controller has enabled a more performant and optimal solution than the NSGA-PID controller, with lower ITAE performance criteria, lower settling time and lower oscillations.
2.0 Quadcopter dynamic model
The essential information about the quadrotor in this section is: It is in line with the quadrotor’s data in [Reference Luis and Le Ny61, Reference Silano, Aucone and Lannelli62]. The four-rotor mini-unmanned aerial vehicle’s mathematical model was developed under the following assumptions: the mini-unmanned aerial vehicle’s mass remains constant, its body is solid and symmetrical, and its centre of gravity is located in the middle of the vehicle [Reference Lefeber63]. The centre of mass of the quadrotor must be known in order to fit the solution of the equation of motion to the recorded oscillatory motion data and to calculate the moments of inertia about an axis passing through the centre of mass. In order to obtain optimum flight performance, the centre of mass of a quadrocopter must be as close as possible to the geometric centre. The quadrotor body has a solid structure, which means that the body does not deform after a force is applied to it. Therefore, the same material structure does not cause internal dynamics. In addition, the symmetry around the body axes due to the design of the quadrotor allows us to use the diagonal inertia matrix when defining the system dynamics. As a result, the assumptions made are good approaches that greatly simplify the examination and understanding of the quadrotor.
An accurate dynamic model is used in the construction of a quadcopter-suitable position controller [Reference Silano, Lannelli and Koubaa64]. As a typical technique in the literature, we must define two frames, as illustrated in Fig. 1: the Earth-based Global Inertial Frame (OFI) representing the inertial frame, and the fixed body frame (OABC) of the Crazyflie 2.1 nano quadcopter with a “X” configuration. The fixed fuselage frame of the Crazyflie 2.1 is positioned along its cardinal directions and fixed at the centre of gravity of the quadcopter. The equations for momentum (Equations (3) and (4)) and forces (Equations (1) and (2)) can be determined, according to [Reference Silano, Aucone and Lannelli62, Reference Silano, Lannelli and Koubaa64]. Twelve differential equations for system dynamics and four algebraic equations (Equations (7) and (8)) that characterise the connections between system inputs (forces and moments) and rotor speeds make up this model.
\begin{align}\left[ {\begin{array}{*{20}{c}}{{{\dot x}_d}}\\{{{\dot y}_d}}\\{{{\dot z}_d}}\end{array}} \right] = {R^T}\left( {{\emptyset _d},\;{\theta _d},{\psi _d}} \right)\left[ {\begin{array}{*{20}{c}}{{u_d}}\\{{v_d}}\\{{w_d}}\end{array}} \right]\end{align}
\begin{align}\left[ {\begin{array}{*{20}{c}}{{{\dot u}_?}}\\{{{\dot v}_d}}\\{{{\dot w}_d}}\end{array}} \right] = \left[ {\begin{array}{*{20}{c}}0\\0\\{{F_z}/m}\end{array}} \right] - R\left( {{\emptyset _d},{\theta _d},{\psi _d}} \right)\left[ {\begin{array}{*{20}{c}}0\\0\\g\end{array}} \right] - \left[ {\begin{array}{*{20}{c}}{{p_d}}\\{{q_d}}\\{{r_d}}\end{array}} \right] \times \left[ {\begin{array}{*{20}{c}}{{u_d}}\\{{v_d}}\\{{w_d}}\end{array}} \right]\end{align}
\begin{align}\left[ {\begin{array}{*{20}{c}}{{{\dot p}_d}}\\{{{\dot q}_d}}\\{{{\dot r}_d}}\end{array}} \right] = {J^{ - 1}}\left( {\left[ {\begin{array}{*{20}{c}}{{M_x}}\\{{M_y}}\\{{M_z}}\end{array}} \right] - \left[ {\begin{array}{*{20}{c}}{{p_d}}\\{{q_d}}\\{{r_d}}\end{array}} \right] \times J\left[ {\begin{array}{*{20}{c}}{{p_d}}\\{{q_d}}\\{{r_d}}\end{array}} \right]} \right)\end{align}
\begin{align}\left[ {\begin{array}{*{20}{c}}{{{\dot \emptyset }_d}}\\{{{\dot \theta }_d}}\\{{{\dot \psi }_d}}\end{array}} \right] = \left[ {\begin{array}{c@{\quad}c@{\quad}c}1 {}&{{s_{{\emptyset _d}}}{t_{{\theta _d}}}} {}&{{c_{{\emptyset _d}}}{t_{{\theta _d}}}}\\0 {}&{{c_{{\emptyset _d}}}} {}&{ - {s_{{\emptyset _d}}}}\\0 {}&{{s_{{\emptyset _d}}}/{c_{{\theta _d}}}} {}&{{c_{{\emptyset _d}}}/{c_{{\theta _d}}}}\end{array}} \right]\left[ {\begin{array}{*{20}{c}}{{p_d}}\\{{q_d}}\\{{r_d}}\end{array}} \right],\;\;\;{\theta _d} \ne \frac{\pi }{2}\end{align}
(a) Earth-based Global Inertial Frame (OFI), (b) fixed body frame (OABC) of Crazyflie 2.1 nano quadcopter. The forces of each rotor, their direction of rotation and the angular velocity of the propellers ωi are shown.

The quadcopter’s fixed body frame orientation (OFI) is specified by the Euler angles Ød, θd and ψd that are defined in compliance with the ZYX rule [Reference Siciliano, Sciavicco, Villani and Oriolo65]. Since Equation (5) allows for conversion to a vector expressed in the body frame, it is possible to construct a vector of the rotation matrix R(Ød; θd; ψd)expressed in the fixed frame OABC.
\begin{align}R = \;\left[ {\begin{array}{c@{\quad}c@{\quad}c}{{c_{{\theta _d}}}{c_{{\psi _d}}}} {}&{{c_{{\theta _d}}}{s_{{\psi _d}}}} {}&{ - {s_{{\theta _d}}}}\\{{s_{{\emptyset _d}}}{s_{{\theta _d}}}{c_{{\psi _d}}} - {c_{{\emptyset _d}}}{s_{{\psi _d}}}} {}&{{s_{{\emptyset _d}}}{s_{{\theta _d}}}{s_{{\psi _d}}} + {c_{{\theta _d}}}{c_{{\psi _d}}}} {}&{{s_{{\emptyset _d}}}{c_{{\theta _d}}}}\\{{c_{{\emptyset _d}}}{s_{{\theta _d}}}{c_{{\psi _d}}} + {s_{{\emptyset _d}}}{s_{{\psi _d}}}} {}&{{c_{{\emptyset _d}}}{s_{{\theta _d}}}{s_{{\psi _d}}} - {s_{{\emptyset _d}}}{c_{{\psi _d}}}} {}&{{c_{{\emptyset _d}}}{c_{{\theta _d}}}}\end{array}} \right]\end{align}
Where, the general inertia matrix “J”, which can be simplified by the symmetry assumption made at the beginning of the chapter, is listed in Equation (6).
\begin{align}J = \left[ {\begin{array}{c@{\quad}c@{\quad}c}{{I_{xx}}} {}&{ - {I_{xy}}} {}&{ - {I_{xz}}}\\{ - {I_{xy}}} {}&{{I_{yy}}} {}&{ - {I_{yz}}}\\{ - {I_{xz}}} {}&{ - {I_{yz}}} {}&{{I_{zz}}}\end{array}} \right] \to \left[ {\begin{array}{c@{\quad}c@{\quad}c}{{I_{xx}}} {}&0 {}&0\\0 {}&{{I_{yy}}} {}&0\\0 {}&0 {}&{{I_{zz}}}\end{array}} \right]\end{align}
Thus, using inverse matrix R(Ø
d
; θ
d
; ψ
d
)
−1 = R(Ø
d
; θ
d
; ψ
d
)
T
correlates, Equation (1) computes linear velocities of quadcopter in O
ABC
frame, i.e., (u
d
, v
d
, w
d
)
T
, with linear velocities of quadcopter in fixed frame indicated by (
$\dot{x}$
d
,
$\dot{y}$
d
,
$\dot{z}$
d
)
T
. On the other hand, angular velocities of quadcopter in OFI frame are connected to corresponding velocities represented in fuselage frame by Equation (4) when taking into account derivative of R(Ø
d
; θ
d
; ψ
d
) with respect to time. Notations
$s_{x}=\textrm{sin}(\textrm{x}),\,c_{x}=\textrm{cos}(\textrm{x}),\,\textrm{and} t_{x}= \textrm{tan}(\textrm{x})$
are used to simplify representations. The six remaining equations (Equations (2) and (3)) specify the quadcopter’s linear and angular accelerations in terms of the OABC frame. Also, “m” is mass of Crazyflie 2.1, “g” is gravitational acceleration and “I
xx
”, “I
yy
”, “I
zz
” are moments of inertia about the x, y, z axis whose numerical values are given in Table 1.
Crazyflie 2.1 parameters [Reference Rooney66]

In general, the inputs to quadcopter are the total thrust expressed by Fz in Equation (7) and roll, pitch and yaw moments expressed as M x , M y , M z in Equation (8), respectively. Equations (7) and (8) relate these inputs to the speeds of the four engines of the Crazyflie quadcopter. ω 1 , ω 2 , ω 3 , ω 4 given in Equation (7) and (8) are rotational speeds of four DC motors in the quadcopter in rpm.
\begin{align}M = \;\left[ {\begin{array}{*{20}{c}}{{M_x}}\\{{M_y}}\\{{M_z}}\end{array}} \right] = \;\frac{1}{{\sqrt 2 }}\;\left[ {\begin{array}{*{20}{c}}{{C_T}d\left( { - \omega _1^2 - \omega _2^2 + \omega _3^2 + \omega _4^2} \right)}\\{{C_T}d\left( { - \omega _1^2 + \omega _2^2 + \omega _3^2 - \omega _4^2} \right)}\\{\sqrt 2 {C_D}\left( { - \omega _1^2 + \omega _2^2 - \omega _3^2 + \omega _4^2} \right)}\end{array}} \right]\end{align}
At last, “d” represents propellers’ separation from quadcopter’s centre of gravity, “C T ” denotes thrust coefficient, and “C D ” denotes drag coefficient [67]. While the quadcopter will achieve a change in altitude by increasing or decreasing the propeller speeds uniformly, a change in ω 1 and ω 4 speeds, or conversely, a change in the ω 2 and ω 3 speed pair will cause the quadcopter to tilt around the y-axis. Similarly, changing speeds ω 1 and ω 2 or speeds ω 3 and ω 4 will cause quadcopter to tilt around x-axis. The rotation of quadrotor around the z axis is provided by vector sum of moments created by speed pairs ω 1 and ω 3 and speed pairs ω 2 and ω 4 . More detailed information about Crazyflie 2.1 Parameters are given in [Reference Luis and Le Ny61, Reference Rooney66].
2.1. Control of quadrotor flight system
To characterise how test methodologies implement to unmanned aerial vehicle (UAV) design, construction of a quadcopter flight control system is described in Ref. (Reference Luis and Le Ny61) and is used to regulate a quadcopter’s position. There is a ‘reference generator’ that has desired positions (x
r
, y
r
, z
r
) and desired yaw angle ψr values and produces input-based command signals (Ø
c
, θ
c
, Ω
c
ve
${\dot \psi _c}$
) for the on-board control structure. Figure 2 shows the general flight control architecture of Crazyflie 2.1.
Limit values of Crazyflie 2.1 quadrotor data [Reference Rooney66]

Crazyflie 2.1 flight control architecture.

Reference generator utilises quadrotor technical datas to calculate command signals (Ø
c
, θ
c
, Ω
c
and
${\dot \psi _c}$
) given in Table 2, specifically uses quadrotor position (xd, yd and zd) and body frame rate (u
d
, v
d
) and its approximative guidance along the z-axis (yaw angle ψ
k
). In actual implementation carried out in closed areas, quadrotor position and speed are provided by the structure called motion capture system (Mocap), which stands out with the brands Vicon [72], Optitrack [68] and Qualiys [Reference Qualisys73]. The command impulse Ωc is given as a 16-bit number ranging from 0 to 65,535. Additionally by examining quadrotor firmware, we determine that internal signals (outputs of the ‘Control Mixer’ block) to drive the quadcopter are PWM signals. The speed values of each motor (ω
1
, ω
2
, ω
3
, ω
4
), conversion from PWM to RPM are given in Equation (9) [Reference Huştiu, Lupaşcu, Popescu, Burlacu and Kloetzer74].
Therefore, the translation (Equation 9) and the dynamic model (Equations (1) – (8)) are essentially corresponding to the ‘Plant with Gyro’ block in Fig. 2. Additionally, the quadrotor is equipped with a gyro sensor that provides internal feedback for next announced controllers that come with the standard firmware of quadrotor, as well as the actual values of the (Ø, θ, ψ) states. ‘Attitude Controller’ is a (PI, PID) controller that, in response to send orders and real feedback from Ø and θ, outputs desired roll and pitch angular rates
$\left( {{{\dot \emptyset }_c}\;,{{\dot \theta }_c}} \right)$
. In order to produce the angular momentum, ‘Rate Controller’ also determines necessary angular changes (Δ
$_\varphi$
, Δ
θ
, Δ
ψ
). Final built-in controller receives its inputs from the ratio controller’s outputs. The PWM for each rotor using the Equation (10) is generated by the ‘Control Mixer’ block in conjunction with the thrust Ωc [Reference Abdelmaksoud, Mailah and Hing53].
\begin{align}\left\{ {\begin{array}{*{20}{c}}{\begin{array}{*{20}{c}}{PW{M_1} = {\Omega _c} - \frac{{{\Delta _\emptyset }}}{2} - \frac{{{\Delta _\theta }}}{2} - {\Delta _\psi }}\\{PW{M_2} = {\Omega _c} + \frac{{{\Delta _\emptyset }}}{2} - \frac{{{\Delta _\theta }}}{2} + {\Delta _\psi }}\end{array}}\\{\begin{array}{*{20}{c}}{PW{M_3} = {\Omega _c} + \frac{{{\Delta _\emptyset }}}{2} + \frac{{{\Delta _\theta }}}{2} - {\Delta _\psi }}\\{PW{M_4} = {\Omega _c} - \frac{{{\Delta _\emptyset }}}{2} + \frac{{{\Delta _\theta }}}{2} + {\Delta _\psi }}\end{array}}\end{array}} \right.\end{align}
3.0 UAV control
3.1 Cascade PID controller for position
The structure created in the simulation environment for position control can be seen in Fig. 3.
Stucture of position control created in simulation.

Components of the cascade controller implemented in the simulation environment; Trajectory, Controller, Motors, Quadcopter Dynamics and Sensor Noise are seen as structures. The structure that provides trajectory information input to the controller including x, y, z and yaw position information is defined as the ‘Trajectory’ structure. The commands obtained from this structure only provide signal inputs to the controller such as constants or sinusoids, random signals, ramps, etc. The controller is included in the system by creating input values. The structure that accepts the trajectory information applied to the input part and the states of the quadcopter as input values and calculates the PWM signals to be sent to the motor in line with this information is called ‘Controller’. The part defined as the motor structure establishes a linear relationship between PWM signals obtained from the controller and actual angular speed produced by the motors. The Quadcopter Dynamics block implements the quadcopter dynamics equations mentioned previously. The basis of this block are equations generally created in vector form. The nonlinear equations of the quadcopter can be linearised for comparison with the state space model if desired. In this part of the cascade control structure, additional noise is added to the states obtained from the quadcopter to observe the actual states used in the system. Necessary modifications can also be made to obtain more sophisticated models.
3.1.1 Onboard control architecture
To control the quadcopter, it is first necessary to understand the currently applied controllers that come with the standard firmware of quadcopter. The built-in control architecture specified by the manufacturers is as shown in Fig. 4.
Onboard control architecture.

Pitch and roll commands are sent from the x-y position controller to the attitude controller. Values for roll and pitch angular velocity are obtained by comparing the estimated state values with the commanded values. The attitude controller provides the rate controller with roll, pitch and angular velocity commands, while the off-board yaw controller provides the rate controller with yaw angular velocity commands. An output of PWM modulations that are sent into the control mixer is created by comparing the commanded values with the estimated state values. A cascade PID control structure was used in the simulation of the quadcopter to control and observe pitch and yaw angles. There are two structures in cascade control, an internal and an external control. The analysis is provided by these two structures; where outer loop regulates inner loop and as a result entire system is organised. In the recommended control, the set point transmitted from the outer loop to the inner loop is changed after the inner loop structure output reaches the steady state value. There should be no synchronisation problems between inner loop and outer loop. In order to do this, it is important to focus on the situations in which the outer loop response exceeds the required speed and inner loop response falls short of the required speed. Generally, to overcome such problems, inner loop is set twice as fast as outer loop.
3.1.1.1 Inner loop: controller of rate (Speed)
Block’s input and output details are displayed in Fig. 5.
Rate Controller diagram.

In order to determine the values of p c , q c , and r c , respectively, this control structure seeks to compute the input change from the motors’ balancing point to produce the angular momentum needed for the variables p, q and r in the state. Three controllers, operating independently of one another, are employed to accomplish this.
Roll Rate Proportional controller: While calculating Δ
$_\varphi$
with the help of the equation (11) given below, the pc defined as outer loop attitude controller computes desired value.
Pitch Rate Proportional controller: It functions similarly to the roll rate controller. Calculates setpoint value Δθ from the variable defined as qc.
Yaw Rate Proportional-Integral controller: Uses base thrust to determine desired yaw rate, Δ ψ , via r c which is a value subsequently incorporated into the controller via the interactive quadcopter control system or by the off-board controller.
3.1.1.2 Outer loop: attitude controller
Input and output information of block is shown in Fig. 6.
Structure of attitude controller.

This controller structure determines appropriate setpoints for system for angular velocities around x and y axis. It also stabilises the quadcopter at a defined angular position while enabling changes in the ratio controller. The attitude controller uses pitch and roll angle prediction information and compares this information with external
$\varphi_c$
and θ
c
command information. Information gathered from this comparison is sent to a controller, which uses it to determine appropriate angular velocities (pc and qc). Controllers mentioned are given as follows.
Roll Attitude Proportional-Integral controller: Determines targeted roll rate to be achieved within the framework of the defined control law.
Pitch Attitude Proportional-Integral controller: While this control structure uses defined variables, it operates similarly to the roll controller.
3.1.1.3 Control mixer
Creating a torque in targeted direction of movement through the total input changes of the motors in balance is defined as the output of the driver. Then the different input values obtained in terms of PWM need to be transmitted separately to rotors of the motor to keep the quadcopter stably in the air. The quadcopter is designed according to the X configuration. By transmitting half of the motor power to each rotor, the targeted torque value around x and y axis is achieved. Pulse width modulation (PWM) is the conventional method of controlling brushless DC motors. Duty cycles are changed to regulate rotor speeds and, indirectly, thrust forces. This can be accomplished by generating the PWM needed to accomplish thrust and torque in rigid body control by applying a number of maps or functions specified in the system description. Each PWM term in this case depends on the base thrust term as well as the three previously determined angular ratio terms. Each motor incorporates the base thrust as a positive term, as the controller mixer shows, however, the angular ratio terms’ signs differ based on the motor. With each angular ratio term being positive for two motors and negative for the other two, the sign is determined by the contribution of each rotor to the torque about each axis. Control Mixer block installed in the simulation environment performs these analyses within the scope of the equations specified as follows.
\begin{align}\left\{ {\begin{array}{*{20}{c}}{{\rm{PW}}{{\rm{M}}_{{\rm{moto}}{{\rm{r}}_1}}} = {\rm{\Omega }} - {\vartriangle _{\rm{\varphi }}}/2 - {\vartriangle _{\rm{\theta }}}/2 - {\vartriangle _{{\rm{\psi \;}}}}}\\{\begin{array}{*{20}{c}}{{\rm{PW}}{{\rm{M}}_{{\rm{moto}}{{\rm{r}}_2}}} = {\rm{\Omega }} + {\vartriangle _{\rm{\varphi }}}/2 - {\vartriangle _{\rm{\theta }}}/2 + {\vartriangle _{{\rm{\psi \;}}}}}\\{{\rm{PW}}{{\rm{M}}_{{\rm{moto}}{{\rm{r}}_3}}} = {\rm{\Omega }} + {\vartriangle _{\rm{\varphi }}}/2 + {\vartriangle _{\rm{\theta }}}/2 - {\vartriangle _{{\rm{\psi \;}}}}}\\{{\rm{PW}}{{\rm{M}}_{{\rm{moto}}{{\rm{r}}_4}}} = {\rm{\Omega }} - {\vartriangle _{\rm{\varphi }}}/2 - {\vartriangle _{\rm{\theta }}}/2 + {\vartriangle _{{\rm{\psi \;}}}}}\end{array}}\end{array}} \right.\end{align}
While the ‘Ω’ value set by an altitude controller creates the PWM value, it also ensures that it remains at the defined altitude value. Rate controller’s outputs are denoted by values △
$\varphi$
, △θ and △ψ. In addition, it contributes with the yaw value information obtained from the thrust force for the targeted torque value in the x, y and z axis. From Equation (16) it becomes more clear how, for example, a △
$\varphi$
> 0 command will be distributed in half in the sense that the PWM input to motor1 and motor4 will be reduced by half, as a result of increasing power supplied to motor2 and motor3, appropriate angular momentum is created in order to provide a precise angle in the pitch direction. Figure 7 shows the block diagrams that make up the onboard control scheme.
Onboard control structure that includes the control mixer in addition to the attitude and rate controller.

Inputs that are controllable from outside the permanent software are indicated in red by a remote operating system or an automatic position controller, as previously suggested. Other signals in the control structure are either obtained from sensor algorithms or appear as control architecture’s intermediary variables.
3.1.2 Off-board position controller
Control of x, y, z axial movement of the quadcopter is achieved by incorporating an external position controller that provides inputs including waypoint and trajectory information. An altitude controller is required to provide required thrust force to keep output value on Z axis at a defined position value ‘Ω’. A position controller is required, which adjusts the output values on the X and Y axes to desired pitch and roll angles via onboard controller. A yaw position controller is required, which provides the target angular velocity value as input to the onboard yaw rate controller. All these situations explained about the three-dimensional movement of the quadcopter give us information about the off-board controller. The vertical, lateral, longitudinal and yaw movements of the quadcopter are theoretically independent from each other. This can be clearly seen in the dynamic analysis of the quadcopter. This outcome also means a simpler controller design because one controller can be modified independently of others.
3.1.2.1 Altitude controller
If the controller’s gains are too large, this creates a saturation problem. To overcome this situation, it is preferable to add a feedforward expression that will affect the system instead of the weight of the quadcopter. Figure 8 shows this controller structure.
Altitude controller with two inputs and one output.

A PID controller that provides altitude status information of the quadcopter from the dynamic block of the quadcopter, obtains the targeted altitude value from the trajectory block, and accepts these as input values is defined as an altitude controller. The equation that defines this PID controller is as follows:
The error is immediately reduced by the proportional term (Kp), which is typically dominating. Overshoot and oscillations may result from the system being unstable due to an excessively high proportional gain. A controller with a low gain will be less sensitive, and one with a low gain will have a control signal that is insufficiently powerful to avoid distortions. A steady-state error for a proportional control will result in a higher integration of the error; hence, an integration term will help move the error towards zero and accelerate the controller’s transient response. The integral term (Ki) integrates the total error over time. The amount that the derivative term contributes is determined by the derivative gain (Kd). By forecasting the error’s future behaviour, this term shortens the convergence time, minimises overshoots, and gets rid of oscillations. PID controller output is 16 bits of thrust offset from the set balance point in the air condition. The feedforward expression seen in Fig. 8 shows us that it is the PWM signal required to prevent any change in the altitude value of the quadcopter. Within the equilibrium calculations, in the light of the quadcopter technical data, the feedforward expression can be defined as follows.
3.1.2.2 X-Y Position controller
This controller’s goal is to constantly monitor pitch and roll angles and adjust the onboard attitude controller to ensure the movement of the quadcopter between two positions determined in the x and y planes. Expressions for input and output values of mentioned controller are given in Fig. 9.
X-Y position controller.

The first of the two blocks seen in Fig. 9 calculates the error between the actual position information and the desired position information on the x-y axis. Additionally, it performs the rotation required to project this error vector into the body frame. This process is given as follows:
The erroneous value found in the body frame during the computations is expressed as follows.
In the later stage, the error set to the body frame begins to act as a set point. The natural consequence of this situation is that using the single set point obtained means that in case of large errors, the quadcopter must move faster to reach the specified target faster. On the other hand, in case of small error, in other words, when the speed set point is small, it can be concluded that the quadcopter is close to the target. A more traditional method for making the position tracker is to use the setpoint of position rather than velocity of the error in the frame-fixed frame, but in practice it has been found to be easier to adjust the PID gains in the first proposed method as there are only two out of three gains that need to be adjusted. On the other hand, in the traditionally defined position tracker, all three gains are used to achieve better results. The only disadvantage of the first of the two methods mentioned is that the speed value in the frame fixed to the frame cannot be measured directly in the real system. As a result, the situations to be measured are predicted with mathematical expressions. With the help of the control laws given in the following, controllers can calculate the desired situations.
X Position Proportional-Integral Controller:
Y Position Proportional-Integral Controller:
The error checked in this section consists of difference between target yaw position and actual position seen in Fig. 10. This error value calculated by yaw position controller is sent to on-board rate controller, which provides necessary adjustment to obtain the targeted yaw rate. The output value obtained from this section is sent to the proportional controller. All the stages mentioned are shown as follows.
Yaw position controller.

4.0 TYPE-2 fuzzy sets (T2FS)
Type-2 fuzzy sets are generalised forms of type-1 fuzzy sets to contribute to the solution of dynamic uncertainties [Reference Kumbasar, Eksin, Guzelkaya and Yesil75]. A T2FS designated as
$\tilde A$
is characterised by the type-2 membership function (MF)
${\mu _{\tilde A}}\left( {x,u} \right)$
.
Where,
$\forall x \in X$
and
$u \in {J_x} \subseteq \left[ {0,1} \right]$
, in which
$0 \le {\mu _{\tilde A}} \le 1$
Considering a continuous discourse of universe,
$\tilde A$
can also be expressed as follows [Reference Gonzalez, Melin, Castro, Castillo and Mendoza69, Reference Kumbasar, Eksin, Guzelkaya and Yesil75–Reference Kumar and Kumar80].
Where the double integral (∫∫) indicates the union on all acceptable input variables x and u [Reference Gonzalez, Melin, Castro, Castillo and Mendoza69, Reference Kayacan and Khanesar77, Reference Kumar and Kumar79].
Interval type-2 fuzzy sets (IT2FSs) are a customised form of type-2 fuzzy set (T2FS). When assigned all
${\mu _{\tilde A}}\left( {x,u} \right) = 1$
, an IT2FS is [Reference Kumbasar, Eksin, Guzelkaya and Yesil75, Reference Kayacan and Khanesar77, Reference Kumar and Kumar79, Reference Kumar and Kumar80]. Now
$\tilde A$
is expressed in its new form.
Where x is known as primary variable at
$\forall x \in X$
;
$u \in U$
, belongs to secondary variable in
${J_x}$
at each
$\forall x \in X$
. The domain of a secondary MF is called primary membership of x.
${J_x}$
is known as primary membership of x and
${\mu _{\tilde A}}\left( {x,u} \right)$
is a type-1 fuzzy set known as amplitude of the secondary membership degree [Reference Gonzalez, Melin, Castro, Castillo and Mendoza69, Reference Kumbasar, Eksin, Guzelkaya and Yesil75, Reference Kayacan and Khanesar77, Reference Kumar and Kumar79–Reference Linda and Manic81].
In generalised T2FSs, secondary MFs can accept values in the range [0,1], while IT2FSs are uniform functions that can only take a value of 1. Interval T2FSs are more frequently used in the literature because they are easier to administer and have a lower computational overhead than general T2FSs [Reference Kayacan and Khanesar77].
The footprint of uncertainty (FOU) is a region that symbolises uncertainty [Reference Melin and Castillo82].
Between the lower membership function (LMF) and upper membership function (UMF), represented as
${\underline \mu _{\tilde A}}\left( x \right) \equiv \;\underline {FOU\left( {\tilde A} \right)}, \;\forall x \in X,$
, is a closed region known as FOU, which is the unity of all primary memberships
${J_x}$
(Reference Le and Hung57) in Fig. 12(a).
${\overline {0\mu } _{\tilde A}}\left( x \right) \equiv \;\overline {FOU\left( {\tilde A} \right)}, \;\forall x \in X$
respectively [1].
${J_x}$
is an interval set and given by [Reference Wang, Zhang and Jiao59, Reference Dong and Duan60]
Thus in Equation (29) FOU
$\left( {\tilde A} \right)$
can be given as
Boundaries referred to as lower and upper MF refer to two type-1 membership functions to connect the FOU of IT2FS [Reference Kumbasar, Eksin, Guzelkaya and Yesil75, Reference Kayacan and Khanesar77, Reference Kumar and Kumar79].
4.1 Interval type-2 fuzzy logic system
Block diagram for interval type-2 fuzzy logic system (IT2FLS) is displayed in Fig. 11. Fuzzifier block transforms crisp inputs into fuzzy inputs for any collection of crisp inputs. A set of rules in the form of fuzzy if-then statements, such as type-1 fuzzy logic systems, that relate inputs and outputs define an IT2FLS rule base block. However, IT2FLS is used to identify fuzzy clusters that are either antecedent or consequent. Following the fuzzification of the inputs, the predefined input range, type-2 membership functions, and rule base are used to determine the firing levels. Concurrently, the rule base is computed using the received crisp inputs, taking into account the output membership functions and rule outputs. After processing the type-2 fuzzy set outputs, type-reducer merges output sets to create type-1 fuzzy sets, or type-reduced sets. To obtain clean output, the type-reduced set is further defuzzified [Reference Hailemichael, Salaken, Karimoddini, Homaifar, Abbas and Nahavandi71, Reference Kumbasar, Eksin, Guzelkaya and Yesil75]. Fuzzifier, rule base, fuzzy inference engine, type-reducer and defuzzifier blocks are therefore included in the framework of an IT2FLS [Reference Gonzalez, Melin, Castro, Castillo and Mendoza69, Reference Melin and Castillo82–Reference Chen and Tan85].
Interval type-2 fuzzy logic system structure.

(a) A triangular interval type-2 fuzzy membership function, (b) Inference stage for interval type-2 fuzzy logic system.

4.1.1 Fuzzification
The fuzzification block, pairs crisp inputs into type-2 fuzzy sets, which enables the inference engine [Reference Kayacan and Khanesar77].
Similar to the type-1 FLS, the simplest and most common way to apply the fuzzifier to the type-2 FLS is to map a crisp input to IT2 singleton FS
${\tilde A_x}$
.While information ambiguity is not fully taken into account during fuzzification, it is indirectly accounted for in the FS representations of the rule.
${\tilde A_x}$
has only one non-zero membership as given in Equation 30 [Reference Kumar and Kumar80, Reference Melin and Castillo82, Reference Castillo and Melin84–Reference Maldonado, Castillo and Melin89].
\begin{align}{\mu _{{{\tilde A}_x}}} = \begin{cases}1,\quad x = x^{\prime} \\ 0,\quad x \ne x^{\prime} \end{cases} \end{align}
Where
$x^{\prime}$
is the system’s input value.
4.1.2 Rule base
Range type-2 fuzzy sets specify the antecedents and consequents of a T2FLS, while the rules are still the same as in a T1FLS [Reference Kayacan and Khanesar77]. As a continuation of the type-1 FLS, type-2 FLSs that are linked to it also create connections between the system’s input and output by structuring their own rule-base into a series of if-then rules. The rules are constructed in the same way regardless of the type of fuzzy sets. As a result, the type-2 FLS rule is expressed as [Reference Antão86].
${R^l}$
represents the lth fuzzy rule,
$\tilde F_p^l$
and
${\tilde G^l}$
are linguistic terms characterised by interval type-2 FSs,
$l = \left[ {1, \cdots, M} \right]$
where M is the number of rules,
$p = \left[ {1, \cdots, N} \right]$
where N is the number of premises,
${x_p}$
is the FLS inputs, and
${y^l}$
is the rule output [Reference Antão86].
4.1.3 Inference engine
Fuzzy inputs are assigned to fuzzy outputs by the inference engine block through the use of rules-based operators like union and intersection. In type-2 fuzzy sets, union and intersection operators are substituted by the join (⊔) and meet (⊓) operators – new concepts in fuzzy logic theory [Reference Kayacan and Khanesar77]. It is also necessary to compute the extended sub-star composition of type-2 relationships. If
$\tilde F_1^l \times \cdots \times \tilde F_p^l = {\tilde A^l}$
, Equation 31 can be re-written as follows [Reference Kumar and Kumar80, Reference Melin and Castillo82, Reference Castillo and Melin84, Reference Castillo and Melin87]:
${R^l}$
, is described by the membership function
${\mu _{{R^l}}}\left( {x,y} \right) = {\mu _{{R^l}}}\left( {{x_1}, \cdots {x_p},y} \right)$
, where
can be written as [Reference Kumar and Kumar80, Reference Melin and Castillo82, Reference Castillo and Melin84, Reference Castillo and Melin87]:
Generally, the p-dimensional input to
${R^l}$
is given by the type-2 fuzzy set
${\tilde A_x}$
whose membership function express as follow [Reference Dong and Duan60, Reference Silano, Aucone and Lannelli62, Reference Siciliano, Sciavicco, Villani and Oriolo65, 68]:
Where
${\tilde X_i}\left( {i = 1, \cdots, p} \right)$
define the inputs and indicate the labels of the fuzzy sets. Each rule
${R^l}$
determines a type-2 fuzzy set
${\tilde B^l} = {\tilde A_x} \circ {R^l}$
such that [Reference Dong and Duan60, Reference Silano, Aucone and Lannelli62, Reference Siciliano, Sciavicco, Villani and Oriolo65, 68]:
This dependency, represented in Fig. 12(b), is the input/output relation that exists between the type-2 fuzzy set at the engine’s output and the type-2 fuzzy set that triggers a particular rule in the inference engine [Reference Melin and Castillo82, Reference Castillo and Melin84, Reference Castillo and Melin87].
Since the intersection under the product t-norm in IT2FLS is taken into account, the result of the input and antedecent operations consisting of the firing set
$ \sqcap _{i = 1}^p{\mu _{{{\tilde F}_i}}}\left( {x_i^{\prime} \equiv {F^l}\left( {x^{\prime}} \right)} \right)$
is an interval type-1 sets [Reference Kumar and Kumar80].
Where
and
Where * means product operation.
4.1.4 Type reduction and defuzzification
Type-2 set that is produced by inference engine block [Reference Lin90] needs to be mapped to a T1FS in order to be defuzzified [Reference Nafia, El Kari, Ayad and Mjahed91–Reference Ouali, Ghanai and Chafaa93]. For IT2FLS to convert the interval type-2 fuzzy set into a type-1 fuzzy set, a type reducer – an extension of type-1 fuzzy – is required [Reference Bi, Srinivasan, Lu, Sun and Zeng83, Reference Sun, Wang and Bi94, Reference Zhao, Chen, Dian, Guo and Li95]. The type-1 set known as the ‘type reduced set’ is obtained by type reduction from the type-2 output sets of FLS [Reference Lin90]. There are numerous applications for an IT2FLS type reducer [Reference Sanchez, Castillo and Castro96], and there are numerous reduction types available, including centroid, height and centre of sets [Reference Gonzalez, Melin, Castro, Castillo and Mendoza69, Reference Mekki, Djerioui, Zeghlache and Bouguerra97]. For IT2FLSs, numerous type reduction techniques have been put out in the literature. The most popular type reduction techniques are described in this section.
4.1.4.1 Karnik- Mendel (KM) type reduction method
KM type reduction method is simple iterative algorithms to follow to calculate exact left and right endpoint values,
${y_l}$
and
${y_r}$
. The general KM type reduction method [Reference Karnik and Mendel98] for calculating left and right intervals are as follows:
-
1 Without loss of generality, assume that the pre-computed
$y_r^i$
are arranged in ascending order, i.e.,
$y_r^1 \le y_r^2 \le \cdots \le y_r^M$
. -
2 Compute
${y_r}$
as(40)by initially setting
\begin{align}{y_r} = \mathop \sum \limits_{i = 1}^M f_r^iy_r^i/\mathop \sum \limits_{i = 1}^M f_r^i\end{align}
$f_r^i = \left( {{{\underline f }^i} + {{\bar f}^i}} \right)/2$
for
$i = 1, \cdots, M$
, and let
$y_r^{\prime} \equiv {y_r}$
.
-
3 Find
$R\left( {1 \le R \le M - 1} \right)$
such that
$y_r^R \le y_r^{\prime} \le y_r^{R + 1}$
. -
4 Compute
${y_r} = \mathop \sum \nolimits_{i = 1}^M f_r^iy_r^i/\mathop \sum \nolimits_{i = 1}^M f_r^i$
with
$f_r^i = {\bar f^i}$
for
$i \le R$
and
$f_r^i = {\underline f ^i}$
for
$i \gt R$
, and let
$y_r^{\prime\prime} \equiv {y_r}$
-
5 If
$y_r^{\prime\prime} \ne y_r^{\prime}$
, then go to Step 6. If
$y_r^{\prime\prime} = y_r^{\prime}$
, then stop and set
${y_r} \equiv y_r^{\prime\prime}$
. -
6 Set
$y_r^{\prime}$
equal to
$y_r^{\prime\prime}$
and return to Step 3.
The algorithm for computing
${y_l}$
is to similar to that of the
${y_r}$
algorithm except all instances of
${y_r},y_r^{\prime},y_r^{\prime\prime},y_r^i,y_r^R,y_r^{R + 1},f_r^i$
and R are replaced with
${y_l},y_l^{\prime},y_l^{\prime\prime},y_l^i,y_l^L,y_l^{L + 1},f_l^i$
and L, respectively. Finally, the defuzzified output is the average of
${y_r}$
and
${y_l}$
as follows:
5.0 Cascade control system design
The quadrotor stage control structure parameters, which are explained in detail in Chapter 3, are adjusted separately for inner loop and outer loop. Depending on determined performance criteria, initially inner loop parameters and then outer loop parameters are determined. In this study, NSGA-PID and IT2FLC-NSGA-PID were applied as inner loop and outer loop controllers of the cascade control structure. Related to this, the methods applied for design of PID and IT2FLC-PID controllers are shown. Fuzzy logic controllers have an extraordinary ability in systems with many uncertainties and nonlinearities, such as quadrotor control [Reference Runkler, Chen and John38, Reference Gaidhane, Nigam, Kumar and Pradhan39]. While type-2 fuzzy logic controllers provide effective solutions to uncertainties and nonlinear situations, the negative aspect of these controllers is that there are many parameters that need to be adjusted, and this adjustment process takes a lot of time [Reference Oh, Jang and Pedrycz46]. These problems can be solved using optimisation methods [Reference Oh, Jang and Pedrycz46, Reference Castillo47]. In this study, NSGA-II algorithm was used as the optimisation method. Firstly, a design based on the NSGA-II optimisation used for the PID controller is presented. Secondly, the NSGA-II optimisation and rule weighting tuning design used for the IT2FLC-PID controller structure is presented.
5.1 NSGA-II
NSGA-II algorithm was employed as optimisation technique in this work. The way the selection operator functions is the only way NSGA-II varies from a straightforward genetic algorithm. By producing the number of fronts ranked by non-dominance, NSGA-II effectively reduces several targets into a single fitness measure.
NSGA-II optimisation algorithm is an effective algorithm that divides the solutions obtained against the problem to be optimised into dominance classes and selects the most appropriate solution among them. Sorting and distance play an important role in the solutions obtained in optimisation stages it applies. Taking these into consideration, it reaches a solution using the elitist and adaptation assignment rule [99]. Figure 13 shows flow chart of relevant optimisation method.
Flow diagram of the NSGA-II algorithm.

Tuning PID gains with NSGA-II algorithm.

5.2 NSGA-II optimisation of the PID structure
PID is one of the main types of controllers used in many fields. It can be used to treat steady-state and transient errors. However, the high performance of the PID is lost when disturbances occur. PID usage method provides additional benefits to the system to be controlled, such as wide usage area, simple usage method, effective robust results. In industrial areas, it is widely preferred in decisive control systems due to the accurate and effective mathematical model it uses. On the other hand, its dependence on the object being controlled creates a fundamental limitation in terms of control. To overcome this situation, it is necessary to know the mathematical model of the controlled object. A second disadvantage arises in nonlinear control. Non-linearity, time variation, difficulty in mathematical model design and the problem of obtaining the parameters of the controlled object online narrow the usage area of the PID controller. Therefore, we used a meta-heuristic optimisation algorithm-based PID controller to control the quadrotor’s roll, pitch, yaw and altitude movements, so that it has the ability to automatically adjust the Kp, Ki and Kd parameters to optimum values. The value range of the three mentioned parameters of the PID controller has significant value in terms of the applied optimisation method. The control flow diagram is shown in Fig. 14.
The reference input in this case is denoted by R(t), system input by U(t), error between reference and feedback by e(t), system output by Y(t), coefficient of the derivative term is
$K_{d}$
, coefficient of the integral term is
$K_{i}$
, and coefficient of the proportional term is
$K_{p}$
. Any kind of controller requires a different set of optimal control parameters to be designed. To lower the fitness function, certain parameters must be calculated. The fitness function selected the ITAE error performance index, which is defined as follows:
\begin{align}J = \mathop \int \limits_0^\infty t\left| {e\left( t \right)} \right|d\left( t \right)\;\end{align}
(a) Antecedent MFs (b) consequent MFs of the IT2FLC controller structure.

Structure diagram of the NSGA-II algorithm optimising the IT2FLC-PID controller parameter.

The rule base of the IT2FLC-PID controller

5.3 IT2FLC-PID controller structure
The IT2FLC-PID structure has two inputs, K1 and K2, and two output scaling factors, KPI and KPD, as shown in Fig. 16. A 3 × 3 rule base is used for the IT2FLC-PID controller, which is implemented in a cascade control structure with inner and outer loops. This rule base is given in Table 3. IT2FLC-PID rule structure;
${R_n}\;:If\;E\;is\;{\tilde A_{1j}}\;and\;\Delta E\;is\;{\tilde A_{2j}}\;Then\;U\;is\;{\tilde G_m}\;with\;{W_m}$
Here E; normalised error, ΔE; are the controller inputs defined as the normalised error variation, and U is the controller output. Gm; output range set, M; number of rules (
${\tilde G_m} = \left[ {{{\underline g }_m},{{\bar g}_m}} \right]$
, m = 1,…,M = 9),
${\tilde A_{1j}}$
; for E and
${\tilde A_{2j}}$
; The interval defined for ΔE are type-2 membership functions.
Figure 15a illustrates how input MFs of the IT2FLC controller are expressed using the three linguistic labels N (negative), Z (zero), and P (positive). Furthermore, as illustrated in Fig. 15a, the antecedent IT2-MFs is specified by four parameters (l ij, c ij, r ij, m ij; i = 1,2, j = 1,2,3). Figure 15b defines the five distinct unique results for the output MFs of the IT2FLC controller: Negative (N), Negative Medium (NM), Zero (Z), Positive Medium (PM) and Positive (P). Chapter 4 provides a detailed explanation of expressions utilised for IT2FLC, including the membership function, total firing interval, and type reduction approach (Karnik and Mendel approach-KM).
5.4 NSGA-II optimisation of the IT2FLC-PID structure
Fuzzy logic controllers have an extraordinary ability in systems with many uncertainties and nonlinearities, such as quadrotor control [Reference Runkler, Chen and John38, Reference Gaidhane, Nigam, Kumar and Pradhan39]. While type-2 fuzzy logic controllers provide effective solutions to uncertainties and nonlinear situations, the negative aspect of these controllers is that there are many parameters that need to be adjusted and this adjustment process takes a lot of time [Reference Oh, Jang and Pedrycz46]. These problems can be solved using optimisation methods [Reference Oh, Jang and Pedrycz46, Reference Castillo47]. In this study, NSGA-II algorithm was used as the optimisation method. We used IT2FLC-PID controller based on meta-heuristic optimisation algorithm to control roll, pitch, yaw and altitude movements of quadrotor, so that it has ability to automatically adjust the KPI, KPD, K1, K2 parameters to optimum values. The importance of the KPI, KPD, K1, K2 value range is to optimise the four parameters within the specified range. Control flow diagram is shown in Fig. 16.
3D helix trajectory of NSGA_PID controller.

3D helix trajectory of IT2FLC-NSGA-PID controller.

In the IT2FLC-PID control system design, the antecedent MF parameters of IT2FLC-PID are optimised separately for the inner and outer loops, using the NSGA-II algorithm, with the aim of minimising the ITAE performance index. The antecedent IT2-MFs, ‘N’ linguistic tag three parameters (c i1, r i1, m i1), ‘P’ linguistic tag three parameters (l i3, c i3, m i3, i = 1,2), The linguistic tag ‘Z’ is defined separately for each entry, including four parameters (l i2, c i2, r i2, m i2, i = 1,2).
3D eight-shaped trajectory of NSGA_PID controller.

3D eight-shaped trajectory of IT2FLC-NSGA-PID controller.

Time response of NSGA_PID controller in eight-shaped trajectory.

Time response of IT2FLC-NSGA-PID controller in eight-shaped trajectory.

It is understood from here that the total number of parameters that the NSGA-II algorithm needs to optimise in the IT2FLC-PID design is 10 + 10 = 20 for two inputs. Total parameters to be optimised; it is defined as “l 11, c 11, m 11, l 12, c 12, m 12, r 12, c 13, r 13, m 13, l 21, c 21, m 21, l 22, c 22, m 22, r 22, c 23, r 23, m 23”. In addition to these parameters, scaling factors (K1, K2, KPI, KPD) are also optimised. While optimising, the antecedent parameter and scaling factors are optimised separately and their effects on the system are observed. While performing these operations, the weights (Wn) of the rules were not optimised and were set to ‘1’. There are some restrictions when optimising IT2-MF parameters as inner and outer loop. These; It is expressed as “0 < m ij < 1, c i1 < c i2 < c i3, l i1 < c i1 < r i1, l i2 < c i2 < r i2, l i3 < c i3 < r i3”. Within the determined total optimisation parameters and constraints, firstly inner loop and then the outer loop are optimised with NSGA-II algorithm to minimise the ITAE performance criterion.
Error outputs of NSGA-PID controller in x, y, z axes, respectively, in helix trajectory.

Error outputs of the IT2FLC-NSGA-PID controller in the x, y, z axes, respectively, in helix trajectory.

6.0 Simulation results
In simulation studies carried out in Matlab/Simulink environment based on block diagrams of system given in Fig. 2, two different reference trajectories, helix and eight-shaped, were applied to the controllers optimised with the NSGA-II algorithm. PID and IT2FLC-PID parameters were obtained within the desired helix and eight-shaped trajectory with the NSGA-II meta-heuristic algorithm. The simulation programme was run 20 times for each reference trajectories, and the obtained data are given in figures and tables. While comparing the NSGA-PID and IT2FLC-NSGA-PID controllers examined in the nonlinear case, the PID controller case in the linear case is also given in the figures to contribute to the analysis of the results. A helix trajectory can be obtained when the ramp function is applied as the altitude command, as seen in the following equation:
\begin{align}\left\{ {\begin{array}{l}{{x_c}\left( t \right) = 0.5\sin \left( {2\pi 0.05t - \pi /2} \right)}\\{{y_c}\left( t \right) = 0.5\sin \left( {2\pi 0.05t} \right)}\\{{z_c}\left( t \right) = 0.05t}\\{\psi \left( t \right) = 50t}\end{array}} \right.\end{align}
Error outputs of the NSGA-PID controller in the x, y, z axes, respectively, in eight-shaped trajectory.

Error outputs of the IT2FLC-NSGA-PID controller in the x, y, z axes, respectively, in eight-shaped trajectory.

NSGA-II was used as the optimisation technique to determine the optimum PID gain and scale factor gain values. Both controllers to which optimisation was applied were simulated for 100 seconds with a zero initial condition. For each different reference applied, the simulation was run 20 times and the best and worst ITAE performance criterion values were recorded. In the observed simulation results, it is clearly seen that the height command on the vertical axis expresses a linear speed of 5 centimeters per second. The height expression defined in Equation (43) gave the expected results regarding the ramp function. The NSGA-II meta-heuristic optimisation method applied to follow the trajectory determined in Equation (43) tries to fulfill the task of minimising the error between the quadrotor trajectory and the desired trajectory depending on the fitness function. The position tracker is successful on its own, although it has difficulty in following a time-changing trajectory when the rate of change of the defined trajectory is very fast. This success is higher on the IT2FLC-NSGA-PID controller side than the NSGA_PID controller. Helix trajectory outputs of both controllers are shown in Figs 17 and 18. These two figures show the ability of both controllers to achieve the desired trajectory. In the helix trajectory, the error outputs of the x, y, z axes of both controllers are given in Figs. 23 and 24. Quantitative comparison of the steady-state and transient state responses of the data obtained from both controllers in the helix trajectory is given in Tables 4 and 5. According to the data in Table 5, it is seen that the IT2FLC-NSGA-PID controller achieves much better results than the NSGA-PID controller.
Optimised parameters and performance index values of the IT2FLC-NSGA-PID and NSGA-PID controllers for helix trajectory

Performance evaluation of IT2FLC-NSGA-PID and NSGA-PID controllers for helix trajectory

As the second reference trajectory, eight-shaped trajectory was applied in the two-dimensional x-y plane at a fixed altitude. This reference trajectory is challenging to follow because, in order to guarantee the flight height, the pitch, roll and yaw angles must all be simultaneously controlled within the controllable error range. Eight-shaped trajectory outputs of both controllers are shown in Figs. 19 and 20. These two figures show the ability of both controllers to achieve the desired trajectory. While the detailed time responses of the x, y, z axes of both controllers in the eight-shaped trajectory are given in Figs 21 and 22, at the same time the error outputs of the x, y, z axes are given in Figs 25 and 26. Quantitative comparison of steady-state and transient state responses of the data obtained from both controllers in the eight-shaped trajectory is shown in Tables 6 and 7. According to the data in Table 7, it is seen that IT2FLC-NSGA-PID controller achieves much better results than NSGA-PID controller.
Figures 17 and 18 and Table 5 demonstrate that our proposed controller consistently achieves lower overshoot and faster settling time across all four types of displacement responses for helix trajectory. In the x (Roll) displacement, the obtained results indicate for IT2FLC-NSGA-PID controller 18.452%, 4.558s, 19.74 for overshoot, settling time, and ITAE, respectively. But the obtained results indicate for NSGA-PID controller 74.561%, 47.356s, 29.37 for overshoot, settling time and ITAE, respectively. In the y (Pitch) displacement, the obtained results indicate for IT2FLC-NSGA-PID controller 0.725%, 4.332s, 19.25 for overshoot, settling time and ITAE, respectively. But the obtained results indicate for NSGA-PID controller 0.847%, 49.375s, 28.46 for overshoot, settling time and ITAE, respectively. In the z (Altitude) displacement, the obtained results indicate for IT2FLC-NSGA-PID controller 0.658%, 6.193s, 0.07699 for overshoot, settling time and ITAE, respectively. But the obtained results indicate for NSGA-PID controller 6.923%, 9.879s, 0.1777 for overshoot, settling time and ITAE, respectively. In the
$\psi$
(Yaw) displacement, the obtained results indicate for IT2FLC-NSGA-PID controller 0.658%, 6.193s, 0.07699 for overshoot, settling time and ITAE, respectively. But the obtained results indicate for NSGA-PID controller 6.923%, 9.879s, 0.1777 for overshoot, settling time and ITAE, respectively.
Optimised parameters and performance index values of the IT2FLC-NSGA-PID and NSGA-PID controllers for eight shaped trajectory

Performance evaluation of IT2FLC-NSGA-PID and NSGA-PID controllers for eight shaped trajectory

Figures 19 and 20 and Table 7 demonstrate that our proposed controller consistently achieves lower overshoot and faster settling time across all four types of displacement responses for eight-shaped trajectory. In the x (Roll) displacement, the obtained results indicate for IT2FLC-NSGA-PID controller 1.885%, 2.797s, 7.97 for overshoot, settling time and ITAE, respectively. But the obtained results indicate for NSGA-PID controller 25.401%, 5.338s, 15.97 for overshoot, settling time and ITAE, respectively. In the y (Pitch) displacement, the obtained results indicate for IT2FLC-NSGA-PID controller 19.780%, 0.877s, 7.436 for overshoot, settling time and ITAE, respectively. But the obtained results indicate for NSGA-PID controller 51.257%, 19.690s, 15.93 for overshoot, settling time and ITAE, respectively. In the z (Altitude) displacement, the obtained results indicate for IT2FLC-NSGA-PID controller 0.525%, 6.599s, 4.744 for overshoot, settling time and ITAE, respectively. But the obtained results indicate for NSGA-PID controller 0.598%, 8.199s, 5.814 for overshoot, settling time and ITAE respectively. In the
$\psi$
(Yaw) displacement, the obtained results indicate for IT2FLC-NSGA-PID controller 0.681%, 0.773s, 2.134 for overshoot, settling time and ITAE, respectively. But the obtained results indicate for NSGA-PID controller 0.766%, 0.892s, 3.441 for overshoot, settling time and ITAE, respectively.
In conclusion, the best performance outcomes are obtained by IT2FLC-NSGA-PID. When taking into account the IT2FLC-NSGA-PID testing goal, the minimal task duration, and ITAE parameters, the highest level of accuracy is achieved. Compared to the NSGA-PID approach, the IT2FLC-NSGA-PID control method has a lower convergence time for attitude and position monitoring. Overall, based on simulation results and comparison with NSGA-PID, we can fairly conclude that the IT2FLC-NSGA-PID technique can achieve trajectory tracking control of the quadrotor system in a finite period of time with strong resilience and high control quality.
7.0 Conclusion
In this study, a dynamic FOU interval type-2 fuzzy PID cascade control system architecture for a micro quadrotor UAV was implemented and simulated in the Matlab/Simulink environment for three-dimensional trajectory tracking. PID controllers have the drawback of being less appropriate for nonlinear systems. The NSGA method was used to optimise the NSGA-PID controller, but the intended outcome was not obtained. In contrast, the IT2FLC-NSGA-PID controller that has been improved operates well in nonlinear systems and shows strong robustness and adaptability. In terms of performance metrics (overshoot, settling time and ITAE), the simulation results showed that, depending on the optimisation technique employed, the optimised cascade IT2FLC-NSGA-PID performed better than the optimised cascade NSGA-PID. The results prove that the proposed controller is an effective alternative for three-dimensional trajectory tracking, position and attitude control applications. Basically, in the study, PID and IT2FLC-PID controllers optimised with NSGA-II were compared. PID controllers are widely applied in the literature. However, it is seen that its performance decreases when applied to nonlinear systems. IT2FLC, on the other hand, is known to perform better in controls with high levels of nonlinearity and uncertainty compared to T1FLCs. However, the design of IT2FLCs is not easy due to the large number of parameters that need to be adjusted. To overcome this situation, the NSGA-II algorithm was used. From all simulation results, it has been observed that the designed IT2FLC-NSGA-PID controller is more efficient and robust with less overshoot, faster settling time, and has a minimum error value against the applied three-dimensional reference trajectories compared to the NSGA-PID controller. In future studies, it is aimed to examine the proposed controller in real-time applications in the presence of distortions, uncertainties and noise.














