Heba ElKholy Thesis S2014
Heba ElKholy Thesis S2014
Heba ElKholy Thesis S2014
A Thesis Submitted by
Spring 2014
ii
iv
Dynamic Modeling and Control of a Quadrotor Using Linear
and Nonlinear Approaches
by
Heba talla Mohamed Nabil ElKholy
Abstract
With the huge advancements in miniature sensors, actuators and processors depend-
ing mainly on the Micro and Nano-Electro-Mechanical-Systems (MEMS/NEMS),
many researches are now focusing on developing miniature flying vehicles to be used
in both research and commercial applications.
This thesis work presents a detailed mathematical model for a Vertical Takeoff
and Landing (VTOL) type Unmanned Aerial Vehicle(UAV) known as the quadrotor.
The nonlinear dynamic model of the quadrotor is formulated using the Newton-Euler
method, the formulated model is detailed including aerodynamic effects and rotor
dynamics that are omitted in many literature. The motion of the quadrotor can be
divided into two subsystems; a rotational subsystem (attitude and heading) and a
translational subsystem (altitude and x and y motion). Although the quadrotor is
a 6 DOF underactuated system, the derived rotational subsystem is fully actuated,
while the translational subsystem is underactuated.
The derivation of the mathematical model is followed by the development of four
control approaches to control the altitude, attitude, heading and position of the
quadrotor in space. The first approach is based on the linear Proportional-Derivative-
Integral (PID) controller. The second control approach is based on the nonlinear
Sliding Mode Controller (SMC). The third developed controller is a nonlinear Back-
stepping controller while the fourth is a Gain Scheduling based PID controller.
The parameters and gains of the forementioned controllers were tuned using Ge-
netic Algorithm (GA) technique to improve the systems dynamic response. Simula-
tion based experiments were conducted to evaluate and compare the performance of
the four developed control techniques in terms of dynamic performance, stability and
the effect of possible disturbances.
Keywords: Quadrotor, Quadcopter, UAV, VTOL, Nonlinear Control, PID, Sliding
Mode Control (SMC), Backstepping, Gain Scheduling, Genetic Algorithm (GA).
v
vi
Declaration
I hereby declare that this thesis represents my original work and all used references
are properly indicated and cited.
vii
viii
Acknowledgments
I would like to thank my supervisor Prof. Maki K. Habib for all his help, support
and guidance.
I would like to thank my mom and dad for their continuous support, for always
pushing me forward and for providing me with the calm environment to work in.
My good friend Amr Nagaty, words cannot express how thankful I am for all what
you have done.
Last but not least, my best friends Ingee, Marium, Mohamed Shalaby, Marwa,
Sara, Mary, Omar Shehata and Tarek, thank you for always being there for me and
encouraging me through the tough times.
ix
x
List of Figures
xi
4-8 PD Control Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4-9 Trajectory Response under PD . . . . . . . . . . . . . . . . . . . . . 57
4-10 Gain Scheduling Block Diagram . . . . . . . . . . . . . . . . . . . . . 58
4-11 Altitude Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
4-12 Attitude Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
4-13 Heading Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
4-14 Gain Sheduling based PD Control Inputs . . . . . . . . . . . . . . . . 63
4-15 SMC Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
4-16 SMC Controller Simulation Response . . . . . . . . . . . . . . . . . . 68
4-17 The Chattering Effect [29] . . . . . . . . . . . . . . . . . . . . . . . . 69
4-18 Derivative of Sliding Surface for c1 = 6.98, k1 = 2.66 and k2 = 6.64 . . 69
4-19 SMC Controller Simulation Response with Chattering Reduction . . . 71
4-20 Derivative of Altitudes Sliding Surface . . . . . . . . . . . . . . . . . 72
4-21 Roll Response for c1 = 1.98, k1 = 0.0010 and k2 = 1.33 . . . . . . . . 72
4-22 sgn vs. sat Functions [29] . . . . . . . . . . . . . . . . . . . . . . . . 73
4-23 Modified SMC Controller Simulation Response . . . . . . . . . . . . . 74
4-24 SMC Control Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
4-25 Trajectory Response under SMC . . . . . . . . . . . . . . . . . . . . . 75
4-26 Backstepping Controller Simulation Response . . . . . . . . . . . . . 82
4-27 Backstepping Control Inputs . . . . . . . . . . . . . . . . . . . . . . . 83
xii
List of Tables
5.1 System Settling Time Response Under Different Controllers in the Lin-
ear Region . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
5.2 System Overshoot Response Under Different Controllers in the Linear
Region . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
5.3 System Settling Time Response Under Different Controllers in the Non-
linear Region . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
5.4 System Overshoot Response Under Different Controllers in the Non-
linear Region . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
xiii
THIS PAGE INTENTIONALLY LEFT BLANK
xiv
Acronyms
GA Genetic Algorithm
LQ Linear Quadratic
PD Proportional-Derivative
PID Proportional-Integral-Derivative
RC Radio Controlled
xv
UAV Unmanned Aerial Vehicle
xvi
List of Symbols
A blade area
I Identity matrix
Jr rotors inertia
xvii
MB moments acting on the quadrotor in the body frame
R Rotation Matrix
V Lyapunov Function
X State vector
n speed of rotor n
Euler rates
roll angle
d Desired roll
yaw angle
d Desired yaw
air density
pitch angle
d Desired pitch
e Error
xviii
kd Derivative gain
ki Integral gain
kp Proportional gain
l moment arm
m mass of quadrotor
r radius of blade
s Sliding surface
xd Desired x position
yd Desired y position
zd Desired altitude z
xix
THIS PAGE INTENTIONALLY LEFT BLANK
xx
Contents
List of Figures xi
Acronyms xiv
Contents xxi
1 Introduction 1
1.1 Objectives and Motivation . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Unmanned Aerial Vehicles . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.1 History of UAVs . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.1.1 Military History . . . . . . . . . . . . . . . . . . . . 3
1.2.1.2 Civil History . . . . . . . . . . . . . . . . . . . . . . 4
1.2.2 Applications of UAVs . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.3 Classification of UAVs . . . . . . . . . . . . . . . . . . . . . . 6
1.2.3.1 Range of Action Classification . . . . . . . . . . . . . 6
1.2.3.2 Aerodynamic Configuration Classification . . . . . . 7
1.2.3.3 Size and Payload Classification . . . . . . . . . . . . 9
1.2.3.4 Levels of Autonomy Classification . . . . . . . . . . . 10
1.3 Quadrotors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.3.1 The Quadrotor Concept . . . . . . . . . . . . . . . . . . . . . 14
xxi
1.3.2 Advantages and Drawbacks of Quadrotors . . . . . . . . . . . 15
1.4 Thesis Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3 System Modeling 27
3.1 Kinematic Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.2 Dynamics Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.2.1 Rotational Equations of Motion . . . . . . . . . . . . . . . . . 30
3.2.2 Translational Equations of Motion . . . . . . . . . . . . . . . 34
3.3 Aerodynamic Effects . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.3.1 Drag Forces . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.3.2 Drag Moments . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.4 Rotor Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.5 State Space Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.5.1 State Vector X . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.5.2 Control Input Vector U . . . . . . . . . . . . . . . . . . . . . . 39
3.5.3 Rotational Equation of Motion . . . . . . . . . . . . . . . . . 41
3.5.4 Translational Equation of Motion . . . . . . . . . . . . . . . . 42
3.5.5 State Space Representation . . . . . . . . . . . . . . . . . . . 43
4 System Control 45
4.1 Open Loop Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . 45
4.2 Closed Loop Simulation . . . . . . . . . . . . . . . . . . . . . . . . . 46
xxii
4.2.1 Altitude Controller . . . . . . . . . . . . . . . . . . . . . . . . 47
4.2.2 Attitude and Heading Controller . . . . . . . . . . . . . . . . 47
4.2.3 Position Controller . . . . . . . . . . . . . . . . . . . . . . . . 47
4.3 Parameters Tuning Using GA . . . . . . . . . . . . . . . . . . . . . . 50
4.4 PID Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.4.1 Altitude Control . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.4.2 Attitude and Heading Control . . . . . . . . . . . . . . . . . . 52
4.4.2.1 Roll Controller . . . . . . . . . . . . . . . . . . . . . 52
4.4.2.2 Pitch Controller . . . . . . . . . . . . . . . . . . . . 52
4.4.2.3 Yaw Controller . . . . . . . . . . . . . . . . . . . . . 53
4.4.3 Position Controller . . . . . . . . . . . . . . . . . . . . . . . . 53
4.5 PID Controller Simulation . . . . . . . . . . . . . . . . . . . . . . . . 54
4.6 Gain Scheduling Based PD Controller . . . . . . . . . . . . . . . . . . 58
4.7 Gain Scheduling Based PD Controller Simulation Results . . . . . . . 59
4.7.1 Altitude Controller . . . . . . . . . . . . . . . . . . . . . . . . 59
4.7.2 Attitude Controller . . . . . . . . . . . . . . . . . . . . . . . . 59
4.7.3 Heading Controller . . . . . . . . . . . . . . . . . . . . . . . . 60
4.8 Sliding Mode Controller . . . . . . . . . . . . . . . . . . . . . . . . . 64
4.8.1 Introduction to SMC . . . . . . . . . . . . . . . . . . . . . . . 64
4.8.2 Attitude Control . . . . . . . . . . . . . . . . . . . . . . . . . 65
4.8.2.1 Roll Controller . . . . . . . . . . . . . . . . . . . . . 65
4.8.2.2 Pitch Controller . . . . . . . . . . . . . . . . . . . . 66
4.8.2.3 Yaw Controller . . . . . . . . . . . . . . . . . . . . . 66
4.8.3 Altitude Control . . . . . . . . . . . . . . . . . . . . . . . . . 66
4.9 SMC Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
4.10 SMC Chattering Reduction . . . . . . . . . . . . . . . . . . . . . . . 68
4.10.1 Re-tuning using GA . . . . . . . . . . . . . . . . . . . . . . . 69
4.10.1.1 Simulations . . . . . . . . . . . . . . . . . . . . . . . 70
4.10.2 Discontinuous to Continuous Control Law . . . . . . . . . . . 72
4.10.2.1 Simulations . . . . . . . . . . . . . . . . . . . . . . . 73
xxiii
4.11 Backstepping Controller . . . . . . . . . . . . . . . . . . . . . . . . . 76
4.11.1 Introduction to Backstepping . . . . . . . . . . . . . . . . . . 76
4.11.2 Attitude and Heading Control . . . . . . . . . . . . . . . . . . 76
4.11.2.1 Roll Controller . . . . . . . . . . . . . . . . . . . . . 76
4.11.2.2 Pitch Controller . . . . . . . . . . . . . . . . . . . . 79
4.11.2.3 Yaw Controller . . . . . . . . . . . . . . . . . . . . . 80
4.11.3 Altitude Control . . . . . . . . . . . . . . . . . . . . . . . . . 81
4.12 Backstepping Controller Simulation . . . . . . . . . . . . . . . . . . . 81
5 Results Discussion 85
5.1 Varying Trajectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.2 Performance in a Windy Environment . . . . . . . . . . . . . . . . . 86
5.3 Nonhovering Operation . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.4 Summary of Findings . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
6 Conclusion 95
C Listings 103
C.1 Quadrotor Parameters Initialization . . . . . . . . . . . . . . . . . . . 103
C.2 GA Parameters Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . 105
C.3 GA Objective Function . . . . . . . . . . . . . . . . . . . . . . . . . . 105
C.4 Quadrotor Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
C.4.1 Quadrotor Dynamics . . . . . . . . . . . . . . . . . . . . . . . 108
C.4.2 System Input Calculation . . . . . . . . . . . . . . . . . . . . 109
C.4.3 Motor Speed Calculation . . . . . . . . . . . . . . . . . . . . . 109
xxiv
C.4.4 Controller Blocks . . . . . . . . . . . . . . . . . . . . . . . . . 110
C.4.4.1 PID . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
C.4.4.2 SMC . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
C.4.4.3 Backstepping . . . . . . . . . . . . . . . . . . . . . . 112
Bibliography 113
xxv
xxvi
Chapter 1
Introduction
This chapter will first discuss the objectives and motivation behind writing this thesis.
A brief introduction about Unmanned Aerial Vehicles (UAVs), their history, types
and uses will then be presented. We will then move to the quadrotor type UAVs
and discuss their concept and architecture. Lastly, the structure of the thesis will be
outlined.
1
The contributions of this work are: deriving an accurate and detailed mathemat-
ical model of the quadrotor UAV, developing linear and nonlinear control algorithms
and applying those on the derived mathematical model in computer based simula-
tions. The thesis will be concluded with a comparison between the developed control
algorithms in terms of their dynamic performance and their ability to stabilize the
system under the effect of possible disturbances.
UAVs were mainly used in military application but recently they are being deployed
in civil applications too [5].
UAVs were first manufactured by Lawrence and Sperry (USA) in the year 1916. They
called it the Aviation Torpedo shown in Figure 1-1 and they were able to fly it for a
distance of 30 miles. It was reported that Lawrence and Sperry used a gyroscope to
balance the body [5].
2
Figure 1-1: Lawrence and Sperry UAV [5]
A great interest was shown by the USA to develop UAVs to be used in the World
War I (WWI) and two projects where funded. The first was by Elmer Sperry to
develop the Flying Bomb UAV and the second project was the Kettering Bug
manufactured by General Motors. Both projects were cancelled and the funding
stopped as they proved unsuccessful. This is due to the fact of the absence of the
required technological advances in the fields of guidance systems and engines [6].
Development of UAVs started increasing tremendously by the end of the 1950s, the
USA deployed them during the Vietnam War to decrease the casualties in pilots when
flying over hostile territories. After their success, the USA and Israel decided to invest
more to build smaller and cheaper UAVs, they used small motors like those found in
motorcycles to result in smaller sized and lighter UAVs. In addition, a video camera
was added on the UAVs to transmit images to the ground operator. In 1991, the USA
used UAVs extensively in the Gulf War, and the most famous model was the Predator
shown in Figure 1-2. UAVs were intensively used by the USA in many conflicts and
wars in the late 1990s and early 2000s and later on, UAVs were used extensively in
the war against Iraq [7].
3
Figure 1-2: Predator Military UAV [5]
The uses of UAVs were not only confined to military use; in 1969, NASA grew a
concern to automatically control an aircraft, the first trials was the PA-30 program.
The program was successful but they had a pilot onboard to take over the control
of the aircraft in case anything went wrong. Other research programs followed the
success of the PA-30 program like: Drones for Aerodynamic and Structural Testing
(DAST) and Highly Maneuverable Aircraft Technology (HiMAT) programs [8]. Fol-
lowing that era, in the 1990s NASA then partnered with industrial companies to
develop a nine-year long research project called the Environmental Research Aircraft
and Sensor Technology Project (ERAST). They developed several UAVs models that
were able to fly for altitudes up to 30 Km and endured flights up to 6 months. The
resulting UAV models included the: Pathfinder, Helios, Atlus and Perseus B. The de-
veloped UAVs carried several sensors to carry out environmental measurements, the
onboard sensors included a camera, a Digital Array Scanned Interferometer (DASI)
and an active detect, see and avoid (DSA) system [8].
In addition to the military use, UAVs can be used in many civil or commercial ap-
plications that are too dull, too dirty or too dangerous for manned aircrafts. These
uses include but not limited to:
4
Earth Science observations from UAVs can be used side-to-side with that acquired
from satellites. Such missions include [8]:
(a) Measuring deformations in the Earths crust that may be indications to natural
disasters like earthquakes, landslides or volcanos [8].
(c) Tropospheric pollution and air quality measurements to determine the pollution
sources and how plumes of pollution are transported from one place to another
[8, 9]..
(d) Ice sheet thickness and surface deformation for studying global warming [8].
(f) River discharge is measured from the volume of water flowing in a river at multiple
points. This will help in global and regional water balance studies [8].
Search and rescue UAVs equipped with cameras are used to search for survivors
after natural disasters like earthquakes and hurricanes or survivors from shipwrecks
and aircraft crashes [9, 10].
Wild fire suppression UAVs equipped with infrared sensors are sent to fly over
forests prone to fires in order to detect it in time and send a warning back to the
ground station with the exact location of the fire before it spreads [810].
Law enforcement UAVs are used as a cost efficient replacement of the traditional
manned police helicopters [10].
Border surveillance UAVs are used to patrol borders for any intruders, illegal
immigrants or drug and weapon smuggling [5, 8, 10].
5
Research UAVs are also used in research conducted in universities to proof certain
theories. Also, UAVs equipped with appropriate sensors are used by environmental
research institutions to monitor certain environmental phenomena like pollution over
large cities [10].
Agriculture development UAVs also have agriculture uses such as crops spraying
[5, 9, 10].
There are different ways to classify UAVs, either according to their range of action,
aerodynamic configuration, size and payload or according to their levels of autonomy.
UAVs can be classified into 7 different categories based on their maximum altitude
and endurance as follows [9]:
(a) High-Altitude Long-Endurance (HALE): they can fly over 15000 m high
with an endurance of more than 24 hr. They are mainly used for long-range
surveillance missions.
(c) Medium-Range or Tactical UAV (TUAV): They can fly between 100 and
300 km of altitude. They are smaller and operated with simpler systems that
their HALE and MALE counterparts.
6
(d) Close Range UAV: They have an operation range of 100 km. They are mainly
used in the civil application such as powerline inspection, crop-spraying, traffic
monitoring, homeland security, etc..
(e) Mini UAV (MUAV): They have a weight of about 20 kg and an operating
range of about 30 km.
(f) Micro UAV (MAV): They have a maximum wingspan of 150 mm. They are
mainly used indoors where they are required to fly slowly and hover
(g) Nano Air Vehicles (NAV): They have a small size of about 10 mm. they are
mainly used in swarms for applications such as radar confusion. They are also
used for short range surveillance if equipped with an equally small camera.
UAVs can be classified into four main categories based on their aerodynamic config-
uration as follows [9]:
(a) Fixed-wing UAVs: require a run-way to take-off and land. They can fly for
a long time and at high cruising speeds. They are mainly used in scientific ap-
plications such as meteorological reconnaissance and environmental monitoring,
shown in Figure 1-3.
7
(a) Single Rotor (b) Coaxial
(b) Rotary-wing UAVs: they can take off and land vertically. They can also
hover and fly with high maneuverability. The Rotary-wing UAVs can be further
classified into four groups [4]:
(i) Single-rotor: they have a main rotor on top and another rotor at the tail
for stability, same like the helicopter configuration. Shown in Figure 1-4(a).
(ii) Coaxial: they have two rotors rotating in opposite directions mounted to
the same shaft. Shown in Figure 1-4(b).
(iii) Quadrotor: they have four rotors fitted in a cross-like configuration. Shown
in Figure 1-4(c).
(iv) Multi-rotor: UAVs with six or eight rotors. They are agile type and fly
even when a motor fails, as there is redundancy due to the large number of
rotors. Shown in Figure 1-4(d).
Increasing the number of rotors in turn increases the payload and maximum
altitude of the UAVs but it comes at the cost of increasing the size and power
consumption.
(c) Blimps UAVs: which may look like balloons or airships, they ensure lifting by
8
their helium-filled body. They are very light and have a large size. They can fly
for a long time and at low speeds, shown in Figure 1-5.
(d) Flapping-wing UAVs: they are inspired from birds and flying insects. These
UAVs have small wings and have an extremely low payload and endurance. On
the other hand, they have low power consumption and can perform vertical take-
off and landing. This class of UAVs is still under development, shown in Figure 1-6
[5].
UAVs can be classified into five main classes based on their size and payload. Figure 1-
7 shows examples of these five classes as described below [3]:
(a) Full-Scale UAVs: these are normal sized vehicles, shown in Figure 1-7(a). Al-
though a pilot can be present on board, the vehicle is capable of autonomous
9
flying. The purpose of the pilot is to backup when trying complex flight tests
and maneuvers. Also, these vehicles have the highest payload and endurance.
(b) Medium-scale UAVs: these are the vehicles mainly used for security missions.
They have a relatively high payload of 10 kg enabling having heavy and high-
quality navigation sensors on board, thus achieving dependant flights. Figure 1-
7(b) shows an example of the Medium Scale UAV used in the US army.
(c) Small-scale UAVs: these are mainly UAVs based on Radio Controlled (RC)
toys, they have a lower payload of the range 2 to 10 kg, which enables them to
carry adequate quality navigation sensors. An example of a small-scale UAV is
shown in Figure 1-7(c).
(d) Mini UAVs: portable UAVs that are able to fly indoors and outdoors with a
payload of less than 2 kg which is sufficient to carry small lightweight sensors.
The small size, low cost and ease of maintenance of these UAVs makes them the
most common test- bed UAVs in research applications. An example of a mini
UAV is shown in Figure 1-7(d).
(e) Micro UAVs: mainly used indoors due to their very small size. They have
a payload of less than 100 g which makes it very hard to be equipped with
navigation and guidance sensors. The research challenge regarding these micro
UAVs is to design light-weight navigation and guidance sensors. An example of
a micro UAV is shown in Figure 1-7(e).
UAVs can be also classified according to their level of autonomy. The National Insti-
tute of Standards and Technology published a framework that can be used to classify
UAVs according to their autonomy level which is defined by three metrics namely:
Human Independence (HI), Mission Complexity (MC) and Environmental Complex-
ity (EC) [3, 4]. The framework proposes five levels of autonomy [4]:
10
(a) Full-Scale UAV (b) Medium-Scale UAVs
(a) Level 1: Full human interaction is needed to operate these UAVs as they are
purely remotely controlled. Level 1 UAVs are mainly used for the least complex
missions.
(b) Level 2: Still require human interaction but can perform more complex missions
than level 1 UAVs.
(c) Level 3: Moderate level of human interaction with moderate mission complexity.
(d) Level 4: Minimal human interaction, used in missions where the environment
is complex and dynamic and the reaction time of human operator may not be
sufficient to correctly navigate the UAV.
(e) Level 5: Zero human interaction, used to carry out missions in the most complex
environments. Literature claims that level 5 UAVs do not currently exist and they
serve as a goal for future research.
11
Although the National Institute of Standards and Technology proposed a five lev-
els classification framework that can be validly applied to UAVs, Kendoul finds that
framework is insufficient for a proper classification of current UAV systems and pro-
posed a new eleven-level framework called Autonomy Levels for Unmanned Rotorcraft
Systems [3]. In his new framework, Kendoul used six metrics to classify UAVs which
are: External System Independence (ESI), Environment Complexity (EC), Mission
Complexity (MC), External System (ES), Situational Awareness (SA) and Real Time
(RT) [4]. The framework is shown in Figure 1-8.
12
Figure 1-8: Kendouls 11-level Framework [3]
13
1.3 Quadrotors
The quadrotor concept for aerial vehicles was developed a long time ago. It was
reported that the Breguet-Richet quadrotor built in 1907 had actually flown. A
quadrotor is considered to be a rotary-wing UAV due to its configuration that will be
discussed later.
A quadrotor consists of four rotors, each fitted in one end of a cross-like structure as
shown in Figure 1-9. Each rotor consists of a propeller fitted to a separately powered
DC motor. Propellers 1 and 3 rotate in the same direction while propellers 2 and
4 rotate in an opposite direction leading to balancing the total system torque and
cancelling the gyroscopic and aerodynamics torques in stationary flights [1, 11].
The quadrotor is a 6 DOF object, thus 6 variables are used to express its position
in space (x, y, z, , and ). x, y and z represent the distances of the quadrotors
center of mass along the x,y and z axes respectively from an Earth fixed inertial frame.
, and are the three Euler angles representing the orientation of the quadrotor.
is called the roll angle which is the angle about the x-axis, is the pitch angle about
the y-axis, while is the yaw angle about the z-axis. Figure 1-10 clearly explains
the Euler Angles. The roll and pitch angles are usually called the attitude of the
quadrotor, while the yaw angle is referred to as the heading of the quadrotor. For
14
the linear motion, the distance from the ground is referred to as the altitude and the
x and y position in space is often called the position of the quadrotor.
To generate vertical upwards motion, the speed of the four propellers is increased
together whereas the speed is decreased to generate vertical downwards motion. To
produce roll rotation coupled with motion along the y-axis, the second and fourth
propellers speeds are changed while for the pitch rotation coupled with motion along
the x-axis, it is the first and third propellers speeds that need to be changed.
One problem with the quadrotor configuration is that to produce yaw rotation,
one need to have a difference in the opposite torque produced by each propeller pair.
For instance, for a positive yaw rotation, the speed of the two clockwise turning rotors
need to be increased while the speed of the two counterclockwise turning rotors need
to be decreased [11, 12]. Figure 1-11 shows how different movements can be produced,
note that a thicker arrow means a higher propeller speed.
Some advantages of the quadrotor over helicopters is that the rotor mechanics are
simplified as it depends on four fixed pitch rotors unlike the variable pitch rotor in
the helicopter, thus leading to easier manufacturing and maintenance. Moreover, due
15
Figure 1-11: Generated Motion of the Quadrotor [13]
to the symmetry in the configuration, the gyroscopic effects are reduced leading to
simpler control.
Stationary hovering can be more stable in quadrotors than in helicopters due to
the presence of four propellers providing four thrust forces shifted a fixed distance
from the center of gravity instead of only one propeller centered in the middle as in
the helicopters structure [1].
More advantages are the vertical take-off and landing capabilities, better maneu-
verability and smaller size due to the absence of a tail [14], these capabilities make
quadrotors useful in small area monitoring and buildings exploration [15].
Moreover, quadrotors have higher payload capacities due to the presence of four
motors thus providing higher thrust [1].
On the other hand, quadrotors consume a lot of energy due to the presence of
four separate propellers [15]. Also, they have a large size and heavier than some of
their counterparts again to the fact that there is four separate propellers [15, 16].
16
altitude and position of the quadrotor in space. The controllers are verified using
computer simulations and the results of these simulations are shown. Chapter 5
presents the discussion of the results acquired in the previous chapter and finally
Chapter 6 shows the conclusion and future work for this thesis.
17
THIS PAGE INTENTIONALLY LEFT BLANK
18
Chapter 2
Since the advances in technologies and the ability to manufacture miniature sensors
and controllers using the Micro-Electo-Mechanical Systems (MEMS) technologies,
there have been a lot of advances in the UAVs area. A lot of the research conducted
focused on the quadrotor due to its previously mentioned advantages of easier man-
ufacturing, compactness and maneuverability among others. Some literature focused
only on developing a control algorithm to be applied in a simulation environment
while others developed quadrotors models to test their proposed flight algorithm on.
This chapter discusses some of the most commonly used control techniques and some
of the hardware platforms used in research.
2.1 Control
There are several control techniques that can be used to control a quadrotor varying
between the classical linear Proportional-Integral-Derivative (PID) or Proportional-
Derivative (PD) controller to more complex nonlinear schemes as backstepping or
sliding-mode controllers. The flight control systems can be classified into four main
categories which are: linear fight control systems, non-linear flight control systems,
hybrid and learning-based flight control systems [3]. It was found that the most
common control technique used is the PID or PD controller. Although it is a lin-
ear controller used for the nonlinear multivariable quadrotor system, it was proven
19
successful in many literature [17].
They are the most common and conventional flight control systems, typically based
on PID, Linear Quadratic (LQ) or H algorithms. It was reported that in the
late 1960s, a full scale helicopter achieved autonomous waypoint navigation using a
classical linear control technique [3].
PID and LQ Bouabdallah et al. proposed the usage of PID and LQ control tech-
niques to be applied on an indoor micro quadrotor, it was found out that these two
types of controllers performed comparably and were able to stabilize the quadrotors
attitude around its hover position when it undergoes little disturbances [11, 17]. Li
and Li used the classical PID to control the position and orientation of a quadrotor
and it was able to stabilize in a low speed wind environment [14]. Yang et al. used
a self tuning PID controller based on adaptive pole placement to control the atti-
tude and heading of a quadrotor. Simulation showed that the proposed controller
performed well with online tuning of the parameters [18].
20
model of a STARMAC quadrotor to a set of simple hybrid modes and this approach
enabled the quadrotor to carry out aerobatic maneuvers [3, 20]. Also, Ataka et al.
used gain scheduling on a linearized model of the quadrotor around some equilibrium
points and tested the controllability and observability of the resulting system [21].
Amoozgar et al. used a gain scheduled PID controller with the laters parameters
tuned using a fuzzy logic inference scheme to control a quadrotor. The system was
tested under actuator fault conditions and compared with the performance of the
conventional PID controller. The results showed a better performance for the gain
scheduled PID controller [22]. Sadeghzadeh et al. also use a gain scheduled PID
controller applied to a quadrotor dropping a carried payload at a designated time.
The algorithm was able to stabilize the system during the dropping operation [23].
Due to the fact that the dynamics of the quadrotor is of a nonlinear nature, developing
nonlinear control algorithms to be used as flight controllers was necessary. There is
a variety of nonlinear control algorithms applied to quadrotors including: feedback
linearization, model predictive control, backstepping and sliding-mode.
21
subsystems. Their proposed algorithm was able to stabilize the system under no
disturbances [25]. Fang and Gao proposed merging a backstepping controller with
an adaptive controller to overcome the problems of model uncertainties and exter-
nal disturbances. The proposed adaptive integral backstepping algorithm was able
to reduce the systems overshoot and response time and eliminate steady state error
[26]. Lee et al. used a backstepping controller to control the position and attitude of
a quadrotor, the proposed controller was tested in a noisy environment and gave a
satisfactory performance [27]. Zhen et al. combined a backstepping controller with an
adaptive algorithm to control the attitude of a quadrotor. A robust adaptive function
is used to approximate the external disturbances and modeling errors of the system.
Simulations showed the success of the proposed controller in overcoming disturbances
and uncertainties [28]. Gonzalez et al. proposed using a chattering free sliding mode
controller to control the altitude of a quadrotor. The proposed controller performed
well in both simulations and on a real system in the presence of disturbances [29].
22
2.1.3 Learning-Based Flight Control Systems
Opposing the previous control techniques, learning based flight control systems do
not need a precise and accurate dynamic model of the system to be controlled. On
the other hand, several trials are carried out and flight data are used to train the
system. There are many types of learning-based flight control systems, the most
widely used are: neural networks, fuzzy logic and human-based learning.
Neural Network Efe used a Neural Network to simplify the design of a PID con-
troller and decrease the computational time and complexity [32].
Fuzzy Logic The idea behind fuzzy logic is to translate the knowledge and actions
of skilled human beings to a set of rules that can be used by a machine to execute a
certain task usually executed by humans. So for flight control systems, a skilled pilot
is usually the one doing the training for a fuzzy logic system [3].
In recent literature, it was found out that using only one type of flight control al-
gorithms was not sufficient to guarantee a good performance, specially when the
quadrotor is not flying near its nominal condition, so researchers are now propos-
ing using more than one type of flight control algorithms. Azzam and Wang used
a PD controller for altitude and yaw rotation and a PID controller integrated with
a backstepping controller for the pitch and roll control. An optimization algorithm
was used instead of the pole placement technique to overcome the difficulty of pole
placement in a nonlinear time variant system. The system was divided into rotational
and translation subsystems where the translation subsystem stabilizes the quadrotor
position in flight and generates the needed roll and pitch angles to be fed to the
rotational subsystem [5]. Nagaty et al. proposed the usage of a nested loop control
algorithm; the outer loop consists of a PID controller responsible for the generation
of the desired attitude angles that would achieve the desired position. These attitude
23
angles are then fed to the inner loop. The inner loop stabilization controller relies on
the backstepping algorithm to track the desired altitude, attitude and heading [33].
24
2.3 Research Challenges
After an intensive literature review of the control algorithms applied on quadrotors,
it was found out that one of the research challenges facing researchers in this field is
flying the quadrotor outside the linear or hovering region. Also, there no work focused
on having a comparative study that compares between employing different types of
controllers on the quadrotor system and comparing their performances in stabilizing
the quadrotor under different flight conditions and this will be the focus of this work.
25
THIS PAGE INTENTIONALLY LEFT BLANK
26
Chapter 3
System Modeling
In this chapter, the kinematics and dynamics models of a quadrotor will be derived
based on a Newton-Euler formalism with the following assumptions:
The center of gravity of the quadrotor coincides with the body fixed frame
origin.
After deriving the kinematics and dynamics models of the quadrotor, the aerody-
namic effects acting on the quadrotor body will be discussed together with the rotor
dynamics of the actuators of the quadrotor. The chapter will be ended with formulat-
ing a state space model for the quadrotor system that will be used in the subsequent
modeling chapter.
27
frame fixed on a specific place at ground level as its name implies, it uses the N-E-D
notation where the axes point to the North, East and Downwards respectively. On
the other hand, the body frame is at the center of the quadrotor body, with its x-axis
pointing towards propeller 1, y-axis pointing towards propeller 2 and the z-axis is
pointing to the ground.
The distance between the Earth frame and the body frame describes the absolute
position of the center of mass of the quadrotor r = [x y z]T . The rotation R from
the body frame to the inertial frame describes the orientation of the quadrotor. The
orientation of the quadrotor is described using roll, pitch and yaw angles (, and )
representing rotations about the X, Y and Z-axes respectively. Assuming the order of
rotation to be roll (), pitch () then yaw (), the rotation matrix R which is derived
based on the sequence of principle rotations is:
cc ssc csc + ss
R = cs sss + cc css sc (3.1)
s sc cc
where c and s denote cos and sin respectively. The derivation of the rotation
28
matrix R is shown in details in Appendix A.1.1.
The rotation matrix R will be used in formulating the dynamics model of the
quadrotor, its significance is due to the fact that some states are measured in the
body frame (e.g. the thrust forces produced by the propellers) while some others
are measured in the inertial frame (e.g. the gravitational forces and the quadrotors
position). Thus, to have a relation between both types of states, a transformation
from one frame to the other is needed.
To acquire information about the angular velocity of the quadrotor, typically
an on-board Inertial Measurement Unit (IMU) is used which will in turn give the
velocity in the body coordinate frame. To relate the Euler rates = [ ]T that are
measured in the inertial frame and angular body rates = [p q r]T , a transformation
is needed as follows:
= Rr (3.2)
where
1 0 sin
Rr = 0 cos sin cos
0 sin cos cos
Around the hover position, small angle assumption is made where cos 1, cos 1
and sin = sin = 0. Thus Rr can be simplified to an identity matrix I [33]. The
derivation for the previous transformation is shown in Appendix A.1.2.
29
3.2.1 Rotational Equations of Motion
The rotational equations of motion are derived in the body frame using the Newton-
Euler method with the following general formalism,
J + J + MG = MB (3.3)
Where:
J Quadrotors diagonal inertia Matrix
Angular body rates
MG Gyroscopic moments due to rotors inertia
MB Moments acting on the quadrotor in the body frame
The first two terms of Equation 3.3, J and J, represent the rate of change of an-
gular momentum in the body frame. While MG represent the gyroscopic moments due
to the rotors inertia Jr . The Gyroscopic moments are defined to be [0 0 Jr r ]T ,
thus the rotational equation of the quadrotors motion can be written as [33],
J + J + [0 0 Jr r ]T = MB (3.4)
Where:
Jr rotors inertia
r rotors relative speed r = 1 + 2 3 + 4
The reason behind deriving the rotational equations of motion in the body frame
and not in the inertial frame, is to have the inertia matrix independent on time.
30
Inertia Matrix
The inertia matrix for the quadrotor is a diagonal matrix, the off-diagonal elements,
which are the product of inertia, are zero due to the symmetry of the quadrotor.
Ixx 0 0
J = 0 Iyy 0 (3.5)
0 0 Izz
Where Ixx , Iyy and Izz are the area moments of inertia about the principle axes in
the body frame.
Gyroscopic Moment
For the last term of equation (3.4), there is a need to define two physical effects
which are the aerodynamic forces and moments produced by a rotor. As an effect of
rotation, there is a generated force called the aerodynamic force or the lift force and
there is a generated moment called the aerodynamic moment. Equations (3.6) and
(3.7) show the aerodynamic force Fi and moment Mi produced by the ith rotor [5].
1
Fi = ACT r2 2i (3.6)
2
1
Mi = ACD r2 2i (3.7)
2
31
where
air density
A blade area
CT , CD aerodynamic coefficients
rb radius of blade
i angular velocity of rotor i
Clearly, the aerodynamic forces and moments depend on the geometry of the propeller
and the air density. Since for the case of quadrotors, the maximum altitude is usually
limited, thus the air density can be considered constant, Equations (3.6) and (3.7)
can be simplified to [33],
Fi = Kf 2i (3.8)
Mi = KM 2i (3.9)
Where Kf and KM are the aerodynamic force and moment constants respectively and
i is the angular velocity of rotor i. The aerodynamic force and moment constants
can be determined experimentally for each propeller type.
By identifying the forces and moments generated by the propellers, we can study
the moments MB acting on the quadrotor. Figure 3-2 shows the forces and moments
acting on the quadrotor. Each rotor causes an upwards thrust force Fi and generates
a moment Mi with direction opposite to the direction of rotation of the corresponding
rotor i.
Starting with the moments about the body frames x-axis, by using the right-hand-
rule in association with the axes of the body frame, F2 multiplied by the moment arm l
generates a negative moment about the y-axis, while in the same manner, F4 generates
32
Figure 3-2: Forces and Moments acting on Quadrotor
a positive moment. Thus the total moment about the x-axis can be expressed as
Mx = F2 l + F4 l
= (Kf 22 )l + (Kf 24 )l
For the moments about the body frames y-axis, also using the right-hand-rule,
the thrust of rotor 1 generates a positive moment, while the thrust of rotor 3 generates
a negative moment about the y-axis. The total moment can be expressed as,
My = F1 l F3 l
= (Kf 21 )l (Kf 23 )l
For the moments about the body frames z-axis, the thrust of the rotors does
33
not cause a moment. On the other hand, moment caused by the rotors rotation as
per Equation 3.7. By using the right-hand-rule, the moment about the body frames
z-axis can be expressed as,
Mz = M1 M2 + M3 M4
= KM (21 22 + 23 24 )) (3.12)
where l is the moment arm, which is the distance between the axis of rotation of each
rotor to the origin of the body reference frame which should coincide with the center
of the quadrotor.
The translation equations of motion for the quadrotor are based on Newtons second
law and they are derived in the Earth inertial frame [33],
0
mr = 0 + RFB (3.14)
mg
Where
r = [x y z]T Quadrotors distance from the inertial frame
m Quadrotors mass
g gravitational acceleration g =9.81m/s2
FB nongravitational forces acting on the quadrotor in the body frame
34
Nongravitational Forces Acting on the Quadrotor
When the quadrotor is in a horizontal orientation (i.e. it is not rolling or pitching), the
only nongravitational forces acting on it is the thrust produced by the rotation of the
propellers which is proportional to the square of the angular velocity of the propeller
as per Equation (3.8). Thus, the nogravitational forces acting on the quadrotor, FB ,
can be expressed as,
0
FB = 0 (3.15)
Kf (21 + 22 + 23 + 24 )
The first two rows of the force vector are zeros as there is no forces in the X and
Y directions, the last row is simply an addition of the thrust forces produced by the
four propellers. The negative sign is due to the fact that the thrust is upwards while
the positive z-axis in the body framed is pointing downwards.
FB is multiplied by the rotation matrix R to transform the thrust forces of the
rotors from the body frame to the inertial frame, so that the equation can be applied
in any orientation of the quadrotor.
Due to the friction of the moving quadrotor body with air, a force acts on the body
of the quadrotor resisting the motion. As the velocity of travel of the quadrotor
increases, the drag forces in turn increase. The drag forces Fa can be approximated
35
by,
Fa = Kt r (3.16)
The same as the drag force, due to the air friction, there is a drag moment Ma acting
on the quadrotor body which can be approximated by,
Ma = Kr (3.18)
where Kr is a constant matrix called the aerodynamic rotation coefficient matrix and
is the Euler rates. Accordingly, the rotational equation of motion expressed by
Equation (3.4) can be rewritten to as,
J + J + [0 0 Jr r ]T = MB Ma (3.19)
36
DC motor. The schematic for a brushless DC motor at steady state is shown in
Figure 3-3.
dia
v = Rmot ia + Lmot + Kmot (3.20)
dt
where Rmot and Lmot are the ith motors resistance and inductance respectively, ia
is the armature current, v is the input voltage and the term Kmot represents the
generated emf, e, with Kmot as the motor torque constant. Since the quadrotor relies
on small motors, their inductance is very small and thus can be neglected leading to
or
v Kmot i
ia = (3.22)
Rmot
where Tmot is the torque produced by the motor which is equal to Ke ia , where Ke is
the motors electric constant and for small motors it is approximately equal to Kmot .
Tload is the load torque which is the torque generated from the propeller system which
37
is KM 2 as per Equation (3.7). Substituting the equations of Tmot and Tload together
with the current equation from Equation (3.22) yields,
v Kmot i
Jr i = Kmot KM 2i (3.24)
Rmot
After simplification the voltage can be written as a function of the rotors velocity as
follows
Rmot
v= Jr i + Kmot i + KM Rmot 2i (3.25)
Kmot
The rotor dynamics can be approximated to a first order lag transfer function with
its parameters (gain and time constant) identified experimentally by using a system
identification tool (e.g. MATLABs System Identification Toolbox). The transfer
function maps the desired propellers speed to the actual speed [16]. Depending
on the [OS4] quadrotor hardware in [16], the first order lag transfer function was
identified to be,
Brushless DC motor typically have their own embedded controllers and they work
with a Pulse Width Modulated (PWM) signal. The voltage supplied to the brushless
DC motor is directly proportional to the RPM of their rotation, the relationship can
be found by a black box identification process for the motor and propeller pair. The
constant of proportionality of this linear relationship appears as a gain in the transfer
function in (3.26). The application of the rotor dynamics transfer function will be
further elaborated in Section 4.1.
38
3.5.1 State Vector X
h iT
X= x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 (3.27)
which is mapped to the degrees of freedom of the quadrotor in the following manner,
h iT
X= z z x x y y (3.28)
The state vector defines the position of the quadrotor in space and its angular and
linear velocities.
h i
U= U1 U2 U3 U4 (3.29)
Where
U1 = Kf (21 + 22 + 23 + 24 ) (3.30)
U2 = Kf (22 + 24 ) (3.31)
U3 = Kf (21 23 ) (3.32)
U4 = KM (21 22 + 23 24 ) (3.33)
Equations (3.30) through (3.33) can be arranged in a matrix form to result in,
U1 Kf Kf Kf Kf 2
1
U2 0 Kf 0 Kf 22
= (3.34)
0 Kf 0 23
U3 Kf
U4 KM KM KM KM 24
39
U1 is the resulting upwards force of the four rotors which is responsible for the
altitude of the quadrotor and its rate of change (z, z). U2 is the difference in thrust
between rotors 2 and 4 which is responsible for the roll rotation and its rate of change
(, ). U3 on the other hand represents the difference in thrust between rotors 1
and 3 thus generating the pitch rotation and its rate of change (, ). Finally U4
is the difference in torque between the two clockwise turning rotors and the two
counterclockwise turning rotors generating the yaw rotation and ultimately its rate
of change (, ). This choice of the control vector U decouples the rotational system,
where U1 will generate the desired altitude of the quadrotor, U2 will generate the
desired roll angle, the desired pitch angle will be generated by U3 whereas U4 will
generate the desired heading.
If the rotor velocities are needed to be calculated from the control inputs, an
inverse relationship between the control inputs and the rotors velocities is needed,
which can be acquired by inverting the matrix in Equation (3.34) to give,
1 1 1
2 0 U
1 4Kf 2Kf 4KM 1
2 1
2 4K 2K1 f 0 4K1M U2
= f (3.35)
2 1
3 4K 0 2K1 f 1
U
4KM 3
f
1 1
24 4Kf 2Kf
0 4K1M U4
Taking the square root of that, the rotors velocities can be calculated from the
control inputs as follows,
s
1 1 1
1 = U1 + U3 + U4
4Kf 2Kf 4KM
s
1 1 1
2 = U1 U2 U4
4Kf 2Kf 4KM
s
1 1 1
3 = U1 U3 + U4
4Kf 2Kf 4KM
s
1 1 1
4 = U1 + U2 U4 (3.36)
4Kf 2Kf 4KM
40
3.5.3 Rotational Equation of Motion
Substituting equations (3.30) through (3.33) in equation (3.13), the equation of the
total moments acting on the quadrotor becomes
l U2
MB = l U3 (3.37)
U4
Substituting (3.37) into the rotational equation of motion (3.4) and expanding
each term with their prior definition from Chapter 3, the following relation can be
derived,
I 0 0 I 0 0 0 lU
xx xx 2
0 Iyy 0 + 0 Iyy 0 + 0 = l U3
0 0 Izz 0 0 Izz J r r U4
Rewriting the last equation to have the angular accelerations in terms of the other
variables,
l Jr Iyy Izz
= U2 r + (3.39)
Ixx Ixx Ixx Ixx
l Jr Izz Ixx
= U3 r + (3.40)
Iyy Iyy Iyy Iyy
1 Ixx Iyy
= U4 + (3.41)
Izz Izz Izz
41
To simplify, define,
Iyy Izz
a1 =
Ixx
Jr l
a2 = b1 =
Ixx Ixx
Izz Ixx l
a3 = b2 =
Iyy Iyy
Jr l
a4 = b3 =
Iyy Izz
Ixx Iyy
a5 =
Izz
= b1 U2 a2 x4 r + a1 x4 x6 (3.42)
= b2 U3 + a4 x2 r + a3 x2 x6 (3.43)
= b3 U4 + a5 x2 x4 (3.44)
With the choice of the control input vector U , it is clear that the rotational subsystem
is fully-actuated, it is only dependant on the rotational state variables x1 x6 that
correspond to , , , , , respectively.
Substituting equations (3.30) through (3.33) in equation (3.15), the equation of the
total moments acting on the quadrotor becomes,
0
FB = 0 (3.45)
U1
Embedding that into the translational equation of motion (3.14) and expanding the
42
terms, we get
x 0 cc css ss + ccs 0
m y = 0 + cs cc + sss css cs 0
z mg s cs cc U1
x 0 (ss + ccs)(U1 )
m y = 0 + (css cs)(U1 ) (3.46)
z mg (cc)(U1 )
Rewriting Equation (3.46) to have the accelerations in terms of the other variables,
we get
U1
x = (sin sin + cos cos sin ) (3.47)
m
U1
y = (cos sin sin cos sin ) (3.48)
m
U1
z = g (cos cos ) (3.49)
m
U1
x = (sin x1 sin x5 + cos x1 cos x5 sin x3 ) (3.50)
m
U1
y = (cos x1 sin x5 sin x3 cos x5 sin x1 ) (3.51)
m
U1
z = g (cos x1 cos x3 ) (3.52)
m
Using the equations of the rotational angular acceleration. Equations (3.42) to (3.44),
and those of translation, Equations (3.50) to (3.52), the complete mathematical model
43
of the quadrotor can be written in a state space representation as follows,
x1 = = x2
x2 = = x4 x6 a1 x4 r a2 + b1 U2
x3 = = x4
x4 = = x2 x6 a3 + x2 r a4 + b2 U3
x5 = = x6
x6 = = x2 x4 a5 + b3 U4
x7 = z = x8
U1
x8 = z = g (cos x1 cos x3 )
m
x9 = x = x10
U1
x10 = x = (sin x1 sin x5 + cos x1 sin x3 cos x5 )
m
x11 = y = x12
U1
x12 = y = (sin x1 cos x5 cos x1 sin x3 sin x5 )
m
x2
x4 x6 a1 x4 r a2 + b1 U2
x4
x2 x6 a3 + x2 r a4 + b2 U3
x6
x2 x4 a5 + b3 U4
f (X, U ) =
(3.53)
x8
g Um1 (cos x1 cos x3 )
x10
U1
m (sin x1 sin x5 + cos x1 sin x3 cos x5 )
x12
U1
m
(sin x1 cos x5 cos x1 sin x3 sin x5 )
44
Chapter 4
System Control
In this chapter, the formulated quadrotor model will be used in open-loop simulations
and controller design. Four controllers will be developed, a linear PID controller, non-
linear Sliding Mode, Backstepping and Gain Scheduling controllers. The parameters
and gains of these controllers will be tuned using Genetic Algorithm (GA). Computer
based simulations will then be implemented on MATLAB/Simulink and will be used
to asses the performance of the developed controllers.
45
The rotors speed required for the quadrotor to hover was calculated using the
following equation
mg = 4Fi
46
4.2.1 Altitude Controller
The open loop simulation previously developed was expanded to include an altitude
controller as shown in the block diagram in Figure 4-2. The altitude controller takes
an error signal e as an input which is the difference between the desired altitude zd
and the actual altitude z and produces a control signal U1 .
To control the attitude and heading of the quadrotor, the open loop simulation was
modified to include the attitude and heading controllers as shown in Figure 4-3.
Similar to the attitude controller block, the attitude and heading controller take as
an input an error signal e which is the difference between the desired roll d , pitch d
and yaw d and their actual values , and . The attitude and heading controller
produces the output signals U2 , U3 and U4 .
Unlike the altitude and orientation of the quadrotor, its x and y position is not
decoupled and cannot be directly controlled using one of the four control laws U1
through U4 . On the other hand, the x and y position can be controlled through the
roll and pitch angles. The desired roll and pitch angles d and d can be calculated
47
Figure 4-3: Block Diagram for Attitude and Heading Controller
from the translational equations of motion, Equations (3.47) and (3.48) as follows:
U1
x = (sin d sin + cos d sin d cos )
m
U1
y = (cos d sin d sin sin d cos )
m
Since the quadrotor is operating around hover, which means small values for the roll
and pitch angles and , we can use the small angle assumption (sin d d , sin d
d and cos d = cos d = 1) to simplify the above equations,
U1
x = (d sin + d cos ) (4.2)
m
U1
y = (d sin d cos ) (4.3)
m
48
which can be inverted to get
1
sin cos x
d = m d
d cos sin U1 yd
m sin cos xd
=
U1 cos sin yd
m xd sin + yd cos
= (4.5)
U1 xd cos yd sin
The controller blocks in the previous block diagrams can contain any type of
control algorithm, whether linear or nonlinear. All controllers input(s) are the error
related to some of the quadrotors states and produce an output which is either one
49
or several control inputs U1 through U4 or d and d if it is the position controller.
50
4.4 PID Controller
After the mathematical model of the quadrotor along with its open loop simulation
are verified, a PID controller was developed. The PID controller generates the desired
control inputs for the quadrotor. The block diagram for a PID controller is shown in
Figure 4-6.
where
kp Proportional gain
zd Desired altitude
kd Derivative gain
zd Desired altitude rate of change
ki Integral gain
51
4.4.2 Attitude and Heading Control
Another PID controller is developed to control the roll angle of the quadrotor. The
derived control law generates the input U2 that controls the roll angle as follows
Z
U2 = kp (d ) + kd (d ) + ki (d )dt (4.7)
where
kp Proportional gain
d Desired roll angle
kd Derivative gain
d Desired roll angle rate of change
ki Integral gain
A PID controller is developed to control the pitch angle of the quadrotor. The
derived control law generates the input U3 that controls the pitch angle as follows,
Z
U3 = kp (d ) + kd (d ) + ki (d )dt (4.8)
where
kp Proportional gain
d Desired pitch angle
kd Derivative gain
d Desired pitch angle rate of change
ki Integral gain
52
4.4.2.3 Yaw Controller
Similar to the pitch and roll controllers, a yaw controller was developed to generate
the control input U4 based on the following control law,
Z
U4 = kp (d ) + kd (d ) + ki (d )dt (4.9)
where
kp Proportional gain
d Desired yaw angle
kd Derivative gain
d Desired yaw angle rate of change
ki Integral gain
After acquiring stable controllers for the altitude and the attitude of the quadrotor,
a complete position controller is developed. PID controllers are used to calculate the
desired accelerations xd and yd
Z
xd = kp (xd x) + kd (xd x) + ki (xd x)dt (4.10)
Z
yd = kp (yd y) + kd (yd y) + ki (yd y)dt (4.11)
53
where
kp Proportional gain
xd Desired x position
kd Derivative gain
xd Desired x position rate of change
yd Desired y position
yd Desired y position rate of change
ki Integral gain
Plugging the values of the desired accelerations xd and yd into Equation (4.5), the
desired roll and pitch angles d and d can be calculated which are in turn fed to the
attitude controller previously expressed in Equations (4.7) and (4.8).
54
equivalent to that of the roll rotation. This theory was verified and proved using the
closed loop simulation and their results is shown in the attitude row in Table 4.1.
As with the roll and pitch, the performance of the y position controller was exactly
the same as the performance of the x position controller due to the symmetry of the
quadrotor.
Thus, a complete position and altitude PD controller was developed for the
quadrotor. This controller is able to perform well near hovering. The controller
was also tested in commanding the quadrotor to follow a circular trajectory as shown
in Figure 4-9.
55
(a) Altitude Response (b) Attitude Response
56
(a) Control Input U1 (b) Control Input U2
57
4.6 Gain Scheduling Based PD Controller
To overcome the shortcomings of the linear PD controller in its ability to only operate
in the linear near hover region, a gain scheduling based PD controller is proposed.
The theory behind gain scheduling is developing a set of controllers for different
operating points and switching between these controllers depending on the operating
point of the system [45]. In this work, a family of PD controllers will be developed,
each PD controller having different controller gains and will be able to stabilize the
quadrotor system in a certain range of operation. Gain scheduling will then be used
to choose an appropriate controller from the family of developed PD controllers.
This approach renders the classical PD controller an adaptive controller since the
controllers parameters are adapting to different operating conditions. Similar to the
previously implemented controllers, GA was used to acquire the control gains, that
would result in the least possible settling time, for the family of PD controllers are
different operating points. The acquired gains were used in a look up table fashion
in the developed MATLAB/Simulink model. The Block Diagram for the developed
Gain Scheduling based PD controller is shown in Figure 4-10.
58
4.7 Gain Scheduling Based PD Controller Simula-
tion Results
GA was used to tune the parameters of the PD controller for the system, the param-
eters for different desired altitudes are shown in Table 4.2 together with the resulted
settling time for the system. In order to show the strength of the developed gain
Table 4.2: Altitude Gain Scheduling Based PD Controller Gains and Results
scheduling based PD controller, it was tested to follow a wide range trajectory unlike
the step input that was used in the classical PD. The response shown in Figure 4-11
compares the performance of the classical PD to the gain scheduled PD.
For the roll and pitch control, GA was also used to find the controller gains for a set of
operating points. Table 4.3 shows the operating points together with their controller
gains and performance. Figure 4-12 shows a comparison between the performance of
59
Figure 4-11: Altitude Response
the gain scheduled PD controller and the classical PD controller in following a varying
trajectory.
Similar to the attitude controller, a look up table was synthesised for the heading con-
troller. The controller gains and their respective performances at multiple operating
points are shown in Table 4.4 and the response is shown in Figure 4-13.
The control inputs for the previous trajectories are shown in Figure 4-14.
60
Table 4.3: Attitude Gain Scheduling Based PD Controller Gains and Results
61
Table 4.4: Heading Gain Scheduling Based PD Controller Gains and Results
62
(a) Control Input U1 (b) Control Input U2
63
4.8 Sliding Mode Controller
Since the quadrotor system is a nonlinear type system, we proposed using a nonlinear
Sliding Mode Controller (SMC) to control the states of the quadrotor.
A SMC is a type of Variable Structure Control (VSC). It uses a high speed switching
control law to force the state trajectories to follow a specified, user defined surface in
the states space and to maintain the state trajectories on this surface [46]. The control
law for a SMC consists of two parts as per Equation (4.12); a corrective control part
and an equivalent control part. The corrective control function is to compensate any
variations of the state trajectories from the sliding surface in order to reach it. The
equivalent control on the other hand, makes sure the time derivative of the surface is
maintained to zero, so that the state trajectories would stay on the sliding surface.
Where
U (t) Control Law
Uc (t) Corrective Control
Ueq (t) Equivalent Control
64
4.8.2 Attitude Control
The sliding mode attitude controller is based on the approach used by Bouabdallah
and Siegwart [15].
The SMC is used to track a reference trajectory for the roll angle. The error in the
roll is defined as,
e = d (4.13)
s = c1 e + e (4.14)
where c1 is a constant that has to be greater than zero. This format is a common for-
mat for the sliding surface in tracking problems. The derivative of the sliding surface
defined in Equation (4.14) with the substitution of Equation (4.13) is formulated as
the following,
s = c1 e + e
= c1 (d ) + d (4.15)
1
V (e, s) = (e2 + s2 ) (4.16)
2
Based on the Lyapunov function, an exponential reaching law is proposed for the
sliding mode controller as follows
s = k1 sgn(s) k2 s (4.17)
65
where
1 if s < 0;
sgn(s) =
1 if s > 0.
and k1 and k2 are design constants. To satisfy the sliding mode condition ss < 0,
limits has to be set on k1 and k2 such as k1 > 0 and k2 > 0. By equating the proposed
reaching law (4.17) to the derivative of the sliding surface in Equation (4.15) and
substituting by its definition from Equation (3.42), the control input U2 is calculated
to be,
1
U2 = [k1 sgn(s) + k2 s + c1 (d ) + d + a2 r a1 ] (4.18)
b1
Following exactly the same steps as the roll controller, the control input U3 responsible
of generating the pitch rotation is calculated to be,
1
U3 = [k1 sgn(s) + k2 s + c1 (d ) + d a4 r a3 ] (4.19)
b2
Following the same steps as the roll and pitch controller, the control input U4 respon-
sible of producing the yaw rotation is calculated to be,
1
U4 = [k1 sgn(s) + k2 s + c1 (d ) + d a5 ] (4.20)
b3
As what has been done with the development of the attitude controllers, an altitude
SMC is implemented. The error is defined as,
e = z zd (4.21)
66
where zd is the desired altitude of the quadrotor. The sliding surface is defined as
previously
s = c1 e + e (4.22)
Also, c1 has to be a positive constant. The derivative of the sliding surface is then
equated to the exponential reaching law as follows
k1 sgn(s) k2 s = c1 (z zd ) + z zd (4.23)
Substituting z by its definition from equation (3.52), the control input U1 is calculated
to be
m
U1 = [k1 sgn(s) + k2 s + c1 (z zd ) + g zd ] (4.24)
cos cos
Due to the symmetry of the quadrotor, the results for the pitch controller were
67
(a) Altitude Response (b) Attitude Response
exactly the same as that of the roll and accordingly the GA produced the same control
gains.
68
(s < 0). Accordingly, the control law works to drive the trajectory again to (s = 0),
yet it passes it and this causes the famous chattering effect. The main drawbacks of
chattering are that it causes the excitation of unmodeled system dynamics that yields
a possible instability of the system. In addition to that it is associated with a high
power consumption and possible actuator damage. These drawbacks make the SMC
hard to be implemented on real systems [29].
The chattering can be observed more clearly in the plot of the derivative of the
sliding surface s for the altitude shown in Figure 4-18.
Figure 4-18: Derivative of Sliding Surface for c1 = 6.98, k1 = 2.66 and k2 = 6.64
69
the desired and actual response graphs starting from the settling time until the end
of the simulation time.
Z Tend
chat = k d k dt (4.25)
Ts
where
Ts Settling Time for Roll Response
Tend Simulation End Time
By visual inspection, Equation (4.25) did not provide accurate means of numer-
ically measuring the chattering of the SMC. Hence, another method was proposed
and verified for measuring the chattering which depends on the time derivative of the
sliding surface s. The lower s is, the lower the chattering.
4.10.1.1 Simulations
The result of Equation (4.26) was used as an objective function for the GA to calculate
the design gains. Table 4.6 shows the GA generated design parameters that result
in the least chattering and based on these parameters the resulting settling time and
overshoot of the system. The response is shown in Figure 4-19.
Using the chattering as the objective function of the GA led to the desired reduc-
tion of chattering but as a counter effect, the settling time of the system was largely
70
(a) Altitude Response (b) Attitude Response
affected. It resulted in an increase in the altitudes settling time from 0.57 sec to 3.11
sec. Figure 4-20 shows the derivative of the surface clearly indicating the absence of
chattering. The attitudes settling time increased from 0.8 sec to 15 sec. While that
of the heading increased from 0.74 to 5.25 sec.
For a final trial to optimize the traditional SMC, compromising between its per-
formance in terms of the settling time and chattering, the objective function given to
the GA was both the settling time and chattering of the roll angle. The control gains
were found to be c1 = 1.98, k1 = 0.0010 and k2 = 1.33 and they resulted in a settling
time of 3.57 sec and a minimal chattering effect as shown in Figure 4-21.
71
Figure 4-20: Derivative of Altitudes Sliding Surface
Another approach was proposed to get rid of the chattering effect. As stated ear-
lier, the reason behind chattering is the discontinuity of the control law due to the
presence of sgn function which is a discontinuous function. Replacing sgn with the
saturation function sat will change the control law to be a continuous one instead
of discontinuous. Figure 4-22 shows graphs of both functions. The sat function is
defined by,
s if |s| 1;
sat(s) =
sgn(s) if |s| > 1.
Thus, to implement this modification on the SMCs for our system, the sgn(s)
terms in Equations (4.18), (4.19), (4.20) and (4.24) should be replaced by sat(s/).
72
Figure 4-22: sgn vs. sat Functions [29]
Where is a constant that determines the slope of the line between 1 and -1, this
region is called the boundary region or boundary layer. Higher values means a
thicker boundary layer and thus an increase in the error [47].
4.10.2.1 Simulations
Using the obtained control parameters in Table 4.5 with the modified control laws
(replacing sgn(s) by sat(s/) in Equations (4.18), (4.19), (4.20) and (4.24)), chatter-
ing was eliminated as shown in Figure 4-23, the response graphs for altitude, attitude
and heading respectively. Also, the control inputs are shown in Figure 4-24. More-
over, the quadrotor was commanded to follow a circular trajectory and its response
graph is shown in Figure 4-25
73
(a) Altitude Response (b) Attitude Response
74
(a) Control Input U1 (b) Control Input U2
75
4.11 Backstepping Controller
In this section, a Backstepping controller is used to control the attitude, heading and
altitude of the quadrotor. The Backstepping controller is based on the state space
model derived in (3.53).
The first two states of the state space model in Equation (3.53) are the roll angle and
its rate of change. Extracting those we get:
x1 = x2 (4.27)
x2 = x4 x6 a1 x4 r a2 + b1 U2 (4.28)
The roll angle subsystem is in the strict feedback form (only the last state is a function
of the control input U2 ) which makes it easy to pick a positive definite Lyapunov
76
function for it,
1
V1 = z12 (4.29)
2
where z1 is the error between the desired and actual roll angle defined as follows,
z1 = x1d x1 (4.30)
The time derivative of the Lyapunov function defined in Equation (4.29) is derived
to be,
V1 = z1 z1 (4.31)
= z1 (x1d x1 ) (4.32)
V1 = z1 (x1d x2 ) (4.33)
where c1 is a positive constant. To satisfy this inequality the virtual control input
can be chosen to be,
Defining a new error variable z2 to be the deviation of the state x2 from its desired
77
value,
z2 = x2 x1d c1 z1 (4.36)
V1 = z1 z1
= z1 (x1d x2 )
= z1 z2 c1 z12 (4.37)
Note that the presence of the term z1 z2 in V1 may not lead to a negative semi-
definite time derivative but this will be taken care of in the next iteration of the
backstepping algorithm. The next step is to augment the first Lyapunov function V1
with a quadratic term in the second error variable z2 to get a positive definite V2 ,
1
V2 = V1 + z22 (4.38)
2
V2 = V1 + z2 z2
Choosing the positive definite bounding function to be W2 (z) = c1 z12 c2 z22 where
c2 is a positive definite and substituting by the value of x2 from equation (4.28) leads
to the following inequality,
78
Solving the last inequality, the control input U2 can be written as,
1
U2 = (c2 z2 + z1 x4 x6 a1 + x4 r a2 + x1d + c1 x1d c1 x2 ) (4.41)
b1
The pitch controller is derived in the same manner as the roll controller. The states
used are,
x3 = x4 (4.42)
x4 = x2 x6 a3 + x2 r a4 + b2 U3 (4.43)
1
V3 = z32 (4.44)
2
V3 = z3 z3
= z3 (x3d x4 ) (4.45)
z4 = x4 x3d c3 z3 (4.47)
79
Rewriting the Lyapunov functions time derivative
V3 = z3 z3
= z3 (x3d (z4 + x3 d + c3 z3 ))
= z3 z4 c3 z32 (4.48)
Augmenting the previous Lyapunov function with a quadratic term in the error
variable z4 ,
1
V4 = V3 + z42 (4.49)
2
replacing x4 with its definition from equation (4.43) and solving for U3 . The roll angle
control input is found to be,
1
U3 = (c4 z4 + z3 x2 x6 a3 x2 r a4 + x3d + c3 x3 d c3 x4 ) (4.51)
b2
Following exactly the same steps as the roll and pitch controllers, the control input
for the yaw angle is derived to be,
1
U4 = (c6 z6 + z5 x2 x4 a5 + x5d + c5 x5d c5 x6 ) (4.52)
b3
with
z5 = x5d x5 (4.53)
z6 = x6 x5d c5 z5 (4.54)
80
and c5 and c6 are positive constants.
For the altitude controller, the control input U1 is derived in the same manner as
U2 , U3 , U4 to be
m
U1 = (z7 + g x7d c7 x7d + c7 x8 + c8 z8 ) (4.55)
cos x1 cos x3
with
z7 = x7d x7 (4.56)
z8 = x8 x7d c7 z7 (4.57)
81
Table 4.7: Backstepping Controller Constants and Results
82
(a) Control Input U1 (b) Control Input U2
83
THIS PAGE INTENTIONALLY LEFT BLANK
84
Chapter 5
Results Discussion
85
Figure 5-2: Attitude Response
86
(a) Attitude Response with a desired attitude (b) Attitude Response with a desired attitude
of 2m of 5
87
(a) Attitude Response with a desired attitude (b) Attitude Response with a desired attitude
of 8 m of 80
Figure 5-5: System Response When Operated Outside the Linear Region
88
Nonlinear Operation When the controllers were used outside of the linear region
(away from hover), the PD controller failed to stabilize the system due to the fact
that PD comes out of a family of linear controllers. On the other hand, the SMC and
the Backstepping controller were able to stabilize the system with a good dynamic
performance as shown in Tables 5.3 and 5.4. The developed gain scheduled PD
controller was also not able to stabilize the system as it is also based on the linear
PD controller.
PD One notable advantage of the PD controller over the other implemented con-
trollers is that its control law is not a function of the system parameters, it is only
a function of the state error and its derivative making the control law less computa-
tionally intensive and easier to implement. Also, the controller is less prone to slight
variations or uncertainties in system parameters.
89
Control Effort Comparison Comparing the four developed controllers in terms
of their generated control signals, U1 through U4 , PD comes out to be the most energy
efficient (as shown in Figure 4-8) followed by Backstepping (Figure 4-27) and then
SMC (Figure 4-24). Gain scheduling based PD controllers (with their control signal
shown in Figure 4-14) suffer from spikes in the control signals due to the sudden
transition between one set of controller gains to the other, these sudden transitions
will probably lead to system instability if the controller was implemented on a real
system. To overcome this effect, a smoothing filter needs to be used to result in a
smooth transition before sending the control signals to the actuators. Also, changing
the switching variable to be the error of the state instead of the desired set point
might lead to decreasing the presence of the spikes in the control signals.
90
Choice of Controller The choice of the controller to be used will depend mainly
on the application, if the quadrotor is to be operating near a hovering condition,
a PD controller will be sufficient to stabilize it. On the other hand, if it will be
performing tough acrobatic maneuvers thus operating outside its linear region, a
SMC or a Backstepping controller should be employed. The environment too will
help make the choice, for example simulations showed that PD and Backstepping
controllers were more robust to disturbances which might come in the form of a
windy environment.
Table 5.1: System Settling Time Response Under Different Controllers in the Linear
Region
Table 5.2: System Overshoot Response Under Different Controllers in the Linear
Region
91
Table 5.3: System Settling Time Response Under Different Controllers in the
Nonlinear Region
Table 5.4: System Overshoot Response Under Different Controllers in the Nonlinear
Region
92
(a) SMC (b) Backstepping
93
THIS PAGE INTENTIONALLY LEFT BLANK
94
Chapter 6
Conclusion
The goal of this work was to derive a mathematical model for the quadrotor Un-
manned Aerial Vehicle (UAV) and develop linear and nonlinear control algorithms to
stabilize the states of the quadrotor, which include its altitude, attitude, heading and
position in space and to verify the performance of these controllers with comparisons
via computer simulations.
The mathematical model of a quadrotor UAV was developed in details including its
aerodynamic effects and rotor dynamics which we found lacking in many literatures.
Four control techniques were then developed and synthesized; a linear Proportional-
Integral-Derivative Proportional-Derivative (PD) controller, a Gain Scheduling based
PD controller, a nonlinear Sliding Mode Controller (SMC) and a nonlinear Backstep-
ping controller. A complete simulation was then implemented on MATLAB/Simulink
relying on the derived mathematical model of the quadrotor. The simulation envi-
ronment was used to evaluate the mentioned controllers and compare their dynamic
performances under different types of input conditions.
Tuning the parameters and constants of the four used controllers was done using
Genetic Algorithm (GA) where the objective function was the dynamic response of the
system in terms of its settling time and/or overshoot. The four controllers performed
comparably in near hovering operation of the quadrotor in the range of 0 20
of attitude and heading. The Gain Scheduling based PD controller gave a better
95
performance than the traditional PD controller when the quadrotor was commanded
to follow a varying trajectory. The SMC and Backstepping controllers gave better
performance outside the linear hovering region due to their nonlinear nature. The PD
and Backstepping controllers gave better performance than all the other controllers
when the effect of wind was added to the system. The wind effect was modeled as
extra forces and moments on the quadrotor body.
For future work, we recommend testing the Gain Scheduled PD controller in load
drop applications and actuators failure conditions and compare it to the three other
controllers. Also, changing the Gain Scheduled PD to have the switching to be a
function of the error and its derivative instead of the desired final value. This might
enhance its performance in following a varying trajectory. One valuable addition
would be the robustification of the developed control techniques against wind as this
is a common problem with quadrotors control and our simulation results showed a
huge degradation of the performance of the controllers when the system was exposed
to wind. Moreover, in our work it was assumed that all the model parameters are
known accurately without any uncertainties, which is not the case in reality, thus,
developing adaptive control algorithms to count for the system uncertainties would
enhance the performance of the quadrotor when operating in a real environment.
Adding an integral action to the developed Backstepping controller will lead to the
formulation of an adaptive control algorithm robust to system uncertainties. More-
over, sensors were assumed to be perfect which is not the case in reality, sensors
modeling and noise need to be taken into consideration and checking the effect on
system stability under the effect of the developed controllers. Last but not least,
implementing the developed control techniques on a real quadrotor hardware to give
a more fair comparison between their performances.
96
Appendix A
The notation Riv1 indicates a rotation from frame Fi which is the inertial frame to
frame Fv 1 which is the vehicle-1 frame.
The resulting frame v1 is then rotated by the pitch angle around its y-axis to
result in the vehicle-2 frame. The transformation from the vehicle-1 frame to the
97
vehicle-2 frame is given by
cos 0 sin
v2
Rv1 = 0 1 0 (A.2)
sin 0 cos
The last rotation is the rotation of the vehicle-2 frame about its x-axis to result
in the body frame. The transformation from the vehicle-2 frame to the body frame
is given by
1 0 0
b
Rv2 = 0 cos sin (A.3)
0 sin cos
Finally the rotation matrix or transformation from the inertial frame to the body
frame is given by
Rib = Rv2
b v2 v1
Rv1 Ri
1 0 0 cos 0 sin cos sin 0
= 0 cos sin 0 1 0 sin cos 0
0 sin cos sin 0 cos 0 0 1
cc cs s
= ssc cs sss + cs sc (A.4)
csc + ss css sc cc
where c and s denote cos and sin respectively. Note that due to the premultipli-
cation rule of rotation matrices, the order of rotation ( followed by followed by )
is opposite to that of the order of multiplication ( followed by followed by ).
In order to get the rotation matrix that transforms the body frame to the inertial
frame, the previous rotation matrix Rib is transposed, yielding
R = (Rib )T = Rbi
98
cc ssc csc + ss
= cs sss + cc css sc (A.5)
s sc cc
The transformation between the Euler rates = [ ]T and angular body rates
= [p q r]T shown in Equation (3.2) is derived as follows [50]
p 0 0
q = R() 0 + R()R() + R()R()R() 0 (A.6)
r 0 0
Note that , and are small thus R() = R() = R() = I, then
p 1 0 0 0 1 0 0 cos 0 sin 0
q = 0 + 0 cos sin + 0 cos sin 0 1 0 0
r 0 0 sin cos 0 0 sin cos sin 0 cos
sin
= cos + sin cos
sin + cos cos
1 0 sin
= 0 cos sin cos (A.7)
0 sin cos cos
99
THIS PAGE INTENTIONALLY LEFT BLANK
100
Appendix B
Quadrotor Parameters
This appendix contains the quadrotor parameters used in the simulations. These
parameters are adopted from Bouabdallahs thesis [16].
101
THIS PAGE INTENTIONALLY LEFT BLANK
102
Appendix C
Listings
1 clear
2 clc
3 close all
4 %% Ineria
5 Ixx=7.5e-3;
6 Iyy=7.5e-3;
7 Izz=1.3e-2;
8 % axel length
9 l=0.23;
10 %% rotor inertia
11 Jr=6e-5;
12 %% mass
13 m=0.650;
14 g=9.81;
15 %% aerodynamic force and moments constant
16 kf=3.13e-5;
17 km=7.5e-7;
18 %% aerodynamic coefficients
19 Krx=0;%0.1;
20 Kry=0;%;0.1;
103
21 Krz=0;%0.15;
22 Ktx=0;%0.1;
23 Kty=0;%0.1;
24 Ktz=0;%0.15;
25 %% constants calculations
26 a1=(Iyy-Izz)/Ixx;
27 a2=Jr/Ixx;
28 a3=(Izz-Ixx)/Iyy;
29 a4=Jr/Iyy;
30 a5=(Ixx-Iyy)/Izz;
31 b1=l/Ixx;
32 b2=l/Iyy;
33 b3=l/Izz;
34 %% Rotor Dynamics
35 R mot=0.6; %Motor Circuit Resistance
36 K mot=5.2; %Motor Torque Constant
37 %% Disturbances
38 noise rot=0;
39 noise trans=0;
40 %% PID Constants
41 ki Z=0;
42 ki Theta=0;
43 ki Phi=ki Theta;
44 ki Psi=0;
45 %% desired velocities and accelerations
46 z dot d=0;
47 phi dot d=0;
48 theta dot d=0;
49 psi dot d=0;
50 phi dot dot d=0;
51 theta dot dot d=0;
52 psi dot dot d=0;
53 z dot dot d=0;
54 x dot d=0;
55 y dot d=0;
56 %% hover omega
104
57 omega hover=sqrt( (m*g)/(4*kf) );
58 deltaU1 max=kf*4*omega hover2;
59 deltaU2 max=kf*omega hover2;
60 deltaU4 max=km*2*omega hover2;
61 omega max=(90*100)*9000*(2*pi/(60)); %90% of 9000 rpm to rad/s
62 U1 max=kf*4*omega max2;
63 U2 max=kf*omega max2;
64 U4 max=km*2*omega max2;
1 clear
2 clc
3 close all
4 initialize
5
6 %[k,Perf]=ga(@performancePID, 4)
7 %[k,Perf]=ga(@performancePIDGS, 2)
8 %[k,Perf]=ga(@performanceBackstepping, 2)
9 [k,Perf]=ga(@performanceSMC,3,[],[],[],[],[0.001;0.001;0.001],[])
1 function perf=performanceSMC(k)
2
105
8 assignin('base', 'k1 theta', 1)
9 assignin('base', 'k2 theta', 1)
10
19 assignin('base','epsilon',0.1)
20
31 perf=settlingTz
106
C.4 Quadrotor Model
107
C.4.1 Quadrotor Dynamics
108
C.4.2 System Input Calculation
109
C.4.4 Controller Blocks
C.4.4.1 PID
110
C.4.4.2 SMC
111
C.4.4.3 Backstepping
112
Bibliography
[1] Hongning Hou, Jian Zhuang, Hu Xia, Guanwei Wang, and Dehong Yu. A
simple controller of minisize quad-rotor vehicle. In Mechatronics and Automa-
tion (ICMA), 2010 International Conference on, pages 17011706, 2010. doi:
10.1109/ICMA.2010.5588802.
[2] Jinhyun Kim, Min-Sung Kang, and Sangdeok Park. Accurate modeling and
robust hovering control for a quadrotor vtol aircraft. Journal of Intelligent
and Robotic Systems, 57(1-4):926, 2010. ISSN 0921-0296. doi: 10.1007/
s10846-009-9369-z. URL http://dx.doi.org/10.1007/s10846-009-9369-z.
[3] Farid Kendoul. Survey of advances in guidance, navigation, and control of un-
manned rotorcraft systems. Journal of Field Robotics, 29(2):315378, 2012.
[4] Mark Willis Bailey. Unmanned aerial vehicle path planning and image processing
for orthoimagery and digital surface model generation. 2012.
[5] A. Azzam and Xinhua Wang. Quad rotor arial robot dynamic modeling and
configuration stabilization. In Informatics in Control, Automation and Robotics
(CAR), 2010 2nd International Asia Conference on, volume 1, pages 438444,
2010. doi: 10.1109/CAR.2010.5456804.
[7] JR Wilson. UAV worldwide roundup 2009. Aerospace America, 47(4), 2009.
[8] Timothy H Cox, Christopher J Nagy, Mark A Skoog, Ivan A Somers, and
R Warner. Civil UAV capability assessment. NASA, Tech. Rep., draft Version,
2004.
[9] Luis Rodolfo Garca Carrillo, Alejandro Enrique Dzul Lopez, Rogelio Lozano,
and Claude Pegard. Quad rotorcraft control, 2012.
[10] Zak Sarris and STN ATLAS. Survey of UAV applications in civil markets (june
2001). In The 9 th IEEE Mediterranean Conference on Control and Automation
(MED01), 2001.
113
[11] S. Bouabdallah, A. Noth, and R. Siegwart. PID vs LQ control techniques ap-
plied to an indoor micro quadrotor. In Intelligent Robots and Systems, 2004.
(IROS 2004). Proceedings. 2004 IEEE/RSJ International Conference on, vol-
ume 3, pages 24512456 vol.3, 2004. doi: 10.1109/IROS.2004.1389776.
[12] V. Mistler, A. Benallegue, and N.K. MSirdi. Exact linearization and nonin-
teracting control of a 4 rotors helicopter via dynamic feedback. In Robot and
Human Interactive Communication, 2001. Proceedings. 10th IEEE International
Workshop on, pages 586593, 2001. doi: 10.1109/ROMAN.2001.981968.
[14] Jun Li and Yuntang Li. Dynamic analysis and PID control for a quadrotor. In
Mechatronics and Automation (ICMA), 2011 International Conference on, pages
573578, 2011. doi: 10.1109/ICMA.2011.5985724.
[16] Samir Bouabdallah. Design and control of quadrotors with application to au-
tonomous flying. Phd. thesis, Ecole Polytechnique Federale de Lausanne, 2007.
[17] Paul Edward Ian Pounds. Design, construction and control of a large quadrotor
micro air vehicle. Phd. thesis, Australian National University, 2007.
[18] Jinpeng Yang, Zhihao Cai, Qing Lin, and Yingxun Wang. Self-tuning pid control
design for quadrotor uav based on adaptive pole placement control. In Chinese
Automation Congress (CAC), 2013, pages 233237. IEEE, 2013.
[20] Jeremy H Gillula, Gabriel M Hoffmann, Haomiao Huang, Michael P Vitus, and
Claire J Tomlin. Applications of hybrid reachability analysis to robotic aerial
vehicles. The International Journal of Robotics Research, 30(3):335354, 2011.
114
[22] Mohammad Hadi Amoozgar, Abbas Chamseddine, and YM Zhang. Fault-
tolerant fuzzy gain scheduled pid for a quadrotor helicopter testbed in the pres-
ence of actuator faults. In IFAC Conference on Advances in PID Control, Bres-
cia, Italy (March 2012), 2012.
[24] S.L. Waslander, G.M. Hoffmann, Jung Soon Jang, and C.J. Tomlin. Multi-
agent quadrotor testbed control design: integral sliding mode vs. reinforcement
learning. In Intelligent Robots and Systems, 2005. (IROS 2005). 2005 IEEE/RSJ
International Conference on, pages 37123717, 2005. doi: 10.1109/IROS.2005.
1545025.
[26] Zheng Fang and Weinan Gao. Adaptive backstepping control of an indoor micro-
quadrotor. Research Journal of Applied Sciences, 4, 2012.
[27] Hyeonbeom Lee, Suseong Kim, Tyler Ryan, and H Jin Kim. Backstepping control
on se (3) of a micro quadrotor for stable trajectory tracking. In Systems, Man,
and Cybernetics (SMC), 2013 IEEE International Conference on, pages 4522
4527. IEEE, 2013.
[28] Hongtao Zhen, Xiaohui Qi, and Hairui Dong. An adaptive block backstepping
controller for attitude stabilization of a quadrotor helicopter. WSEAS Transac-
tions on Systems & Control, 8(2), 2013.
[29] Ivan Gonzalez, Sergio Salazar, and Rogelio Lozano. Chattering-free sliding mode
altitude control for a quad-rotor aircraft: Real-time application. Journal of
Intelligent & Robotic Systems, 73(1-4):137155, 2014.
[30] Farid Kendoul, Zhenyu Yu, and Kenzo Nonami. Guidance and nonlinear control
system for autonomous flight of minirotorcraft unmanned aerial vehicles. Journal
of Field Robotics, 27(3):311334, 2010.
[31] Kostas Alexis, George Nikolakopoulos, and Anthony Tzes. Switching model
predictive attitude control for a quadrotor helicopter subject to atmospheric
disturbances. Control Engineering Practice, 19(10):11951207, 2011.
[32] M.O. Efe. Neural network assisted computationally simple pid control of a
quadrotor uav. Industrial Informatics, IEEE Transactions on, 7(2):354361,
2011. ISSN 1551-3203. doi: 10.1109/TII.2011.2123906.
115
[33] Amr Nagaty, Sajad Saeedi, Carl Thibault, Mae Seto, and Howard Li. Con-
trol and navigation framework for quadrotor helicopters. Journal of Intelli-
gent and Robotic Systems, 70(1-4):112, 2013. ISSN 0921-0296. doi: 10.1007/
s10846-012-9789-z. URL http://dx.doi.org/10.1007/s10846-012-9789-z.
[34] Gabriel M Hoffmann, Haomiao Huang, Steven L Waslander, and Claire J Tomlin.
Quadrotor helicopter flight dynamics and control: Theory and experiment. In
Proc. of the AIAA Guidance, Navigation, and Control Conference, pages 120,
2007.
[35] Jun Jiang, Juntong Qi, Dalei Song, and Jianda Han. Control platform design and
experiment of a quadrotor. In Control Conference (CCC), 2013 32nd Chinese,
pages 29742979. IEEE, 2013.
[37] MIT Aerospace Controls Lab. Accessed 15 April 2014. URL http://acl.mit.
edu/.
[38] MIT Robust Robotics Group. Accessed 15 April 2014. URL http://groups.
csail.mit.edu/rrg/.
[39] University of Pennsylvania GRASP Lab. Accessed 15 April 2014. URL https:
//www.grasp.upenn.edu/.
[44] Gergely Regula. Formation control of autonomous aerial vehicles. Phd thesis,
Budapest University of Technology and Economics, 2013.
[45] Kenneth H McNichols and M Sami Fadali. Selecting operating points for discrete-
time gain scheduling. Computers & Electrical Engineering, 29(2):289301, 2003.
[46] Jinkun Liu and Xinhua Wang. Advanced Sliding Mode Control for Mechanical
Systems: Design, Analysis and MATLAB Simulation. Springer, 2012.
116
[47] Chyun-Chau Fuh et al. Variable-thickness boundary layers for sliding mode
control. Journal of Marine Science and Technology, 16(4):286292, 2008.
[49] Horacio J Marquez. Nonlinear control systems: analysis and design. John Wiley,
2003.
[50] Randal W Beard. Quadrotor dynamics and control. Brigham Young University,
2008.
117