# Graduation Project

Mohammad Al-Fetyani

(November 2019)

See pages 1 of cover.pdf

###### Contents

  1. 1 Introduction
    1. 1.1 Background
    2. 1.2 Problem definition
    3. 1.3 Literature review
    4. 1.4 Aims and objectives
    5. 1.5 Project plan
    6. 1.6 Report organization
  2. 2 Design considerations
    1. 2.1 Design options
    2. 2.2 Design constraints and standards
  3. 3 Quadcopter modelling
    1. 3.1 Flight mechanism
    2. 3.2 Basic concepts
    3. 3.3 Dynamical model
  4. 4 Open-loop behaviour
    1. 4.1 Open-loop architecture
    2. 4.2 Open-loop simulation
  5. 5 Controller design
    1. 5.1 Linearization
    2. 5.2 Control system architecture
    3. 5.3 Control system design
    4. 5.4 Closed-loop behaviour
  6. 6 Advanced Stabilization Controller
    1. 6.1 Fuzzy inference system
    2. 6.2 ANFIS controller
    3. 6.3 Closed-loop response
      1. 6.3.1 Case I
      2. 6.3.2 Case II
  7. 7 Design Testing and Results
    1. 7.1 System Limitations and Compliance with Design Constraints
    2. 7.2 Solution Impact
  8. 8 Conclusion and Future work
    1. 8.1 Conclusion
    2. 8.2 Recommendations for Future Work
  9. A Parameter determination
    1. A.1 Mass
    2. A.2 Arm length
    3. A.3 Moment of inertia
  10. B Linear mapping proof
  11. C Steady state error proof

###### List of Figures

  1. 1.1 Gantt diagram for the project.
  2. 3.1 Quadcopter configurations.
  3. 3.2 Quadcopter cross configuration.
  4. 3.3 Quadcopter reference frames.
  5. 4.1 Open-loop architecture.
  6. 4.2 System dynamics architecture.
  7. 4.3 Open-loop positions.
  8. 4.4 Open-loop Euler angles.
  9. 4.5 Open-loop control inputs.
  10. 5.1 Control system architecture.
  11. 5.2 Attitude controller internal architecture.
  12. 5.3 Altitude controller internal architecture.
  13. 5.4 Root locus of the open-loop transfer functions.
  14. 5.5 Root locus of the controlled altitude and attitude loop.
  15. 5.6 Closed-loop positions.
  16. 5.7 Closed-loop Euler angles.
  17. 5.8 Closed-loop control signals.
  18. 6.1 Surface rules of the fuzzy controller.
  19. (a) Altitude
  20. (b) Attitude
  21. 6.2 Membership functions of the fuzzy controller.
  22. (a) Attitude: Input 1
  23. (b) Attitude: Input 2
  24. (c) Altitude: Input 1
  25. (d) Altitude: Input 2
  26. 6.3 First case response.
  27. (a) Angles $\phi$.
  28. (b) Angle $\theta$.
  29. (c) Angle $\psi$.
  30. (d) Position z.
  31. 6.4 Second case response.
  32. (a) Angles $\phi$.
  33. (b) Angle $\theta$.
  34. (c) Angle $\psi$.
  35. (d) Position z.
  36. A.1 Mass measurement.
  37. A.2 Arm length measurement.
  38. A.3 Moment of inertia measurements.

###### List of Tables

  1. 4.1 Parameter values for simulation.
  2. 5.1 Coefficient values for the PD controllers.
  3. 5.2 Step response characteristics of the PD controllers.
  4. 6.1 The inputs and output of the fuzzy controller.
  5. A.1 Results for the moment of inertia experiment.

##  Chapter 1 Introduction

###  1.1 Background

Robotics is an interdisciplinary branch of engineering and science that deals
with systems in which robots do more than what is said on papers as robotics
focus on safety, flexibility, and ease of operation. A robot can be a simple
box with wheels, or a complex robot consisting of a few modules or a set of
modules. A robot is mainly composed of three components, sensing devices that
produce signals which determine the current state of itself, the hardware and
firmware which processes and manages these signals and outputs them to a
hardware, and an actuator that handles the robot’s capabilities and functions.
This involves complex mathematical and algorithmic processes, and this has
been shown to have a high value for innovation, growth, productivity,
competitiveness and cost saving.

Robotics is a fast developing branch of engineering with a variety of
applications that are important for the industry, academia, government, and
the military. Robotics is also a fast-growing field that is changing the way
people live and work, and it will change the world. The field has been in
constant growth and development since the 1980s. Over the past three decades,
robotics has reached its potential and become the next generation of
engineering tools.

One of the major reasons for the growth of robotics in recent years is the
growing interest in robotics for the commercial sector. Robots in the
commercial market are gaining popularity in areas such as construction,
manufacturing, medical services, and more. Robotics are increasingly becoming
an important part of a company’s operations and can improve quality and lower
costs. In addition, robots in the commercial space are beginning to be used to
assist humans in their work.

Many companies have used robots to assist workers in their operations in
recent years. Companies like Amazon have used robots to pick up and deliver
packages to customers. Google’s self-driving cars are now being used in an
extensive way in many U.S. cities. In the medical field, the use of robots for
diagnostic purposes has become an increasing trend. While the technology is
still in its early stages, it is possible that this will lead to significant
improvements in the diagnosis and treatment of patients.

Most robots can be classified as ”Autonomous Robotics”, with autonomous being
a relative term and more accurately referring to the robot being able to make
the correct decision in response to a given situation, rather than being
programmed with that decision. Most robots can be further classified as
”Intelligent Machines” meaning that they can recognize their environment,
recognize their surrounding and act on that information. The development of
such robots has been a breakthrough in how robotics technology has progressed
as a whole and can be seen as one of the first major steps towards developing
a truly intelligent robot.

There are many types of robots, from simple robots like those built for
domestic use to more complex robots like those used for research, construction
and military applications. While they may be built of many different
materials, they are usually constructed of many different components. Each
robot is usually designed for a specific task and a specific environment. For
example, an industrial robot, such as a Robotic Manipulator (R.M.), may be
used in industrial or medical settings, while a robotic pet robot, such as a
Rover, may be used for personal or companion care tasks.

Drones can be classified into three main categories according to their design;
fixed-wing, single rotor and multirotor. These classifications are intended to
cover the vast majority of drones. Fixed-wing drones are generally used by the
military or police in support of troops on the ground. This type of aircraft
is most commonly used for surveillance and patrol, although some can be used
for attack or intelligence gathering missions.

Single rotor drones, also known as helicopters, generally have a long rotary
blade and are used for air support and air cover over large areas. They are
also used for military and paramilitary operations, reconnaissance and
monitoring and are generally much more expensive than fixed-wing drones. This
type of drone is commonly used by law enforcement agencies around the world.
And they provide a very wide array of capabilities and are not usually flown
by hobbyists. This is because they are generally large, complex, expensive to
fly and have a limited flight range.

For the purpose of this project, the focus will be on the multirotor drones.
Multirotor drones are very popular among the drone hobbyist due to the fact
that they make great aerial photography and filming equipment. They are small,
light and easy to control. They are also very easy to fly, very agile and they
can carry a fair amount of payload. Multirotors can be controlled via a remote
controller or via an app on a smartphone. There are many types of multirotors
like quad, hexa and octa rotor, but the attention needs to be focused on the
one that most resemble the ”normal” multirotor that is the quadrotor.

Quadrotor or quadcopter is the most common multirotor because it has four
rotors that can be mounted in a quad equally spaced form, making it the most
simple multirotor model. Although, quadrotors come with different sizes that
are generally small, but they are very powerful and capable of providing high
speed that allows it to fly very fast, easily and very well. A quadcopter can
be controlled by joysticks in different ways that are convenient and it has
many flight modes. A flight controller is essential to flying a quadrotor
because the rotors need to be controlled.

A flight controller is the most important part of a quadrotor that makes it
fly. it is usually the part that can be mounted on the quadrotor and it can be
a small electronic device, that has a gyroscope and other sensors connected to
it to help the quadrotor fly. It can be used to control the position of the
quadrotor or it can be used to control the orientation of the quadrotor to
steer it in a certain direction.

These flight controllers are extremely common on the market and allow the user
to control the quadcopter by simply selecting the desired flight mode by
pressing a button on the remote control. This means the user must know the
desired mode to select the desired controller. The flight controller should
also be equipped with a receiver that can receive the necessary commands from
a remote controller and propagate them to the quadrotor to fly.

Controlling a quadcopter is not an easy task and requires a good understanding
of how a quadcopter works. There are different types of functions that a
quadcopter can have, like hovering or rolling, and there are different
commands that can be changed on the fly. There are many different types of
control systems that are used in a quadcopter and these control systems are
used to control different functions of a quadcopter. This is considered a
problem as the control approach and the controller parameters of a quadcopter
can get really confusing since there are many types of parameters in a control
system.

In the next few sections, this problem and other problems are going to be
discussed in further details as well as a description of what needs to be
achieved and the different controls and mechanisms that are involved.

###  1.2 Problem definition

This work focuses on two problems encountered in the field of drones,
particularly quadcopters. The main problem is the fact that it is almost
impossible to integrate advanced control technologies into ready-made
autopilots. It is also hard to find a work that includes clear and
straightforward steps on how to design a quadcopter controller, so this work
will tackle both problems.

###  1.3 Literature review

In the last few years, the field of drones has received a lot of incredible
attention from researchers. From autonomous drones to robotic soldiers to
aerial surveillance, there has never been a better time to be a drone geek.
This focus has largely been due to advancements in technologies and algorithms
for aerial robotics. These include such applications as automated search and
rescue and surveillance drones. It is likely, however, that we are still many
years away from a day where drones are used to safely drop aid kit into a
patient’s hospital room or to inspect the contents of a house to detect and
assess a potential threat to humans.

One of the major areas of research is how to make drones work more efficiently
and make them safer to operate. Many people think of drones as the ultimate
solution to the issue of search and rescue, and many of the issues are already
being solved by companies that design and build drones. The technology itself
is not new and it was only a few years ago that we saw the first video from
Amazon of a flying drone delivering a package to the front door of a house.

In order to provide a more detailed explanation of what has been achieved so
far, it is better to examine a couple of researches. First, consider one of
the more widely-read research paper, by Mahony, Kumar, and Corke [1], which
outlines a simple approach of controlling a quadcopter. This paper is quite
well-known because it is used by many hobbyists to get started with quadrotors
as the authors provide a tutorial introduction to modeling, estimation, and
control for a quadrotor.

A second research is by Sabatino [2] describing the development of a more
complex quadrotor control. In the paper, the authors first derive a
mathematical model of a quadrotor, and then discusses how to linearize the
derived mathematical model. Finally, the authors discusses how the quadrotor
can be controlled using the Linear Quadratic Regulator (LQR) controller. The
LQR controller is shown to be a simple, easy to construct, and robust
controller that is easy to integrate and operate. Other related works to the
LQR controller are discussed in [3, 4, 5].

Another research is by Bresciani [6] describing the development of another
linear controller, PID controller, that is considered as one of the most
widely used controller. This is due to its simplicity, low number of
parameters, and low cost. It is very simple to implement as well. The authors
of this paper have successfully demonstrated that an integrated PID controller
is able to perform a range of basic operations for a single-pilot quadcopter
in a reasonable amount of time. The paper also discusses a range of topics
regarding PID controller, including control theory, simulation, application,
integration and hardware optimization. Many related studies have been
performed to validate the PID controller including [7, 8, 9, 10].

Another more complex linear controller is the Model Predictive Control (MPC)
that is designed to be highly robust and reliable. The MPC is discussed in a
number of papers, including a paper by Islam, Okasha, and Idres [11], where
they describe how the MPC can be used to make the quadcopter track a desired
trajectory effectively, and many other papers like [12, 13, 14].

Linear controllers are considered a great choice to implement a low cost and
high quality quadcopter control system as they require minimal software and
are relatively easy to tune. However, it is important to choose the correct
region of operation since linear controllers suffer from performance
degradation when operated in different regions [15, 16]. This is why nonlinear
controllers are considered to be a better choice for a quadcopter control.

Nonlinear controllers are considered to be more flexible and capable in
application areas such as obstacle avoidance and precision navigation because
of the different region of operation. Nonlinear controllers are discussed in
many works in the literature, but few of these works are based on experimental
design and thus it is difficult to provide a quantitative assessment of the
performance and reliability of such controllers.

One of the most notable experiments on the performance and reliability of
nonlinear controllers is provided by Bouabdallah and Siegwart [17]. The
experiment was designed to evaluate the performance of a sliding mode and a
backstepping controllers. The authors observed that the performance of the
backstepping controller was significantly better than the sliding mode
controller. These are well known types of nonlinear controllers and many
studies have been performed on them, including [18, 19, 20, 21] for the
sliding mode controller, and [22, 23, 24, 25] for the backstepping controller.

In an analogous experiment, Dydek, Annaswamy, and Lavretsky [26] investigated
the performance and reliability of an adaptive nonlinear controller. The
controller used in their study was able to successfully maintain safe
operation and smooth landing of a quadcopter. In their experiment, the
stability proof of the proposed controller was based on the Lyapunov approach.
Adaptive controllers have also been proposed in [27, 28, 29].

Another nonlinear controller that is explored a lot in the literature is based
on fuzzy logic which was first proposed by Zadeh [30]. One paper is by
Santoso, Garratt, and Anavatti [31] that shows the power use of a fuzzy
controller to enhance the performance of a quadcopter. The authors developed a
self-tuning fuzzy controller for trajectory tracking in the absence of complex
mathematical formulations. Although this approach has gained popularly due to
a few recent papers like [32, 33, 34], it is mostly known that it requires an
expert to design a well performing fuzzy logic controller.

This problem of designing a fuzzy controller was addressed by Jang [35] where
the author presents an adaptive network based fuzzy inference system (ANFIS)
to construct input-output mapping. ANFIS can generate membership functions and
refine fuzzy if-then rules without the need of an expert. Although this
approach still does not receive a lot of attention as a research topic, but a
few recent papers were able to use ANFIS to produce a powerful fuzzy
controller as in [36, 37, 38, 39].

In a recent study by Li, Qian, Zhu, Bao, Helwa, and Schoellig [40], a
nonlinear controller based on deep neural networks was proposed that has the
potential to improve the tracking precision of a quadcopter. Their study also
includes an experimental investigation on the potential of such controller to
increase the tracking accuracy in a real-world quadcopter. A drawback of this
approach is that the improvements are highly dependant on the training data
that is provided to the deep neural networks.

The approach of controlling a quadcopter using neural networks has been
further studied by Boudjedir, Yacef, Bouhali, and Rizoug [41]. Where here, the
goal is to enhance the accuracy of controlling a quadcopter at the presence of
sinusoidal disturbance. A similar approach is proposed by Efe [42] to handle
disturbances using neural networks that emulate the performance of a
fractional order PID controller. The author concluded that this technique can
be extended to emulate a large class of intelligent systems like fuzzy logic,
which in turn may provide extensive flexibility for microprocessors.

More recently, a new approach has been proposed by Siti, Mjahed, Ayad, and El
Kari [43] that aims to optimize the gains of a set of PD/PID controllers using
genetic algorithm techniques. The authors focused their attention on the
optimization problem while introducing a novel control strategy to deal with
the under actuation of the quadcopter. Similar approach of using genetic
algorithm has also been discussed in [44, 45, 46].

To conclude, a brief review of the most controllers used to operate a
quadcopter [47] reveals that each of them have different characteristics and
can be used for different tasks. The optimal selection of one controller is
not necessarily the optimal selection for the whole quadcopters. To find an
optimal controller for a particular problem, a good knowledge of the
application is required.

###  1.4 Aims and objectives

This project aims to introduce a simple and clear way on how to integrate
advance control systems into ready-made autopilots. It also aims to provide
clear instructions and steps on how to design a quadcopter controller.

The objectives of this work are as follows:

  1. 1.

Establish the mathematical model of the quadcopter.

  2. 2.

Obtain a linearized version of the mathematical model.

  3. 3.

Design simple and advanced controller for stabilizing the quadcopter.

  4. 4.

Deploy the developed controller to hardware.

###  1.5 Project plan

The plan of this project is presented as Gantt diagram in Figure 1.1.

[y unit title=0.5cm, y unit chart=0.7cm, vgrid,hgrid, title height=1, title
label font=, bar/.style=fill=blue, bar height=0.7, group right shift=0, group
top shift=0.7, group height=.3, group peaks width=0.2, inline]124 A one-year
project24
[]201912 []202012
Sep3 Oct3 Nov3 Dec3 Jan3 Feb3 March3 June3
[inline=false]Phase 115
[progress=100,inline=false]Introduction12
[progress=100,inline=false]Literature review35

[inline=false]Phase 2612
[progress=100,inline=false]Quadcopter modeling68
[progress=100,inline=false]Stabilization812
[inline=false]Milestone 112

[inline=false]Phase 31318
[progress=60,inline=false]Trajectory Tracking1315
[progress=40,inline=false, bar progress label node/.append style=below left=
10pt and 7pt]Advance control1324

[inline=false]Milestone 218
[inline=false]Phase 41724
[progress=30,inline=false,bar progress label node/.append style=below left=
10pt and 7pt]Hardware deployment1524

Figure 1.1: Gantt diagram for the project.

###  1.6 Report organization

The rest of this work is organized as follows: Chapter 2 ( Design
considerations), Chapter 3 (Quadcopter modelling), Chapter 4 (Open-loop
behaviour), Chapter 4 (Open-loop behaviour), Chapter 5 (Controller design),
Chapter 6 (Advanced Stabilization Controller), Chapter 7 (Design Testing and
Results) and Chapter 8 (Conclusion and Future work).

##  Chapter 2 Design considerations

This chapter discusses the available design options and justifies the approach
adopted in this work. It also presents the constraints and the standards that
are encountered throughout the work.

###  2.1 Design options

Many techniques have been developed to model physical systems including
mathematical modeling, data modeling and agent-based model. Mathematical
modeling is normally based on system dynamic equations, data modeling is based
on system identification and agent-based model normally involve optimization
problems.

In this work, mathematical modeling is adopted because it is capable to
accurately predict the behaviour of the quadcopter. In addition, it
facilitates the design of the controllers based widely known control
techniques.

Many types of control techniques are used nowadays to control the quadcopter
such as PID, LQR, SMC and many more. However, this work mainly focuses on two
types of controllers, PID and Fuzzy. Fuzzy controller is a nonlinear, easy to
construct and robust controller, which is why it is adopted in this work.
Because of the simplicity of the PID controller, it is used as a baseline to
compare the performance of the fuzzy controller.

Although, there are many ways to implement the mathematical model in software
such as programming the model using different programming language (e.g Python
and C++) but the one that is most flexible and reliable is the MATLAB
software, which is adopted in this work. One advantage of MATLAB software is
that it does not require you to discretize the mathematical model like in
programming. It also contains an incredible tools that would ease the
controller design process.

###  2.2 Design constraints and standards

Throughout this work, MATLAB software version 2019a is used for simulation,
control design and deployment. The international standard that MATLAB software
uses for Simulink is ”IEC 61508” and for the model-based designer it uses the
standard ”IEC 61508” [48].

One of the most important constraints in this work is the control signal. The
control signal has to be physically possible and because it represents a PWM
signal, it should be between 1000 and 2000. Another constrain is the budget,
the design of the controller must be compatible with the design of a simple
quadcopter.

##  Chapter 3 Quadcopter modelling

This chapter presents a mathematical model for a three-dimensional quadcopter.
A mathematical model can help us understand how a complex system behaves and
what the consequences of that behavior are. The derivation of the mathematical
model is achieved in a step-wise manner throughout this work as we proceed
from the simplest model to the most complex. As the model becomes more
complex, it allows us to predict the behavior of the realistic quadcopter with
much higher confidence.

The first section of this chapter (3.1 Flight mechanism) describes the most
common movements of a quadcopter, shows the main idea behind each movement and
how it can be achieved, and gives a visual explanation of the quadcopter
mechanisms. This section also describes different configurations of the
quadcopter.

The second section of this chapter (3.2 Basic concepts) shows the math behind
the quadcopter movements, explains what are the inputs and outputs of such
system, and gives a ready-to-use model that can be easily simulated and
modified to meet the needs of different projects.

###  3.1 Flight mechanism

A quadrotor is a multi-rotor aircraft with four rotors attached to its main
body in an equally spaced formation. It is a lightweight flying machine that
can maneuver in any direction and is capable of high speeds. It is also
capable of vertical take-off/landing (VTOL) and can be used to carry a heavy
load of about 1 kg. A significant advantage of this vehicle is its
versatility; it is able to operate in a variety of different configurations,
making it easily adaptable to a wide range of missions.

A quadcopter is mainly composed of four movements, throttle, roll, pitch, and
yaw. These movements are achieved in different manners depending on the
configuration selected. There are many configurations of a quadcopter but the
two most common configurations are a cross ’X’ configuration, and a plus ’+’
configuration. Both configurations are shown in Figure 3.1, where the cross
configuration is shown on the left and plus configuration is shown on the
right.

Figure 3.1: Quadcopter configurations.

In general, the cross configuration is more stable than the plus configuration
[49] due to the fact that all four motors contribute to the stability of the
quadrotor. The cross configuration is also considered the most popular
configuration [50] since a camera can point out between the front two motors
which makes it helpful to be used for aerial photography/videography. The plus
configuration, on the other hand, is easier to control compared to the cross
configuration [50] because only two motors control roll and pitch movements
which makes it a great choice for acrobatic flying [51].

This work focuses on the cross configuration and thus all four movements are
going to be explained based on the cross configuration. These four movements
are described in terms of motors angular velocity, $\omega$, that are labeled
from 1 to 4 as presented in Figure 3.2.

The throttle movement is used to control the height, up or down, of the
quadrotor. It is achieved by changing all angular velocities of the motors,
increasing or decreasing. The amount of thrust applied to the motors is
directly proportional to the height of the quadcopter. For instance, to keep
the quadrotor hovering at a desired height, an equal amount of thrust should
be applied to the motors.

The roll movement is a rotation around the front-to-back axis of the quadrotor
and is achieved by increasing or decreasing the angular velocities of motor 2
and motor 3 ($\omega_{2}$ and $\omega_{3}$) and at the same time decreasing or
increasing the angular velocities of motor 1 and motor 4 ($\omega_{1}$ and
$\omega_{4}$). This movement is used to move the quadrotor to the right or to
the left.

The pitch movement is a rotation around the side-to-side axis of the quadrotor
and it is very similar to the roll movement. The only difference is that it is
used to move the quadrotor forward or backward. And thus, it is achieved by
increasing or decreasing the angular velocities of motor 3 and motor 4
($\omega_{3}$ and $\omega_{4}$) and at the same time decreasing or increasing
the angular velocities of motor 1 and motor 2 ($\omega_{1}$ and $\omega_{2}$).

It is to be noted that the roll and pitch movements stand in the way of the
throttle movement. This due to the fact that the motors are no longer on a
horizontal plane and thus they are not generating an upward force. To counter
this behavior, the angle of rotation must be taken into consideration in the
throttle movement.

The last and final movement is the yaw movement which is a rotation around the
vertical axis of the quadcopter. The yaw movement is acquired by increasing or
decreasing the angular velocities of two opposite motors (say $\omega_{1}$ and
$\omega_{3}$ and at the same time decreasing or increasing the angular
velocities of other two (say $\omega_{2}$ and $\omega_{4}$).

Figure 3.2: Quadcopter cross configuration.

###  3.2 Basic concepts

Before describing the dynamical model of a quadcopter, it is necessary to
introduce two reference frames. The first frame is kept fixed and is referred
to as a world or inertial frame. This frame is used to track the movements of
the second frame. The second frame is referred to as body frame and is
associated with the quadcopter, hence it moves with the quadcopter. These two
frames are assumed as presented in Figure 3.3.

Figure 3.3: Quadcopter reference frames.

The absolute position of the quadcopter is introduced in the world frame as
$x$, $y$ and $z$ axes and these are contained in a column vector, $\bm{\xi}$.
The attitude, or the angular position, of the quadcopter is defined in the
world frame as $\bm{\Theta}$, where the roll angle is $\phi$, the pitch angle
is $\theta$, and the yaw angle is $\psi$. These three angles are referred to
as Euler angles.

$\bm{\xi}=\left[\;\begin{matrix}x\\\ y\\\
z\end{matrix}\;\right],\quad\bm{\Theta}=\left[\;\begin{matrix}\phi\\\
\theta\\\ \psi\end{matrix}\;\right]$ (3.1)

The body frame is located at the center of mass of the quadcopter. The linear
velocities for the three axes are defined in the body frame by $\bm{V_{B}}$
and the corresponding angular velocities are denoted by $\bm{v}$. The angular
velocities in the $x$, $y$ and $z$ axes are denoted by $p$, $q$ and $r$
respectively.

$\bm{V_{B}}=\left[\;\begin{matrix}V_{B,x}\\\ V_{B,y}\\\
V_{B,z}\end{matrix}\;\right],\quad\bm{v}=\left[\;\begin{matrix}p\\\ q\\\
r\end{matrix}\;\right]$ (3.2)

To keep track of the state of the quadcopter, the positions and the angular
velocities of the quadcopter that are measured in the body frame should be
expressed in the world frame. For the positions, this mapping between the two
frames can be achieved through a rotation matrix of each axis. These rotation
matrices are as follows:

$\bm{R_{z,\psi}}=\left[\;\begin{matrix}\text{cos}(\psi)&-\text{sin}(\psi)&0\\\
\text{sin}(\psi)&\text{cos}(\psi)&0\\\ 0&0&1\end{matrix}\;\right]$ (3.3)
$\bm{R_{y,\theta}}=\left[\;\begin{matrix}\text{cos}(\theta)&0&\text{sin}(\theta)\\\
0&1&0\\\ -\text{sin}(\theta)&0&\text{cos}(\theta)\end{matrix}\;\right]$ (3.4)
$\bm{R_{x,\phi}}=\left[\;\begin{matrix}0&0&1\\\
0&\text{cos}(\phi)&-\text{sin}(\phi)\\\
0&\text{sin}(\phi)&\text{cos}(\phi)\end{matrix}\;\right]$ (3.5)

where $\bm{R_{k,t}}$ is the rotation matrix about axis $k$ with angle $t$.

The over all rotation matrix from the body frame to the world frame is derived
from this as follows:

$\bm{R}=\bm{R_{z,\psi}R_{y,\theta}R_{x,\phi}}$ (3.6)

$\bm{R}=\left[\;\begin{matrix}C_{\psi}C_{\theta}&{C_{\psi}S_{\theta}S_{\phi}-S_{\psi}C_{\phi}}&{C_{\psi}S_{\theta}C_{\phi}+S_{\psi}S_{\phi}}\\\\[2.0pt]
{S_{\psi}C_{\theta}}&{S_{\psi}S_{\theta}S_{\phi}+C_{\psi}C_{\phi}}&{S_{\psi}S_{\theta}C_{\phi}-C_{\psi}S_{\phi}}\\\\[2.0pt]
{-S_{\theta}}&{C_{\theta}S_{\phi}}&{C_{\theta}C_{\phi}}\end{matrix}\;\right]$
(3.7)

where $C_{t}=\text{cos}(t)$ and $S_{t}=\text{sin}(t)$.

The inverse of the rotation matrix $\bm{R}$ is the rotation matrix from the
world frame to the body frame. It can be calculated from $\bm{R^{-1}=R^{T}}$
due to the orthogonality of the rotation matrix $\bm{R}$.

The angular velocities of the quadcopter, which are measured in the body
frame, are not the exact same values as seen from the world frame. They should
be mapped to the world frame throughout the rotation matrix $\bm{\eta}$ [6].

$\bm{\dot{\bm{\Theta}}}=\bm{\eta v},\quad\left[\;\begin{matrix}{\dot{\phi}}\\\
{\dot{\theta}}\\\
{\dot{\psi}}\end{matrix}\;\right]=\left[\;\begin{matrix}{1}&{S_{\phi}T_{\theta}}&{C_{\phi}T_{\theta}}\\\
{0}&{C_{\phi}}&{-S_{\phi}}\\\
{0}&{S_{\phi}/C_{\theta}}&{C_{\phi}/C_{\theta}}\end{matrix}\;\right]\left[\;\begin{matrix}{p}\\\
{q}\\\ {r}\end{matrix}\;\right]$ (3.8)

where $T_{t}=\text{tan}(t)$.

The motors generate a vertical force, $F$, in the body z-axis while rotating.
This force is proportional to the square of a motor’s angular velocity. All
motors also contribute in generating a torque, $\bm{\tau}$, on all three axes
in the body frame while rotating. This torque is also proportional to the
angular velocities of the four motors.

$F=\sum_{i=1}^{4}f_{i}=C_{T}\sum_{i=1}^{4}\omega^{2}_{i},\quad\bm{F_{B}}=\left[\;\begin{matrix}0\\\
0\\\ F\end{matrix}\;\right]$ (3.9)

where $f_{i}$ is the force generated by the $i^{th}$ motor, $C_{T}$ is the
thrust coefficient and $\bm{F_{B}}$ is the vector representation of these
forces.

The torques that are created by the four motors consist of $\tau_{\phi}$,
$\tau_{\theta}$ and $\tau_{\psi}$ in the direction of the body $x$, $y$ and
$z$ axes.

$\bm{\tau}=\left[\;\begin{matrix}\tau_{\phi}\\\ \tau_{\theta}\\\
\tau_{\psi}\end{matrix}\;\right]=\left[\;\begin{matrix}dC_{T}(\omega_{1}^{2}-\omega_{2}^{2}-\omega_{3}^{2}+\omega_{4}^{2})\\\\[2.0pt]
dC_{T}(\omega_{1}^{2}+\omega_{2}^{2}-\omega_{3}^{2}-\omega_{4}^{2})\\\\[2.0pt]
C_{D}(\omega_{1}^{2}-\omega_{2}^{2}+\omega_{3}^{2}-\omega_{4}^{2})\end{matrix}\;\right]$
(3.10)

where $d$ is the arm length of the quadcopter and $C_{D}$ is the aerodynamic
drag coefficient.

###  3.3 Dynamical model

The dynamical model of a quadrotor can be described as a set of six equations,
in which three equations describe the $x,y,z$ position of the quadrotor and
the other three describe the roll,pitch,yaw rotation of the quadcopter. Each
of these equations takes the angular velocities of the four motors, $\omega$,
as inputs and outputs the next state of the quadcopter.

In this work, several assumptions are made to simplify the derivation of the
dynamical model. These assumptions do not perfectly reflect the real
quadcopter but they are considered good approximations. These assumptions are
as follows:

  1. 1.

The mass of the quadcopter is evenly distributed and is kept constant, hence
its derivative is zero.

  2. 2.

The quadcopter is a rigid body, meaning that it does not deform.

  3. 3.

The center of gravity is located in the middle of the quadcopter and coincides
with the origin of the body frame.

  4. 4.

The quadcopter structure is symmetrical with four arms aligned with the body
x- and y- axes.

Because of the assumptions we made, the dynamics of the quadcopter can be
described by Newton-Euler equations. Newton’s equations describe the
translational motion of the quadcopter and can be formulated in the inertial
frame as follows:

$\begin{gathered}m\bm{\ddot{\xi}}=\bm{G}+\bm{RF_{B}},\\\\[10.0pt]
m\left[\;\begin{matrix}\ddot{x}\\\ \ddot{y}\\\
\ddot{z}\end{matrix}\;\right]{}=\left[\;\begin{matrix}0\\\ 0\\\
-mg\end{matrix}\;\right]{}+\bm{R}\left[\;\begin{matrix}0\\\ 0\\\
F\end{matrix}\;\right]\end{gathered}$ (3.11)

where $\bm{G}$ is the gravitational force vector.

It is possible to simplify (3.11) and isolate the vector $\bm{\ddot{\xi}}$:

$\left[\;\begin{matrix}\ddot{x}\\\ \ddot{y}\\\
\ddot{z}\end{matrix}\;\right]{}=\left[\;\begin{matrix}0\\\ 0\\\
-g\end{matrix}\;\right]{}+\frac{F}{m}\left[\;\begin{matrix}{C_{\psi}S_{\theta}C_{\phi}+S_{\psi}S_{\phi}}\\\\[2.0pt]
{S_{\psi}S_{\theta}C_{\phi}-C_{\psi}S_{\phi}}\\\\[2.0pt]
{C_{\theta}C_{\phi}}\end{matrix}\;\right]$ (3.12)

The rotational motion of the quadcopter is described by Euler’s equation of
motion in (3.13) and is best expressed in the body frame since control inputs
are given in the body frame as well as the measurements, which are taken from
on-board sensors, are easily converted to body frame.

$\begin{gathered}{}\bm{\tau}=\bm{J\dot{v}}+\bm{v\times Jv},\\\\[10.0pt]
\left[\;\begin{matrix}\tau_{\phi}\\\ \tau_{\theta}\\\
\tau_{\psi}\end{matrix}\;\right]=\left[\;\begin{matrix}I_{xx}&0&0\\\
0&I_{yy}&0\\\ 0&0&I_{zz}\end{matrix}\;\right]\left[\;\begin{matrix}\dot{p}\\\
\dot{q}\\\ \dot{r}\end{matrix}\;\right]+\left[\;\begin{matrix}p\\\ q\\\
r\end{matrix}\;\right]\times\left[\;\begin{matrix}I_{xx}&0&0\\\ 0&I_{yy}&0\\\
0&0&I_{zz}\end{matrix}\;\right]\left[\;\begin{matrix}p\\\ q\\\
r\end{matrix}\;\right],\\\\[10.0pt] \left[\;\begin{matrix}\tau_{\phi}\\\
\tau_{\theta}\\\
\tau_{\psi}\end{matrix}\;\right]=\left[\;\begin{matrix}I_{xx}\dot{p}\\\
I_{yy}\dot{q}\\\ I_{zz}\dot{r}\end{matrix}\;\right]+\left[\;\begin{matrix}p\\\
q\\\ r\end{matrix}\;\right]\times\left[\;\begin{matrix}I_{xx}p\\\ I_{yy}q\\\
I_{zz}r\end{matrix}\;\right],\\\\[10.0pt] \left[\;\begin{matrix}\tau_{\phi}\\\
\tau_{\theta}\\\
\tau_{\psi}\end{matrix}\;\right]=\left[\;\begin{matrix}I_{xx}\dot{p}\\\
I_{yy}\dot{q}\\\
I_{zz}\dot{r}\end{matrix}\;\right]+\left[\;\begin{matrix}I_{zz}qr-I_{yy}qr\\\
-I_{zz}pr+I_{xx}pr\\\ I_{yy}pq-I_{xx}pq\\\
\end{matrix}\;\right]\end{gathered}$ (3.13)

where $\bm{J}$ is the inertia matrix of the quadcopter that contains the mass
moment of inertia of each axis $I_{xx},I_{yy}$ and $I_{zz}$.

It is possible to simplify (3.13) and isolate the vector
$\bm{\dot{v}}=[\;\dot{p},\;\dot{q},\;\dot{r}\;]^{T}$:

$\left[\;\begin{matrix}\dot{p}\\\ \dot{q}\\\
\dot{r}\end{matrix}\;\right]=\left[\;\begin{matrix}\tau_{\phi}/I_{xx}\\\
\tau_{\theta}/I_{yy}\\\
\tau_{\psi}/I_{zz}\end{matrix}\;\right]+\left[\;\begin{matrix}(I_{yy}-I_{zz})qr/I_{xx}\\\
(I_{zz}-I_{xx})pr/I_{yy}\\\ (I_{xx}-I_{yy})pq/I_{zz}\\\
\end{matrix}\;\right]{}$ (3.14)

Equation (3.14) can be transformed to the inertial frame after integration by
(3.8).

These Newton-Euler equations are considered simple because no external forces
or torques are included and they can be written in equation format as follows:

$\displaystyle\ddot{x}$
$\displaystyle=\frac{F}{m}(\text{cos}\psi\;\text{sin}\theta\;\text{cos}\phi+\text{sin}\psi\;\text{sin}\phi)$
(3.15) $\displaystyle\ddot{y}$
$\displaystyle=\frac{F}{m}(\text{sin}\psi\;\text{sin}\theta\;\text{cos}\phi-\text{cos}\psi\;\text{sin}\phi)$
(3.16) $\displaystyle\ddot{z}$
$\displaystyle=\frac{F}{m}(\text{cos}\theta\;\text{cos}\phi)-g$ (3.17)
$\displaystyle\dot{p}$
$\displaystyle=\frac{(I_{yy}-I_{zz})qr}{I_{xx}}+\frac{\tau_{\phi}}{I_{xx}}$
(3.18) $\displaystyle\dot{q}$
$\displaystyle=\frac{(I_{zz}-I_{xx})pr}{I_{yy}}+\frac{\tau_{\theta}}{I_{yy}}$
(3.19) $\displaystyle\dot{r}$
$\displaystyle=\frac{(I_{xx}-I_{yy})pq}{I_{zz}}+\frac{\tau_{\psi}}{I_{zz}}$
(3.20)

To summarize all equations in one page, the following are the transformation
between the angler velocities in the body frame and the inertial frame written
in equation format:

$\displaystyle\dot{\phi}$
$\displaystyle=p+\text{sin}\phi\;\text{tan}\theta\;q+\text{cos}\phi\;\text{tan}\theta\;r$
(3.21) $\displaystyle\dot{\theta}$
$\displaystyle=\text{cos}\phi\;q-\text{sin}\phi\;r$ (3.22)
$\displaystyle\dot{\psi}$
$\displaystyle=\text{sin}\phi/\text{cos}\theta\;q+\text{cos}\phi/\text{cos}\theta\;r$
(3.23)

##  Chapter 4 Open-loop behaviour

This chapter presents the open-loop behaviour of the quadcopter, where various
angular velocities are applied to the quadcopter. This gives an idea of how
quadcopters behave in response to the applied forces and also provides an
indication of how different combinations of angular velocities can yield
different quadcopter movements.

The first section of this chapter (4.1 Open-loop architecture) provides an
overview of the architecture that is used to build the dynamics of the
quadcopter and also explains each block of the architecture in more detail.

The second section of this chapter (4.2 Open-loop simulation) provides a
detailed description of the various angular velocities that are applied to the
quadcopter to control its movements and also illustrates the state of the
quadcopter in response to the applied forces through a simulation of the
flight dynamics.

###  4.1 Open-loop architecture

Figure 4.1 presents the open-loop architecture of the quadcopter. it contains
two main blocks, one generates the angular velocities of the motors and the
other gives the state of the quadcopter in response to the given signal.

Signal GeneratorSystem Dynamics$\left[\;\begin{matrix}\omega_{1}\\\
\omega_{2}\\\ \omega_{3}\\\ \omega_{4}\end{matrix}\;\right]$State =
$\left[\;\begin{matrix}\bm{\xi}\\\ \bm{\dot{\xi}}\\\ \bm{\Theta}\\\
\bm{v}\end{matrix}\;\right]$ Figure 4.1: Open-loop architecture.

The signal generator block is going to be discussed in the next section. Here,
the second block, system dynamics, is discussed in further details. Figure 4.2
illustrates the blocks arrangement inside the system dynamics main block.

ABCCalculate torquesEuler equationsNewton
equations$\left[\;\begin{matrix}\omega_{1}\\\ \omega_{2}\\\ \omega_{3}\\\
\omega_{4}\end{matrix}\;\right]$$\left[\;\begin{matrix}\tau_{\phi}\\\
\tau_{\theta}\\\
\tau_{\psi}\end{matrix}\;\right]$$F$$\left[\;\begin{matrix}\phi\\\ \theta\\\
\psi\end{matrix}\;\right]$$\left[\;\begin{matrix}x\\\ y\\\
z\end{matrix}\;\right]$ Figure 4.2: System dynamics architecture.

As noticed, it composed of three blocks. Block ”A” calculates the torques from
equation (3.10) and directs them to block ”B”. It also calculates the force
generated by the inputs angular velocities using equation (3.9) and directs
them to block ”C”.

Block ”B” starts by integrating the angular velocities, $\bm{v}$, after
calculating the angular accelerations, $\bm{\dot{v}}$, from equation (3.14).
This is followed by transforming the angular velocities, $\bm{v}$, from the
body frame to the angular velocities, $\bm{\dot{\Theta}}$, in the world frame
using the transformation in (3.8) and then integrating again to get Euler
angles, $\bm{\Theta}$.

Finally, block ”C” is a straightforward block, where it calculates the
translational acceleration, $\bm{\ddot{\xi}}$, from equation (3.12) and then
double integrating to get the translational position $\bm{\xi}$.

###  4.2 Open-loop simulation

The previous architecture is implemented in MATLAB Simulink 2019a for
simulation. The parameters of the quadcopter are determined experimentally, as
presented in Appendix A, and are shown in Table 4.1.

The simulation progresses at a sample time of 0.01 second to a total of 2
seconds. The state of the quadcopter, positions and velocities, are initially
set to zero which means that the body frame coincides with the inertial frame
and the quadcopter is initially stable.

Table 4.1: Parameter values for simulation. Parameter | Description | Value
---|---|---
m | Total mass of the quadcopter | 0.9 [kg]
g | Gravity acceleration | 9.81 [m/s2]
l | Arm length | 0.21 [m]
Ixx | Moment of inertia around x axis |  $1.467\times 10^{-2}$ [kg$\times$m2]
Iyy | Moment of inertia around y axis |  $1.667\times 10^{-2}$ [kg$\times$m2]
Izz | Moment of inertia around z axis |  $1.325\times 10^{-2}$ [kg $\times$m2]
CT | Thrust coefficient |  $4.980\times 10^{-8}$ [N/rpm2]
CD | Torque coefficient |  $5.804\times 10^{-9}$ [Nm/rpm2]

As discussed in section 3.1, four main movements of the quadcopter can be
achieved through different control inputs, which are the angular velocities of
the four motors. These movements are achieved here in four different stages,
each stage takes 2 seconds to complete. The control inputs used in each stage
are as follows:

$\displaystyle\omega_{1}$ $\displaystyle=\begin{cases}2000sin(\pi
t)+\omega_{e}&0\leq t\leq 2\\\ 500sin(\pi t)+\omega_{e}&2\leq t\leq 8\\\
\end{cases}$ (4.1) $\displaystyle\omega_{2}$
$\displaystyle=\begin{cases}2000sin(\pi t)+\omega_{e}&0\leq t\leq 2\\\
250sin(\pi t)+\omega_{e}&2\leq t\leq 4\;\text{or}\;6\leq t\leq 8\\\ 500sin(\pi
t)+\omega_{e}&4\leq t\leq 6\\\ \end{cases}$ (4.2) $\displaystyle\omega_{3}$
$\displaystyle=\begin{cases}2000sin(\pi t)+\omega_{e}&0\leq t\leq 2\\\
250sin(\pi t)+\omega_{e}&2\leq t\leq 6\\\ 500sin(\pi t)+\omega_{e}&6\leq t\leq
8\\\ \end{cases}$ (4.3) $\displaystyle\omega_{4}$
$\displaystyle=\begin{cases}2000sin(\pi t)+\omega_{e}&0\leq t\leq 2\\\
500sin(\pi t)+\omega_{e}&2\leq t\leq 4\\\ 250sin(\pi t)+\omega_{e}&4\leq t\leq
8\\\ \end{cases}$ (4.4)

where $\omega_{e}$ is the angular velocity of each motor that maintains an
equilibrium state of the quadcopter which is calculated in equation (5.5).

It is to be noted that the selection of such control inputs is not arbitrary,
as the angular velocities of the motors are almost smooth and because the
quadcopter is unstable, the time for each stage has to be tight so that the
response can be easily visualized. Also, since the sine function completes one
period each stage, it divides the stages equally into alternating values of
$\omega$.

Now, for the first 0.5 seconds, the angular velocities of the motors are
identical allowing the quadcopter to ascend in the first 0.25 seconds and then
to decelerate in the next 0.25 seconds until it steadily reaches an
approximate of 0.3 m.

This is followed by a roll movement, where the values of $\omega_{1}$ and
$\omega_{4}$ are bigger than the values of $\omega_{2}$ and $\omega_{3}$. This
rotates the angle $\phi$ to about 12∘ and consequently moves the quadcopter in
the y direction to reach approximately -0.1 m in the next 0.5 seconds. The
quadcopter will keep moving in the y direction because the angle $\phi$ does
not return to zero.

Next in the following 0.5 seconds, pitch movement is achieved by increasing
the values of $\omega_{1}$ and $\omega_{4}$ and decreasing the values of
$\omega_{2}$ and $\omega_{3}$ which is responsible for rotating the angle
$\theta$ of 10∘. Consequently, the quadcopter moves approximately 0.1 m in the
x direction. The $\psi$ angles also starts to increase because of the coupling
between the quadcopter’s states.

Finally in the last 0.5 seconds, the yaw movement is achieved by increasing
the values of $\omega_{1}$ and $\omega_{3}$ and decreasing the values of
$\omega_{2}$ and $\omega_{4}$ which is responsible for rotating the angle
$\psi$ of 10∘.

The inertial positions and angles of the quadcopter during the open-loop
simulation are presented in Figure 4.3 and Figure 4.4 respectively. The
control inputs are also illustrated in Figure 4.5.

Figure 4.3: Open-loop positions. Figure 4.4: Open-loop Euler angles. Figure
4.5: Open-loop control inputs.

##  Chapter 5 Controller design

This chapter presents the controller design approach that is adopted in this
work for stabilizing the altitude and attitude of the quadcopter. The
controller design is based on a linear approximation of the quadcopter model,
which its derivation is explained in details. The controller is then tested on
the original system dynamics, the nonlinear system dynamics.

The first section of this chapter (5.1 Linearization) provides a detailed
description of the linearization process that is used for control design and
also explains the operating point selection criteria.

The second section of this chapter (5.2 Control system architecture) provides
a detailed description of the various blocks involved in the feedback control
loop.

The third section of this chapter (5.3 Control system design) describes the
design process of a PID altitude and attitude controller for the quadcopter.
This design process is based on root locus technique by using MATLAB software.

The forth section of this chapter (5.4 Closed-loop behaviour) provides the
response of the nonlinear system dynamics due to the closed-loop system after
applying the developed controller.

###  5.1 Linearization

Linearization, in short, is a process of approximating the behavior of a
nonlinear function by a linear function that is close enough to the original
function. It is a technique used in many areas of engineering, notably in
control theory, to approximate nonlinearities. The approximation is then used
as a basis for the controller design to produce the desired system behaviour.

In general, linearization is performed around an operating point that
resembles the desired system behaviour. In the case of the quadrotor, the most
convenient operating point is the point at which the quadcopter is in hover
mode, which means that the quadcopter is at an equilibrium state. This implies
the following:

  * •

The roll and pitch angles are close to zero, hence Taylor’s first order
approximation of the trigonometric functions is adopted and thus any higher
order terms are omitted.

  * •

The angular velocities of the quadcopter are close to zero, hence higher order
terms are also omitted.

  * •

At an equilibrium state, inertial positions and the yaw movement can be
considered constants as they are indifferent in term of the linearization
process.

At equilibrium state and to make sure the quadcopter stays stationary in the
air, the forces generated by the motors should compensate for the weight of
the quadcopter, which is created by gravity in the z direction. This means the
quadcopter does not accelerate in the z direction, hence $\ddot{z}=0$. This
being said, equation (3.17) simplifies to:

$F=mg$ (5.1)

where the first order approximation of cos$t$ = 1.

Substituting $F$ from equation (3.9):

$C_{T}(\omega_{1e}^{2}+\omega_{2e}^{2}+\omega_{3e}^{2}+\omega_{4e}^{2})=mg$
(5.2)

Since the quadcopter is assumed to be symmetrical, the angular velocities of
the four motors must be equal, this means:

$\omega_{1e}^{2}=\omega_{2e}^{2}=\omega_{3e}^{2}=\omega_{4e}^{2}=\omega_{e}^{2}$
(5.3)

This leads to the following equation:

$\begin{split}4C_{T}\omega_{e}^{2}&=mg,\\\\[10.0pt]
\omega_{e}&=\sqrt{\frac{mg}{4C_{T}}}\end{split}$ (5.4)

Substituting the physical parameters from Table 4.1:

$\begin{split}\omega_{e}&=\sqrt{\frac{0.9\times 9.81}{4\times 4.980\times
10^{-8}}},\\\\[10.0pt] \omega_{e}&=6657.5\text{ [rpm]}\end{split}$ (5.5)

where $\omega_{e}$ is the required speed of each motor that would maintain the
hover state of the quadcopter.

Now, the linear relationship between the angular velocities in the body from
and the inertial frame is as follows:

$\begin{split}\dot{\phi}&=p+\phi\theta q+\theta r\\\ \dot{\theta}&=q-\phi r\\\
\dot{\psi}&=\phi q+r\end{split}$ (5.6)

where the first order approximation of sin$t$ and tan$t$ is equal to $t$.

By removing all higher order terms, it simplifies to:

$\left[\;\begin{matrix}\dot{\phi}\\\ \dot{\theta}\\\
\dot{\psi}\end{matrix}\;\right]=\left[\;\begin{matrix}p\\\ q\\\
r\end{matrix}\;\right]$ (5.7)

Finally, the linearized dynamic equations of the quadcopter are:

$\begin{split}\ddot{x}&=\frac{F}{m}(\theta\text{cos}\psi+\phi\text{sin}\psi),\\\\[10.0pt]
\ddot{y}&=\frac{F}{m}(\theta\text{sin}\psi-\phi\text{cos}\psi),\\\\[10.0pt]
\ddot{z}&=\frac{F}{m}-g\end{split}{}\quad\quad\begin{split}\ddot{\phi}&=\frac{\tau_{\phi}}{I_{xx}},\\\\[10.0pt]
\ddot{\theta}&=\frac{\tau_{\theta}}{I_{xx}},\\\\[10.0pt]
\ddot{\psi}&=\frac{\tau_{\psi}}{I_{zz}}\end{split}$ (5.8)

###  5.2 Control system architecture

The architecture of the feedback control system is presented in Figure 5.1.

DesiredControllerMixerQuadcopter dynamics$\left[\;\begin{matrix}z_{d}\\\
\phi_{d}\\\ \theta_{d}\\\
\psi_{d}\end{matrix}\;\right]$$\left[\;\begin{matrix}U_{1}\\\ U_{2}\\\
U_{3}\\\ U_{4}\end{matrix}\;\right]$$\left[\;\begin{matrix}\omega_{1}\\\
\omega_{2}\\\ \omega_{3}\\\
\omega_{4}\end{matrix}\;\right]$$\left[\;\begin{matrix}z\\\ \phi\\\ \theta\\\
\psi\end{matrix}\;\right]$ Figure 5.1: Control system architecture.

The system is implemented by four blocks and is designed to allow the
quadcopter to keep continuous track of the desired state. The quadcopter
dynamics block is explained in details in section (4.1). The desired block
holds the desired target values, which can be either constants or time-
varying.

The controller block implements four PD controllers for the four desired
states. Each controller handles a single desired state. As will be seen in the
next section, the controller block output is directly related to the force and
torques needed for the quadcopter to track the desired states:

$\left[\;\begin{matrix}U_{1}\\\ U_{2}\\\ U_{3}\\\
U_{4}\end{matrix}\;\right]=\left[\;\begin{matrix}F\\\ \tau_{\phi}\\\
\tau_{\theta}\\\ \tau_{\psi}\end{matrix}\;\right]$ (5.9)

These control signals need to be converted to he angular velocities of the
motors. This is achieved by the mixer block. The mixer block implements the
following equations, which are calculated from equation (3.9) and equations
(3.10):

$\begin{split}\omega_{1}^{2}=\frac{U_{1}}{4C_{T}}+\frac{U_{2}}{4dC_{T}}+\frac{U_{3}}{4dC_{T}}+\frac{U_{4}}{4C_{D}}\\\\[10.0pt]
\omega_{2}^{2}=\frac{U_{1}}{4C_{T}}-\frac{U_{2}}{4dC_{T}}+\frac{U_{3}}{4dC_{T}}-\frac{U_{4}}{4C_{D}}\\\\[10.0pt]
\omega_{3}^{2}=\frac{U_{1}}{4C_{T}}-\frac{U_{2}}{4dC_{T}}-\frac{U_{3}}{4dC_{T}}+\frac{U_{4}}{4C_{D}}\\\\[10.0pt]
\omega_{4}^{2}=\frac{U_{1}}{4C_{T}}+\frac{U_{2}}{4dC_{T}}-\frac{U_{3}}{4dC_{T}}-\frac{U_{4}}{4C_{D}}\end{split}$
(5.10)

Back to the controller block, Figure 5.2 shows the control loop architecture
for the attitude controller while Figure 5.3 shows the control loop
architecture for the altitude controller.

$s$$K_{D}$$K_{P}$$+$$-$$+$$+$$R(s)$$Y(s)$$E(s)$$U(s)$ Figure 5.2: Attitude
controller internal architecture.
$s$$K_{D}$$K_{P}$$mg$$+$$-$$+$$+$$+$$+$$R(s)$$Y(s)$$E(s)$$\bar{U}(s)$$U(s)$
Figure 5.3: Altitude controller internal architecture.

where $R(s)$ is the desired input, $Y(s)$ is the current output, $E(s)$ is the
error signal, $U(s)$ is the control signal, block ”$s$” represents the
derivation operation, $K_{P}$ is the proportional coefficient and $K_{D}$ is
the derivative coefficient.

The reason behind adding a forward term, $mg$, in the altitude control loop
and discarding the integral term in both loops is discussed in the next
section.

###  5.3 Control system design

After the mathematical model of the quadcopter was linearized, it is time to
transform the equations, which need to be controlled, to the $s$ domain. For
the linearized Euler equations, this transformation is straightforward and is
given as follows:

$\begin{split}\frac{\phi(s)}{\tau_{\phi}}=\frac{\phi(s)}{U_{2}(s)}&=\frac{1}{I_{xx}s^{2}}\\\\[10.0pt]
\frac{\theta(s)}{\tau_{\theta}}=\frac{\theta(s)}{U_{3}(s)}&=\frac{1}{I_{yy}s^{2}}\\\\[10.0pt]
\frac{\psi(s)}{\tau_{\psi}}=\frac{\psi(s)}{U_{4}(s)}&=\frac{1}{I_{zz}s^{2}}\end{split}$
(5.11)

The altitude equation does not satisfy the linear mapping conditions, which is
discussed in Appendix (B). Therefore, it cannot be directly transformed to a
transfer function. A workaround to this problem is as follows:

  1. 1.

Rearrange the equation:

$m\ddot{z}=F-mg$ (5.12)

  2. 2.

Make the following substitution:

$\bar{U}_{1}=U_{1}-mg,\quad U_{1}=F$ (5.13)

  3. 3.

The equation becomes:

$m\ddot{z}=\bar{U}_{1}$ (5.14)

  4. 4.

Transform the equation to the $s$ domain:

$\frac{z(s)}{\bar{U}_{1}}=\frac{1}{ms^{2}}$ (5.15)

  5. 5.

Make sure to substitute $U_{1}$ back to the equation after the controller is
designed as shown in Figure 5.3.

It is obvious that the transfer functions exhibit double integrator behaviour
which means that the steady state error is zero, as explained in Appendix C,
thus the integral term in the controller is not required. This also means the
system is unstable due to the fact that two poles are on the jw-axis, as shown
in the root locus plot in Figure 5.4.

$-1$$-0.8$$-0.6$$-0.4$$-0.2$$0$$0.2$$0.4$$0.6$$0.8$$1$$-1$$-0.5$$0$$0.5$$1$Real
AxisImaginary Axis Figure 5.4: Root locus of the open-loop transfer functions.

In this work, root locus design technique is adopted to design the PD
controller with the help of the Root Locus Designer that is provided by the
MATLAB software. Figure 5.5 shows the reshaped root locus for the controlled
altitude and attitude loop with the following PD controller parallel form:

$u(s)=K_{p}+K_{d}\frac{N}{1+N\frac{1}{s}}$ (5.16)

where $N$ is the filter coefficient.

$-120$$-100$$-80$$-60$$-40$$-20$$0$$20$$-10$$-5$$0$$5$$10$Real AxisImaginary
Axis$-1$$-0.5$$0$$-0.2$$0$$0.2$ Figure 5.5: Root locus of the controlled
altitude and attitude loop.

The coefficient values of the four PD controller are presented in Table 5.1.
The step response characteristics of these values is described in Table 5.2.

Table 5.1: Coefficient values for the PD controllers. Parameter | Proportional gain $K_{p}$ | Derivative gain $K_{d}$ | Filter value $N$
---|---|---|---
$z$ | $1.89\times 10^{-1}$ | $8.78\times 10^{-1}$ | 114.286
$\phi$ | $3.08\times 10^{-3}$ | $1.43\times 10^{-2}$ | 114.286
$\theta$ | $3.08\times 10^{-3}$ | $1.43\times 10^{-2}$ | 114.286
$\psi$ | $3.08\times 10^{-3}$ | $1.43\times 10^{-2}$ | 114.286
Table 5.2: Step response characteristics of the PD controllers. Performance | Value |  | Performance | Value
---|---|---|---|---
Rise time | 1.53 seconds |  | Settling time | 12 seconds
Overshoot | 12.5% |  | Peak | 1.12
Closed-loop stability | Stable |  |  |

###  5.4 Closed-loop behaviour

In this section, the performance of the developed PD controllers is tested by
a case study. The case study is intended to demonstrate the ability of the
developed controllers to stabilize the quadcopter from an initial conditions.

The developed feedback loop, presented in Figure 5.1, is implemented in MATLAB
Simulink 2019a using the PD values obtained in Table 5.1. The initial
conditions given to the quadcopter are:

$\left[\;\begin{matrix}z_{i}\\\ \phi_{i}\\\ \theta_{i}\\\
\psi_{i}\end{matrix}\;\right]=\left[\;\begin{matrix}2\text{ [m]}\\\
15^{\circ}\\\ 15^{\circ}\\\ 15^{\circ}\end{matrix}\;\right]$ (5.17)

The desired state for the altitude and the attitude is zero, since the
quadcopter is required to maintain the hover state. As before, the simulation
progress at a sample time of 0.01 seconds to a total of 20 seconds. The
position, attitude and control signals during the simulation are illustrated
in Figure 5.6, Figure 5.7 and Figure 5.8 respectively.

Figure 5.6: Closed-loop positions. Figure 5.7: Closed-loop Euler angles.
Figure 5.8: Closed-loop control signals.

As expected, the attitude reaches the desired value in about 12 seconds while
the altitude takes less time of about 6 seconds to reach zero. The attitude
initial values causes the x position to settle at round 16 m and the y
position at around -10 m.

The control signals shows a smooth response with maximum value of about 8000
rpm and a steady state value of about 6600 rpm. This makes sure that the
response is feasible and can be implemented in a hardware with fine tuning.

##  Chapter 6 Advanced Stabilization Controller

###  6.1 Fuzzy inference system

Fuzzy logic reflects how humans reason about changes, as it represents a
continues small changes to an output based on a given input. This is a natural
extension of the simple logic (e.g. finite state machines, Boolean) to include
more powerful operations such as the ability to represent a continues set of
states and outputs.

This means that for example representing a change in temperature, $f(T)$,
using Boolean logic would be something like this:

$f(T)=\begin{cases}0,\quad 0\leq T\leq 10\\\ 1,\quad 10<T\leq 20\end{cases}{}$
(6.1)

The conventional logic uses sharp distinctions between cases of a class. For
some applications, this is considered a problem because the output sharply
changes even if the input changes in a small amount (e.g. from 10 to 10.1).
Fuzzy logic solves exactly this problem.

The working of fuzzy inference system mainly consists of three steps, which
are briefly as follows:

  1. 1.

Fuzzification that is used to map crisp inputs into corresponding fuzzy values
based on predefined functions, called membership functions.

  2. 2.

Rule evaluation that is used to evaluate predefined rules, which are IF-THEN
statements, based on given fuzzy values.

  3. 3.

Defuzzification which is used to convert a fuzzy output to a crisp one.

In this work, these steps are achieved with the help of Fuzzy Toolbox of
MATLAB software. Also, the membership functions and the rules are obtained
automatically as will be discussed next. For more details of the fuzzy
inference system, check the book by Passino et al. [52].

###  6.2 ANFIS controller

Designing a fuzzy controller can be rather a hard task and for most of the
times, an expert is required to define precise rules and shape functional
membership functions. Adaptive Neuro-Fuzzy Inference System (ANFIS) is
considered a more efficient and optimal way to construct such controller.
ANFIS uses the power of neural network to construct an optimized fuzzy
inference system controller.

Training data that consists of the error and its rate of change are collected
and fed to the neural network along with the controller output to train and
construct reliable fuzzy controller. Fuzzy Toolbox of MATLAB is used to
develop the controller due to its ease of use. The inputs and outputs for the
four controllers are presented in Table 6.1. It is to be noted that roll,
pitch and yaw movements share the same fuzzy controller .

Table 6.1: The inputs and output of the fuzzy controller. Controller | Input 1 | Input 2 | Output
---|---|---|---
Altitude | $e_{z}$ | $\dot{e}_{z}$ | $U_{1}$
Attitude | $e_{\phi,\theta,\psi}$ | $\dot{e}_{\phi,\theta,\psi}$ | $U_{2,3,4}$

where $e_{t}$ is the error between the desired state, $t_{d}$, and the actual
state, $t_{a}$. The error is calculated as follows:

$e_{t}=t_{d}-t_{a}$ (6.2)

After the training is complete, five membership functions and a set of rules
are constructed. Figure 6.1 shows the rules expressed in a surface form for
both attitude and altitude while Figure 6.2 shows the generated membership
functions.

(a) Altitude

(b) Attitude

Figure 6.1: Surface rules of the fuzzy controller.

(a) Attitude: Input 1

(b) Attitude: Input 2

(c) Altitude: Input 1

(d) Altitude: Input 2

Figure 6.2: Membership functions of the fuzzy controller.

###  6.3 Closed-loop response

In this section, the performance of the developed fuzzy controller is compared
to the PD controller via two cases. The cases are intended to demonstrate the
ability of the developed fuzzy controllers to stabilize the quadcopter from an
initial conditions.

The developed feedback loop, presented in Figure 5.1, is implemented in MATLAB
Simulink 2019a using the fuzzy controller membership functions presented in
Figure 6.2. The desired state for the altitude and the attitude is zero for
both cases, since the quadcopter is required to maintain the hover state. As
before, the simulation progress at a sample time of 0.01 seconds to a total of
20 seconds.

####  6.3.1 Case I

For the second case, the initial conditions given to the quadcopter are:

$\left[\;\begin{matrix}z_{i}\\\ \phi_{i}\\\ \theta_{i}\\\
\psi_{i}\end{matrix}\;\right]=\left[\;\begin{matrix}2\text{ [m]}\\\
30^{\circ}\\\ -30^{\circ}\\\ 0^{\circ}\end{matrix}\;\right]$ (6.3)

It is obvious from Figure 6.3 that the fuzzy controller is far way better. For
the altitude, the settling time of the PD controller and the fuzzy controller
is 14 and 8 respectively. The fuzzy controller is 43% times better than the PD
controller. The fuzzy controller reaches the desired state with no overshoot
where as the PD controller responses with an overshoot of about 20%.

For the angle $\phi$, the settling time of the PD controller and the fuzzy
controller is 12 and 5 respectively. The fuzzy controller is 58% times better
than the PD controller. The fuzzy controller reaches the desired state with no
overshoot where as the PD controller responses with an overshoot of about 3%.
For the angles $\theta$, no obvious improvements occur.

(a) Angles $\phi$.

(b) Angle $\theta$.

(c) Angle $\psi$.

(d) Position z.

Figure 6.3: First case response.

It is to be noted that the angles $\psi$ deviate a little bit to a maximum of
3.7 deg and then returns to zero. This deviation happens due to the coupling
between the dynamics of the quadcopter. For angle $\psi$, this deviation can
be ignored.

####  6.3.2 Case II

For the second case, the initial conditions given to the quadcopter are:

$\left[\;\begin{matrix}z_{i}\\\ \phi_{i}\\\ \theta_{i}\\\
\psi_{i}\end{matrix}\;\right]=\left[\;\begin{matrix}0\text{ [m]}\\\
70^{\circ}\\\ -60^{\circ}\\\ 20^{\circ}\end{matrix}\;\right]$ (6.4)

The response of the attitude is approximately the same as the previous case.
The keynote here is for the altitude response. Both controller succeeded in
stabilizing the altitude, but the PD controller exhibit large overshoot
behaviour which is not acceptable. The fuzzy controller has way less overshoot
as noted from Figure 6.4.

It is important to note that even-though the PD controller was developed near
the hover state of the quadcopter but it does perform relatively good in
stabilizing the quadcopter.

(a) Angles $\phi$.

(b) Angle $\theta$.

(c) Angle $\psi$.

(d) Position z.

Figure 6.4: Second case response.

##  Chapter 7 Design Testing and Results

###  7.1 System Limitations and Compliance with Design Constraints

Developing a precise mathematical model of quadcopters can be quite a
challenging process due to the environmental impacts on the quadcopter. In
this project, we have not considered any external forces that might affect
quadcopter dynamics such as aerodynamic forces and drag effects. We also
assumed the quadcopter is rigid, symmetrical and the center of gravity is
exactly located in the middle, which is not always the case.

In addition, we linearized the model and made it only operate in a small
state, the hover state. Then, we developed a controller based on this model
which makes the controller operate perfectly only in the hover state. We are
also constrained by the physical properties of motors where the control signal
should be feasible.

###  7.2 Solution Impact

Robots have been used in many different areas throughout human history,
including in many of our most important and significant technological
achievements. From building the pyramids to operating our satellites, robots
have been crucial in the development of the modern world. One interesting area
is the use of drones as aerial surveillance tools. Today, drones are being
used for a wide variety of applications. Some have been used to map out parts
of the world quickly and accurately, while others have been used to deliver
packages to remote locations, and still others have been used to protect the
country’s borders from illegal crossings.

Drones are also being used as tools to help in the search for survivors after
natural disasters, and in the search for missing people. They are also being
used as part of the defense of Earth’s natural resources and in the fight
against disease-spreaders, drug smugglers, and terrorists. Drones are one of
the newest and most important tools of warfare, and their presence and impact
on our society are only going to grow as the technologies in the drone
industry continue to evolve.

They will soon be seen everywhere and will be used as tools in every aspect of
our lives, so much so that we may lose sight of their true role in our lives.
Drones are not just a tool for war and disaster relief. They are tools for the
21st century. They are a platform for innovation and collaboration. They can
provide real world assistance to people in need in the midst of natural
disasters and other catastrophes. Drones can assist with relief efforts by
providing low cost and high precision surveillance of the disaster area,
enabling people to make life-saving decisions and saving them time and money.
Drones can be used to provide communications and humanitarian aid. They can
also be used as a platform to enhance security, allowing for a better
understanding of the terrain, and protecting people. They can be used to
assist in search and rescue missions. And they can be used to protect property
and prevent crimes.

But the use of drones has also been used for more nefarious purposes. One such
use was the widespread use of Predator drones to kill suspected terrorists.
The use of drones for assassination has raised many privacy and ethical
concerns and there are even calls for a ban on the use of drones. But as more
countries begin using drones to spy on their citizens and spy on other
countries, it’s important to be cautious when it comes to how drones are used.

##  Chapter 8 Conclusion and Future work

###  8.1 Conclusion

In this project, we developed a simple mathematical model of the quadcopter in
a step by step manner. The derived model is then implemented in MATLAB
Simulink 2019a, a non-linear simulation environment. To validate the model, we
simulated the response of the open-loop system.

Now that the model is validated, we designed a PID controller to stabilize the
quadcopter and for that we used a linearized version of the quadcopter model.
The linearization is achieved around a given operation point, which is the
hover state, that made the calculations more simple and decoupled the system.

We then implemented the developed PID controller and simulated the closed-loop
response of the system. As expected, we found that the model is working
properly and gives reasonable results. We then went further and expanded the
region of operation of the quadcopter by developing a non-linear controller,
the ANFIS controller. We showed that the ANFIS controller clearly outperforms
the classical PID controller when the quadcopter operates far from the hover
state.

Finally, we successfully deployed the developed controllers on hardware but
due to Covid-19 pandemic, we were unable to test and debug. Therefore, we have
not included any details regarding the deployment process.

###  8.2 Recommendations for Future Work

This project can be expanded to include many new features or even use it to
try any new control algorithms. We can recommend a few improvements as
follows:

  1. 1.

Develop, implement and simulate aggressive controllers.

  2. 2.

Derive the equations that govern the positions of the quadcopter. Then, build
and implement trajectory tracking control loop.

  3. 3.

Improve the current mathematical model of the quadcopter to include more
environmental effects.

  4. 4.

Deploy, debug and test custom made trajectory tracking controllers based on
GPS readings.

##  Appendix A Parameter determination

This chapter summarizes the process of measuring the physical properties of
the quadcopter.

###  A.1 Mass

The quadcopter’s mass was measured by a food scale, as shown in Figure A.1. A
flat object was placed on the scale to ensure that the quadcopter remained
stable on the scale. The quadcopter’s mass, $m$, was equal to 900 grams.

Figure A.1: Mass measurement.

###  A.2 Arm length

The arm length was measured using a meter as shown in Figure A.2, and it was
found to be 22 cm.

Figure A.2: Arm length measurement.

###  A.3 Moment of inertia

The process of measuring the moment of inertia of the quadcopter depends on an
experiment known as the bifilar pendulum [53]. In this experiment, the
quadcopter is suspended using two strings of equal length.

Once the quadcopter is suspended and stops moving, the quadcopter is shifted
slightly from the equilibrium position. A stopwatch starts in conjunction with
the the start of the quadcopter’s movement and the number of seconds it takes
for the quadcopter to complete ten oscillations is recorded. This procedure is
repeated two more times in order to calculate the mean.

This procedure is repeated in the other two axes as presented in Figure A.3.
The results from the experiments are presented in Table A.1 where we recorded
the results three times for each axis and took the average.

Figure A.3: Moment of inertia measurements. Table A.1: Results for the moment of inertia experiment. Time (s) | About x | About x | About z
---|---|---|---
T1 | 12.15 | 12.76 | 13.32
T2 | 12.23 | 13.15 | 13.12
T3 | 12.15 | 13.09 | 13.41

After the measurements are determined, the moment of inertia is calculated for
each axis from the following equation [53]:

$I=\frac{mgT^{2}d^{2}}{16\pi^{2}L}$ (A.1)

where,
$m$ \- mass of the quadcopter, kg
$g$ \- gravity acceleration, ms-2
$T$ \- period of one oscillation, s
$d$ \- distance between strings, m
$L$ \- length of string, m

For this experimental setup the following values were measured,
$L=0.24$ m
$d=0.21$ m

##  Appendix B Linear mapping proof

In order to transform a given function, $f$, to the $s$ domain as a transfer
function, it has to satisfy the linear mapping conditions, additivity and
homogeneity [54]. Additivity is the operation of addition while homogeneity is
the operation of scalar multiplication. These two conditions are:

$\displaystyle f(u+v)$ $\displaystyle=f(u)+f(v)$ (B.1) $\displaystyle f(cv)$
$\displaystyle=cf(v)$ (B.2)

Recall, the linearized altitude equation is as follows:

$\ddot{z}=\frac{F}{m}-g$ (B.3)

After reassigning variables, the equation becomes:

$f(F)=\frac{F}{m}-g$ (B.4)

Checking for the additivity condition:

$\begin{split}f(u)&=\frac{u}{m}-g,\\\\[10.0pt]
f(v)&=\frac{v}{m}-g,\\\\[10.0pt] f(u)+f(v)&=\frac{u+v}{m}-2g,\\\\[10.0pt]
f(u+v)&=\frac{u+v}{m}-g,\\\\[10.0pt] f(u)+f(v)&\neq f(u+v)\end{split}$ (B.5)

Checking for the homogeneity condition:

$\begin{split}f(cv)&=\frac{cv}{m}-g,\\\\[10.0pt]
cf(v)&=\frac{cv}{m}-cg,\\\\[10.0pt] f(cv)&\neq cf(v)\end{split}$ (B.6)

This proves that the altitude equation does not satisfy the linear mapping
conditions, therefore it cannot be directly transformed to transfer function.

##  Appendix C Steady state error proof

According to the final value theorem, the steady state behaviour of $f(t)$
when $t\to\infty$ is related to the behaviour of $sF(s)$ when $s\to 0$
provided that $f(t)$ is the limit of $f(t)$ as $t\to\infty$ exists [55]. This
means:

$\lim_{t\to\infty}f(t)=\lim_{s\to 0}sF(s)$ (C.1)

Recall, the second order system is:

$G(s)=\frac{F(s)}{R(s)}=\frac{1}{Ks^{2}}$ (C.2)

where $K$ is a constant and $R(s)$ is the input.

The error of the system, $E(s)$, is found to be [56]:

$E(s)=\frac{R(s)}{1+G(s)}$ (C.3)

For a step input, $1/s$, the error becomes:

$\begin{split}e(\infty)&=\lim_{s\to 0}sE(s)\\\ &=\lim_{s\to
0}s\frac{1/s}{1+G(s)}\\\ &=\lim_{s\to 0}\frac{1}{1+G(s)}\\\ &=\lim_{s\to
0}\frac{1}{1+\frac{1}{Ks^{2}}}\\\ &=0\end{split}$ (C.4)

where $e(t)$ is the error in time domain.

For a ramp input, $1/s^{2}$, the error becomes:

$\begin{split}e(\infty)&=\lim_{s\to 0}sE(s)\\\ &=\lim_{s\to
0}s\frac{1/s^{2}}{1+G(s)}\\\ &=\lim_{s\to 0}\frac{1/s}{1+G(s)}\\\ &=\lim_{s\to
0}\frac{1/s}{1+\frac{1}{Ks^{2}}}\\\ &=\lim_{s\to
0}\frac{s}{s^{2}+\frac{1}{K}}\\\ &=0\end{split}$ (C.5)

This proves that the steady state error for the system dynamic equations is
zero due to step and ramp inputs.

## References

  * Mahony et al. [2012] Robert Mahony, Vijay Kumar, and Peter Corke.  Multirotor aerial vehicles: Modeling, estimation, and control of quadrotor.  _IEEE robotics & automation magazine_, 19(3):20–32, 2012.
  * Sabatino [2015] Francesco Sabatino.  Quadrotor control: modeling, nonlinearcontrol design, and simulation, 2015\.
  * Argentim et al. [2013] Lucas M Argentim, Willian C Rezende, Paulo E Santos, and Renato A Aguiar.  Pid, lqr and lqr-pid on a quadcopter platform.  In _2013 International Conference on Informatics, Electronics and Vision (ICIEV)_ , pages 1–6. IEEE, 2013.
  * Kuantama et al. [2018] Endrowednes Kuantama, Ioan Tarca, and Radu Tarca.  Feedback linearization lqr control for quadcopter position tracking.  In _2018 5th International Conference on Control, Decision and Information Technologies (CoDIT)_ , pages 204–209. IEEE, 2018.
  * Jiřinec [2011] Tomáš Jiřinec.  Stabilization and control of unmanned quadcopter, 2011.
  * Bresciani [2008] Tammaso Bresciani.  Modelling, identification and control of a quadrotor helicopter.  _MSc Theses_ , 2008.
  * Praveen et al. [2016] Viswanadhapalli Praveen, S Pillai, et al.  Modeling and simulation of quadcopter using pid controller.  _International Journal of Control Theory and Applications_ , 9(15):7151–7158, 2016.
  * Leong et al. [2012] Bernard Tat Meng Leong, Sew Ming Low, and Melanie Po-Leen Ooi.  Low-cost microcontroller-based hover control design of a quadcopter.  _Procedia Engineering_ , 41:458–464, 2012.
  * Kodgirwar et al. [2014] VP Kodgirwar, Vivek Kumar, Manish Shegokar, and Sushant Sawant.  Design of control system for quadcopter using complementary filter and pid controller.  _IJERT_ , 3(4), 2014.
  * Paiva et al. [2016] Ernesto Paiva, Juan Soto, Julio Salinas, and William Ipanaqué.  Modeling, simulation and implementation of a modified pid controller for stabilizing a quadcopter.  In _2016 IEEE International Conference on Automatica (ICA-ACCA)_ , pages 1–6. IEEE, 2016.
  * Islam et al. [2017] M Islam, M Okasha, and MM Idres.  Dynamics and control of quadcopter using linear model predictive control approach.  In _IOP Conference Series: Materials Science and Engineering_ , volume 270, page 012007. IOP Publishing, 2017.
  * Ganga and Dharmana [2017] G Ganga and Meher Madhu Dharmana.  Mpc controller for trajectory tracking control of quadcopter.  In _2017 International Conference on Circuit, Power and Computing Technologies (ICCPCT)_ , pages 1–6. IEEE, 2017.
  * Bemporad et al. [2009] Alberto Bemporad, Carlo A Pascucci, and Claudio Rocchi.  Hierarchical and hybrid model predictive control of quadcopter air vehicles.  _IFAC Proceedings Volumes_ , 42(17):14–19, 2009\.
  * Iskandarani et al. [2013] Mohamad Iskandarani, Sidney N Givigi, Camille Alain Rabbath, and Alain Beaulieu.  Linear model predictive control for the encirclement of a target using a quadrotor aircraft.  In _21st Mediterranean Conference on Control and Automation_ , pages 1550–1556. IEEE, 2013.
  * Rudol and Doherty [2016] Piotr Rudol and Patrick Doherty.  Bridging the mission-control gap: A flight command layer for mediating flight behaviours and continuous control.  In _2016 IEEE International Symposium on Safety, Security, and Rescue Robotics (SSRR)_ , pages 304–311. IEEE, 2016.
  * Aangenent [2008] WHTM Aangenent.  Nonlinear control for linear motion systems: an exploratory study.  2008\.
  * Bouabdallah and Siegwart [2005] Samir Bouabdallah and Roland Siegwart.  Backstepping and sliding-mode techniques applied to an indoor micro quadrotor.  In _Proceedings of the 2005 IEEE international conference on robotics and automation_ , pages 2247–2252. IEEE, 2005.
  * Xu and Ozguner [2006] Rong Xu and Umit Ozguner.  Sliding mode control of a quadrotor helicopter.  In _Proceedings of the 45th IEEE Conference on Decision and Control_ , pages 4957–4962. IEEE, 2006.
  * Xu and Özgüner [2008] Rong Xu and Ümit Özgüner.  Sliding mode control of a class of underactuated systems.  _Automatica_ , 44(1):233–241, 2008.
  * Sumantri et al. [2014] Bambang Sumantri, Naoki Uchiyama, and Shigenori Sano.  Second order sliding mode control for a quad-rotor helicopter with a nonlinear sliding surface.  In _2014 IEEE Conference on Control Applications (CCA)_ , pages 742–746. IEEE, 2014.
  * Sridhar et al. [2017] Siddharth Sridhar, Rumit Kumar, Mohammadreza Radmanesh, and Manish Kumar.  Non-linear sliding mode control of a tilting-rotor quadcopter.  In _ASME 2017 Dynamic Systems and Control Conference_. American Society of Mechanical Engineers Digital Collection, 2017.
  * Madani and Benallegue [2006a] Tarek Madani and Abdelaziz Benallegue.  Backstepping control for a quadrotor helicopter.  In _2006 IEEE/RSJ International Conference on Intelligent Robots and Systems_ , pages 3255–3260. IEEE, 2006a.
  * Madani and Benallegue [2006b] Tarek Madani and Abdelaziz Benallegue.  Control of a quadrotor mini-helicopter via full state backstepping technique.  In _Proceedings of the 45th IEEE Conference on Decision and Control_ , pages 1515–1520. IEEE, 2006b.
  * Fang and Gao [2011] Zheng Fang and Weinan Gao.  Adaptive integral backstepping control of a micro-quadrotor.  In _2011 2nd International Conference on Intelligent Control and Information Processing_ , volume 2, pages 910–915. IEEE, 2011.
  * Madani and Benallegue [2007] Tarek Madani and Abdelaziz Benallegue.  Sliding mode observer and backstepping control for a quadrotor unmanned aerial vehicles.  In _2007 American Control Conference_ , pages 5887–5892. IEEE, 2007\.
  * Dydek et al. [2012] Zachary T Dydek, Anuradha M Annaswamy, and Eugene Lavretsky.  Adaptive control of quadrotor uavs: A design trade study with flight evaluations.  _IEEE Transactions on control systems technology_ , 21(4):1400–1406, 2012.
  * Nicol et al. [2011] C Nicol, CJB Macnab, and A Ramirez-Serrano.  Robust adaptive control of a quadrotor helicopter.  _Mechatronics_ , 21(6):927–938, 2011.
  * Zhao et al. [2014] Bo Zhao, Bin Xian, Yao Zhang, and Xu Zhang.  Nonlinear robust adaptive tracking control of a quadrotor uav via immersion and invariance methodology.  _IEEE Transactions on Industrial Electronics_ , 62(5):2891–2902, 2014.
  * Palunko and Fierro [2011] Ivana Palunko and Rafael Fierro.  Adaptive control of a quadrotor with dynamic changes in the center of gravity.  _IFAC Proceedings Volumes_ , 44(1):2626–2631, 2011.
  * Zadeh [1965] Lotfi A Zadeh.  Fuzzy sets.  _Information and control_ , 8(3):338–353, 1965\.
  * Santoso et al. [2015] Fendy Santoso, Matthew A Garratt, and Sreenatha G Anavatti.  Fuzzy logic-based self-tuning autopilots for trajectory tracking of a low-cost quadcopter: A comparative study.  In _2015 International Conference on Advanced Mechatronics, Intelligent Manufacture, and Industrial Automation (ICAMIMIA)_ , pages 64–69. IEEE, 2015.
  * Olivares-Mendez et al. [2012] Miguel A Olivares-Mendez, Luis Mejias, Pascual Campoy, and Ignacio Mellado-Bataller.  Quadcopter see and avoid using a fuzzy controller.  In _Uncertainty Modeling in Knowledge Engineering and Decision Making_ , pages 1239–1244. World Scientific, 2012.
  * Talha et al. [2019] Muhammad Talha, Furqan Asghar, Ali Rohan, Mohammed Rabah, and Sung Ho Kim.  Fuzzy logic-based robust and autonomous safe landing for uav quadcopter.  _Arabian Journal for Science and Engineering_ , 44(3):2627–2639, 2019.
  * Kuantama et al. [2017] Endrowednes Kuantama, Tiberiu Vesselenyi, Simona Dzitac, and Radu Tarca.  Pid and fuzzy-pid control model for quadcopter attitude with disturbance parameter.  _International journal of computers communications & control_, 12(4):519–532, 2017.
  * Jang [1993] J-SR Jang.  Anfis: adaptive-network-based fuzzy inference system.  _IEEE transactions on systems, man, and cybernetics_ , 23(3):665–685, 1993.
  * Anjum et al. [2016] Asif Sajjad Khan Anjum, Rana Ali Sufian, Zain Abbas, and Ijaz Mansoor Qureshi.  Attitude control of quadcopter using adaptive neuro fuzzy control.  _International Journal of Hybrid Information Technology_ , 9(4):139–150, 2016.
  * Santoso et al. [2016] Fendy Santoso, Matthew A Garratt, and Sreenatha G Anavatti.  Adaptive neuro-fuzzy inference system identification for the dynamics of the ar. drone quadcopter.  In _2016 International Conference on Sustainable Energy Engineering and Application (ICSEEA)_ , pages 55–60. IEEE, 2016.
  * Dorzhigulov et al. [2018] Anuar Dorzhigulov, Batyrgali Bissengaliuly, Billie F Spencer, Jong Kim, and Alex Pappachen James.  Anfis based quadrotor drone altitude control implementation on raspberry pi platform.  _Analog Integrated Circuits and Signal Processing_ , 95(3):435–445, 2018.
  * Ponce et al. [2016] Pedro Ponce, Arturo Molina, Israel Cayetano, Jose Gallardo, Hugo Salcedo, Jose Rodriguez, and Isela Carrera.  Fuzzy logic sugeno controller type-2 for quadrotors based on anfis.  In _Nature-Inspired Computing for Control Systems_ , pages 195–230. Springer, 2016.
  * Li et al. [2017] Qiyang Li, Jingxing Qian, Zining Zhu, Xuchan Bao, Mohamed K Helwa, and Angela P Schoellig.  Deep neural networks for improved, impromptu trajectory tracking of quadrotors.  In _2017 IEEE International Conference on Robotics and Automation (ICRA)_ , pages 5183–5189. IEEE, 2017.
  * Boudjedir et al. [2012] Hana Boudjedir, Fouad Yacef, Omar Bouhali, and Nassim Rizoug.  Adaptive neural network for a quadrotor unmanned aerial vehicle.  _International Journal in Foundations of Computer Science and Technology_ , 2(4):1–13, 2012.
  * Efe [2011] Mehmet Önder Efe.  Neural network assisted computationally simple piλdμ control of a quadrotor uav.  _IEEE Transactions on Industrial Informatics_ , 7(2):354–361, 2011.
  * Siti et al. [2019] Imane Siti, Mostafa Mjahed, Hassan Ayad, and Abdeljalil El Kari.  New trajectory tracking approach for a quadcopter using genetic algorithm and reference model methods.  _Applied Sciences_ , 9(9):1780, 2019.
  * Noshahri and Kharrati [2014] Hengameh Noshahri and Hamed Kharrati.  Pid controller design for unmanned aerial vehicle using genetic algorithm.  In _2014 IEEE 23rd International Symposium on Industrial Electronics (ISIE)_ , pages 213–217. IEEE, 2014.
  * Nemes [2015] Attila Nemes.  Genetic algorithm-based adaptive fuzzy logic systems for dynamic modeling of quadrotors.  In _Proceedings of the 3rd International Conference MechEdu, Subotica Tech–College of Applied Sciences. Subotica_ , pages 96–103, 2015.
  * Pratama et al. [2019] Nasra Pratama, Fransiskus Xaverius Manggau, and Philipus Betaubun.  Attitude quadrotor control system with optimization of pid parameters based on fast genetic algorithm.  _International Journal of Mechanical Engineering and Technology (IJMET)_ , 10(1):335–343, 2019.
  * Zulu and John [2016] Andrew Zulu and Samuel John.  A review of control algorithms for autonomous quadrotors.  _arXiv preprint arXiv:1602.02622_ , 2016.
  * [48] Matlab international standards.  https://www.mathworks.com/solutions/automotive/standards/iec-61508.html.  Accessed: 2020-01-28.
  * Thu and Gavrilov [2017] Kyaw Myat Thu and AI Gavrilov.  Designing and modeling of quadcopter control system using l1 adaptive control.  _Procedia Computer Science_ , 103:528–535, 2017.
  * Agrawal and Shrivastav [2015] Kanaiya Agrawal and Punit Shrivastav.  Multi-rotors: A revolution in unmanned aerial vehicle.  _International Journal of Science and Research_ , 4(11):1800–1804, 2015.
  * Niemiec and Gandhi [2016] Robert Niemiec and Farhan Gandhi.  A comparison between quadrotor flight configurations.  2016\.
  * Passino et al. [1998] Kevin M Passino, Stephen Yurkovich, and Michael Reinfrank.  _Fuzzy control_ , volume 42.  Citeseer, 1998.
  * Amadi et al. [2018] Chinedu Amata Amadi et al.  _Design and implementation of a model predictive control on a pixhawk flight controller._ PhD thesis, Stellenbosch: Stellenbosch University, 2018.
  * Whitelaw [2019] Thomas A Whitelaw.  _Introduction to Linear Algebra_.  Routledge, 2019.
  * Franklin et al. [2015] Gene F Franklin, J David Powell, Abbas Emami-Naeini, and HS Sanjay.  _Feedback control of dynamic systems_.  Pearson London, 2015.
  * Shinners [1998] Stanley M Shinners.  _Modern control system theory and design_.  John Wiley & Sons, 1998.