Professional Documents
Culture Documents
net/publication/343769542
CITATIONS READS
0 879
1 author:
Safeer Ullah
Mohammad Ali Jinnah University
25 PUBLICATIONS 225 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Safeer Ullah on 26 August 2021.
By
Safeer Ullah
CIIT/FA14-REE-032/ISB
MS Thesis
In
Electrical Engineering
A Thesis presented to
MS (Electrical Engineering)
By
Safeer Ullah
CIIT/FA14-REE-032/ISB
Spring, 2016
ii
Design a Nonlinear Controller for a Quadcopter
Supervisor:
iii
Final Approval
This thesis titled
Supervisor: ________________________________________________________
Dr. Adeel Mehmood
Assistant Professor, Department of Electrical Engineering Islamabad
iv
Declaration
I Safeer Ullah, CIIT/FA14-REE 032/ISB hereby declare that I have produced the work
presented in this thesis, during the scheduled period of study. I also declare that I have not
taken any material from any source except referred to wherever due that amount of
plagiarism within acceptable range. If a violation of HEC rules on research has occurred in
this thesis, I shall be liable to punishable action under the plagiarism rules of the HEC.
Date: ________________
____________________
Safeer Ullah
CIIT/FA14-REE-032/ISB
v
Certificate
It is certified that Safeer Ullah, CIIT/FA14-REE-032/ISB has carried out all the work related
to this thesis under my supervision at the Department of Electrical Engineering, COMSATS
Institute of Information Technology, Islamabad and the work fulfills the requirements for
the award of MS degree.
____________________________________
Dr. Adeel Mehmood
Assistant Professor
Head of Department:
______________________________
Dr. Shahid A. Khan
Professor, Department of Electrical Engineering
vi
DEDICATION
I dedicate this thesis to my dear father Noor Zakam and to my sweet Brothers
Shoukat Ullah, Zafar Iqbal, Asif Khan and to my best friend Ejaz Ahmad,
Muhammad Ilyas and Owais Khan. Their prayers and support have helped me to
achieve this milestone.
vii
ACKNOWLEDGMENT
I am forever grateful to Almighty God, the Creator and the Guardian of the universe, and to
whom I owe my very existence. I owe my deepest gratitude to my supervisor Dr. Adeel
Mehmood for mentoring me and supporting me throughout my thesis for the last one year.
This thesis would not have been possible unless it was for his patience, motivation,
enthusiasm and immense knowledge of the subject matter.
Besides my advisors, I would like to thank Dr Shafayat Abrar and my research mates for
their kind support and motivation in any respect for completing my research work.
Last but not the least, I am grateful to my parents for encouraging me throughout my life and
eventually supporting my entire education.
Safeer Ullah
CIIT/FA14-REE-032/ISB
viii
ABSTRACT
Design a Nonlinear Controller for a Quadcopter
Quadcopter aerial vehicle is a nonlinear and under-actuated system. Actually it have four
actuators (motors) with six degree of freedom. The actuators are fixed pitch propellers which
are placed on brushless DC motors. For flying control of a quadcopter, three basic operations
are achieved by actuators;
By changing the relative angular speed of each propeller, both the translational and
rotational motions of quadcopter are controlled. The direction of thrust force can be adjust
by varying the propeller relative speed and consequently the desired motion is also achieved.
The purpose of research thesis is to stabilize the attitude, altitude and longitude motions
of a quadcopter during flight condition. Undesirable vibrations are produced due to changing
the speed of rotors. In order to decrease these undesirable vibrations and to make the system
stable, an optimum quadcopter’s model is selected. The mathematical model of quadcopter
comprises of deriving its equations of motion, extracting the control inputs equations in
terms of angular speed of motors and obtaining model for brushless DC motors. In this
research work, control techniques like Proportional, Integral and Derivative Controller
(PID), Backstepping controller and Sliding Mode controller have been simulated in
Matlab/Simulink. Finally the results of linear and nonlinear control techniques have been
presented which clearly shows the superior performance of Backstepping control and Sliding
Mode control techniques over the other linear techniques.
ix
TABLE OF CONTENTS
1 Introduction 1
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Significance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Types of Micro Aerial Vehicles (MAVs) . . . . . . . . . . . . . . . . . . . 3
1.4.1 Fixed Wing Aerial Vehicles . . . . . . . . . . . . . . . . . . . . . 4
1.4.2 Propeller Based Aerial Vehicles . . . . . . . . . . . . . . . . . . . 4
1.4.3 Quadcopter Aerial Vehicle as special case of Helicopter . . . . . . 6
1.4.4 Quadcopter comparison with Micro Aerial Vehicle . . . . . . . . . 7
1.5 Advantages of Quadcopter System . . . . . . . . . . . . . . . . . . . . . . 8
1.5.1 Commercial Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.5.2 Military and Law Enforcement . . . . . . . . . . . . . . . . . . . . 8
1.6 Literature Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.6.1 Literature Review Comparison . . . . . . . . . . . . . . . . . . . . 11
1.7 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.8 Scope of Thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.9 Thesis Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2 Mathematical model 16
2.1 Quadcopter Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.1.1 Thrust . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.1.2 Roll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.1.3 Pitch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.1.4 Yaw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.2 Nonlinear mathematical model for rotational Subsystem . . . . . . . . . 20
2.2.1 Frame of References of a Quadcopter: micro aerial vehicle . . . . 20
2.2.2 Kinetic energy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.2.3 Potential energy . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.2.4 Lagrangian Equation . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.2.5 Non-conservative moments of Quadcopter . . . . . . . . . . . . . 33
2.3 Nonlinear mathematical model for translational Subsystem . . . . . . . . 34
x
2.3.1 External Forces . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.3.1.1 Gravitational forces . . . . . . . . . . . . . . . . . . . . 36
2.3.1.2 Air drag force . . . . . . . . . . . . . . . . . . . . . . . . 36
2.3.1.3 Thrust force . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.4 Control Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.5 State Space Model of Quadcopter . . . . . . . . . . . . . . . . . . . . . . 40
2.6 Angular speed "Ω" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.7 DC Motor Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
2.8 Motor /Propeller Matching . . . . . . . . . . . . . . . . . . . . . . . . . . 47
2.9 System Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.10 Simulation Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
xi
5 Conclusions and Future Work 88
5.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
5.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
6 Bibliography 91
xii
LIST OF FIGURES
xiii
4.1 Block Diagram for Integrator Backstepping Controller . . . . . . . . . . . 70
4.2 Simulation Results of rotational position . . . . . . . . . . . . . . . . . . 71
4.3 Simulation Results of translational position . . . . . . . . . . . . . . . . . 71
4.4 Simulation Results of Control Inputs . . . . . . . . . . . . . . . . . . . . 72
4.5 Simulation Results of Backstepping after adding disturbance . . . . . . . 72
4.6 Sliding Mode Controller Block Diagram . . . . . . . . . . . . . . . . . . . 83
4.7 Simulation Results of rotational position . . . . . . . . . . . . . . . . . . 84
4.8 Simulation Results of translational position . . . . . . . . . . . . . . . . . 84
4.9 Simulation Results of Control Inputs . . . . . . . . . . . . . . . . . . . . 85
4.10 Simulation Results of SMC after adding disturbance . . . . . . . . . . . . 85
4.11 Simulation Results of rotational position . . . . . . . . . . . . . . . . . . 86
4.12 Simulation Results of translational position . . . . . . . . . . . . . . . . . 87
xiv
LIST OF TABLES
xv
Chapter 1
Introduction
1
1.1 Introduction
A micro aerial vehicle is just like an air-craft. Micro aerial vehicle is either dis-
tantly controlled from the ground or controlled by auto pilots. Aerial vehicles are receiving
a lot more attractiveness in research area. Micro aerial vehicles are more elastic and solid
with the variation in payloads. The payloads are typically video recorders and cameras.
The micro aerial vehicle has complex performance. Micro aerial vehicles are self-directed
such as to handle with the changes in environment. MAV have distinctive characteristics
to fly in nearly all types of weather conditions. It can be place where human beings can’t
go. The improvement in the performance of these micro aerial vehicles is the recent goal
in research field of aerial vehicles.
A quadcopter is a flying object, which changes its altitude and attitude by four
rotating blades. Quadcopters are a variation of multicopters, which are rotorcrafts. Dur-
ing 20th century there were several attempts to implement manned quadcopters, earliest
known cases are in 1922 by Etienne Oemichen in France [1] and by George Bothezat
in USA [2]. However, during the progress in rotorcrafts industry, the helicopters with
different schemes of rotors adjusting were chosen.
1.2 Motivation
2
tion areas they should be more autonomous and intelligent. They are planned to be used
in rescue operations [3], as a fire-fighter [4] or working as a group for fulfillment tasks
with general purposes [5].
1.3 Significance
Quadcopter aerial vehicles have greater significance in the research field of robotics.
It has greater reduction in mechanical complexity compared to single propeller helicopter.
Thus the Quadcopter platform is more reliable and robust. The use of a Quadcopter aerial
robot allows for high degrees of maneuverability, including the ability to hover. For prac-
tical applications and operations, it is necessary to improve the performance, stability,
more advanced control techniques and aerodynamic capabilities of Quadcopter aerial
robot. Research work is being in progress to improve abilities of Quadcopter through
advancement in multi Quadcopter communication, exploration and maneuverability. If
these all capabilities have been adopted, then Quadcopter would be the only micro aerial
vehicle to get advancement in such autonomous missions which are not possible for any
other vehicle.
3
1.4.1 Fixed Wing Aerial Vehicles
Motion of fixed wing aerial vehicle is achieved by control surfaces (ailerons, rud-
ders, elevators), that are effective with aerodynamic forces. A fixed wing aerial vehicle
(airplane) has stable flight. The stability and lift of a fixed wing aerial vehicle is created
through the flow of air above and below the wings during the forward motion. In a fixed
wing aerial vehicle, lift is provided by wings which overcome the weight of aerial vehicle.
Drag is the opposition of air during the forward motion. Drag is overcome by thrust
provided by engine, as shown in figure (1.1).
Fixed wing aerial vehicles are simple in construction compared to rotary wing aerial
vehicles. Fixed wing aerial vehicles are able to travel for longer time at moderate and
high speeds while having run way requirements for take-off and landing in most of the
cases.
Aerial vehicles have six degrees of freedom in its motions: up/down, fore/aft
(longitudinal motion), left/right (lateral motion), pitching, rolling, and yawing. A con-
ventional propeller based aerial vehicle consists of a main propeller providing thrust and a
tail propeller to counter the centripetal force of the main propeller as shown in figure (1.2).
4
Figure 1.2: Aerodynamic forces acting on a helicopter
• Collectively changing the pitch of all the main propeller blades thus increases the
propeller thrust (collective pitch) as shown in figure (1.3).
• Cyclically changing the tail propeller pitch to change the direction of thrust vector
(cyclic pitch) as shown in figure (1.4).
• Collectively changing the tail propeller pitch to change the yaw moment as shown
5
in figure (1.5).
Quadcopter has four rotary-wings to create lift. Two arms, each with motors at
its ends. Two motors installed on the same arm, rotate in a clockwise while the other
two motors installed on the second arm, rotate in counter clockwise direction. Motors
installed on same arm create equal torques as rotate with same speed. Quadcopter flight
is controlled through relative angular speeds (RPM) of motors.
6
Figure 1.6: Quadcopter aerial vehicle
Using two rotors can eliminate unwanted torque, but mechanical problems still
exist. Three and four rotor platform was better because they eliminate the extra torque
(when the propeller rotating in the opposite direction on the other side), and mechanically
simpler. Using differential thrust with four rotors, an aerial vehicle is able to hover and
move without complexity. Quadcopter aerial vehicle is classified as an under-actuated
system. This is because only four drives (rotors) are used to control all six degrees of
freedom (DOF). Four actuators directly affect the z axis (height) and on each of the
three major axes of rotation. Two other degrees of freedom are along the x axis and y
axis translations. Additional benefit of four-rotor aerial vehicle is the fast mobility and
increased payload.
Quadcopter has many advantages over conventional propeller based aerial vehicle.
Quadcopter does not need to change pitch angle of the rotor blade as it has fixed pitch
rotors. By increasing the number of propellers to create lift, size of each propeller is
reduced as compared to that of the conventional single propeller based aerial vehicle.
Thus each propeller consumes lesser amount of energy during flight. Quadcopter aerial
vehicle with smaller size is able to get closer to the desired point of interest without
7
having any risk of collision.
• Simple in design.
• Stable.
• No orientation issues.
Beside these, there are some important applications of a Quadcopter aerial vehicle.
Quadcopter aerial vehicles have special applications in video recording and aerial
imagery. Quadcopter are used autonomously for explorations in danger zones. Quad-
copter are used to get images and videos of such species like volcanoes, mountains, and
forests etc which are not in human access. They are also helpful in finding a missing
person or team in hilly areas or in another dangerous zone. They could be used for video
recording in large functions. Many Quadcopter aerial vehicles can be used to work to-
gether as a team. In fact, an entire heterogeneous system with many Quadcopter aerial
vehicles can be used for specific missions, all in unison.
Quadcopter aerial vehicle can be used for surveillance and reconnaissance, mil-
itary and law enforcement agencies, as well as search and rescue missions in an urban
environment.
8
Figure 1.7: Military operation using Quadcopter aerial vehicle
Many researchers have been working in the field of micro aerial vehicles with
particularly on quadcopter micro aerial vehicle (MAV). Some of their research work is
discussed here.
Bresciani et. al. work was focused on modeling the dynamics of quadcopter and
evaluating the control algorithm [9]. For this purpose, he developed a real platform and
simulated the system in 6 DOF simulations. For modeling of the dynamical system,
Newton-Euler method was used. In the first stage simulation of the quadcopter was
carried out while the control approach was implemented on the platform in the second
stage.
Flores designed a control model for tilt rotorcraft and experimentally implemented
the model using hardware platform in [10]. The rotorcraft was able to cruise with high
speed and hover like a helicopter. The control algorithm was based on Newtonian model
9
and the transition between cruise mode and the hover state of the rotorcraft was con-
trolled.
Kondak et al. [12] proposed a control algorithm for quadcopter micro aerial vehicle
having an autonomous flight with vertical takeoff and landing characteristics. The control
algorithm is based on decoupling and linearization. Two types of issues were addressed
in the proposed model, disturbances and uncertainties. The controller was designed to
compensate these issues. The model was based on reduced state observer for motion
control. In order to control the orientation of the quadcopter, the model considered
compensator and disturbance observer. Overall results showed good performance for
control of the system.
Mary et al. [13] designed a control algorithm for tracking and stabilization of a
quadcopter helicopter using thrust, roll, pitch and yaw commands. Nonlinear modeling
was used for analyzing and identification of the system. Linear Quadratic Regulator
(LQR) was used for linearization of the system at a specific hover position, and then
implemented in simulation.
Mian and Daobo [14] used a sequential nonlinear control strategy to derive a non-
linear under actuated model with six degree of freedom using Newton Euler method. A
PD controller was designed for its translational motion, coupled with feedback lineariza-
tion and a PID nonlinear controller based on backstepping phenomenon was designed for
rotational motion. At the end simulation of nonlinear control algorithm being proposed
showed good results.
Naidoo et al. [15] presented his research work, his research effort consists of
modeling of quadcopter helicopter using blade element and momentum theory. Basically
the aero-dynamical forces produced by the propellers were modeled. His model shows the
capacity of the quadcopter for payload and lift force exerted by the propellers. Equations
of motions were derived by Euler-Lagrange method and the system was considered to
be having six degree of freedom. The controller was suggested using linear PD control
technique.
Patkar et al. [16] designed Micro Aerial Vehicle (MAV). This showed good ma-
neuverability in the presence of atmospheric disturbances. Using lift forces lift coefficient,
10
roll, pitch and yaw movements caused by the variations in the rotor speeds and other
basic operations of maneuvering generated by rotors of an MAV, a kinematic model was
designed. The research also analyzed the structural deflections of an MAV under different
transient conditions.
Petersen et al. [17] have modeled X-Pro project studying the hover control of the
quadcopter helicopter. His model consists of three parts. First part was of motor/gear
system, the second part consisted of a rotor and body of quadcopter while third part was
electronics which is based on X-Pro. The motor is modeled through system identification
while rotors are modeled as polynomial of the second order. The body of the X-Pro
modeled through relationship of dynamics and kinematics and is considered to be rigid.
An LQR and PID controller has been designed using linearization. In order to track the
system (position and angles of X-Pro) a Vicon Motion Tracking System was used. Hover
control of the quadcopter was achieved with the controllers.
Pounds et al. [18] developed a quadcopter platform known as the X-4 Flayer. It
consisted of a custom-built avionics and chassis. For attitude stabilization an onboard
controller was designed. Another linear controller, SISO was also designed for regulating
the X-4 Flayer attitude.
Rodic and Mester [19] developed a model for outdoor autonomous quadcopter.
The research consists of developing a simulator for flight control. These researchers mod-
eled quadcopter kinematics and dynamics, navigation through different environments and
also to locate any position. The simulation results were shown for different maneuvers.
Zhang et al. [20] explained the hover control of a mini quadcopter. The researcher
has suggested a control technique to get the hover position of a quadcopter at the spe-
cific point using multiple sensors. The sensors used were a vision based system camera
and an Inertial Measurement Unit. A vision based control approach was implemented
using PID controllers. The system performance was enhanced by integrating the Inertial
Measurement Unit.
Different types of modeling and control methods for quadcopter micro aerial
vehicles have been used so far as already been discussed in Literature Review. Quadcopter
micro aerial vehicle has so many control issues. To stabilize the system different control
strategies had been applied. There are three basic stability issues found in quadcopter
system.
11
• Altitude stability.
• Longitudinal stability
Roll, pitch and yaw movement’s stabilities which are basically the rotation of
quadcopter in three dimensions about the three axes (longitudinal, lateral and vertical
axis) are considered in Angular stability.
Many researchers carried out the research work while considering one of the two
stabilities or both using different modeling and control techniques.
Altitude, attitude and position control of a quadcopter is being carried out while
considering the aerodynamic coefficients during motion [8]. The control technique used
was design of PID Controller in conjunction with Backstepping called Integral Backstep-
ping (IB). As a result an OS4 project was designed which was capable of Vertical Take
Off and Landing (VTOL), hover and collision avoidance.
12
A more stable system is designed for hover control of Quadcopter using Backstep-
ping and Sliding Mode control techniques. Angular stability at hover condition has been
achieved. Altitude stability is also achieved at hover. The presented approach is general
and the Backstepping and Sliding Mode controller designed are simpler but it may pro-
vide sufficient performance in vast range of practical applications. It shows better results
for roll, pitch, yaw and altitude and the steady state error is completely diminished. The
system response is fast and there are no overshot present which are devised to be avoided.
13
1.9 Thesis Organization
This thesis is divided into eight chapters. A brief introduction of each chapter is
presented in this section.
Chapter 2
In chapter 2 ’Mathematical model of the quadcopter’ several issues are discussed.
At the beginning an analysis of quadrocopter physical processes is done and collected
as one process. Then deferential equations described each process are represented. This
chapter describes the mathematical modeling of the Quadcopter, deriving the equations
of motion describing system dynamics combining and rewriting these equation in to state-
space form.
Chapter 3
Chapter 3 ’Design of the linear Control System’ dedicates to choosing structures
of controllers and calculation their coefficients. It starts from short discussion about PID
approach. A method for choosing poles based on quality requirements is discussed. At the
end, implementation in Matlab/Simulink is described and results of simulation are shown.
Chapter 4
In this chapter nonlinear control techniques have been discussed in detail. The
control strategies are Identified, developed, and simulated on Matlab/Simulink.
Chapter 5
This chapter concludes this thesis with a summary and recommendation for the
future work. .
Chapter 6
This chapter contains the bibliography.
Overall picture of understanding and designing the controller for the Quadcopter Aerial
Vehicle is shown in Figure (1.8)
14
Figure 1.8: Overall Picture For Quadcopter Aerial Vehicle
15
Chapter 2
Mathematical model
16
This chapter derives the model of Quadcopter. A step by step procedure is
adopted for development of a Quadcopter model by starting with DC motor model. The
Quadcopter consists of four motors (DC brushless) with corresponding four propellers.
First a best model of motor/propeller matching is obtained. In the second section, Quad-
copter model will be presented which include mathematical derivations for modeling the
Quadcopter parameters.
Quadcopter aerial robot produces thrust by applying force on the volume of air
through four propellers. When the propeller spins, it causes the air around it to accelerate
from side to side, leading to the production of thrust in the opposite direction.
Four helicopter rotor blades are responsible for three basic functions:
• Production of horizontal force for flight along lateral axis and longitudinal axis.
Four types of commands are required for complete flight control of a Quadcopter
aerial robot.
2.1.1 Thrust
Thrust is produced by varying the angular speeds of all the four propellers simul-
taneously at the same rate. When the speed of all propellers is increased then an upward
motion is produced. If the speed of all propellers is reduced then a downward motion is
produced. Figure (2.1) shows the throttle command of a Quadcopter where Ωi represents
the constant angular speed and ∆A represents increment in angular speed.
When all propellers are rotating with same angular speed Ωi and producing thrust
17
Figure 2.1: Throttle movement of a Quadcopter
equal to the weight of Quadcopter then it will hold in a steady state called hover. Accel-
eration due to gravity is counter balanced by thrust in a hover condition. There are no
net forces on Quadcopter. The steady hover is shown in figure (2.2).
2.1.2 Roll
18
Figure 2.3: Throttle movement of a Quadcopter
2.1.3 Pitch
2.1.4 Yaw
19
command provides the yaw angular acceleration as shown in figure (2.5).
Where angular speeds of front and rear propellers are decremented by ∆B and
those of left and right propellers are incremented by ∆A . Thus this creates a net torque
about vertical axis which causes the rotation of a Quadcopter.
The motion of a Quadcopter aerial robot is considered as rigid body motion. The
motion of a rigid body with 6 DOF can best be described using two reference frames.
The Earth inertial frame and the Body fixed frame are as shown in figure (2.6).
Earth inertial frame is shown as the right hand reference where XE is pointing
towards North, YE is pointing towards West, ZE is pointing in upward direction with
20
Figure 2.6: Reference Frames of a Quadcopter Aerial Robot
respect to earth and OE is the E-frame origin. The Earth inertial frame is used to describe
the linear and angular positions of a Quadcopter aerial robot in a ground station.
Body fixed frame describes the orientation of a body of a Quadcopter aerial robot.
XB is in the direction of a Quadcopter front, YB is in the direction of a Quadcopter left,
ZB is in the upward direction and OB coincides at the origin of a Quadcopter. The
transformation of linear and angular positions between the origin of B-frame and the
origin of E-frame is given by the transformation matrix.
cos ψ − sin ψ 0
Cψ = sin ψ cos ψ 0 (2.1)
0 0 1
21
Figure 2.8: Rotation of a Quadcopter about new YE axis
cos ϑ 0 sin ϑ
Cϑ = 0 1 0 (2.2)
− sin ϑ 0 cos ϑ
The rotation matrix about new XE axis is;
1 0 0
Cφ = 0 cos φ − sin φ (2.3)
0 sin φ cos φ
22
The axis of earth fixed frame E is represented by [X, Y, Z] and axis of body of moving
object fixed frame B is represented by [x, y, z]. Any point of the moving object having
3D rotations can be written as:
x
rX,Y,Z (x, y, z) = Cφϑψ y (2.5)
z
cos ϑ cos ψ sin ϑ cos ψ sin φ − sin ψ cos φ sin ψ sin φ + cos ψ sin ϑ cos φ x
rX,Y,Z = sin ψ cos ϑ sin ψ sin ϑ sin φ + cos ψ cos φ sin ψ sin ϑ cos φ − cos ψ sin φ y
− sin ϑ cos ϑ sin φ cos ϑ cos φ z
it can expressed as:
rX (x, y, z) = (cos ϑ cos ψ) x+(sin ϑ cos ψ sin φ − sin ψ cos φ) y+(sin ψ sin φ + cos ψ sin ϑ cos φ) z
rY (x, y, z) = (sin ψ cos ϑ) x+(sin ψ sin ϑ sin φ + cos ψ cos φ) y+(sin ψ sin ϑ cos φ−cos ψ sin φ)z
23
[ ] x
υZ (x, y, z) = υZ x x + υZ y y + υZ z z = υZ x υZ y υZ z y
z
here
υX y = (cos ψ sin ϑ cos φφ̇+cos ψ cos ϑ sin φϑ̇−sin ψ sin ϑ sin φψ̇)−(cos φ cos ψ ψ̇−sin ψ sin φφ̇)
υX z = (sin ψ cos φφ̇+cos ψ sin φψ̇)−(cos ψ sin ϑ sin φφ̇−cos ψ cos ϑ sin φϑ̇+sin ψ sin ϑ cos φψ̇)
υY y = cos ψ sin φ sin ϑψ̇ +sin ψ cos φ sin ϑφ̇+sin ψ sin φ cos ϑϑ̇−sin ψ cos φψ̇ −cos ψ sin φφ̇
υY z = sin ψ sin φψ̇ −cos ψ cos φφ̇+cos ψ cos φ sin ϑψ̇ −sin ψ sin φ sin ϑφ̇+sin ψ cos φ cos ϑϑ̇
υZ x = − cos ϑϑ̇
taking square of magnitude of the speed for any point of moving object:
24
Putting the valves in equ: (2.6)
( )
2 2 2 2 2
υ (x, y, z) = x cos ϑψ̇ + ϑ̇
( )
+ y 2 ψ̇ 2 (cos2 φ + sin2 φsin2 ϑ) − ψ̇(2 sin φ cos φ cos ϑϑ̇ + 2 sin ϑφ̇) + sin2 φϑ̇2 + φ̇2
( )
+ z 2 ψ̇ 2 (sin2 φ + cos2 φsin2 ϑ) + ψ̇(2 sin φ cos φ cos ϑϑ̇ − 2 sin ϑφ̇) + cos2 φϑ̇2 + φ̇2
( )
+ 2xy ψ̇ sin ϑ cos ϑ sin φ + ψ̇(cos φ sin ϑϑ̇ − sin φ cos ϑφ̇) − cos φφ̇ϑ̇
2
( )
+ 2xz ψ̇ 2 cos φ sin ϑ cos ϑ + ψ̇(− cos φ sin ϑφ̇ − sin φ sin ϑϑ̇) − cos φφ̇ϑ̇
( )
+ 2yz −ψ̇ sin φ cos φcos ϑ + ψ̇(sin φ cos ϑϑ̇ − cos φ cos ϑϑ̇) + sin φ cos φϑ̇
2 2 2 2 2
(2.7)
( ) ( )
+ z 2 + x2 . ϑ̇2 cos2 φ + ψ̇ 2 sin2 φcos2 ϑ + 2 sin φ cos φ cos ϑϑ̇ψ̇
( ) ( )
+ x2 + y 2 . ψ̇ 2 cos2 φ cos2 ϑ + ϑ̇2 sin2 φ − 2 sin φ cos φ cos ϑϑ̇ψ̇
( )
+ xy. ψ̇ sin φ sin ϑ cos ϑ − φ̇ϑ̇ cos φ − ψ̇(φ̇ sin φ cos ϑ − ϑ̇ cos φ sin ϑ)
2
( )
+ xz. ψ̇ 2 cos φ sin ϑ cos ϑ + φ̇ϑ̇ sin φ − ψ̇(φ̇ cos φ cos ϑ + ϑ̇ sin φ sin ϑ)
( )
+ yz. ψ̇(ϑ̇sin2 φ cos ϑ − ϑ̇cos2 φ cos ϑ) − ψ̇ 2 sin φ cos φcos2 ϑ + ϑ̇2 sin φ cos φ
(2.8)
(2.9)
25
here ∫
( )
z 2 + x2 dm = Iyy (2.10a)
∫
( )
x2 + y 2 dm = Izz (2.10b)
∫
( )
y 2 + z 2 dm = Ixx (2.10c)
∫
xy dm = Ixy ≈ 0 (2.10d)
∫
xz dm = Ixz ≈ 0 (2.10e)
∫
yz dm = Iyz ≈ 0 (2.10f)
Due to the mechanical structure of the Quadcopter, we can neglect the inertia products
because the inertia moments are a thousand times greater than the inertia products.
Taking into account equ: (2.10), the kinetic energy become then:
1 ( )2 1 ( )2 1 ( )2
K = Ixx φ̇ − ψ̇ sin ϑ + Iyy ϑ̇ cos φ + ψ̇ sin φ cos ϑ + Izz ϑ̇ sin φ − ψ̇ cos φ cos ϑ
2 2 2
(2.11)
∫ ∫ ∫
P=g x.dm (x). (− sin ϑ) + g y.dm (y). (sin φ cos ϑ) + g z.dm (z). (cos φ cos ϑ)
(2.12)
26
2.2.4 Lagrangian Equation
(2.14)
∂L ( )( )
= Iyy ϑ̇ cos φ + ψ̇ sin φ cos ϑ −ϑ̇ sin φ + ψ̇ cos ϑ cos φ
∂φ
( )( )
+ Izz ϑ̇ sin φ − ψ̇ cos φ cos ϑ ϑ̇ cos φ + ψ̇ sin φ cos ϑ (2.16a)
∫ ∫
− ydm (y). (g cos ϑ cos φ) + zdm (z). (g sin φ cos ϑ)
∂L ( )( ) ( )( )
= Ixx φ̇ − ψ̇ sin ϑ ψ̇ cos ϑ + Iyy ϑ̇ cos φ + ψ̇ sin φ cos ϑ −ψ̇ sin φ sin ϑ
∂ϑ
( )( ) ∫
+ Izz ϑ̇ sin φ − ψ̇ cos φ cos ϑ ψ̇ cos φ sin ϑ + xdm (x). (g cos ϑ)
∫ ∫
+ ydm (y). (g sin φ sin ϑ) + zdm (z). (g cos φ sin ϑ)
(2.16b)
∂L
=0 (2.16c)
∂ψ
27
and taking derivatives (eq:2.13) w.r.t φ̇, ϑ̇ and ψ̇
∂L ( )
= Ixx φ̇ − ψ̇ sin ϑ (2.17a)
∂ φ̇
∂L ( ) ( )
= Iyy ϑ̇ cos φ + ψ̇ sin φ cos ϑ (cos φ) + Izz ϑ̇ sin φ − ψ̇ cos φ cos ϑ (cos φ cos ϑ)
∂ ϑ̇
(2.17b)
∂L ( ) ( )
= Ixx φ̇ − ψ̇ sin ϑ (− sin ϑ) + Iyy ϑ̇ cos φ + ψ̇ sin φ cos ϑ (sin φ cos ϑ)
∂ ψ̇
( ) (2.17c)
+ Izz ϑ̇ sin φ − ψ̇ cos φ cos ϑ (− cos φ cos ϑ)
d ∂L ( )
( ) = −Iyy ϑ̇ cos φ + ψ̇ sin φ cos ϑ (φ̇ sin φ)
dt ∂ ϑ̇
( )
+ Iyy (cos φ) −ϑ̇φ̇ sin φ + ϑ̈ cos φ + ψ̈ sin φ cos ϑ + ψ̇ φ̇ cos φ cos ϑ − ψ̇ ϑ̇ sin φ sin ϑ
( )( )
+ Izz ϑ̇ sin φ − ψ̇ cos φ cos ϑ −ϑ̇ cos φ sin ϑ − φ̇ sin φ cos ϑ
( )
+ Izz ϑ̈ sin φ + ϑ̇φ̇ cos φ − ψ̈ cos φ cos ϑ + ψ̇ φ̇ sin φ cos ϑ + ψ̇ ϑ̇ cos φ sin ϑ (cos φ cos ϑ)
(2.18b)
d ∂L ( ( )( ) ( ) )
( ) = Ixx − φ̇ − ψ̇ sin ϑ ϑ̇ cos ϑ − φ̈ − ψ̈ sin ϑ − ψ̇ ϑ̇ cos ϑ (sin ϑ)
dt ∂ ψ̇
( )( )
+ Iyy ϑ̇ cos φ + ψ̇ sin φ cos ϑ φ̇ cos φ cos ϑ − ϑ̇ sin φ sin ϑ
( )
+ Iyy ϑ̈ cos φ − ϑ̇φ̇ sin φ + ψ̈ sin φ cos ϑ + ψ̇ φ̇ cos φ cos ϑ − ψ̇ ϑ̇ sin φ sin ϑ (sin φ cos ϑ)
( )( )
+ Izz ϑ̇ sin φ − ψ̇ cos φ cos ϑ ϑ̇ cos φ sin ϑ + φ̇ sin φ cos ϑ
+ Izz (ϑ̈ sin φ + ϑ̇φ̇ cos φ − ψ̈ cos φ cos ϑ + ψ̇ φ̇ sin φ cos ϑ + ψ̇ ϑ̇ cos φ sin ϑ) (− cos φ cos ϑ)
(2.18c)
taking into account (eq:2.16) and (eq:2.18)
( ) ( )
d ∂L ∂L
− = Ixx φ̈ − ψ̈ sin ϑ − ψ̇ ϑ̇ cos ϑ
dt ∂ φ̇ ∂φ
( )( )
− Iyy ϑ̇ cos φ + ψ̇ sin φ cos ϑ ψ̇ cos ϑ cos φ − ϑ̇ sin φ
( )( ) (2.19a)
− Izz ϑ̇ sin φ − ψ̇ cos φ cos ϑ ϑ̇ cos φ + ψ̇ sin φ cos ϑ
∫ ∫
+ ydm (y). (g cos ϑ cos φ) − zdm (z). (g sin φ cos ϑ)
28
d ∂L ∂L ( )
( )− = Iyy ϑ̇ cos φ + ψ̇ sin φ cos ϑ (−φ̇ sin φ)
dt ∂ ϑ̇ ∂ϑ
( )
+ Iyy (cos φ) ϑ̈ cos φ − ϑ̇φ̇ sin φ + ψ̈ sin φ cos ϑ + ψ̇ φ̇ cos φ cos ϑ − ψ̇ ϑ̇ sin φ sin ϑ
( )( )
+ Izz ϑ̇ sin φ − ψ̇ cos φ cos ϑ −ϑ̇ cos φ sin ϑ − φ̇ sin φ cos ϑ
+ Izz (ϑ̈ sin φ + ϑ̇φ̇ cos φ − ψ̈ cos φ cos ϑ + ψ̇ φ̇ sin φ cos ϑ + ψ̇ ϑ̇ cos φ sin ϑ) (cos φ cos ϑ)
( )( ) ( )( )
− Ixx φ̇ − ψ̇ sin ϑ ψ̇ cos ϑ − Iyy ϑ̇ cos φ + ψ̇ sin φ cos ϑ −ψ̇ sin φ sin ϑ
( )( ) ∫
− Izz ϑ̇ sin φ − ψ̇ cos φ cos ϑ ψ̇ cos φ sin ϑ − xdm (x). (g cos ϑ)
∫ ∫
− ydm (y). (g sin φ sin ϑ) − zdm (z). (g cos φ sin ϑ)
(2.19b)
d ∂L ( ( )( ) ( ) )
( ) = Ixx − φ̇ − ψ̇ sin ϑ ϑ̇ cos ϑ − φ̈ − ψ̈ sin ϑ − ψ̇ ϑ̇ cos ϑ (sin ϑ)
dt ∂ ψ̇
( )( )
+ Iyy ϑ̇ cos φ + ψ̇ sin φ cos ϑ φ̇ cos φ cos ϑ − ϑ̇ sin φ sin ϑ
( )
+ Iyy ϑ̈ cos φ − ϑ̇φ̇ sin φ + ψ̈ sin φ cos ϑ + ψ̇ φ̇ cos φ cos ϑ − ψ̇ ϑ̇ sin φ sin ϑ (sin φ cos ϑ)
( )( )
+ Izz ϑ̇ sin φ − ψ̇ cos φ cos ϑ ϑ̇ cos φ sin ϑ + φ̇ sin φ cos ϑ
+ Izz (ϑ̈ sin φ + ϑ̇φ̇ cos φ − ψ̈ cos φ cos ϑ + ψ̇ φ̇ sin φ cos ϑ + ψ̇ ϑ̇ cos φ sin ϑ) (− cos φ cos ϑ)
(2.19c)
After development:
( )
d ∂L ∂L ( ( ))
− = φ̈.Ixx − ψ̈. sin ϑ.Ixx − ψ̇ ϑ̇. cos ϑ Ixx + (Iyy − Izz ) 2 cos φ2 − 1
dt ∂ φ̇ ∂φ
1 1
+ ϑ̇2 . sin 2φ (Iyy − Izz ) − ψ̇ 2 . sin 2φ cos ϑ2 (Iyy − Izz )
∫ 2 2∫
+ ydm (y). (−g cos φ cos ϑ) + zdm (z). (g sin φ cos ϑ)
( )
d ∂L ∂L ( )
− = φ̈ − ψ̈. sin ϑ − ψ̇ ϑ̇. cos ϑ Ixx
dt ∂ φ̇ ∂φ
( )
2 1 2 1
( )
+ ϑ̇ . sin 2φ − ψ̇ . sin 2φ cos ϑ − ψ̇ ϑ̇. cos ϑ 2 cos φ − 1 (Iyy − Izz )
2 2
2 2
∫ ∫
+ ydm (y). (−g cos φ cos ϑ) + zdm (z). (g sin φ cos ϑ)
(2.20)
29
d ∂L ∂L ( ) 1
( )− = ϑ̈. Iyy cos2 φ + Izz sin2 φ + ψ̈. sin 2φ cos ϑ. (Iyy − Izz )
dt ∂ ϑ̇ ∂ϑ 2
1 ( )
+ ψ̇ 2 . sin 2ϑ −Ixx + Iyy sin2 φ + Izz cos2 φ + ϑ̇φ̇. sin 2φ (Izz − Iyy )
2 ∫
+ ψ̇ ϑ̇. cos ϑ (cos 2φ. (Iyy − Izz ) + Ixx ) + xdm(x)(−g cos ϑ)
∫ ∫
− ydm(y)(g sin φ sin ϑ) − zdm(z)(g cos φ sin ϑ)
( ) ( )
d ∂L ∂L 2 1
− = ψ̇ ϑ̇. cos ϑ − ψ̇ . sin 2ϑ Ixx
dt ∂ ϑ̇ ∂ϑ 2
( ) 1 ( )
+ ϑ̈. Iyy cos2 φ + Izz sin2 φ + ψ̇ 2 . sin 2ϑ Iyy sin2 φ + Izz cos2 φ
( 2 )
1
+ ψ̈. sin 2φ cos ϑ − ϑ̇φ̇. sin 2φ + ψ̇ ϑ̇. cos ϑ (cos 2φ) (Iyy − Izz )
2
∫ ∫ ∫
− xdm(x)(g cos ϑ) − ydm(y)(g sin φ sin ϑ) − zdm(z)(g cos φ sin ϑ)
(2.21)
( )
d ∂L ( ( ) )
= ψ̈. cos2 ϑ Izz cos2 φ + Iyy sin2 φ + sin2 ϑIxx − φ̈. sin ϑIxx
dt ∂ ψ̇
1 ( )
+ ϑ̈. sin 2φ cos ϑ (Iyy − Izz ) + ψ̇ ϑ̇. sin 2ϑ Ixx − Izz cos2 φ + Iyy sin2 φ
2
( ( ) )
− ψ̇ φ̇. sin 2φcos2 ϑ (Iyy − Izz ) + φ̇ϑ̇. cos ϑ Ixx + 2cos2 φ − 1 (Iyy − Izz )
1
− ϑ̇2 . sin 2φ sin ϑ (Iyy − Izz )
2
(2.22)
The equations (2.20), (2.21) and (2.22) are more simplified by presenting the velocities
and accelerations of rotational angles as a function of the instantaneous velocities and
accelerations in the fixed frame B of moving object by using the transformation matrix
of angular rates.
Transformation matrix:
The time derivatives of Euler angles (φ, ϑ, ψ) is not a continuous function and it is
different from angular rates of moving object (p, q, r), which are measured physically with
gyroscopes. In general the body rotations can be measured using an IMU in aerospace.
(p, q, r)T is transfer to [φ̇, ϑ̇, ψ̇]T using the transformation matrix as such [24]:
p φ̇
q = Tr ϑ̇ (2.23)
r ψ̇
30
where
1 0 − sin ϑ
Tr = 0 cos φ cos ϑ sin φ (2.24)
0 − sin φ cos ϑ cos φ
p 1 0 − sin ϑ φ̇
q = 0 cos φ cos ϑ sin φ ϑ̇ (2.25)
r 0 − sin φ cos ϑ cos φ ψ̇
from eq: (2.25)
p = φ̇ − ψ̇. sin ϑ
Its derivatives
q̇ = ϑ̈. cos φ − ϑ̇φ̇. sin φ + ψ̈. sin φ cos ϑ + ψ̇ φ̇. cos φ cos ϑ − ψ̇ ϑ̇ sin φ sin ϑ (2.26b)
ṙ = ẍψ. cos φ cos ϑ − ψ̇ φ̇. sin φ cos ϑ − ψ̇ ϑ̇ cos φ sin ϑ − ẍϑ. sin φ − ϑ̇φ̇. cos φ (2.26c)
31
( ) ∫
d ∂L ∂L
− = Ixx ω̇x − (Iyy − Izz ) ωy ωz + ydm (y). (−g cos φ cos ϑ)
dt ∂ φ̇ ∂φ
∫ (2.29a)
+ zdm (z). (+g sin φ cos ϑ)
( )
d ∂L ∂L
− = − sin φ (ω̇z Izz − ωx ωy (Ixx − Iyy )) + cos φ (ω̇y .Iyy − ωx ωz (Izz − Ixx ))
dt ∂ ϑ̇ ∂ϑ
∫ ∫
+ xdm (x). (−g cos ϑ) − ydm (y). (g sin φ sin ϑ)
∫
− zdm (z). (g cos φ sin ϑ)
(2.29b)
( )
d ∂L
= cos φ cos ϑ. (ω̇z Izz − ωx ωy (Ixx − Iyy )) + sin φ cos ϑ. (ω̇y Iyy − ωx ωz (Izz − Ixx ))
dt ∂ ψ̇
− sin ϑ. (ω̇x Ixx − ωy ωz (Iyy − Izz ))
(2.29c)
using small angle approximations, the dynamic equations of the rotational subsystem
developed into:
( )
d ∂L ∂L
− = Ixx ω̇x − (Iyy − Izz ) ωy ωz (2.30a)
dt ∂ φ̇ ∂φ
( )
d ∂L ∂L
− = ω̇y .Iyy − ωx ωz (Izz − Ixx ) (2.30b)
dt ∂ ϑ̇ ∂ϑ
( )
d ∂L
= ω̇z Izz − ωx ωy (Ixx − Iyy ) (2.30c)
dt ∂ ψ̇
(Iyy − Izz ) Tx
φ̈ = ϑ̇ψ̇ + (2.31a)
Ixx Ixx
(Izz − Ixx ) Ty
ϑ̈ = φ̇ψ̇ + (2.31b)
Iyy Iyy
(Ixx − Iyy ) Tz
ψ̈ = φ̇ϑ̇ + (2.31c)
Izz Izz
Faero denotes the resultant of aerodynamic frictions tarques due to φ, ϑ and ψ such as
Kφ 0 0 ∥φ̇∥2
Faero = 0 Kϑ 0 ∥ϑ̇∥2 (2.32)
0 0 Kψ ∥ψ̇∥2
32
where Kφ , Kϑ and Kψ are the coefficients of aero-dynamics frictions.
(Iyy − Izz ) Tx
φ̈ = ϑ̇ψ̇ + − Kφ ∥φ̇∥2 (2.33a)
Ixx Ixx
(Izz − Ixx ) Ty
ϑ̈ = φ̇ψ̇ + − Kϑ ∥ϑ̇∥2 (2.33b)
Iyy Iyy
(Ixx − Iyy ) Tz
ψ̈ = φ̇ϑ̇ + − Kψ ∥ψ̇∥2 (2.33c)
Izz Izz
Tx2 = Ir ωy (Ω1 + Ω3 − Ω2 − Ω4 )
Ty2 = Ir ωx (−Ω1 − Ω3 + Ω2 + Ω4 )
Ω̄ = Ω1 + Ω3 − Ω2 − Ω4
33
Tx = Tx1 + Tx2 = bl(Ω24 − Ω22 ) + Ir ωy Ω̄
( )
Ty = Ty1 + Ty2 = bl Ω23 − Ω21 − Ir ωx Ω̄
Newtonian Euler approach is used to find mathematical model for the three
translational subsystem. Newtonian Euler approach is described as:
dp
netF = (2.34)
dt
here netF shows all the external forces exerted to the moving object and p represents
linear momentum.
Figure 2.11: Position of the moving object in XYZ fixed reference frame
To apply eq. (2.34) to this moving object, a linear momentum of the moving object can
be expressed as:
34
p = mv (2.35)
where m is a mass of the moving object and v represents a linear velocity of the moving
object. Substituting equ. (2.35), in equ. (2.34) as:
dv d2 r
netF = m =m 2 (2.36)
dt dt
The movement in position of the moving object can be written from equ. (2.36) as
If the external net force netF and external net torque netT are given, then the
position and orientation of the quadcopter can be found from equations (2.38) and (2.33).
There are three external forces: (1). a gravitational force Fmg , (2). a drag force Fdrag and
(3). a thrust force O which can produced by three sources gravitational field, air drag
and rotations of the blades in the air respectively. The forces and torques from blades
are only controllable. The gravitational force and drag force cannot be controlled.
35
2.3.1.1 Gravitational forces
Fmg = mg
where g is gravitational acceleration and m represent the mass of the quadcopter . Let
us consider that the center of mass coincides with the center of gravity of the quadcopter .
When ever a moving body moves through the air, it feels with air resistant. Air
drag force can be formulated as:
Fdrag = ϱ A Kd v2 (2.40)
where Kd shows coefficient of air drag force, A is specific area of the moving body, ϱ is
mass density of the air flow, v is the speed of the moving body relative to the air flow.
The coefficient Kd depends on the shape of the body. The drag force coefficients
for several shapes are well known. The air’s mass density "ϱ" depends on the height
above the see level and its valve is measured to be 1.2250 for 1 meter above sea level.
Fdrag = ϱ A Kd | v| v (2.41)
36
ϱAKd 0 0 ∥ẋ∥2
Fdrag = 0 ϱAKd 0 ∥ẏ∥2 (2.42)
0 0 ϱAKd ∥ż∥2
The thrust force exerted by moving object, " O" can be expressed as:
Ox
O = Oy = C ∗ Oxb yb zb (2.43)
Oz
The thrust force is always along zb axis, so eq.(2.43) can be written as:
0
O=C∗ 0 (2.44)
O
where b is the thrust factor of propeller and Ω is the angular velocity of the DC motor.
37
mẍ sin ψ sin φ + cosψ sin ϑ cos φ 0 ϱAKd ∥ẋ∥2
mÿ = − cos ψ sin φ + sin ψ sin ϑ cos φ ∗ O − 0 + ϱAKd ∥ẏ∥2
mz̈ cos ϑ cos φ mg ϱAKd ∥ż∥2
O ∥ẋ∥2
ẍ = (sin ψ sin φ + cosψ sin ϑ cos φ) ∗ − ϱAKd (2.48a)
m m
O ∥ẏ∥2
ÿ = (sin ψ sin ϑ cos φ − cos ψ sin φ) ∗ − ϱAKd (2.48b)
m m
O ∥ż∥2
z̈ = (cos ϑ cos φ) ∗ − g − ϱAKd (2.48c)
m m
ϱAKd
Kx,y,z = (2.49)
m
using equ: (2.46) and (2.49),
The control of a Quadcopter is totally based on the motion control of the four
propellers attached to brushless dc motors. Generally the angular speed of a motor is
represented by a symbol omega "Ω" and measured in radians per second. Thus the
angular speeds of the four motors M1 , M2 , M3 and M4 mounted at the end of each
arm are Ω1 , Ω2 , Ω3 and Ω4 respectively. Relative variations in angular speeds of the
motors give rise to control inputs.
Based on the pattern of variations in angular speeds, there are four basic control
inputs to a Quadcopter. The control vector for a Quadcopter is given by:
[ ]
U= U1 U2 U3 U4 (2.51)
where U1 , U2 , U3 and U4 are the four control inputs of a Quadcopter representing thrust,
roll, pitch and yaw control respectively.
In terms of angular speeds of a Quadcopter, the control inputs are given by:
38
U2 = b(−Ω22 + Ω24 ) (2.52b)
in the above equations (2.52), "b" is the thrust factor and "d" is the drag factor.
U1 represents the total thrust force exerted by all the four rotors on the air
profile. As a reaction the air pushes up the Quadcopter. Thus it provides the lift force
to a Quadcopter. If the total lift force overcomes the weight then it will move in the
upward direction. If the total lift force becomes equal to the weight of a Quadcopter then
it will remain in a stationary position up in air known as hover. But if the total lift force
becomes less than the total weight of a Quadcopter then it will move in the downward
direction.
U3 represents the rotation about lateral axis known as pitch movement of a Quad-
copter. As it is clear from equation (2.52c) that pitch movement is a result of relative
increase and decrease in angular speeds of motor M1 and motor M3 . If angular speed of
motor M1 (Front motor) exceeds that of motor M3 (Rear motor) then the Quadcopter
will move in the backward direction. If angular speed of motor M3 (Rear motor) exceeds
that of motor M1 (Front motor) then the Quadcopter will move in the forward direction.
U4 represents the rotation about vertical axis known as yaw movement of a Quad-
copter. Yaw movement is the difference in angular speeds of pairs of motors mounted on
the two arms of a Quadcopter. The angular speeds of motors M1 and motor M3 located
on the same arm may be greater than or less than that of motors M2 and M4 .
Using eq.(2.52),
1
ẍ = −Kx ∥ẋ∥2 + (sin ψ sin φ + cos ψ sin ϑ cos φ) U1
m
1
ÿ = −Ky ∥ẏ∥2 + (sin ψ sin ϑ cos φ − cos ψ sin φ) U1
m
1
z̈ = −Kz ∥ż∥2 − g + (cos ϑ cos φ) U1
m
39
Ir (Iyy − Izz ) l
φ̈ = ϑ̇Ω̄ + ψ̇ ϑ̇ − Kφ ∥φ̇∥2 + U2
Ixx Ixx Ixx
Ir (Izz − Ixx ) l
ϑ̈ = − φ̇Ω̄ + ψ̇ φ̇ − Kϑ ∥ϑ̇∥2 + U3
Iyy Iyy Iyy
(Ixx − Iyy ) 1
ψ̈ = ϑ̇φ̇ − Kψ ∥ψ̇∥2 + U4
Izz Izz
where Kx , Ky and Kz are the positive translation drag coefficients and Kφ , Kϑ and Kψ
are the coefficients of aero-dynamics frictions
X = (x1 x2 y1 y2 z1 z2 φ1 φ2 ϑ1 ϑ2 ψ1 ψ2 ) (2.54)
40
x˙1 = x2
x˙2 = −Kx x22 + ux m1 U1
y˙1 = y2
y˙2 = −Ky y22 + uy m1 U1
z˙1 = z2
z˙2 = −g − Kz z2 + (cos ϑ1 cos φ1 ) m1 U1
2
(2.56)
φ˙1 = φ2
φ˙2 = a1 ψ2 ϑ2 + a2 Ω̄ ϑ2 − Kφ φ22 + b1 U2
ϑ˙1 = ϑ2
ϑ˙2 = a3 ψ2 φ2 + a4 Ω̄ φ2 − Kϑ ϑ22 + b2 U3
ψ˙1 = ψ2
ψ˙2 = a5 ϑ2 φ2 − Kψ ψ22 + b3 U4
where
ux = (sin ψ1 sin φ1 + cos ψ1 sin ϑ1 cos φ1 )
a2 = IR /Ixx
a4 = −IR /Iyy
b1 = l/Ixx
b2 = l/Iyy
b3 = 1/Izz
41
x2
−Kx x2 2
y2
−Ky y2 2
z2
−g − Kz z2 2
f (x, y, z, φ, ϑ ψ) = (2.57)
φ2
− K 2
a1 ψ 2 ϑ 2 + a2 Ω̄ϑ 2 φ φ 2
ϑ
2
− K 2
a 3 ψ2 φ 2 + a 4 Ω̄φ 2 ϑ ϑ 2
ψ
2
a ϑ φ −K ψ 2
5 2 2 ψ 2
0 0 0 0 0 0
1
0 0 0
ux m
0 0
0 0 0 0 0 0
0 uy m1 0 0 0 0
0 0 0 0 0 0
0
0 (cos ϑ1 cos φ1 ) m 0 0 0
1
g(x, y, z, φ, ϑ ψ) = (2.58)
0 0 0 0 0 0
0 b1 0 0
0 0
0 0 0 0 0 0
0
0 0 0 b2 0
0 0 0 0 0 0
0
0 0 0 0 b3
42
the equations (2.52a −→ 2.52d) can be rearranged as,
U3
Ω21 = + Ω23 (2.60)
b
U2
Ω24 =+ Ω22 (2.61)
b
Putting values of Ω21 and Ω24 in equation (2.52a),
{( ) ( )}
U3 U2
U1 = b + Ω23 + Ω22 + Ω23 + + Ω22
b b
( )
U2 U3
U1 = b + 2
+ 2Ω2 + 2Ω3 2
b b
( )
U1 = U2 + U3 + 2bΩ22 + 2bΩ23 (2.62)
d d
U4 = U2 − U3 + 2dΩ22 − 2dΩ23
b b
b
U4 = U2 − U3 + 2bΩ22 − 2bΩ23 (2.63)
d
Adding equations (2.62) and (2.63),
b
U1 + U4 = 2U2 + 4bΩ22
d
b 1 b
U4 = U1 + U2 − U3 − U2 + U4 − 2bΩ23 (2.65)
d 2 2d
43
Simplifying and rearranging for Ω23 ,
1 b
2bΩ23 = U1 − U3 − U4
2 2d
1 1 1
Ω23 = U1 − U3 − U4 (2.66)
4b 2b 4d
( )1/2
1 1 1
Ω3 = U1 − U3 − U4 (2.67)
4b 2b 4d
Considering equation (2.52c) and putting Ω23 to get Ω1 ,
( )
1 1 1
U3 = b Ω1 − ( U1 − U3 − U4 )
2
4b 2b 4d
1 1 b
U3 = bΩ21 − U1 + U3 + U4
4 2 4d
1 1 1
Ω21 = U1 + U3 − U4 (2.68)
4b 2b 4d
( )1/2
1 1 1
Ω1 = U1 + U3 − U4 (2.69)
4b 2b 4d
Considering the equation (2.52b) and putting Ω22 to get Ω4 ,
( )
1 1 1
U2 = b ( U1 − U2 + U4 ) + Ω4
2
4b 2b 4d
1 1 b
U2 = − U1 + U2 − U4 + bΩ24
4 2 4d
Rearranging for Ω24 ,
1 1 1
Ω24 = U1 + U2 + U4 (2.70)
4b 2b 4d
( )1/2
1 1 1
Ω4 = U1 + U2 + U4 (2.71)
4b 2b 4d
The whole system of equation for angular speeds in terms the four control inputs
is given as follows. (1 )1/2
Ω1 = 4b U1 + 2b
1
U3 − 4d
1
U4
(1 )1/2
Ω2 = 4b U1 − 2b
1
U2 + 4d
1
U4
Ω = ( 1 U − 1 U − 1 U )1/2 (2.72)
3 1 3 4
( 4b1 2b 4d
)1/2
Ω4 = 4b U1 + 2b
1
U2 + 4d
1
U4
where "b" and "d" are the thrust and drag factors respectively.
44
2.7 DC Motor Model
DC motor consists of a stator and a rotor. Stator is a static part and fed by a
DC voltage source. Rotor is a rotating part which rotates through the action of electro-
magnetic induction. DC motor consisted of a series resister, an inductor and a voltage
generator "e" (back emf of a rotor) as shown in figure (2.13).
Rotor voltage "e" and motor speed are directly related. Speed of the motor is controlled
by a DC voltage source V. Circuit diagram is given by (2.14),
v = vR + vL + e (2.73)
45
Equation (2.73) can be written as,
∂i
v =R i+L + KE ω M (2.75)
∂t
JT M ω̇M = TM − TL (2.77)
TM = KM i (2.78)
JT M ω̇M = KM i − TL (2.79)
KE KM KM
JT M ω̇M = − ωM − TL + v (2.80)
R R
46
By balancing electrical and mechanical powers, KE and KM have same values.
P E = e i = KE i ω M (2.81)
PM = TM ωM = KM i ωM (2.82)
KE = KM (2.83)
in figure (2.16),
JM = rotor moment of inertia around motor axis,
JP = rotor moment of inertia around propeller axis,
ωP = propeller angular speed,
TP = propeller torque,
TP M = propeller torque in motor axis,
TM P = motor torque in propeller axis
Gear box reduction ratio "N" is the ratio of motor angular speed to propeller
angular speed as given by,
ωM
N= (2.84)
ωP
47
Conversion efficiency of gear box relates mechanical power along motor axis "PM "
and mechanical power along propeller axis "PP " as,
PM η = PP (2.85)
ωM TP M η = ωP TM P (2.86)
JM ω̇M = TM − TP M (2.87)
JP ω̇P = TM P − TP (2.88)
ωP ωM
ω̇P = ω̇M and N=
ωM ωP
( )
JP TP
JM + 2
ωM = TM − (2.90)
ηN ηN
Equation (2.90) describes the dynamics of motor/propeller gear box system while
equation (2.77) describes the dynamics of motor only. Comparing equations (2.77) and
(2.90), ( )
JP
JT M = JM + (2.91)
ηN 2
TP
TL = (2.92)
ηN
Using aerodynamic calculus to find propeller torque in terms of propeller angular
speed and motor angular speed,
2
d ωM
TP = d ωP2 = (2.93)
N2
2
d ωM
TL = (2.94)
ηN 3
48
Using equations (2.92) and (2.94), equation (2.80) can be written with reference
to the motor axis,
( )
JP KE KM d 2 KM
JM + 2
ω̇M = − ωM − 3
ωM + v (2.95)
ηN R ηN R
( ) KE KM KM
JP + ηN 2 JM ω̇P = − ηN 2 ωP − dωP2 + ηN v (2.96)
R R
From equation (2.96) it is clear that total moment of inertia around propeller axis
is,
( )
JT P = JP + ηN 2 JM (2.97)
49
2.10 Simulation Results
50
Plot of Euler Angle Position (Roll, Pitch and Yaw)
100
Angle (rad)
Roll Position
0
-100
-200
0 1 2 3 4 5 6 7 8 9 10
150
Angle (rad)
Pitch Position
100
50
0
0 1 2 3 4 5 6 7 8 9 10
0.5
Angle (rad)
0 Yaw Position
-0.5
0 1 2 3 4 5 6 7 8 9 10
Time (seconds)
z position
-200
-400
-600
0 1 2 3 4 5 6 7 8 9 10
40
Position (m)
x Position
20
0
0 1 2 3 4 5 6 7 8 9 10
50
Position (m)
y Position
0
-50
-100
0 1 2 3 4 5 6 7 8 9 10
Time (seconds)
51
Chapter 3
52
3.1 Introduction
Control systems can be classify into two types, an open loop control system and
a closed-loop control system. A closed-loop control system is a complex system in which
the control action is dependent on previous output as shown in figure (3.1).
Based on Performance parameters, there are three types of controllers that are
used in closed-loop passion namely Proportional Integral Controller (PI Controller), Pro-
portional Derivative Controller (PD Controller) and Proportional Integral Derivative
Controller (PID Controller). PID Control is an era of study for the addressed prob-
lem in this thesis.
53
controller is used to improve the speed of response by optimizing the settling time and
rise time. The integral controller is used to deal with the steady state error. Following is
the equation that expresses the control law using PID controller.
∫
d
U (t) = κp ξ(t) + κi (ξ(t)) dt + κd (ξ(t)) (3.1)
dt
where,
κp is the proportional controller gain,
κi is the integral controller gain,
κd is the derivative controller gain.
In order to get a stable system, the control parameters must be adjusted to the
optimum values. PID controller can be tuned using auto tuning method in matlab.
Based on control aspects, the algorithm is divided into two subsystems, the atti-
tude control subsystem and the altitude control subsystem. It is necessary to precisely
control both the attitude and altitude of a Quadcopter. It is required for a Quadcopter to
reach a desired position (reference) while encounter for external disturbances in a quick
and controlled way.
Attitude control of a Quadcopter is the basic goal for maintaining the stability
during flight. The attitude control algorithm is related to the rotational motions of a
Quadcopter. It is used to control roll, pitch and yaw motions. The actual angles are fed
to the corresponding controller. The task of the controller is to compare both the actual
angle and the desired angle. Thus computing the error and generates control signals.
The control signals are fed to the corresponding actuators (motors). Thus the speeds of
the motors are controlled accordingly.
54
3.2.1.1 Roll Control
The roll motion is controlled through roll PID controller which generates the
control signal U2 to change the speed of the left and right motors as described in equation
(3.2). ∫
d
U2 = κpφ ξ(t) + κiφ ξ(t)dt + κdφ ξ(t) (3.2)
dt
During flight towards left of a Quadcopter, the speed of the left motor is decreased
and that of right motor is increased and vice versa for flight towards right.
In order to handle the pitch angle, the pitch PID controller generates the control
signal U3 to change the speed of the front and back motors as described in equation (3.3).
∫
d
U3 = κpϑ ξ(t) + κiϑ ξ(t)dt + κdϑ ξ(t) (3.3)
dt
During forward flight of a Quadcopter, the speed of the front motor is decreased
and that of back motor is increased and vice versa for flight in backward direction.
Yaw motion of a Quadcopter is being controlled by changing the speed of all the
four motors. The speeds of the front and back motors are decreased (increased) and those
of left and right are increased (decreased). Thus the yaw PID controller generates the
control signal U4 in order to get the yaw angle.
∫
d
U4 = κpψ ξ(t) + κiψ ξ(t)dt + κdψ ξ(t) (3.4)
dt
55
∫
d
U1 = κpz ξ(t) + κiz ξ(t)dt + κdz ξ(t) (3.5)
dt
This signal is fed to all the four motors. The speeds of all four motors are in-
creased during upward flight of a quadcopter, decreased during the downward flight and
maintained during the hover.
Controller Parameters κp κi κd
Roll 52 9 3
Pitch 148 22 3
Yaw 152 17 1
z 102 21 2
56
Figure 3.2: PID Controller Block Diagram
Angle (radians)
1
1
0.5
0.5
0
Desired Roll Angle Desired Pitch Angle
Actual Roll Angle Actual Pitch Angle
-0.5 0
0 2 4 6 8 10 0 2 4 6 8 10
Time (seconds) Time (seconds)
Yaw Plot z Plot:
1 15
10
0.8
Angle (radians)
Position (m)
5
0.6
0
0.4
-5
57
Chapter 4
58
4.1 Integral Backstepping for Quadcopter
59
x˙1 = x2
x˙2 = −Kx x22 + ux m1 U1
y˙1 = y2
y˙2 = −Ky y22 + uy m1 U1
z˙1 = z2
z˙2 = −g − Kz z2 + (cos ϑ1 cos φ1 ) m1 U1
2
(4.2)
φ˙1 = φ2
φ˙2 = a1 ψ2 ϑ2 + a2 Ω̄ ϑ2 − Kφ φ22 + b1 U2
ϑ˙1 = ϑ2
ϑ˙2 = a3 ψ2 φ2 + a4 Ω̄ φ2 − Kϑ ϑ22 + b2 U3
ψ˙1 = ψ2
ψ˙2 = a5 ϑ2 φ2 − Kψ ψ22 + b3 U4
x˙1 = x2 (4.3a)
1
x˙2 = −Kx x22 + ux U1 (4.3b)
m
First of all define the tracking-error variable for x1 :
ξ1 = x1 − xd1 (4.4)
1
V1 (ε1 ) = ε1 2
2
60
the Virtual control input x2 used to stabilize ε1 is
x2 = ẋd1 − κ1 ε1 (4.9)
The stabilizing function α1 (x1 ) used to stabilize the second error state is:
ε2 = x2 − α1 (x1 ) (4.11)
ε2 = x2 − ẋd1 + κ1 ε1 (4.12)
from eq.(4.6)
ε2 = ε̇1 + κ1 ε1
ε̇1 = ε2 − κ1 ε1 (4.13)
put eq.(4.3b),
1
ε˙2 = −Kx x22 + ux
U1 − ẍd1 + κ1 ε̇1 (4.15)
m
we now need to select augmented lyapunov candidate function Va1
1
Va1 (ε1 , ε2 ) = (ε21 + ε22 )
2
derivative of Va1 is
V̇a1 (ε1 , ε2 ) = ε1 ε̇1 + ε2 ε̇2 (4.16)
1
V̇a1 (ε1 , ε2 ) = ε1 (ε2 − κ1 ε1 ) + ε2 (−Kx x22 + ux U1 − ẍd1 + κ1 ε̇1 ) (4.17)
m
1
V̇a1 (ε1 , ε2 ) = −κ1 ε21 + ε2 (ε1 − Kx x22 + ux U1 − ẍd1 + κ1 ε̇1 ) (4.18)
m
61
letteing
m( )
U1 = −κ2 ε2 − ε1 + Kx x22 + ẍd1 − κ1 ε̇1
ux
m( )
ux = −κ2 ε2 − ε1 + Kx x22 + ẍd1 − κ1 (x2 − ẋd1 ) (4.19)
U1
Putting into equation (4.18), we get
y˙1 = y2 (4.20a)
1
y˙2 = −Ky y22 + uy U1 (4.20b)
m
First of all define the tracking-error variable for y1 :
ε3 = y1 − yd1 (4.21)
1
V2 (ε3 ) = ε3 2
2
y2 = ẏd1 − κ3 ε3 (4.24)
The stabilizing function α2 (y1 ) used to stabilize the second error state is:
ε4 = y2 − α2 (y1 ) (4.27)
62
ε4 = y2 − ẏd1 + κ3 ε3 (4.28)
from eq.(4.22)
ε̇3 = ε4 − κ3 ε3 (4.29)
1
ε˙4 = −Ky y22 + uy U1 − ÿd1 + κ3 ε̇3 (4.30)
m
1
Va2 (ε3 , ε4 ) = (ε23 + ε24 )
2
derivative of Va2 is
1
V̇a2 (ε3 , ε4 ) = −κ3 ε23 + ε4 (ε3 − Ky y22 + uy U1 − ÿd1 + κ3 ε̇3 ) (4.31)
m
m( )
U1 = −κ4 ε4 − ε3 + Ky y22 + ÿd1 − κ3 ε̇3
uy
m( )
uy = −κ4 ε4 − ε3 + Ky y22 + ÿd1 − κ3 (y2 − ẏd1 ) (4.32)
U1
Putting into equation (4.31), we get
z˙1 = z2 (4.33a)
1
z˙2 = −g − Kz z22 + (cos ϑ1 cos φ1 ) U1 (4.33b)
m
first we define the tracking-error variable for z1 :
ε5 = z1 − zd1 (4.34)
63
The lyapunov candidate function V1 (ε5 ) is used to ensure its stability:
1
V3 (ε5 ) = ε5 2
2
z2 = żd1 − κ1 ε5 (4.37)
ε6 = z2 − α3 (z1 ) (4.39)
ε6 = z2 − żd1 + κ5 ε5 (4.40)
from eq.(4.35)
ε̇5 = ε6 − κ5 ε5 (4.41)
1
ε˙6 = −g − Kz z22 + (cos ϑ1 cos φ1 ) U1 − z̈d1 + κ5 ε̇5 (4.42)
m
1
Va3 (ε5 , ε6 ) = (ε25 + ε26 )
2
derivative of Va3 is
1
V̇a3 (ε5 , ε6 ) = −κ5 ε25 + ε6 (ε5 − g − Kz z22 + (cos ϑ1 cos φ1 ) U1 − z̈d1 + κ5 ε̇5 ) (4.43)
m
letteing
m ( )
U1 = −κ6 ε6 − ε5 + g + Kz z22 + z̈d1 − κ5 ε̇5
(cos ϑ1 cos φ1 )
m ( )
U1 = −κ6 ε6 − ε5 + g + Kz z22 + z̈d1 − κ5 (z2 − żd1 ) (4.44)
(cos ϑ1 cos φ1 )
64
Putting into equation (4.43), we get
φ˙1 = φ2 (4.45a)
ε7 = φ1 − φd1 (4.46)
1
V4 (ε7 ) = ε7 2
2
φ2 = φ̇d1 − κ7 ε7 (4.49)
The stabilizing function α4 (φ1 ) used to stabilize the second error state is:
ε8 = φ2 − α4 (φ1 ) (4.51)
ε8 = φ2 − φ̇d1 + κ7 ε7 (4.52)
65
from eq.(4.47)
ε̇7 = ε8 − κ7 ε7 (4.53)
1
Va4 (ε7 , ε8 ) = (ε27 + ε28 )
2
derivative of Va4 is
let
1 ( )
U2 = −κ8 ε8 − ε7 − a1 ψ2 ϑ2 − a2 Ω̄ ϑ2 + Kφ φ22 + φ̈d1 − κ7 (φ2 − φ̇d1 ) (4.56)
b1
ϑ˙1 = ϑ2 (4.58a)
ε9 = ϑ1 − ϑd1 (4.59)
1
V5 (ε9 ) = ε9 2
2
66
V̇5 (ε9 ) = ε9 (ϑ2 − ϑ̇d1 ) (4.61)
ϑ2 = ϑ̇d1 − κ9 ε9 (4.62)
The stabilizing function α5 (ϑ1 ) used to stabilize the second error state is:
from eq.(4.60)
ε̇9 = ε10 − κ9 ε9 (4.66)
1
Va5 (ε9 , ε10 ) = (ε29 + ε210 )
2
derivative of Va5 is
V̇a5 (ε9 , ε10 ) = −κ9 ε29 + ε10 (ε9 + a3 ψ2 φ2 + a4 Ω̄ φ2 − Kϑ ϑ22 + b2 U3 − ϑ̈d1 + κ9 ε̇9 ) (4.68)
letteing
1 ( )
U3 = −κ10 ε10 − ε9 − a3 ψ2 φ2 − a4 Ω̄ φ2 + Kϑ ϑ2 + ϑ̈d1 − κ9 ε̇9
2
b2
1 ( )
U3 = −κ10 ε10 − ε9 − a3 ψ2 φ2 − a4 Ω̄ φ2 + Kϑ ϑ22 + ϑ̈d1 − κ9 (ϑ2 − ϑ̇d1 ) (4.69)
b2
Putting into equation (4.68), we get
67
I.B. Controller design for (ψ)
ψ˙1 = ψ2 (4.71a)
1
V6 (ε11 ) = ε11 2
2
The stabilizing function α6 (ψ1 ) used to stabilize the second error state is:
ε12 = ψ2 − α6 (ψ1 )
from eq.(4.73)
ε̇11 = ε12 − κ11 ε11 (4.78)
68
we now need to select augmented lyapunov candidate function Va1
1
Va6 (ε11 , ε12 ) = (ε211 + ε212 )
2
derivative of Va6 is
V̇a6 (ε11 , ε12 ) = −κ11 ε211 + ε12 (ε11 + a5 ϑ2 φ2 − Kψ ψ22 + b3 U4 − ψ̈d1 + κ11 ε̇11 ) (4.80)
1 ( )
U3 = −κ12 ε12 − ε11 − a5 ϑ2 φ2 + Kψ ψ22 + ψ̈d1 − κ11 ε̇11
b3
1 ( )
U3 = −κ12 ε12 − ε11 − a5 ϑ2 φ2 + Kψ ψ22 + ψ̈d1 − κ11 (ψ2 − ψ̇d1 ) (4.81)
b3
Putting into equation (4.80), we get
The simulation results can play a key role in designing and controlling real process.
The controller designed through integral backstepping is simulated in Matlab/Simulink.
User defined Matlab functions are used to construct the plant and controller, both are
connected by goto and from blocks. The Simulink model of backstepping design for
Quadcopter is presented in figure (4.1). For trajectory tracking we have introduced a
sinusoid/step input to the controller as desired signal. The comparison for both desired
and actual trajectories of rotational subsystem is shown in figure (4.2) and the comparison
for both desired and actual trajectories of translational subsystem is shown in figure (4.3).
69
Integral backstepping controller gains for Quadcopter
70
Simulation Results of rotational position and translational position
0
0 1 2 3 4 5 6 7 8 9 10
0.8
Angle (rad)
0.2
0
0 1 2 3 4 5 6 7 8 9 10
0.8
Angle (rad)
0.2
0
0 1 2 3 4 5 6 7 8 9 10
Time (seconds)
15
Position (m)
Desired z position
10
Actual z position
0
0 1 2 3 4 5 6 7 8 9 10
15
Position (m)
Desired x position
10
Actual x position
0
0 1 2 3 4 5 6 7 8 9 10
15
Position (m)
Desired y position
10
Actual y position
0
0 1 2 3 4 5 6 7 8 9 10
Time (seconds)
71
Simulation Results of Control Inputs (U1 , U2 , U3 and U4 )
Plot of U1 Plot of U2
0.1
5
0
-0.1
0
-0.2
-5 -0.3
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10
Time (seconds) Time (seconds)
Plot of U3 Plot of U4
0.2
Torque for Pitch (N.m)
0.05
-0.05
0
-0.1
-0.1
-0.15
-0.2
-0.2
-0.25 -0.3
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10
Time (seconds) Time (seconds)
Desired Pitch
Actual Pitch 10
0.5 Desired Z
Actual Z
5
0 0
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10
Time (seconds) Time (seconds)
Plot of Roll Plot of X
1 20
Position (m)
Angle (rad)
0 0
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10
Time (seconds)
Time (seconds)
Plot of Yaw Plot of Y
Position (m)
1 20
Angle (rad)
0 0
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10
Time (seconds) Time (seconds)
72
4.3 Sliding Mode Control
A variable structure Sliding Mode Control (SMC) system where the control logic
is designed to get the desired performance by switching between the two extreme control
laws. The control is a switching function that chooses from one of the controls based
on the state trajectory location. The state trajectory is brought to the sliding manifold
by means of switching between the control laws. The state trajectory when reaches the
hypersurface is forced towards the equilibrium state. This motion of trajectory on the
sliding surface is called sliding motion. Sliding mode control is a robust control technique,
because it is flexible to deal with the matched and unmatched uncertainties.
With many advantages, sliding mode control is a suitable algorithm to deal with
complex high order systems under uncertainty conditions.The three main advantages of
sliding mode control are
• Order Reduction
Sliding mode control reduces order of the system. The order of the system is
reduced when the trajectory arrive at the sliding surface which make the system to
regulate easily.
• Disturbance Rejection
Disturbances which come through input are effectively rejected by SMC. The
dynamics confined to the sliding surface are independent of disturbances.
The entire dynamics of the system is governed by the parameters of the sliding
surface only, not original system parameters.
However, sliding mode control has a major setback: the phenomenon is called
chattering. Chattering is a high frequency switching motion of the state trajectory be-
tween the two extreme control laws, which occurs in the neighborhood of sliding surface.
In an attempt to trap the state trajectory within the sliding surface, the switching func-
tions are switched at infinite frequency. The undesired effect of chattering creates heat as
a result of rapid change between the switching functions when the control is implemented
into electronic or mechanical systems. The heat can burn electronic systems, while in
73
mechanical parts the act of rapidly changing between two extreme control laws can wear
off mechanical parts and eventually damage them. Therefore implementing the sliding
mode control into a real system can pose problems, since the ideal sliding mode may
not be obtained due to imperfections of the switching device, dead zone, hysteresis, or
unmodelled system dynamics, etc. Therefore, the control can only force the state trajec-
tories to the vicinity of the switching surface, which may lead to chattering. Fortunately,
many strategies have been developed to eliminate chattering.
Sliding mode control uses high speed switch feedback control i.e. the control
law switches between different values according to some defined rules called a switching
function, which depend upon the system states. The sliding mode controller synthesis
consists of two stages: the sliding surface design and design of the control action so
that the sliding surface is reached. When the system dynamics is constrained in the
sliding manifold, this is called a sliding motion [28]. During sliding, the system dynamics
is independent of the control and is governed by the properties of the chosen sliding
surface.
The sliding variable is a fictitious system output such that if it is regulated to zero,
the control task is achieved. Once the system states are sliding on the sliding surface,
the system characteristics are governed by the characteristics of the sliding surface only.
Therefore, sliding surface design is performed to achieve the characteristics required from
the system when sliding. For example, if the steady state error is to be kept at zero,
then the sliding variable may be selected as a stable differential equation of steady state
error. Generally, sliding variable is selected as a linear equation of the system states, for
example
ẋ1 = x2
(4.83)
ẋ2 = −a1 x1 + a2 x2 + bu
s = c1 x1 + x2 (4.84)
ṡ = c1 ẋ1 + ẋ2
ṡ = c1 x2 + ẋ2
Let ṡ = 0 then
0 = c1 x2 + ẋ2 (4.85)
74
ẋ2 = −c1 x2 (4.86)
Equation (4.86) shows that the entire dynamics of the system are only governed by the
parameters of the sliding surface. This justifies the robustness of the sliding mode control.
The purpose of the control law is to drive the system trajectories into the sliding
manifold, and thereafter to maintain them within the sliding manifold despite uncertain-
ties being present. In other words, the controller should regulate the sliding variable.
This is achieved by setting conditions on the control law which makes the sliding surface
attractive. Such a condition is called the reachability condition. Lyapunov direct method
provides a stability analysis tool that does not involve solving the differential equations.
Loosely speaking, it states that if one can find a positive definite function V such that
the time derivative along the system trajectories is negative, then the dynamic system is
stable. The method is usually utilized to design a control law which makes the sliding
surface attractive.
Consider the Lyapunov function
1
V = s2 (4.87)
2
V̇ = sṡ
x˙1 = x2 (4.89a)
1
x˙2 = −Kx x22 + ux U1 (4.89b)
m
75
First of all define the tracking-error variable for x1 :
εx = x1 − xd1 (4.90)
taking derivative of εx :
ε̇x = ẋ1 − ẋd1 (4.91)
s1 = (ε̇x + η1 εx )
s1 = (x2 − ẋd1 + η1 εx )
taking derivative of s1
s˙1 = ẋ2 − ẍd1 + η1 ε̇1
put eq.(4.89b),
1
s˙1 = −Kx x22 + ux U1 − ẍd1 + η1 ε̇1 (4.94)
m
let
1
s˙1 = 0 ⇒ −Kx x22 + ux U1 − ẍd1 + η1 ε̇1 = 0
m
the control input Û1 of a continues control law is
m( )
Û1 = Kx x22 + ẍd1 − η1 ε̇1
ux
m( )
U1 = −ζ1 sign (s1 ) − ζ2 s1 + Kx x22 + ẍd1 − η1 ε̇1 (4.96)
ux
m( )
ux = −ζ1 sign (s1 ) − ζ2 s1 + Kx x22 + ẍd1 − η1 ε̇1 (4.97)
U1
76
Sliding Mode Controller Design for (y)
y˙1 = y2 (4.98a)
1
y˙2 = −Ky y22 + uy U1 (4.98b)
m
First of all define the tracking-error variable for y1 :
εy = y1 − yd1
s2 = (ε̇y + η2 εy )
s2 = (y2 − ẏd1 + η2 εy )
taking derivative of s2
s˙2 = ẏ2 − ÿd1 + η2 ε̇y
put eq.(4.98b),
1
s˙2 = −Ky y22 + uy U1 − ÿd1 + η2 ε̇y (4.100)
m
let
1
s˙2 = 0 ⇒ −Ky y22 + uy U1 − ÿd1 + η2 ε̇y = 0
m
the control input Û1 of a continues control law is
m( )
Û1 = Ky y22 + ÿd1 − η2 ε̇y
uy
77
we add this U1sw to Û1 and the entire control law is
m( )
U1 = −ζ3 sign (s2 ) − ζ4 s2 + Ky y22 + ÿd1 − η2 ε̇y (4.102)
uy
m( )
uy = −ζ3 sign (s2 ) − ζ4 s2 + Ky y22 + ÿd1 − η2 ε̇y (4.103)
U1
z˙1 = z2 (4.104a)
1
z˙2 = −g − Kz z22 + (cos ϑ1 cos φ1 ) U1 (4.104b)
m
first we define the tracking-error variable for z1 :
εz = z1 − zd1
s3 = (ε̇z + η3 εz )
s3 = (z2 − żd1 + η3 εz )
taking derivative of s3
s˙3 = ż2 − z̈d1 + η3 ε̇z
put eq.(4.104b),
1
s˙3 = −g − Kz z22 + (cos ϑ1 cos φ1 ) U1 − z̈d1 + η3 ε̇z (4.106)
m
let
1
s˙3 = 0 ⇒ −g − Kz z22 + (cos ϑ1 cos φ1 ) U1 − z̈d1 + η3 ε̇z = 0
m
78
the control input Û1 of a continues control law is
m ( )
Û1 = g + Kz z22 + z̈d1 − η3 ε̇z
(cos ϑ1 cos φ1 )
m ( )
U1 = −ζ5 sign (s3 ) − ζ6 s3 + g + Kz z22 + z̈d1 − η3 ε̇z (4.108)
(cos ϑ1 cos φ1 )
φ˙1 = φ2 (4.109a)
εφ = φ1 − φd1
s4 = (ε̇φ + η4 εφ )
s4 = (φ2 − φ̇d1 + η4 εφ )
taking derivative of s4
s˙4 = φ̇2 − φ̈d1 + η4 ε̇φ
79
put eq.(4.109b),
let
s˙4 = 0 ⇒ a1 ψ2 ϑ2 + a2 Ω̄ ϑ2 − Kφ φ22 + b1 U2 − φ̈d1 + η4 ε̇φ = 0
1 ( )
Û2 = −a1 ψ2 ϑ2 − a2 Ω̄ ϑ2 + Kφ φ22 + φ̈d1 − η4 ε̇φ
b1
1 ( )
U2 = −ζ7 sign (s4 ) − ζ8 s4 − a1 ψ2 ϑ2 − a2 Ω̄ ϑ2 + Kφ φ22 + φ̈d1 − η4 ε̇φ (4.113)
b1
ϑ˙1 = ϑ2 (4.114a)
εϑ = ϑ1 − ϑd1
s5 = (ε̇ϑ + η5 εϑ )
80
s5 = (ϑ2 − ϑ̇d1 + η5 εϑ )
taking derivative of s5
s˙5 = ϑ̇2 − ϑ̈d1 + η5 ε̇ϑ
put eq.(4.114b),
let
s˙5 = 0 ⇒ a3 ψ2 φ2 + a4 Ω̄ φ2 − Kϑ ϑ22 + b2 U3 − ϑ̈d1 + η5 ε̇ϑ = 0
1 ( )
Û3 = −a3 ψ2 φ2 − a4 Ω̄ φ2 + Kϑ ϑ2 + ϑ̈d1 − η5 ε̇ϑ
2
b2
1 ( )
U3 = −ζ9 sign (s5 ) − ζ10 s5 − a3 ψ2 φ2 − a4 Ω̄ φ2 + Kϑ ϑ22 + ϑ̈d1 − η5 ε̇ϑ (4.118)
b2
ψ˙1 = ψ2 (4.119a)
εψ = ψ1 − ψd1
81
since the relative degree of the subsystem is 2, so n = 2 :
s6 = (ε̇ψ + η6 εψ )
s6 = (ψ2 − ψ̇d1 + η6 εψ )
taking derivative of s6
s˙6 = ψ̇2 − ψ̈d1 + η6 ε̇ψ
put eq.(4.119b),
s˙6 = ψ˙2 = a5 ϑ2 φ2 − Kψ ψ22 + b3 U4 − ψ̈d1 + η6 ε̇ψ (4.121)
let
s˙6 = 0 ⇒ ψ˙2 = a5 ϑ2 φ2 − Kψ ψ22 + b3 U4 − ψ̈d1 + η6 ε̇ψ = 0
1 ( )
Û4 = −a5 ϑ2 φ2 + Kψ ψ2 + ψ̈d1 − η6 ε̇ψ
2
b3
1 ( )
U4 = −ζ11 sign (s6 ) − ζ12 s6 − a5 ϑ2 φ2 + Kψ ψ22 + ψ̈d1 − η6 ε̇ψ (4.123)
b3
Parameters ζ2 , ζ4 , ζ6 , ζ8 , ζ10 and ζ12 are selected on the basis of dynamic charac-
teristics of the system that approach the sliding surface. The parameters ζ1 , ζ3 , ζ5 , ζ7 , ζ9
and ζ11 are selected as to control errors and other factors caused by approximate linear
system which can make the system robust. In the control system, in order to ensure fast
tracking and weaken the system chattering at the same time, the values of ζ2 , ζ4 , ζ6 , ζ8 ,
ζ10 and ζ12 should be increased while reducing the values of ζ1 , ζ3 , ζ5 , ζ7 , ζ9 and ζ11 .
The simulation results can play a key role in designing and controlling real process.
The controller designed through sliding mode control is simulated in Matlab/Simulink.
User defined Matlab functions are used to construct the plant and controller, both are
connected by goto and from blocks. The Simulink model of sliding mode control design
for Quadcopter is presented in figure (4.6). For trajectory tracking we have introduced a
sinusoid/step input to the controller as desired signal. The comparison for both desired
82
and actual trajectories of rotational subsystem is shown in figure (4.7) and the comparison
for both desired and actual trajectories of translational subsystem is shown in figure (4.8).
83
Simulation Results of rotational position and translation position
0
0 1 2 3 4 5 6 7 8 9 10
1
Angle (rad)
0
0 1 2 3 4 5 6 7 8 9 10
1
Angle (rad)
0
0 1 2 3 4 5 6 7 8 9 10
Time (seconds)
Desired z Position
10 Actual z Position
0
0 1 2 3 4 5 6 7 8 9 10
10
Position (m)
Desired x Position
5 Actual x Position
0
0 1 2 3 4 5 6 7 8 9 10
10
Position (m)data
Desired y Position
Actual y Position
5
0
0 1 2 3 4 5 6 7 8 9 10
Time (seconds)
84
Simulation Results of Control Inputs (U1 , U2 , U3 and U4 )
0.02
40
0
20
-0.02
0
-0.04
-20 -0.06
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10
Time (seconds) Time (seconds)
Plot of U4
Tarque for Pitch (N.m)
Plot of U3
0
0
-0.02
-0.5
-0.04
-0.06 -1
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10
Time (seconds) Time (seconds)
0 0
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10
Time (seconds) Time (seconds)
Plot of Roll Plot of x
1 10
Position (m)
Angle (rad)
0 0
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10
Time (seconds) Time (seconds)
Plot of Yaw Plot of y
1
Position (m)
10
Angle (rad)
0 0
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10
Time (seconds) Time (seconds)
85
4.5 Comparison of linear and nonlinear controllers for quadcopter
In figure (4.11), the trajectory tracking of rotational subsystem for PID, backstep-
ping and SMC are Compared. Trajectory tracking achieved by backstepping controller
is better than SMC, but settling time for SMC is better than backstepping controller.
Figure (4.12) shows the trajectory tracking of translational subsystem. Steady state er-
ror for SMC is greater than the steady state error for backstepping, while the settling
time for backstepping is better than SMC. The simulation results for both classical as
well as nonlinear control methods show that the backstepping have less settling time as
compared to SMC and linear control techniques but SMC has less steady state error.
Backstepping
0.5 SMC
PID
0
-0.5
0 1 2 3 4 5 6 7 8 9 10
1
Desired Pitch
Angle (rad)
Backstepping
0.5 SMC
PID
0
-0.5
0 1 2 3 4 5 6 7 8 9 10
1
Desired Yaw
Angle (rad)
Backstepping
0.5 SMC
PID
0
-0.5
0 1 2 3 4 5 6 7 8 9 10
Time (sec)
86
Comparison Plot of translational position (x, y and z)
15
Position (m)
Desired z
10 Backstepping
SMC
5
0
0 1 2 3 4 5 6 7 8 9 10
15
Position (m)
Desired x
10 Backstepping
SMC
5
0
0 1 2 3 4 5 6 7 8 9 10
15
Position (m)
Desired y
10 Backstepping
SMC
5
0
0 1 2 3 4 5 6 7 8 9 10
Time (sec)
87
Chapter 5
88
5.1 Conclusion
Quadcopter aerial robot is highly nonlinear system with 6 DOF and only four ac-
tuators. The motion of a Quadcopter can be controlled using the four actuators (motors)
attached to the propellers. The propellers create thrust to lift the Quadcopter up and
down. Also the rotational motion of a Quadcopter is controlled by varying the speeds of
pair of motors simultaneously.
The core purpose of this research work is to design a stable flight for a quad-
copter. As the quadcopter is highly nonlinear system, so there are mechanical vibrations
during its flight condition. To diminish these mechanical vibrations and to get a stabi-
lized quadcopter system, a dynamic model for its stable flight is presented using both
Lagrangian/Euler and Newtonian/Euler equations of motion. The mathematical model
of quadcopter is suitable and handled with its stability and control. The dc motor is ana-
lyzed using mathematical modeling techniques while the quadcopter is analyzed through
relative equations of motions and modeling the aerodynamic forces. Its control inputs
are determined in term of the angular speeds of motors. Simulations have been carried
out in Simulink using traditional linear control method PID controller. A nonlinear con-
trol methods such as Integral Backstepping, Sliding mode control were also simulated
for the quadcopter system. The simulations results of both the control methods were
compared on the basis of performance parameters such as steady state error and settling
time. It has been observed that the Integal backstepping settle down the system with
less time and have less steady state error as compared to SMC and linear techniques.
All controllers were implemented in the simulink environment. The main objective is to
examine the aerodynamic behavior of the Quadcopter and to minimize the mechanical
vibrations through designing of an optimum controller.
The possible directions of research for future, based on the design techniques that
have been discussed in this thesis are outlined below,
• Another extension of this work may be the use of adaptive sliding mode and adaptive
backstepping controller for more efficient control of nonlinear systems.
89
• The implemented control techniques might be further explored by using intelligent
controllers based on fuzzy logic and neural network for the sake of flexibility and intelli-
gence.
• The environmental factors as such temperature, collisions and wind etc may be
considered so as to handle with the physical environment.
• Terminal, Integral and Higher order sliding mode controllers may be further in-
vestigated to minimize the chattering in the control law that arises due to the inertia of
the system.
90
Chapter 6
Bibliography
91
Bibliography
92
[9] T. Bresciani, "Modelling, identification and control of a quadrotor helicopter," MSc
Thesis, 2008.
[13] C. Mary, L. C. Totu, and S. Koldbaek, "Modelling and control of autonomous quad-
rotor," Dept of Electronic Systems University of Aalborg Denmark. Project Report,
2010.
[15] Y. Naidoo, R. Stopforth, and G. Bright, "Quad-rotor unmanned aerial vehicle he-
licopter modelling & control," International Journal of Advanced Robotic Systems,
vol. 8, pp. 139-149, 2011.
[18] P. Pounds, R. Mahony, and P. Corke, "Modelling and control of a quad-rotor robot,"
in Proceedings Australasian Conference on Robotics and Automation 2006.
[19] A. Rodic and G. Mester, "The modeling and simulation of an autonomous quad-
rotor microcopter in a virtual outdoor scenario," Acta Polytechnica Hungarica, vol.
8, pp. 107-122, 2011.
93
[20] T. Zhang, Y. Kang, M. Achtelik, K. Kuhnlenz, and M. Buss, "Autonomous hovering
of a vision/IMU guided quadrotor," in International Conference on Mechatronics
and Automation, 2009, pp. 2870-2875.
[21] G. Ipate, G. Voicu, and I. Dinu, "Research on the use of drones in precision agricul-
ture."
[22] I. Sonnevend, "Analysis and model based control of a quadrotor helicopter," BSc
Diploma work, Peter Pazmany Catholic University, Faculty of Information Technol-
ogy, Budapest, Hungary (supervisor: G. Szederkenyi) MSc Diploma work, 2010.
[23] N. Michael, D. Mellinger, Q. Lindsey, and V. Kumar, "The GRASP multiple micro-
UAV testbed," Robotics & Automation Magazine, IEEE, vol. 17, pp. 56-65, 2010.
[24] B. Etkin and L. D. Reid, Dynamics of flight: stability and control vol. 3: Wiley New
York, 1996.
[27] S. Mahjoub, F. Mnif, and N. Derbel, "Second-order sliding mode control applied to
inverted pendulum," in 14th International Conference on Sciences and Techniques
of Automatic Control and Computer Engineering (STA), 2013, pp. 269-273.
[28] V. Utkin, J. Guldner, and J. Shi, Sliding mode control in electro-mechanical systems
vol. 34: CRC press, 2009.
94