Dynamic Model and Control of Quadrotor in the Presence of Uncerta
Dynamic Model and Control of Quadrotor in the Presence of Uncerta
Scholar Commons
5-2017
Recommended Citation
Agho, C.(2017). Dynamic Model and Control of Quadrotor in the Presence of Uncertainties. (Master's
thesis). Retrieved from https://scholarcommons.sc.edu/etd/4069
This Open Access Thesis is brought to you by Scholar Commons. It has been accepted for inclusion in Theses and
Dissertations by an authorized administrator of Scholar Commons. For more information, please contact
[email protected].
DYNAMIC MODEL AND CONTROL OF QUADROTOR IN THE
PRESENCE OF UNCERTAINTIES
by
Courage Agho
Bachelor of Science
University of South Carolina, 2015
_________________________________________________
Electrical Engineering
2017
Accepted by:
ii
ACKNOWLEDGMENTS
I would like to thank Professor Xiaofeng Wang who is my adviser for giving me
this opportunity to work on this thesis. I thank him for his support and time invested in my
education. I also want to thank the department, my friends and family for their constant
support.
iii
ABSTRACT
This thesis considers the control of quadrotor using a linear PID control and ℒ1
adaptive control. In a justifiable concept, PID controller can be used to control a quadrotor,
adjusted to control the changing dynamics of the quadrotor. To solve the problem
associated with uncertainties, various control methodology can be used for controlling the
changing dynamic of quadrotor, but in this thesis, ℒ1 adaptive control is used because it
allows for fast and robust adaptation for desired transient performance in the presence of
In this thesis, we would derive the quadrotor model which gives us an access on
how we can track positions, then design a controller to track these desired positions using
PID control. Same concept used for PID control would be used for ℒ1 adaptive control in
chapter 5 except this control methodology is used for the cancellation of uncertainty at a
faster and robust manner. ℒ1 Adaptive control would use state feedback for its position
control and this position control is then used to design the final controller to cancel
uncertainties.
iv
TABLE OF CONTENTS
ACKNOWLEDGEMENTS................................................................................................iii
ABSTRACT.......................................................................................................................iv
LIST OF FIGURES...........................................................................................................vii
CHAPTER 1: INTRODUCTION…………........................................................................1
v
CHAPTER 5: ℒ1 ADAPTIVE CONTROL ……………………………………….…….17
REFERENCES …………………………………………………………….....................47
vi
LIST OF FIGURES
Figure 2.1: Body and Earth Frame with their Corresponding Angle …………..…..……..3
Figure 4.1: Altitude Position Tracking Using PID Controller [Z-Axis] ……..……….....13
Figure 4.3: Roll Position Tracking Using PID Controller [X-Axis] ………..………..….14
Figure 4.4: Pitch Position Tracking Using PID Controller [Y-Axis] ………..…….........14
Figure 4.5: Yaw Angle Tracking Using PID Controller [Z-Axis] …………..…………..15
Figure 5.5: Altitude Position Using State Feedback Control [Z-Axis] ………….....……23
vii
Figure 5.9: Estimate Uncertainty vs Real Uncertainty for Altitude Control …...….........26
Figure 5.12: Estimated Uncertainty vs Real Uncertainty for Yaw Control …………......29
Figure 5.14: Roll Position Tracking without Varying Input Uncertainties ……………..31
Figure 5.19: Tracking of Desired Position of 1.4m with Pitch Angle Limitation ............34
Figure 5.20: Tracking of Desired Position of 25m with Pitch Angle Limitation .............34
Figure 5.21: Roll Position Tracking with Varying Matched and Unmatched
Uncertainties without Compensation for Unmatched Uncertainties ...........36
Figure 5.22: Roll Position Tracking with Varying Matched Uncertainties ....…..…..…..37
Figure 5.24: Estimate Uncertainty vs Real Uncertainty for Roll Control .........................37
viii
Uncertainties Pitch Control ………………..……………………...…….....39
Figure 6.2: Altitude Position Tracking Using ℒ1 Adaptive Controller [Z-Axis] .............42
Figure 6.3: Yaw Position Tracking Using ℒ1 Adaptive Controller [Z-Axis] ………..….42
Figure 6.4: Roll Position Tracking Using ℒ1 Adaptive Controller [X-Axis] …...............42
Figure 6.5: Pitch Position Tracking Using ℒ1 Adaptive Controller [Y-Axis] …..............43
ix
CHAPTER 1
INTRODUCTION
In recent year, research on quadrotors has become popular, but the first quadrotor
was built in 1907 by Louis Charles Bréguet. Helicopter development was desired over
quadrotor, but with recent progress in technological development, more funds and time has
been dedicated to the research of quadrotors. Quadrotor became popular because helicopter
uses tail rotors to counterbalance the torque or rotating forces generated by the single main
rotor. Because of the counterbalancing tail rotor, it inefficient in term of control, power
consumption and cost production. Due to the work of Charles Richet and Dr George de
Bothezat in 1956, propellers where used to control the quadcopter roll, pitch and yaw angle.
density has greatly helped the research of quadrotors. Recent development in processors
and low cost efficient sensors has greatly impacted quadrotor development as well.
operation and transportation. It is very applicable because of its size; it is easier for it take
off, to land and occupies less space. Because of its advantages, the demand for accurate
control is needed for stabilized flight when hovering. The demand for accurate stabilized
flight has led for the use of sensors and camera to achieve accurate result. Although PID
controller is commonly used for control of quadrotors, however due to uncertainties and
disturbance that occur during flight, PID controller is not a good mechanism for control.
1
This thesis focuses on creating an accurate control mechanism to achieve stabilized
flight control using ℒ1 adaptive control because it mitigates the issues of uncertainties and
disturbance.
complex because we desire a system that has fast adaptation and response in real time and
robust enough to mitigate the issue of disturbance and uncertainties. Adaptive control was
developed as a technique for automatic adjustment in real time. To achieve and maintain
desired system performance, the aerospace industries and institution started research on
adaptive controller and today it is used widely by different industries and for different
purposed. Model reference adaptive control (MRAC) is a type of adaptive control and ℒ1
adaptive control is a further use of model reference adaptive control (MRAC). Apart from
place for faster adaptation that is decoupled from robustness. ℒ1 Adaptive control doesn’t
control system guarantees robustness in the presence of fast adaption with high gain
feedback. This thesis includes the derivation of quadrotor model, and the model is then
2
CHAPTER 2
QUADROTOR STRUCTURE
A quad employs different control mechanism such as roll, pitch, and yaw which in
most cases are represented by angle of rotation around the center of the quad craft. These
angles make up for the control of the altitude of the quadcopter and to track the altitude of
the quadcopter, a two-coordinate system is required. There is the body frame system which
is attached to the quad at its center of gravity and the earth frame system which is fixed to
the earth and it is sometimes refer to as an inertial coordinate system. The angular different
between the two coordinate helps define the behavior of the quad altitude in space. The
attitude system can be derived by rotating the body frame around the z axis of the earth
frame by the yaw angle 𝜑, which is tend followed by rotating around the y-axis by the pitch
angle 𝜙 and finally by rotating around the x-axis by the roll angle 𝜃. This is shown in figure
2.1 as well as its rotation matrix that has the body and earth frame parallel to each other
and their sequence of rotation is known as the Z-Y-X rotation and its rotation matrix is
Figure 2.1: Body and Earth Frame with their Corresponding Angle
3
cos(𝜃) sin(ψ) sin(ϕ) sin(𝜃) cos(ψ) cos(ϕ) sin(𝜃) cos(ψ) + sin(ϕ) sin(ψ)
𝑅 = [cos(𝜃) sin(ψ) sin(ϕ) sin(𝜃) sin(ψ) + cos(𝜃) cos(ψ) cos(ϕ) sin(𝜃) sin(ψ) − sin(𝜃) cos(ψ) ] (2.1)
−sin(𝜃) sin(ϕ) cos(𝜃) cos(ϕ) cos(𝜃)
From the section of coordinate system, the angle of roll, pitch, and yaw are
represented as 𝜙, 𝜃, 𝜓 in addition to their angle, angular velocity is also required and can
be represented as 𝜙̇, 𝜃̇, 𝜓̇ these are the first six state of the quadcopter that shows a
relationship between the quadcopter and the earth coordinate system. The next six states
show a physical relationship of the physical location within the earth fixed system and it is
denoted as 𝑋, 𝑌, 𝑍. In addition to their physical position is their quad velocity along these
axes and it is denoted as 𝑋,̇ 𝑌,̇ 𝑍̇. Together they make up the 12 states of the quadcopter and
as shown below.
A quad as we know it has four motors and it is important to know that the thrust of
each motor force a change around the pitch, roll, and yaw angle. To understand that, it is
very important to know that a quadcopter is under actuated which means that the six degree
of freedom (𝜙, 𝜃, 𝜓, 𝑋, 𝑌, 𝑍) is only controlled by the four inputs. Two of the six DOF are
couple and they are the x-axis and y-axis on the translational size of the quadcopter. The
translational part of the quadcopter is dependent on the attitude of the craft with respect to
the other four degrees of freedom. More would be discussed on how to account and control
the under actuated part of the quad when designing a control method for the quad. It is also
important to know that a quadcopter has four motor where two of them spins in the
clockwise direction while the order two spins in the counter clockwise direction and if the
thrust generated by the motors is equal, the ability for the quadcopter to roll, hover pitch,
4
and yaw is possible. The diagram in figure 2.2 shows how the force generated by each
motor affects a change the direction of the quadcopter along the angles on the coordinate
system
Figure 2.2: Movement around Angles on the Coordinates System because of Force
5
CHAPTER 3
DYNAMIC MODEL
subsystems known as the rotational subsystem that represent (roll angle, pitch angle and
yaw angle) and translational subsystem that represent (Z position, X position, Y position).
The rotational side of the Quadcopter is completely actuated while the translational side of
An effect of rotation is the force generated called aerodynamic force and moment
propeller and by identifying the moment and force generated by the propeller, we can
understand the moment acting on the quadcopter. From figure 3.1, when F2 is multiplied
by the moment arm, a negative moment is generated about the y-axis. Using the same
concept, F4 generates a positive moment and the total moment about the x-axis can be
expresses as
6
For the moment about the Z axis, the thrust of the rotor does not cause a moment, but rather
the rotor rotation in relation with the rotor speed causes a moment and is represented as
rotation about the body frame and the combination of each body frame axis gives us a
(𝐹4 − 𝐹2)𝑙
𝑀𝑏 = [ (𝐹1 − 𝐹3)𝑙 ] (3.4)
(𝐹1 + 𝐹3 − 𝐹2 − 𝐹4)𝑙𝑐
The inertial matrix for a quadcopter is a diagonal matrix as shown below. The
structure of the matrix is because quadcopters are built symmetrically with respect to the
𝐽𝑥 0 0
𝐽 = [0 𝐽𝑦 0] (3.5)
0 0 𝐽𝑧
From the matrix above 𝐽𝑥 , 𝐽𝑦 and 𝐽𝑧 are the area moments of inertia about the principle axes
7
The control input is from the controller and the input to a quadcopter is from the force
generation by the motor, and for simplicity, Control Input Vector (U) can represent Force
(F) where
From equation 3.4, the moment acting on the quadcopter in its body frame can be
represented as
𝑈𝑡𝑥 𝑙
[ 𝑈𝑡𝑦 𝑙 ] (3.10)
𝑈𝑟𝑧 𝑙𝑐
The rotational part of the quadcopter is derived from the concept of rotational
equation of motion and by using Newton-Euler method derived from the body frame of the
the gyroscopic moment generated due to its rotor inertial and 𝑀𝑏 represents moments
acting on the quadcopter in its body frame. For simplicity, the gyroscopic moment would
not be considered because the inertial generated by the quadcopter is much larger that the
inertial generated by the rotor. So, our final rotor equation would be
8
𝑈𝑡𝑥 𝑙 𝐽𝑥 0 0 𝜙̈ 𝜙̇ 𝐽𝑥 0 0 𝜙̇
[ 𝑈𝑡𝑦 𝑙 ] = [ 0 𝐽𝑦 0 ] [ 𝜃̈ ] + [ 𝜃̇ ] × [ 0 𝐽𝑦 0 ] [ 𝜃̇ ]
𝑈𝑟𝑧 𝑙𝑐 0 0 𝐽𝑧 𝜓̈ 𝜓̇ 0 0 𝐽𝑧 𝜓̇
When the matrix is rewritten to have its angular acceleration, we would have
𝑙 𝐽𝑦 𝐽𝑧
𝜙̈ = 𝑈𝑡𝑥 + 𝜓̇𝜃̇ − 𝜃̇𝜓̇ (3.13)
𝐽𝑥 𝐽𝑥 𝐽𝑥
𝑙 𝐽𝑧 𝐽𝑥
𝜃̈ = 𝑈𝑡𝑦 + 𝜓̇𝜙̇ − 𝜙̇𝜓̇ (3.14)
𝐽𝑦 𝐽𝑦 𝐽𝑦
𝑙𝑐 𝐽𝑥 𝐽𝑦
𝜓̈ = 𝑈𝑟𝑧 + 𝜃̇𝜙̇ − 𝜙̇𝜃̇ (3.15)
𝐽𝑧 𝐽𝑧 𝐽𝑧
newton second law which is derived from the earth inertial frame and it is presented in the
format below.
0
̈
𝑚𝑑 = [ 0 ] + 𝑅×𝐹𝑛𝑔 (3.16)
𝑚𝑔
is the physical location within the earth fixed system and R is the rotational matrix. 𝐹𝑛𝑔 is
shown in equation 3.17. It is the addition of all the thrust force produced by the four
propellers and the negative sign is because the thrust force generated is acting upward while
the z-axis of the body frame is point down. R is for the rotational matrix that is generated
to transform the forces generated from the body frame to the earth frame. By substitution
and simplification, we would derive the acceleration along the X, Y, and Z axis.
0
𝐹𝑛𝑔 = [ 0 ] (3.17)
−𝑈𝑡𝑧
9
By substitution of these equations into equation 3.16, we would get
𝑋̈ 0 cos(𝜃) sin(ψ) sin(ϕ) sin(𝜃) cos 𝜓 − cos(ϕ) sin(𝜃) cos(ψ) + sin(ϕ) sin(ψ) 0
𝑚 [𝑌̈ ] = [ 0 ] + [cos(𝜃) sin(ψ) sin(ϕ) sin(𝜃) sin(φ) + cos(𝜃) cos(ψ) cos(ϕ) sin(𝜃) sin(ψ) − sin(𝜃) cos(ψ) ] × [ 0 ]
𝑍̈ 𝑚𝑔 −sin(𝜃) sin(ϕ) cos(𝜃) cos(ϕ) cos(𝜃) −𝑈𝑡𝑧
−𝑈𝑡𝑧
𝑋̈ = (− cos(𝜙) sin(𝜃) cos(𝜓) + sin(𝜙) sin(𝜓)) (3.18)
𝑚
−𝑈𝑡𝑧
𝑌̈ = (cos(𝜙) sin(𝜃)sin(𝜓) + sin(𝜃) cos(𝜓)) (3.19)
𝑚
−𝑈𝑡𝑧
𝑍̈ = (cos(𝜙) cos(𝜃)) − 𝑔 (3.20)
𝑚
The quadrotor parameter are defined below and these parameters would be use for
simulation
𝑁
𝑚 = 0.8𝑘𝑔; 𝑙 = 0.25𝑚; 𝑔 = 9.81 𝑘𝑔; 𝑐 = 0.02; 𝐽𝑥 = 𝐽𝑦 = 0.015𝑘𝑔𝑚2 ; 𝐽𝑧 = 0.02𝑘𝑔𝑚2
10
CHAPTER 4
Building a control system to control how the quadcopter operate is very important.
The dynamic model of the quadcopter is an open loop and closed loop control is a preferred
method for any design because the system records the output instead of the input and
modifies its output per a preferred condition. For successful maneuvering of the
quadcopter, we need 4 controllers that would be designed to act as in input to the model of
the quadcopter. These 4 controllers represent the 4-input coming from the transmitter
assuming this was a physical quadcopter. They are throttle, roll, pitch, and yaw input. The
throttle coming from the transmitter can be represented and called the altitude controller or
translational controller in the z axis. The roll, pitch, and yaw input from the transmitter can
under-actuated.
The dependent axes on the translational controller are the X, Y axis. So, a controller
must be built that takes in desired X, Y values and produce an angular desired output that
would be sent to rotational controller. For the control of the quadrotor using PID controller,
the dynamic model of the system would be linearized using small angle approximation.
The equation below represents the linear dynamic model of the quadrotor and an in-depth
11
1
𝑍̈ = (−𝑈𝑡𝑧 ) (4.1)
𝑚
1
𝑋̈ = − 𝜃(𝑈𝑡𝑧 ) (4.2)
𝑚
1
𝑌̈ = 𝜙(𝑈𝑡𝑧 ) (4.3)
𝑚
𝑙
𝜓̈ = 𝑈 (4.4)
𝐽𝑧 𝑟𝑧
𝑙
𝜃̈ = 𝑈 (4.5)
𝐽𝑦 𝑡𝑥
𝑙
𝜙̈ = 𝑈 (4.6)
𝐽𝑋 𝑡𝑦
The translational controller takes an error signal as an input which is the difference
between the actual altitude and desired altitude and produces a control signal 𝑈𝑡𝑧 . The
control signal 𝑈𝑡𝑧 is responsible for the altitude of the quadcopter and mathematical
equation is shown below. The equation below uses the concept of a PID controller and for
simulation of result, we would multiply the input data by (-1) to compensate for the
negative sign in equation 4.1 and the controller response to the closed loop simulation is
𝑑𝑧
𝑈𝑡𝑧 = 𝐾𝑝(𝑧 − 𝑧𝑑) + 𝐾𝑖 ∫(𝑧 − 𝑧𝑑) + 𝐾𝑑 (𝑧 − 𝑧𝑑) (4.7)
𝑑𝑡
12
Figure 4.1: Altitude Position Tracking Using PID Controller [Z-Axis]
The translational controller takes an error signal as an input which is the difference
between the actual roll angle and the desired roll angle to produce a control signal 𝑈𝑡𝑥 . The
control signal 𝑈𝑡𝑥 is responsible for moving the quadcopter left and right about the X axis.
The mathematical equation is shown below. The equation below uses the concept of a PID
controller and because translation along the X axis is dependent on 𝜃, control of its desired
𝑑𝑧
𝑈𝑡𝑥 = 𝐾𝑝(𝑥 − 𝑥𝑑) + 𝐾𝑖 ∫(𝑥 − 𝑥𝑑) + 𝐾𝑑 (𝑥 − 𝑥𝑑) (4.8)
𝑑𝑡
This is because the X positions are under the translational subsystem which is under-
actuated. To compensate for the under actuation of the system, the pitch angle can be used
We would assume 𝑈𝑡𝑧 = 𝑚𝑔 which would cause loss in precision, but it also simplifies the
𝑋̈ = −𝜃𝑔 (4.9)
The rotational control provides us 𝜃 which can then be used for translational control. For
simulation of result, we would multiply the input data by (-1) to compensate for the
13
negative sign in equation 4.2 and the controller response to the closed loop simulation is
𝑌̈ = 𝜙𝑔 (4.10)
The design for controller movement along the Y axis is design in similar method for
translation along the X axis. The only difference is the Y axis is dependent on the roll angle.
14
The yaw controller takes an error signal as an input which is the difference between
the actual yaw angle and the desired yaw angle to produce a control signal 𝑈𝑟𝑦 and the
mathematical equation is shown below. The equation below uses the concept of a PID
controller and the block diagram represent how the close loop method of the yaw controller
𝑑𝑧
𝑈𝑟𝑦 = 𝐾𝑝(𝜓 − 𝜓𝑑) + 𝐾𝑖 ∫(𝜓 − 𝜓𝑑) + 𝐾𝑑 (𝜓 − 𝜓𝑑) (4.11)
𝑑𝑡
From the design concept above, 6 PID controllers were designed with Kp, Ki, and Kd gain
derived. Where the controller design for translational control on the X and Y axis would
have two PID controller and their gain constants are shown in figure 4.6.
15
Figure 4.7: Altitude Response to Step Input Disturbance
16
CHAPTER 5
ℒ1 ADAPTIVE CONTROL
As you can see from section 4, using a conventional linear controller work fine
when there is no disturbance or uncertainty, but when disturbance is added to the system
as shown in figure 4.10, the controller is not able to adapt fast enough to compensate for
the additional error. The process of creating an adaptation mechanism leads to further
adjustment of the controller in real time. Various controllers can be used to cancel
uncertainties; the most common one is the robust controller. The concept of adaptive
controller to robust controller is the control law for adaptive controller change while the
control law for robust controller doesn’t change. Adaptive controllers are the combination
of online parameter estimators and automatic control design which has two architecture
designs. There is direct method which only estimates the controller parameters and there is
indirect method which only estimates the state parameter of system. The structure of this
architecture is shown below. From the structures, the estimate is calculated using adaptive
17
5.1 DIRECT & INDIRECT ADAPTIVE CONTROLLER
The architecture is shown in figure 5.1 and the differential equation of the real plant is
Where 𝐴𝑚 defines matrix of the closed loop system, x(t) is the state of the system, b and
1
𝑘𝑔 ≜ (5.4)
𝑐 𝑇 𝐴𝑚
−1 𝑏
Ideal system
18
For stability test and analysis, Lyapunov function is used to test Lyapunov stability. By
taking the first derivative of Lyapunov function, the signal stays bounded and the second
derivative proves that the error converges when 𝑒(𝑡) ⟶ 0 𝑎𝑠 𝑡 ⟶ ∞ which in turns
proves the application of Barbalat’s lemma equation on stability of time varying system.
The theoretical approach used for direct MRAC is used as well for Indirect MRAC. The
main difference is that the indirect method estimates the system parameters and the
derivation of the adaptive law is independent of the control signal with its system
architecture as shown in figure 5.2. The asymptotical convergence of its tracking error is
also concluded using Barbalat’s lemma equation from Lyapunov stability and its adaptive
law becomes
The architecture of both control method works, but with an increase in Γ, estimate
is reduced as t ≥ 0, but high adaptation gain leads to a high frequency oscillation. So,
increasing Γ, does allow a faster adaptation, but hurt robustness and stability because of the
19
known as the ℒ1 adaptive controller is used. With ℒ1 adaptive controller, adaptation can be
separated from robustness. The architecture in figure 5.3 shows how ℒ1 adaptive controller
is designed. The design approach is a combination of the MRAC state predictor and a low
pass filter from the control input to the estimated model and the real plant. The controller
C(s) transfer function is bounded input-bounded output stable which is subjected to C(s)=1
with zero initialization. This is achievable with a first order low pass filter where
ωc
𝐶(𝑠) = 𝑠+𝜔𝑐 (5.12)
and 𝜔𝑐 is the filter bandwidth, the filter should be chosen to maintain equation 5.13.
1
‖𝐺(𝑠)‖ℒ1 < (5.13)
𝐿
Where
𝑏
𝐺(𝑠) = 𝐻(𝑠)[1 − 𝐶(𝑠)], 𝐻(𝑠) = [1 − 𝐶(𝑠)] (5.14)
𝑠 + 𝑎𝑚
𝐿 ≜ 𝑚𝑎𝑥‖𝜃‖1 , 𝜃 ∈ Θ ⊂ ℝ𝑛 (5.15)
With low pass filter added to the system, robustness can be maintained with increased
ΓProj(𝜃̂(𝑡), −𝑥̃ 𝑇 (𝑡)𝑃𝐵𝑥(𝑡)) where the Proj operator ensures that the unknown parameter
𝜃̂ stays bounded. 𝜃 would be replaced by 𝜎 for the quadrotor controller and the adaptive
20
Where
𝜎̂ 2 − 𝜎̂𝑚𝑎𝑥
2
ℎ(𝜎̂) = 2
(5.17)
𝜀𝑎 𝜎̂𝑚𝑎𝑥
𝑐
𝜎̂𝑚𝑎𝑥 = , 𝜀𝑎 ∈ (0,1), 0≤𝑐≤1 (5.18)
√1+𝜀𝑎
Just like is session 4, we would design four controllers to control the movement of
the quadrotor using a state feedback approach. The information derived from the feedback
approach would then be used to design an ℒ1 adaptive controller to cancel out uncertainties.
1
𝑧̈ = (cos(𝜙) cos(𝜃))(−𝑈𝑡𝑧 ) + 𝑔 (5.19)
𝑚
1
𝑧̈ − 𝑔 = (cos(𝜙) cos(𝜃))(−𝑈𝑡𝑧 ) (5.20)
𝑚
𝑈𝑡𝑧 is the addition of the position control output and the control output for the cancelation
of gravity?
21
Since the quadrotor is moving about the z axis, 𝜃 and 𝜙 would be equal to zero. So
1
𝑧̈ − 𝑔 = (1) (−(𝑈𝑧𝑝 + 𝑈𝑧𝑔 )) (5.22)
𝑚
From equation 5.13, gravity would be ignored and later compensated where 𝑈𝑧𝑔 is equal
1
𝑧̈ = (𝑈 ) (5.23)
𝑚 𝑧𝑝
𝑇
𝑦 = 𝐶𝑧𝑝 𝑥
𝑧̇ 0 1 𝑧 0 𝑧
[ ]=[ ][ ] + [ ] 𝑢; 𝑦 = [1 0 ] [ ] (5.24)
𝑧̈ 0 0 𝑧̇ 1/𝑚 𝑧̇
𝑇
𝑥̇ = 𝐴𝑧𝑝 𝑥 + 𝐵𝑧𝑝 (𝑘𝑔𝑟 − 𝑘𝑚𝑧𝑝 𝑥) (5.25)
where kg r is the reference gain and kmTz = [k1tz k2tz ]T which is the feedback gain.
Therefore
𝑇
𝑥̇ = (𝐴𝑧𝑝 − 𝐵𝑧𝑝 𝑘𝑚𝑧𝑝 )𝑥 + 𝐵𝑝 𝑘𝑔𝑟 (5.26)
𝑇
Where 𝐴𝑚𝑧𝑝 = (𝐴𝑃 − 𝐵𝑝 𝑘𝑚𝑧𝑝 ) So, the state spaces become
𝑥̇ = 𝐴𝑚, 𝑧𝑝 𝑥 + 𝐵𝑝 𝑘𝑔𝑟
0 1 0
𝑧̇
[ ]=[ 1 1 ] [𝑧] + [ 1 ] 𝑘𝑔𝑟 (5.27)
𝑧̈ −𝑘1𝑧 ( ) −𝑘2𝑧 ( ) 𝑧̇
𝑚 𝑚 𝑚
22
Transfer function of the state space model becomes
1
𝐺𝑝 (𝑠) = 𝑚 (5.28)
1 1
𝑠2 + 𝑘2𝑧 (𝑚) 𝑠 + 𝑘1𝑧 (𝑚)
𝜔𝑛 2
𝐺𝑟𝑒𝑓 (𝑠) = (5.29)
𝑠 2 + 2𝜁𝜔𝑛 𝑠 + 𝜔𝑛 2
From equation 5.23, 𝜔𝑛 2 = 1/𝑚 and for critical damping, 𝜁 = 1. 𝑘1𝑡𝑧 = 1 and 𝑘2𝑡𝑧 = 2𝜁𝜔𝑛
Therefore 𝑘2𝑡𝑧 = 1.79, where 𝑚=0.8. 𝑈𝑡𝑧 the controller output would be determined as
Figure 5.5 is the simulation result tracking desired reference position and figure 5.6 is the
23
Figure 5.6: State feedback for Altitude Control
With the feedback controller designed to ensure stable flight, we would then design a
controller to cancel out uncertainties which is dependent on the adaptation law for
uncertainty prediction. From equation 5.27, the state space model of the closed loop system
is defined below.
0 1
𝐴𝑚,𝑧𝑝 = [ 1 1 ]= [ 0 1
] (5.32)
−𝑘1𝑧 ( ) −𝑘2𝑧 ( ) −1.25 −2.24
𝑚 𝑚
0
𝐵𝑝 = [ 1 ] (5.33)
𝑚
For the adaptive law, we first need to determine the P matrix that will satisfy Lyapunov
equation 𝐴𝑇𝑚 𝑃 + 𝑃𝐴𝑚 = −𝑄. In order to achieve that, we would set Q as an identity matrix
as shown below.
1 0
𝑄= [ ] (5.34)
0 1
1.30 0.50
𝑃= [ ] (5.35)
0.50 0.50
𝑧̃ 1.30 0.50 01
θ̂̇ = ΓProj(𝜎̂(𝑡), − [ ̇ ] [ ] [ ]) (5.37)
𝑧̃ 0.50 0.50 𝑚
−1
𝐺ℒ1,𝑡𝑧 = [[𝑠𝐼 − 𝐴𝑚,𝑝 ] 𝐵𝑝 ] [1 − 𝐶𝑡,𝑧 (𝑠)] (5.39)
24
1.25𝑠
𝑠3 + 102.24𝑠 2 + 225.25𝑠 + 125
𝐺ℒ1,𝑡𝑧 = (5.40)
1.25𝑠 2
[𝑠 3 + 102.24𝑠 2 + 225.25𝑠 + 125]
‖𝐺ℒ1,𝑡𝑧 ‖ℒ1 = 0.003 which give us an uncertainty limit of 333.33N. with that, the
adaptation gain can be big enough for faster adaptation. Also from equation 5.38, 𝑧̃ = 𝑧̂ −
𝑧 and 𝑧̃̇ = 𝑧̂̇ − 𝑧̇ . For simulation, a varying uncertainty of -10N to 10N would be used with
an adaptation gain of 10000. Figure 5.7 is the simulation result tracking desired reference
position using ℒ1 adaptive controller. Figure 5.8 shows the structural design of the altitude
controller in Simulink and figure 5.9 shows the simulation of the estimated uncertainty vs
Another external force that could affect quadrotor movement in the Z axis is the
input of extra mass. Theoretically, there is no limit on the amount of extra mass that a
quadrotor can lift, but with a physical system, the amount of thrust and rotor speeds are
limited. Most physical quadrotor are designed so that the sum of all four motors can lift at
least twice its original mass. Assuming our simulation is designed for that purpose,
1
𝑚𝑒𝑥𝑡𝑟𝑎 ≤ 0.8. Therefore equation (5.23) can be rewritten as 𝑧̈ = 𝑚+𝑚 (𝑈𝑧𝑝 ). Same
𝑒𝑥𝑡𝑟𝑎
position controller input can be used to control the new rewritten model because 𝑚𝑒𝑥𝑡𝑟𝑎 is
constant and the controller output is well bounded. Extra mass can also affect movement
in the X and Y axis and same concept would be applied to compensate with the input of
extra mass.
25
Figure 5.7: Altitude position [Z-Axis] with response to Varying Uncertainties and Extra
Mass
This is the yaw controller. The aim of the controller is to design a stable yaw rotation
controller to cancel uncertainties. From equation 5.4, using small angle approximation
26
𝑙
𝜓̈ = 𝑈𝑟𝑧 (5.41)
𝐼𝑧𝑧
0 1
𝜓̇ 𝑙𝑐
𝜓
𝑙𝑐 ] [ ] + [ 0 ] 𝑟𝑟𝑧
[ ]=[ (5.42)
𝜓̈ −𝑘1𝑟𝑧 ( ) −𝑘2𝑟𝑧 ( ) 𝜓̇ 𝑙𝑐/𝐽𝑧
𝐽 𝑧 𝐽 𝑧
𝜓
𝑦 = [1 0] [ ̇ ] (5.43)
𝜓
Transfer function is
𝑙𝑐
𝐽𝑧
𝐺𝑟,𝑧 (𝑠) = (5.44)
𝑙𝑐 𝑙𝑐
𝑠 2 + 𝑘2𝑟,𝑧 ( 𝐽 ) 𝑠 + 𝑘1𝑟,𝑧 (𝐽 )
𝑧 𝑧
𝑙𝑐
From equation 5.23, 𝜔𝑛 2 =𝐽 and for critical damping, 𝜁 = 1. 𝑘1𝑟,𝑧 = 1 and 𝑘2𝑟,𝑧 = 2𝜁𝜔𝑛
𝑧
𝑙𝑐
𝑘2𝑡,𝑥 = 2√ (5.45)
𝐽𝑧
Where
0 1
𝐴𝑚 = [ 1 1 ]= [ 0 1
] (5.47)
−𝑘1𝑧 ( ) −𝑘2𝑧 ( ) −0.25 −1
𝑚 𝑚
27
0
𝑙𝑐
𝐵𝑚 = [ ] (5.48)
𝐽𝑧
For the adaptive law, we first need to determine the P matrix that will satisfy Lyapunov
4.50 0.50
𝑃= [ ] (5.49)
0.50 0.625
𝜓̃ 4.50 0.50 0
θ̂̇ = ΓProj(𝜎̂(𝑡), − [ ̇ ] [ ] [𝑙𝑐 ]) (5.51)
𝜓̃ 0.50 0.625 𝐽𝑧
Using matlab, the transfer function is where wc =100 for the low pass filter
0.25𝑠
𝑠3 +101𝑠 2 + 100.25𝑠 + 25
𝐺ℒ1,𝑟𝑧 = (5.54)
0.25𝑠 2
[𝑠 3 + 101𝑠 2 + 100.25𝑠 + 25]
‖𝐺ℒ1,𝑡𝑧 ‖ℒ1 = 0.001 which give us an uncertainty limit of 1000N. With that, the adaptation
gain can be big enough for faster adaptation. Also from equation 5.52, 𝜓̃ = 𝜓̂ − 𝜓 and
𝜓̃̇ = 𝜓̂̇ − 𝜓̇. For simulation, a varying uncertainty of -10N to 10N would be used with an
adaptation gain of 10000. Figure 5.11 provides result tracking desired reference angle using
ℒ1 adaptive controller with varying uncertainties while figure 5.12 provides simulation of
28
Figure 5.11: Tracking of Desired Reference Yaw Angle with Varying Input
Uncertainties
For movement along the X or Y axis, the quadrotor needs to rotate because it is
dependent on the rotation angle. From equation 5.56, you can notice that the translation
in the X direction without the quadrotor getting unstable. For stability to be maintained,
the pitch and roll angle would be limited to maintain small angle approximation. For
movement along the X axis, the quadrotor rotates about the Y axis which provides us the
pitch angle. The yaw angle can then be set equal to zero because the yaw angle is relatively
29
small and does not have a huge effect on movement in the X and Y direction. Also, equation
5.55 can be linearized around hovering mode were 𝜙̇, 𝜃̇, 𝜑̇ is equal to zero.
𝑙 ̈
𝜃̈ = 𝑈 (5.55)
𝐽𝑦 𝑡𝑥
1
𝑋̈ = (cos(𝜙) sin(𝜃) sin(𝜑) + sin(𝜃) 𝑠𝑖𝑛(𝜑)(−𝑈𝑡𝑧 ) (5.56)
𝑚
sin 𝜃 ≈ 𝜃
cos 𝜃 ≈ 1
tan 𝜃 ≈ 𝜃
We would assume that the control input is positive and we would compensate for it on the
controller output for movement along the x axis. We would also set 𝑈𝑡𝑧 = 𝑚𝑔 so that our
For our state feedback, we would four states and our state space feedback would be
modelled as
0 1 0 0 0
𝑥1̇ 0 0 𝑔 0 𝑥1
0
𝑥̇ 𝑥̇ 0 𝑈𝑡𝑥
[ 2] = 0 0 0 1 [ 1] + (5.58)
𝜃̇ 𝑙 𝑙 𝑙 𝑙 𝜃 𝑙
𝜃̈ − ( ) 𝑘1𝑡𝑥 − ( ) 𝑘2𝑡𝑥 −( ) 𝑘3𝑡𝑥 − ( ) 𝑘4𝑡𝑥 𝜃̇
[ 𝐽𝑦 𝐽𝑦 𝐽𝑦 𝐽𝑦 ] [𝐽𝑦 ]
The Simulink model is shown below and the transfer function becomes
𝑙
𝐽𝑦 𝑔
𝐺𝑡𝑥 (𝑠) = (5.59)
𝑙 𝑙 𝑙 𝑙
𝑠 4 + 𝑘4𝑟,𝑦 (𝐽 ) 𝑔𝑠 3 + 𝑘3𝑟,𝑦 (𝐽 ) 𝑔𝑠 2 + 𝑘2𝑟,𝑦 (𝐽 ) 𝑔𝑠 + 𝑘1𝑟,𝑦 (𝐽 ) 𝑔
𝑦 𝑦 𝑦 𝑦
30
Figure 5.13: State Feedback Design in Simulink
4
𝑙 𝑙 𝑙 𝑙 4 𝑙
𝑠 4 + 𝑘4𝑟,𝑦 ( ) 𝑔𝑠 3 + 𝑘3𝑟,𝑦 ( ) 𝑔𝑠 2 + 𝑘2𝑟,𝑦 ( ) 𝑔𝑠 + 𝑘1𝑟,𝑦 ( ) 𝑔 = (𝑠 + √ 𝑔)
𝐽𝑦 𝐽𝑦 𝐽𝑦 𝐽𝑦 𝐽𝑦
The result using pole placement for the feedback gain constants becomes
𝐽𝑦3
4 2 𝐽
𝑦 4 𝐽𝑦
(𝑘1𝑡𝑥 = 1; ) (𝑘2𝑡𝑥 √
= 4 3 𝑔) ; (𝑘3𝑡𝑥 = 6 √ 𝑔) ; (𝑘4𝑡𝑥 = 4 √ )
𝑙 𝑙 𝑙𝑔
Because we are designing a controller for movement around the x axis, we would focus on
the pitch angle 𝜃. It is also important to know that figure 5.14 did not consider the limitation
31
of the pitch angle, but to maintain small angle approximation, 𝜃 should not exceed 14𝑜 or
0.244rad. However, when position is greater than 1.4m as shown in figure 5.16, the pitch
angle is greater than 0.244rad and if our desired position is as high as 25m, 𝜃 would be
higher than 360𝑜 or 3.14rad which makes no sense for the quadrotor to completely rotate
and possibly leads to more difficulty for the control of the quad.
The problem with limitation is that it could affect state feedback control law and to avoid
32
From equation 5.60, if the error between the reference input and the actual position is
greater than 3m, then 𝑒𝑡𝑥 𝑙𝑖𝑚𝑖𝑡 is equal to 3m and if less than -3m then 𝑒𝑡𝑥 𝑙𝑖𝑚𝑖𝑡 is equal to -
3m. By using this technique, the tracking error cannot exceed 3m even if the actual
reference is greater than 3m. With the limitation in place, it takes a longer time for the
quadrotor to reach desired position. Also 3m was the best limitation that would result in a
faster response and still maintain small angle approximation at a degree higher than
14𝑜 . Figure 5.17 and figure 5.18 shows the pitch angle remains same even if the distance
is greater than 1.4m. Figure 5.19 and 5.20 shows the response of the quadrotor at 1.4m and
at 25m.
33
Figure 5.19: Tracking of Desired Position of 1.4m with Pitch Angle Limitation
Figure 5.20: Tracking of Desired Position of 25m with Pitch Angle Limitation
Unlike the altitude controller we cannot directly affect translation without affecting
rotation. Therefore, we have matched and unmatched uncertainty. Figure 5.21 provides a
simulation where unmatched uncertainties were not compensated for and in other to
Where
There for
0
0 0
𝑔
𝐵𝑚 = 0 𝑈𝑡𝑥 𝑎𝑛𝑑 𝐵𝑢𝑚 = [ ] 𝜃 (5.62)
𝑙 0
0
[𝐽𝑦 ]
34
The control law for the controller to compensate for unmatched uncertainty would be defined as
̂ 𝑚 − 𝐶2 𝐻−1
𝑈 = −𝐶1 (𝑆)𝜎 𝑚 𝐻𝑢𝑚 𝜎
̂ 𝑢𝑚 + 𝐾𝑔𝑟 (5.63)
Where
𝐶1 & 𝐶2 are the low pass filter; 𝐻𝑚 = 𝐶[𝑠𝐼 − 𝐴𝑚 ]−1 𝐵𝑚 and 𝐻𝑢𝑚 = 𝐶[𝑠𝐼 − 𝐴𝑚 ]−1 𝐵𝑢𝑚 .
−1
𝐶2 𝐻𝑚 𝐻𝑢𝑚 𝜎̂𝑢𝑚 is needed to cancel the effect of unmatched uncertainty. In this paper, 𝐶2
filter would be a third order low pass filter. It is needed because it makes the transfer
−1
function of 𝐶2 𝐻𝑚 𝐻𝑢𝑚 𝜎̂𝑢𝑚 a proper transfer function. At a filter bandwidth of 100,
−1
60s2 + 860s + 4600
𝐶2 𝐻𝑚 Hum = (5.64)
s3 + 24.14s 2 + 241.4s + 1000
θ̂̇m = ΓProj(σ
̂(t), − (0.834x̃ + 36.674x̃̇ + 8.335θ̃ + 91.852θ̃̇)) (5.66)
θ̂̇um = ΓProj(σ
̂(t), − (4.905x̃ + 20.405x̃̇ + 0.491θ̃ + 21.582θ̃̇)) (5.67)
The adaptation law for matched uncertainties does not include does not include movement
on the translational axis and therefore adaptation law for unmatched uncertainties does not
include movement on the rotational axis and can be shown in the equation below.
35
1.635𝑒06𝑠 3 + 3.925𝑒08𝑠 2 + 3.925𝑒10𝑠
10000𝑠 7 + 2.543𝑒06𝑠 6 + 2.752𝑒08𝑠 5 + 1.363𝑒10𝑠 4 + 1.621𝑒11𝑠 3 + 8.11𝑒11𝑠 2 + 1.871𝑒12𝑠 + 1.635𝑒12
1.635𝑒06𝑠 4 + 3.925𝑒08𝑠 3 + 3.925𝑒10𝑠 2
7 6 5 4 + 1.621𝑒11𝑠 3 + 8.11𝑒11𝑠 2
= 10000𝑠 + 2.543𝑒06𝑠 + 2.752𝑒08𝑠 + 1.363𝑒10𝑠 + 1.871𝑒12𝑠 + 1.635𝑒12 (5.71)
1.635𝑒06𝑠 5 + 3.925𝑒08𝑠 4 + 3.925𝑒10𝑠 3
10000𝑠 7 + 2.543𝑒06𝑠 6 + 2.752𝑒08𝑠 5 + 1.363𝑒10𝑠 4 + 1.621𝑒11𝑠 3 + 8.11𝑒11𝑠 2 + 1.871𝑒12𝑠 + 1.635𝑒12
1.635𝑒06𝑠 6 + 3.925𝑒08𝑠 5 + 3.925𝑒10𝑠 4
[10000𝑠 7 + 2.543𝑒06𝑠 6 + 2.752𝑒08𝑠 5 + 1.363𝑒10𝑠 4 + 1.621𝑒11𝑠 3 + 8.11𝑒11𝑠 2 + 1.871𝑒12𝑠 + 1.635𝑒12]
‖𝐺ℒ1,𝑡𝑥(𝑚𝑎𝑡𝑐ℎ𝑒𝑑) ‖ = 0.008 which give us an uncertainty limit of 125N. With that, the
ℒ1
adaptation gain can be big enough for faster adaptation. From equation 5.68, 𝜃̃ = 𝜃̂ − 𝜃
and 𝜃̃̇ = 𝜃̂̇ − 𝜃̇. For simulation, a varying uncertainty of -10N to 10N would be used with
Figure 5.21: Tracking of Desired Reference Position with Varying Matched and
36
Figure 5.22: Roll Position Tracking with Varying Matched Uncertainties
37
Figure 5.25: Estimate Uncertainty vs Real Uncertainty for Unmatched Uncertainties Roll
Control
Unmatched Uncertainties
This controller design is similar for the controller design for translation about the x
You notice there is no multiplication of (-1) at the dynamic model which is the only
38
Figure 5.27: Feedback Response without Disturbance
Figure 5.29: Estimate Uncertainty vs Real Uncertainty for Matched Uncertainties Pitch
Control
39
Figure 5.30: Estimate Uncertainty vs Real Uncertainty for Unmatched Uncertainties Pitch
Control
40
CHAPTER 6
quadrotor, but in this chapter 6, the nonlinear model is used. The non-linear model is based
on what was discussed in chapter 3 and in addition to the model we would calculate the
thrust generated by each motor as shown below. These thrusts are mathematical relations
𝐹1 1 1 1 1 −1 𝑈𝑡𝑧
𝐹2 0 −1 0 1 𝑈𝑡𝑥
[ ] = [1 0 −1 0 ] [𝑈𝑡𝑦 ]
𝐹3
𝐹4 1 −1 1 −1 𝑈𝑟𝑧
For the simulation, the table below shows the disturbances that were used on the quadrotor
model.
41
Figure 6.1-6.4 shows the quadrotor response to desired position or location. It is exactly
same as most of the result shown in chapter 5. To avoid repetition of results such as tracking
of uncertainties, pitch and roll limitation would be avoided. Figure 6.5 and 6.6 provides the
overall Simulink design and each detail in each subsystem have been discussed from
chapter 3 to chapter 5.
Figure 6.3: Yaw Position Yaw Position Tracking Using ℒ1 Adaptive Controller [Z-Axis]
42
Figure 6.5: Pitch Position Tracking Using ℒ1 Adaptive Controller [Y-Axis]
43
Figure 6.7: Expanded Simulink Design
44
CHAPTER 7
The main goal of this thesis is to design a controller that can control a quadrotor in
the presence of disturbance or uncertainties. Although they are different control method
used such as PID controller, this paper focused on the application of ℒ1 adaptive controller
in simulation. This paper includes the linear and non-linear dynamic model of the
uncertainties. As figure 4.10 shows, when a step disturbance is added to the input of the
altitude controller, it took about 160 seconds for the quadrotor to adapt so the main
limitations and problems are taking into consideration such as the under actuation of the
and failure of rotating motor. All these limitations were taking care of in this paper, except
for failure of the rotating motor. Theoretically when there is a motor failure, it is difficult
to have a stable flight. To avoid these problems, a different technique would be used for
future work. Future work would also focus on the implementation of ℒ1 adaptive controller
45
frame battery, IMU and cost of design are expected to affect performance, but with ongoing
46
REFERENCES
Bouabdallah, Samir and Siegwart, Roland. 2007. Full Control of Quadrotor. Autonomous
of Munich.
ElKholy, Heba talla Mohamed Nabil. 2014. Dynamic Modeling and Control of a
in Cairo.
Hovakimyan, Naira. 2013. ℒ1 Adaptive Control and Its Transition to Practice. Department
Hovakimyan, Naira and Cao, Chengyu. 2010. ℒ1 Adaptive Control Theory: Guaranteed
Robustness with Fast Adaptation. Philadelphia: Society for Industrial & Applied
Mathematics, U.S.
Murray, M. Richard and Aström, J. Karl. 2009. Feedback Systems: An introduction for
Premerlani, William and Bizard, Paul. 2009. Direction Cosine Matrix IMU: Theory.
Raza, A. Syed and Gueaieb, Wail. 2010. Intelligent Flight Control of an Autonomous
47
Schmidt, M. David. 2011. Simulation and Control of a Quadrotor Unmanned Aerial
Seiler, Peter, Dorobantu, Andrei and Balas, Gary. 2010. Robustness Analysis of an
Wang, Xiaofeng and Hovakimyan, Naira. 2012. ℒ1 Adaptive Controller for Nonlinear
48