Professional Documents
Culture Documents
A thesis on Quadcopter
MD. ROKIBUJJAMAN SOVON
sovonsdp@gmail.com
© All right reserved 2017
Abstract
UAV is defined as an aerial vehicle that does not carry a human operator, uses
aerodynamic forces to provide vehicle lift, can fly autonomously or be piloted remotely,
can be expandable or recoverable, and can carry a lethal or nonlethal payload. It is
controlled either autonomously by on-board computers or by remote control of a pilot on
the ground. Its’s usage is currently limited by difficulties such as satellite communication
and cost. A Quadcopter has been built that can be operated by radio frequency controller
and send live audio-visual feedback. The developed Quadcopter control system has been
simulated in MATLAB and abaqus. The simulation shows a very stable operation and
control of the developed Quadcopter. Microcontroller based drone control system has
also been developed where a RF transmitter and receiver operating in the frequency of
2.4 GHz are used for remote operation for the Quadcopter.
The development in the fields of MEMS sensors, miniature, energy efficient and very
powerful microcontrollers, and microprocessors has given the opportunity to build small
autonomous flying vehicles. This thesis is studying one type of these vehicles, so called
quadcopter. The quadcopter is flying vehicle like helicopter but having four rotors which
are situated in one plane. The popularity of quadcopters are increasing as the sensors and
control systems are getting more advanced. The quadcopter is naturally unstable, has a
complex dynamic model and six degrees of freedom.
This paper describes modelling, estimation, and control of the horizontal translational
motion of an open-source and cost effective quadcopter. I determine the dynamics of its
roll and pitch attitude controller, system latencies, and the units associated with the values
exchanged with the vehicle over its serial port. Using this we create a horizontal-plane
velocity estimator that uses data from the built-in inertial sensors and an onboard laser
scanner, and implement translational control using a nested control loop architecture.
Although there are many enhancements that I could do to the design, we have proven that
it is possible to produce a small-scale UAV that performs functions of interest to the
military as well as commercial/industrial applications. The final quadcopter concept is
well suited for further experimental work.
Keywords
Contents
ABSTRACT ..................................................................................................................... 1
CHAPTER 1: INTRODUCTION .................................................................................. 7
1.1 QUADCOPTER ....................................................................................................... 7
1.2 ISSUE.................................................................................................................... 8
1.2.1 Flight Controller Failure .............................................................................. 8
1.2.2 Electronic Speed Controller (ESC) Problems .............................................. 8
1.2.3 Radio Transmitter/Receiver Signal .............................................................. 9
1.2.4 Motor............................................................................................................ 9
1.2.5 Video Transmitter/Receiver Signal .............................................................. 9
1.2.6 Final Words ................................................................................................ 10
1.3 REVIEW .............................................................................................................. 10
1.4 STRUCTURE OF THE PROJECT .............................................................................. 11
CHAPTER 2: REFERENCE GEOMETRY AND DYNAMIC MODEL ................ 12
2.1 COORDINATE SYSTEM......................................................................................... 12
2.2 ROTATION MATRIX.............................................................................................. 13
2.3 MOTOR REFERENCE ........................................................................................... 14
2.4 COORDINATE SUMMARY .................................................................................... 14
2.5 AERODYNAMIC EFFECT ...................................................................................... 14
2.6 THE BASIC STRUCTURE OF THE FOUR-ROTOR AIRCRAFT ..................................... 15
2.6.1 Quadcopter movement mode ..................................................................... 16
2.6.2 Ground and the establishment of the body coordinate system................... 17
2.6.3 Euler angles ................................................................................................ 18
2.7 DYNAMIC MODEL .............................................................................................. 20
2.8 BASIC ASSUMPTIONS BEFORE MODELING............................................................ 21
2.9 KINEMATICS ....................................................................................................... 21
2.9.1 Kinetic model ............................................................................................. 21
2.9.2 Kinematic analysis ..................................................................................... 24
2.10 PHYSICS .......................................................................................................... 25
2.11 MOTORS ......................................................................................................... 25
2.12 FORCES ........................................................................................................... 26
2.13 TORQUES ........................................................................................................ 27
2.14 EQUATIONS OF MOTION .................................................................................. 28
2.15 ENGINE DYNAMICS ......................................................................................... 29
CHAPTER 3: DEVELOPMENT & CONSTRUCTION .......................................... 31
3.1 DEVELOPMENT AND EQUIPMENT: ....................................................................... 31
3.1.1 Brushless DC motor ................................................................................... 31
3.1.2 Multi-Rotor control board .......................................................................... 32
3.1.3 ESC (Electronic Speed Controller) ............................................................ 35
3.1.4 Servo motor ................................................................................................ 36
3.1.5 Li-Po battery............................................................................................... 36
3.1.6 Landing gear............................................................................................... 37
3.2 CONTROL SYSTEM DESIGN................................................................................. 37
3.2.1 BLDC motor transfer function ................................................................... 38
3.2.2 BLDC motor open loop analysis ................................................................ 40
3.2.3 DC servo motor .......................................................................................... 40
3.2.4 DC servo motor transfer function............................................................... 41
3.2.5 Yaw-controller ............................................................................................ 42
3.2.6 Phi-Theta controller ................................................................................... 43
3.2.7 PID control ................................................................................................. 43
3.2.8 LQR control ............................................... Error! Bookmark not defined.
3.2.9 Firmware limitation.................................................................................... 46
3.3 PROPORTIONAL CONTROLLER ............................................................................. 46
3.4 PAYLOAD COMPONENTS ..................................................................................... 47
3.5 TELEMETRY SYSTEM .......................................................................................... 48
3.5.1 Radio communication ................................................................................ 48
3.5.2 Wi-Fi Communication................................................................................ 49
3.5.3 Wireless communication module for quadcopter....................................... 49
3.6 HARDWARE IMPLEMENTATION ............................................................................ 50
3.7 HARDWARE SELECTION OF QUADCOPTER .......................................................... 51
3.8 FLIGHT CONTROLLER FOR QUADCOPTER ........................................................... 52
3.8.1 Microprocessor STM32F103VC................................................................ 53
3.8.2 Inertial Measurement Unit ......................................................................... 54
3.8.3 HMC5883L geomagnetic sensor ................................................................ 54
3.8.4 Air pressure altimeter ................................................................................. 55
CHAPTER 4: CONTROL SCHEME DESIGN AND SIMULATION ..................... 56
4.1 CONTROL SCHEME DESIGN ................................................................................. 56
4.2 EFFECT OF MOTOR ROTATION SPEED ON ATTITUDE ANGLE ............................... 56
4.2.1 The overall design of the program ............................................................. 56
4.2.2 Simulation model is established ................................................................. 56
4.2.3 Simulation results analysis ......................................................................... 58
4.3 ATTITUDE ANGLE CLOSED-LOOP CONTROL OF THE MOTOR SPEED REGULATION .. 60
4.3.1 Control scheme overall design ................................................................... 60
4.3.2 Attitude control .......................................................................................... 61
4.3.3 Height control............................................................................................. 62
4.3.4 Establish the simulation model .................................................................. 62
4.3.5 Simulation environment settings: ............................................................... 63
4.3.6 Emulation Stop Condition Setting ............................................................. 63
4.3.7 Control parameter optimization ................................................................. 64
4.3.8 Simulation results analysis: ........................................................................ 64
4.4 INNER AND OUTER LOOP PID POSITION CONTROL SIMULATION ........................... 66
4 A thesis on Quadcopter
Chapter 1: Introduction
Unmanned aerial vehicles (UAV) are more properly known as Drone [1]. Basically,
drone is a flying robot. Working in combination with GPS, the flying machine may be
remotely controlled or can fly autonomously by software controlled flight plans in their
embedded systems. Drones are most often used in military services. However, it is also
used for weather monitoring, firefighting, search and rescue, surveillance and traffic
monitoring etc. In recent years, the drone has come into attention for a number of
commercial uses. In late 2013, Amazon announced a plan to use unmanned aerial
vehicles for delivery in the nearby areas future. It is known as Amazon Prime air; it is
estimated to deliver the orders within 30 minutes inside 10 miles of distance. So it is clear
that domestic usage of UAV has vast future possibility in different fields rather than
military usage [1,2,5].
Drones for military use were started in the mid-1990s with the High-Altitude Endurance
Unmanned Aerial Vehicle Advanced Concept Technology Demonstrator (HAE UAV
ACTD) program managed by the Defense Advanced Research Projects Agency (DARPA)
and Defense Airborne Reconnaissance Office (DARO) [3]. This ACTD placed the base
for the improvement of the Global Hawk. The Global Hawk hovers at heights up to
65,000 feet and flying duration is up to 35 hours at speeds approaching 340 knots and it
costs approximately 200 million dollars. The wingspan is 116 feet and it can fly 13.8094
miles which is significant distance. Motherland security and drug prohibition are the
main needs Global Hawk was designed for. Another very successful drone is the Predator
which was also built in the mid-1990s but has since been improved with Hellfire missiles.
“Named by Smithsonian’s Air & Space magazine as one of the top ten aircraft that
changed the world, Predator is the most combat-proven Unmanned Aircraft System
(UAS) in the world”. The original version of the Predator, built by General Atomics, can
fly at 25,000 feet for 40 hours at a maximum airspeed of 120 [47,48].
1.1 Quadcopter
A quadcopter is a popular form of UAV (Unmanned aerial vehicle). It is operated by
varying the spin RPM of its four rotors to control lift and torque. The thrust from the
rotors plays a key role in maneuvering and keeping the copter airborne. Its small size and
swift maneuverability enables the user to perform flying routines that include complex
aerial maneuvers. But for conducting such maneuvers, precise angle handling of the
copter is required. The precise handling is fundamental to flying by following a user-
defined complex trajectory-based path and while performing any type of missions. This
paper serves as a solution to handling the quadcopter with angular precision by
illustrating how the spin of the four rotors should be varied simultaneously to achieve
correct angular orientation along with standard flight operations such as taking-off,
landing and hovering at an altitude [4,34,52].
8 A thesis on Quadcopter
1.2 Issue
For anyone who has experience of building quadcopters, should be familiar with all the
critical parts of the machine. If not please take a look at the quadcopter hardware
overview guide. Here I will discuss some hardware failures and how to prevented it.
• Flight Controller
• Electronic Speed Controller (ESC) Problems
• Radio Receiver/Transmitter (Signal)
• Motor
• ESC
• Video Receiver/Transmitter (Signal)
There is nothing can stop hardware failure, but there are things you can do to minimize
the chance of disaster happening [35].
other.
1.2.4 Motor
Motors are quite robust and they don’t break easily. But one may replace any motors with
bent shaft or loose magnet.
The problem with bad motors is that, they take a lot more current to spin at the same
speed, so uses more power and generates a lot more heat. Not only that, it results in less
stable aircraft, also risks your ESC getting burnt out if it draws too much current in punch
outs for example. To check, one should spin the motors with propellers mounted on, if
one motor is harder to spin (you can feel the resistance), and it stops earlier than other
motors, that is a sign of bad motor that needs to be replaced.
Also, getting some decent Circular Polarized Antennas could improve the range a lot too.
And again, range check your equipment before you fly.
1.3 Review
Many methodologies have been tried to improve real-world aircraft with vertical take-
off and landing abilities. First, Nikola Tesla introduced a vertical take-off and landing
vehicle concept in 1928. Advanced VTOL aircrafts uses a single engine with thrust
vectoring. Thrust vectoring illustrates that the aircraft can send thrust from the engine in
different directions, so that vertical and horizontal fight can be controlled by one engine.
The Harrier Jump Jet is one of the most famous and successful fixed-wing single-engine
VTOL aircraft. In the 21st century, UAVs are becoming progressively conventional.
Many of these have VTOL capability, especially the quad copter type [6]. We were also
interested by the requirements of DARPA’s UAVforge, while studying large and tiny
UAVs competition which was posted around the time we started our project. The UAV
forge contest us basically to design and build a micro-UAV that can take off vertically,
go to the destination and surveillance the area for three hours.
We know transporting and resupplying troops is a great challenge in war field. To meet
this challenge DARPA initiated a program in 2010 demonstrating four-person vertical
takeoff and landing vehicle. Lockheed Martin’s Skunk Works® is foremost a group with
Plawecki Aircraft to improve the next generation of dynamic vertical takeoff and landing
(VTOL) transport systems under the ARES program. ARES VTOL flight unit is designed
to work as an unmanned platform capable of transferring a variety of payloads [8]. The
flight unit has built in digital flight controls, remote command-control interfaces, power
system and gasoline. Twin tilting ducted fans would deliver effective flying and landing
abilities in a compact structure. It is capable of rapid change to high-speed travel voyage.
However, this project is under development now. Our project has similarities with this
Lockheed Martin’s research and the flying methodology is partially similar to their
machine.
On the other hand, using drone in firefighting has already been taken place in history. An
unmanned Predator B aircraft helped firefighters and saved many lives in 2007 in
southern California. It delivered firefighters up-to-the-minute information.
In addition to the military practices of the drones, we were concerned in evaluating
applications in the industrial, commercial and as well as government sector. In addition,
new markets and uses will emerge if small drones are very available. Potential new
markets in business and modern applications incorporate reviewing pipelines or actually
Chapter 1: Introduction 11
investigating perilous regions like an emergency site at an atomic force plant. Harvest
evaluation or natural disaster aid seems also to be possible areas where small drones
could be beneficial. Although the designs of different UAVs are charming, our interest
was in attempting to produce a small UAV which could support a broad mission
capability.
In this chapter coordinate systems and reference geometry is defined. The chapter also
defines motor position and its direction of rotation. The last part of this chapter is a
method to transform from one coordinate system to another.
𝜎x
𝜎y 𝜎z
Yb
Zb Xb
Xn
Yn
Zn
Figure 2.1: The blue coordinates are the navigation frame, while the black is the body
coordinates
In order to get the orientation of the quadcopter in terms of angles, the quadcopters
coordinate system has to be linked to the navigation coordinates. The way this is done is
Chapter 2: Reference Geometry And Dynamic Model 13
by the implementation of Euler angles. There are three Euler angles, φ, θ and ψ, known
as roll, pitch and yaw. This notation is often used in avionics [31].
The calculated matrix gives the conversion from body to navigation frame. It is also
needed in some cases to calculate from navigation to body frame. This can be done by
transposing the result
C nb matrix, C bn = C nb T (2.2)
ψ X
Y
X
M1
M4
Yb M
M3 Xb 2
Zb
Figure 2.3: Sketch of where the motors are mounted and direction of propeller
movement
(2.3)
in which Ax, Ay and Az are the drag force coefficients for velocities in the corresponding
directions of the inertial frame. Several other aerodynamical effects could be included in
the model. The influence of aerodynamical effects are complicated and the effects are
difficult to model. Also, some of the effects have significant effect only in high velocities.
Thus, these effects are excluded from the model and the presented simple model is used
[26].
Chapter 2: Reference Geometry And Dynamic Model 15
Quadcopter is a four-rotor lift with the aircraft, by changing the speed of the four motor
to control the size of the lift to control the four-wing flight attitude. There are six DOFs
in the air, only four inputs, which are typical multi-input and multi-output systems, and
the output of the quadcopter is more than the input, and there is a coupling relation
between the control quantity and the state quantity, Therefore, the control system of the
four-rotor vehicle is also under-driven and strong coupling control system [19]. Four
motors always maintain the same speed, began to accelerate the rotation, when the total
force is greater than the total force from the ground began to rise to a certain height after
the appropriate slow down can be kept hovering, this time if the left side of the motor
speed reduction, it will To break the balance, the four-wing aircraft will tilt to the left and
move to the left and flip, and will also cause the original rotor torque balance between the
destruction of the four-wing aircraft to the left yaw, at the same time, the total lift , And
the tilting, the vertical component of the force decreases, four-wing aircraft will gradually
decline, so the end can lead to its side rotation, edge down, while moving in the direction
of tilt. Therefore, the speed of a motor is changed, and from the viewpoint of the body
coordinate system, four output quantities are changed
size. Figure 2.2 shows a schematic diagram of several flight principles for a four-rotor
vehicle.
16 A thesis on Quadcopter
2. Yaw movement
During the hovering and hoisting movements, the four motors rotate at the same speed,
counteracting the counter-torque generated by the rotors rotating in different directions.
However, when the speed of motor 1, 3 and 4 are not the same, the anti-torque can not
reach equilibrium, so that the rotation of the aircraft body. As shown in Fig. 2.5(b), if the
rotation speed of the No. 2 and No. 4 motors are not changed and the rotation speed of
the No. 1 and No. 3 motors are reduced, the sum of the anti-torque effects of the rotor
group to the airframe in the clockwise direction is smaller than Counterclockwise
direction and the role of the body will eventually counterclockwise torque, the same as
the No. 2,4 motor speed, 1,3 motor speed is the same, making the plane by the lift on the
horizontal plane symmetry, the whole body Does not occur, such as rollover, so in the air
to complete the same level of clockwise yaw movement.
and the motion of the aircraft as the particle motion. The rotation process is studied in the
body coordinate system and the aircraft is regarded as rigid body model.
From Figure 2.6, the transformation from the body coordinate system to the ground
coordinate system is described as follows: Using the right-hand rule, a new coordinate
system E1 is obtained by rotating the body coordinate system B (oxyz) around its z axis.
The new coordinate system E2 is obtained by rotating the angle θ on the y axis. Finally,
E2 is rotated around the x axis to obtain the final ground coordinate system E (OXYZ).
From B (oxyz) to E1, from E1 to E2, and from E2 to E (OXYZ), the corresponding
transformation matrix is:
cosψ −sinψ 0
R(z, ψ) = ( sinψ cosψ 0)
0 0 1
cosθ 0 sinθ
R(y, θ) = ( 0 1 0 ) (2.4)
−sinθ 0 cosθ
1 0 0
R(x, Φ) = (0 cosΦ −sinΦ)
{ 0 sinΦ cosΦ
The transfer matrix of the whole process is: R = R (z, ψ) R (y, θ) R (x, Φ)
cos ψ cos θ cos ψ sin θ sin ∅ − sin ψ cos ∅ cos ψ sin θ cos ∅ + sin ψ sin ∅
R = ( sin ψ cos θ sin ψ sin θ sin ∅ + cos ψ cos ∅ sin ψ sin θ cos ∅ − cos ψ sin ∅) (2.5)
− sin θ cos θ sin ∅ cos θ cos ∅
(2.7) can be reduced to a standard unit matrix when the four rotors are stabilized in flight,
the roll angle and the pitch angle are small, and the corresponding angular rate is also
small:
∅̇ 1 0 0 p
[ θ̇ ] = [0 1 0] [q] (2.8)
ψ̇ 0 0 1 r
2.9 Kinematics
Before delving into the physics of quadcopter motion, let us formalize the kinematics in
the body and inertial frames. We define the position and velocity of the quadcopter in the
inertial frame as x = (x, y, z)T and x˙ = (x˙ , y˙, z˙)T , respectively. Similarly, we define the
roll, pitch, and yaw angles in the body frame as θ = (φ, θ, ψ)T , with corresponding angular
velocities equal to θ̇ = (φ̇ , θ̇, ψ̇ ) T . However, note that the angular velocity vector ω ƒ= θ̇.
The angular velocity is a vector pointing along the axis of rotation, while θ˙ is just the
time derivative of yaw, pitch and roll. To convert these angular velocities into the angular
velocity vector, we can use the following relation:
1 0 −𝑠𝜃
𝜔 = [0 𝑐𝜑 𝑐 𝜃 𝑠𝜑 ] (2.9)
0 −𝑠𝜑 𝑐𝜃 𝑐𝜑
After completion of the force analysis, per Newton's law of motion and Euler equation,
based on the force analysis is easy to obtain quadcopter dynamics model equation:
mv̇ = Ff + Fd + Fg
{ (2.1
JΩ̇ + Ω × JΩ = Mf − Md + Mc
1)
In order to study the convenience and effectiveness of this model, and according to the
research environment and requirements of this article, the mathematical model to increase
the constraints: (1) in the absence of indoor or outdoor circumstances, the aircraft hover
and (2) As the rotor mass and volume are very small, its moment of inertia J_r is also very
small, the rotor rotation generated when the Coriolis torque Mc = ∑4i=1 Ω ×
T
Jr [0 0 (−1)i+1 wi ] Which is not obvious and neglects its influence on the angular
motion of the aircraft. Therefore, we get the simplified model applied in this paper
mv̇ = Ff + Fg
{ (2.1
JΩ̇ + Ω × JΩ = Mf
2)
Explain the specific meaning of the variables in this model:
The translational motion of a four-rotor vehicle is achieved by the lift provided by four
propellers, and since the propeller shaft of the aircraft is fixed, its lift direction is constant
in the body coordinate system, ie perpendicular to the body. In the ground coordinate
system, the horizontal force along the three-axis, can be expanded as follows:
Quadcopter by the gravity of the body (select the positive direction up) can be written as:
Fg = [0 0 − mg]T (2.15)
(2.13) ~ (2.15) into the first equation of equation (2.12), we can get:
(2.17)
Quadcopter in the air to do roll, pitch, yaw movement, will be driven by the rotational
torque, resulting in changes in attitude. Specific roll, pitch, and yaw torques are expressed
as
l(F4 − F2 ) lb(w42 − w22 )
Mf = [ l(F3 − F1 ) ]=[ lb(w32 − w12 ) ] (2.18)
d(w12 + w32 − w22 − w42 ) d(w12 + w32 − w22 − w42 )
Substituting Equations (2.17) and (2.18) into the second equation in Equation (2.12)
yields the following equation:
Iy −Iz l
qr ( I ) b(w42 − w22 )
x Ix
ṗ l
I −I
[q̇ ] = pr ( zI x ) + b(w32 − w12 ) (2.19)
y I y
ṙ Ix −Iy d
pq ( ) [ (w12 + w32 − w22 − w42 )]
[ Iz ] I z
We assume that the control input of the four rotorcraft is U = (U1, U2, U3, U4)T. Where U1
is the resultant force of lift force; U2 is the resultant force that affects the roll angle of the
aircraft; U3 is the resultant force that affects the pitch angle of the vehicle; U4 is the
resultant force that affects the yaw angle of the aircraft. The control input U is:
U1 = b(w12 + w22 + w32 + w42 )
U2 = b(w42 − w22 )
(2.20)
U3 = b(w32 − w12 )
2 2 2 2
{U4 = d(w1 + w3 − w2 − w4 )
(2.8) and (2.12) ~ (2.20), the dynamic model of a four-rotor vehicle can be expressed as
follows:
24 A thesis on Quadcopter
U
ẍ = ( cos Ф cos ψ sin θ + sin Ф sin ψ ) m1
U
ÿ = ( cos Ф sin θ sin ψ − cos ψ sin Ф ) m1
U
z̈ = cos θ cos Ф m1 − g
Iy −Iz l (2.21)
Ф̈ = θ̇ψ̇ ( I ) + I U2
x x
I −I l
θ̈ = ∅̇ψ̇ ( zI x ) + I U3
y y
Ix −Iy 1
ψ̈ = ∅̇θ̇ ( ) + I U4
Iz z
v , v
qx qy , vqz Linear velocities measured along each axis in body framer Rq
,
qx qy , qz Angular velocities measured along each axis in body frame Rq
The states x, y, z are inertial frame quantities, where vqx , vqy , vqz are body frame
quantities, however, assuming the rotation applied from inertial to body follow sequence
1-2-3, there is a relation between position and velocities [25]:
𝑥 𝑣𝑞𝑥 𝐶𝜓 𝐶𝜃 𝑆𝜃 𝑆𝜙 𝐶𝜓 − 𝑆𝜓 𝐶𝜙 𝑆𝜓 𝑆𝜃 + 𝑆𝜃 𝐶𝜓 𝐶𝜙
𝑑 𝑇
[ 𝑦 ]=𝑅𝑞 𝑣𝑞 =(𝑅𝑞 ) [𝑣𝑞𝑦 ]=[ 𝑆𝜓 𝐶𝜃
𝑖 𝑖 𝑆𝜃 𝑆𝜙 𝑆𝜓 + 𝐶𝜃 𝐶𝜓 𝐶𝜙 𝑆𝜃 𝑆𝜓 − 𝑆𝜙 𝐶𝜓 ] (2.22)
𝑑𝑡
−𝑧 𝑣𝑞𝑧 −𝑆𝜃 𝑆𝜃 𝐶𝜃 𝐶𝜙
Now, we need to relate Euler angles to angular velocities [2], considering the angular
velocities are body frame quantities, each Euler angles along different direction as
following figure:
1
2 4
3 Roll
Pitch Yaw
Figure 2.9: Eular angles along different directions
Chapter 2: Reference Geometry And Dynamic Model 25
We can set following identity matrix for relating Euler angles to angular velocities:
𝑏 𝑅𝑜𝑙𝑙 𝑅𝑜𝑙𝑙
𝑅𝑅𝑜𝑙𝑙 (𝜙)=𝑅𝑃𝑖𝑡𝑐ℎ (𝜃)= 𝑅𝑌𝑎𝑤 (𝜓)= I (2.23)
Then
𝜔𝑞𝑥 𝜙 0 0
[𝜔𝑞𝑦 ]=𝑅𝑅𝑜𝑙𝑙 (𝜙) [ 0 ]+𝑅𝑅𝑜𝑙𝑙 (𝜙)𝑅𝑃𝑖𝑡𝑐ℎ (𝜃́) [𝜃́] + 𝑅𝑅𝑜𝑙𝑙 (𝜙)𝑅𝑃𝑖𝑡𝑐ℎ (𝜃) 𝑅𝑌𝑎𝑤 (𝜓) [ 0 ] (2.24)
𝑏 𝑏 𝑅𝑜𝑙𝑙 𝑏 𝑅𝑜𝑙𝑙 𝑅𝑜𝑙𝑙
𝜔𝑞𝑧 0 0 𝜓́
We write the above equation in more compact form:
𝜔𝑞𝑥 𝜙 0 0
[𝜔𝑞𝑦 ]=[ 0 ]+𝑅𝑅𝑜𝑙𝑙
𝑏 𝑏
(𝜙) [𝜃́] + 𝑅𝑅𝑜𝑙𝑙 𝑅𝑜𝑙𝑙
(𝜙)𝑅𝑃𝑖𝑡𝑐ℎ (𝜃) [ 0 ] (2.25)
𝜔𝑞𝑧 0 0 𝜓́
𝜙́ 1 0 0 0 1 0 0 𝐶𝜃 0 𝑆𝜃 0
=[ 0 ] + [0 𝐶𝜙 𝑆𝜙 ] [𝜃́] + [0 𝐶𝜙 𝑆𝜙 ] [ 0 1 0 ] [0]
0 0 −𝑆𝜙 𝐶𝜙 0 0 −𝑆𝜙 𝐶𝜙 𝑆𝜃 0 𝐶𝜃 𝜓́
1 0 −𝑆𝜃 𝜙́
=[0 𝐶𝜙 𝑆𝜙 𝐶𝜃 ] [ 𝜃́ ]
0 −𝑆𝜃 𝐶𝜙 𝐶𝜃 𝜓́
𝜙́ 1 𝑆𝜙 𝑡𝜃 𝐶𝜙 𝑡𝜃 𝜔𝑞𝑥
[ 𝜃́ ] = [0 𝐶𝜙 𝜔
−𝑆𝜃 ] [ 𝑞𝑦 ] (2.26)
𝜓 ́ 0 𝑆𝜙 𝑆𝑒𝑐𝜃 𝐶𝜙 𝑆𝑒𝑐𝜃 𝜔𝑞𝑧
2.10 Physics
In order to properly model the dynamics of the system, we need an understanding of the
physical properties that govern it. We will begin with a description of the motors being
used for our quadcopter, and then use energy considerations to derive the forces and
thrusts that these motors produce on the entire quadcopter. All motors on the quadcopter
are identical, so we can analyze a single one without loss of generality. Note that adjacent
propellers, however, are oriented opposite each other; if a propeller is spinning
“clockwise”, then the two adjacent ones will be spinning “counter-clockwise”, so that
torques are balanced if all propellers are spinning at the same rate [30].
2.11 Motors
Brushless motors are used for all quadcopter applications. For our electric motors, the
torque produced is given by
τ = Kt (I − I0) (2.27)
where τ is the motor torque, I is the input current, I0 is the current when there is no load
on the motor, and Kt is the torque proportionality constant [18]. The voltage across the
26 A thesis on Quadcopter
For the purposes of our simple model, we will assume a negligible motor resistance. Then,
the power becomes proportional to the angular velocity:
(𝜏 + 𝐾𝑡 𝐼0)𝐾𝑣𝜔
P≈ (2.30)
𝑘𝑡
2.12 Forces
The power is used to keep the quadcopter aloft. By conservation of energy, we know that
the energy the motor expends in a given time period is equal to the force generated on the
propeller times the distance that the air it displaces moves (P · d t = F · d x). Equivalently,
the power is equal to the thrust times the air velocity (P =𝐹𝑑𝑥 /𝑑𝑡 )
P = Tvh (2.32)
We assume vehicle speeds are low, so vh is the air velocity when hovering. We also
assume that the free stream velocity, v∞, is zero (the air in the surrounding environment
is stationary relative to the quadcopter). Momentum theory gives us the equation for hover
velocity as a function of thrust,
𝑣ℎ = √(𝑇/2𝜌𝐴) (2.33)
where ρ is the density of the surrounding air and A is the area swept out by the rotor.
Using our simplified equation for power, we can then write
𝑇 3/2
P≈𝑘𝑣 𝜏𝜔/𝑘𝑡 =𝑘𝑡 𝑘𝑣 𝜏𝜔/𝑘𝑡 = (2.34)
√2𝜌𝐴
Note that in the general case, τ = ˙r × ˙F; in this case, the torque is proportional to the thrust
T by some constant ratio Kt determined by the blade configuration and parameters.
Solving for the thrust magnitude T, we obtain that thrust is proportional to the square of
angular velocity of the motor:
𝑘𝑣 𝑘𝑡 √2𝜌𝐴
T=( 𝜔)2=k𝜔2 (2.35)
𝑘𝑡
Chapter 2: Reference Geometry And Dynamic Model 27
where k is some appropriately dimensioned constant. Summing over all the motors, we
find that the total thrust on the quadcopter (in the body frame) is given by
0
TB=∑4𝑖=1 𝑇𝑖 =[ 0 ] (2.36)
∑ 𝜔𝑖2
In addition to the thrust force, we will model friction as a force proportional to the linear
velocity in each direction. This is a highly-simplified view of fluid friction, but will be
sufficient for our modeling and simulation. Our global drag forces will be modeled by an
additional force term
−𝑘𝑑 ẋ
𝐹𝐷 =[−𝑘𝑑 ẏ] (2.37)
−𝑘𝑑 ż
If additional precision is desired, the constant 𝑘𝑑 can be separated into three separate
friction constants, one for each direction of motion. If we were to do this, we would want
to model friction in the body frame rather than the inertial frame [20,21,22].
2.13 Torques
Now that we have computed the forces on the quadcopter, we would also like to compute
the torques. Each rotor contributes some torque about the body z axis. This torque is the
torque required to keep the propeller spinning and providing thrust; it creates the
instantaneous angular acceleration and overcomes the frictional drag forces.
The drag equation from fluid dynamics gives us the frictional force:
1
𝐹𝐷 = 2 𝜌𝐶𝐷 𝐴𝑣 2 (2.38)
where r is the surrounding fluid density, A is the reference area (propeller cross-section,
not area swept out by the propeller), and CD is a dimensionless constant. This, while only
accurate in some in some cases, is good enough for our purposes. This implies that the
torque due to drag is given by
1 1
𝐹𝐷 = 2 𝜌𝐶𝐷 𝐴𝑣 2 = 𝜌𝐶𝐷 𝐴(𝜔𝑅)2 (2.39)
2
where ω is the angular velocity of the propeller, R is the radius of the propeller, and b is
some appropriately dimensioned constant. Note that we’ve assumed that all the force is
applied at the tip of the propeller, which is certainly inaccurate; however, the only result
that matters for our purposes is that the drag torque is proportional to the square of the
angular velocity. We can then write the complete torque about the z axis for the ith motor:
τz = bω2 + I M ω̇ (2.40)
where IM is the moment of inertia about the motor z axis, ˙w is the angular acceleration
of the propeller, and b is our drag coefficient. Note that in steady state flight (i.e. not
28 A thesis on Quadcopter
takeoff or landing), ˙w _ 0, since most of the time the propellers will be maintaining a
constant (or almost constant) thrust and won’t be accelerating. Thus, we ignore this term,
simplifying the entire expression to
τz = (−1)i+1bωi2 (2.41)
where the (−1)i+1 term is positive for the ith propeller if the propeller is spinning
clockwise and negative if it is spinning counterclockwise. The total torque about the z
axis is given by the sum of all the torques from each propeller:
τψ = b( ω1 2 − ω2 2 + ω3 2 – 𝜔42 ) (2.42)
The roll and pitch torques are derived from standard mechanics. We can arbitrarily choose
the i = 1 and i = 3 motors to be on the roll axis, so
τφ = ∑ r × T = Lk(kω12 − kω32) = Lk(ω12 − ω32) (2.43)
where L is the distance from the center of the quadcopter to any of the propellers. All
together, we find that the torques in the body frame are
𝐿𝑘(𝜔12 − 𝜔32)
τB =[ 𝐿𝑘(𝜔12 − 𝜔32) ] 2.45)
2 2 2 2
𝑏( 𝜔1 − 𝜔2 + 𝜔3 – 𝜔4 )
The model we’ve derived so far is highly simplified. We ignore a multitude of advanced
effects that contribute to the highly nonlinear dynamics of a quadcopter. We ignore
rotational drag forces (our rotational velocities are relatively low), blade flapping
(deformation of propeller blades due to high velocities and flexible materials),
surrounding fluid velocities (wind), etc. With that said, we now have all the parts
necessary to write out the dynamics of our quadcopter [25,37].
While it is convenient to have the linear equations of motion in the inertial frame, the
rotational equations of motion are useful to us in the body frame, so that we can express
Chapter 2: Reference Geometry And Dynamic Model 29
rotations about the center of the quadcopter instead of about our inertial center. We derive
the rotational equations of motion from Euler’s equations for rigid body dynamics.
Expressed in vector form, Euler’s equations are written as
M =Iω̇ + I𝜔2 (2.47)
where ω is the angular velocity vector, I is the inertia matrix, and M is a vector of applied
torques. We can rewrite this as
𝜏−𝐼𝜔 2
𝜔̇= (2.48)
𝑀
We can model our quadcopter as two thin uniform rods crossed at the origin with a point
mass (motor) at the end of each. With this in mind, it’s clear that the symmetries result in
a diagonal inertia matrix of the form
𝐼𝑥𝑥 0 0
I =[ 0 𝐼𝑦𝑦 0 ] (2.49)
0 0 𝐼𝑧𝑧
Therefore, we obtain our final result for the body frame rotational equations of motion
𝐼𝑦𝑦 −𝐼𝑧𝑧
−1
𝜔𝑦 𝜔𝑧
𝑀𝜑𝐼𝑥𝑥 𝐼𝑥𝑥
−1 𝐼𝑧𝑧 −𝐼𝑥𝑥
𝜔˙=[𝑀𝜑𝐼𝑦𝑦 ]- 𝐼𝑦𝑦
𝜔𝑧 𝜔𝑥 (2.50)
−1
𝑀𝜑𝐼𝑧𝑧 𝐼𝑥𝑥 −𝐼𝑦𝑦
[ 𝜔𝑥 𝜔𝑦 ]
𝐼𝑧𝑧
Where,
• L - inductance of the coil in the engine
• ke – back EMFconstant
30 A thesis on Quadcopter
• ki – torque constant
In practice, we have used 12 × 6 propellers so that we can get 1.5kg thrust form one motor.
As we have used two motors in our drone so we are getting approximately 3kg of thrust.
KK2
MENU
ITEM
PI Editor P Gain: P Limit: I Gain: I
Axis: Limit:
200 40 0 0
Roll
(Ailero
Axis:
200 40 0 0
n)
Pitch
(Elevato
Axis:
200 40 0 0
r)Yaw
(Rudder Auxiliar
Receiver Aileron: 0 Elevator: 0 Throttle: 0 Rudder: 0
) y: 0
Test
Link Roll Auto
Mode Self Level: CPPM:
Pitch: Disar
Settings
m:
aux No Yes no
Pitch(Elev
Stick Scaling Roll (Ail): Yaw Throttle:
):
(Rud):
36 53 52 90
Height Height Alarm Servo
Misc. Min
Dimen: D. 1/10 Filter:
Settings Throttle:
Limit: Volts:
10 16 30 105 50
Self- ACC ACC
P Gain: P Limit:
Level Trim Trim
Settin 90 89 0 Roll: 0 Pitch:
gs
Camera Roll PitchGain PitchOffse
Roll Gain: 0
Stab Offset: 50 :0 t: 50
Settings
Sensor Test Gyro X: Gyro Y: Gyro Z: ACC X: ACC ACC
ACC Y: Z:
Calibration
Pitch
CPPM Roll (Ail): Throttle: Yaw Aux:
(Elev):
Settings (Rud):
Mixer Editor Throttle: Aileron: Elevator: Rudder: Offset: Type Rate
Ch: 1 100 100 0 0 0 :
esc :
high
Ch: 2 100 -100 0 0 0 Esc high
Ch: 3 0 0 -100 -75 32 Serv low
Ch: 4 0 0 100 -75 49 o
Serv low
Show o
②-----①
Motor
Layout
Load
Dual-copter
Motor
Layout
Finally, with these settings from table 3.2 our model started hovering with stability.
Chapter 3: Development & Construction 35
This servomotor is connected with the KK2.1.5 multi-rotor board to get signals and power
both. Technical specifications of the Futaba S-140 Servo motor is given below:
• Modulation: Analog
• Torque: 4.8V: 122.0 oz-in (8.78 kg-cm) 6.0V: 153.0 oz-in (11.02 kg-cm)
• Speed: 4.8V: 0.70 sec/60° 6.0V: 0.56 sec/60°
• Weight: 2.54 oz (72.0 g)
• Dimensions: Length: 1.73 in (43.9 mm)
• Width: 0.91 in (23.1 mm)
• Height: 1.69 in (42.9 mm)
• Motor Type: 3-pole
• Gear Type: Hybrid
• Rotation/Support: Dual Bearing
Specifications:
• Capacity: 3300mAh
• Voltage: 11.1V
• Max Continuous Discharge: 25C (82.5A)
• Max Burst Discharge: 50C (165A)
• Weight: 284g
• Dimensions: 133×42×23mm
• Charge Rate: 1-3C Recommended, 5C Max
brushless DC motor, electronic speed controller (ESC), KK2 multicomputer board, and
high torque servo motor. We have built a GPS tracking android application to keep a track
where it is traveling and used an IP camera software to get live video stream from the
Drone which is also described elaborately in this chapter [21].
Thrust 4200g
Mechanical constant
𝑗×0.004×𝑅
𝜏𝑚 = (3.1)
𝑘𝑒 ×𝑘𝑡
Electrical constant
1
𝜏𝑒 = 0.004𝑅 (3.2)
Chapter 3: Development & Construction 39
𝑘𝑒 = 𝑘𝑡 × 0.0605
(3.3)
Where kt is torque constant, DC current I=0.0605
𝑝𝑤 ×9.554
Torque = (3.4)
𝑛
1300×9.554
= 6100
= 2.03Nm
Torque constant,
𝑇𝑜𝑟𝑞𝑢𝑒
𝑘𝑡 = 𝐶𝑢𝑟𝑟𝑒𝑛𝑡 (3.5)
2.03
= 55
= 0.04Nm/A
Electrical torque,
𝐾𝑒=0.04×0.0605=0.0024
Mechanical constant,
0.089×0.004×0.22
𝜏𝑚 = = 0.8158
0.04×0.0024
416.67
= 0.38𝑠2 +0.82𝑠+1
= 28.5
40 A thesis on Quadcopter
Weight: 1.57 oz
(44.4g)
Motor 3-pole
Type:
Rotational 1800
angle
3.2.5 Yaw-controller
The total motor thrust is set as a variable. This thrust is the thrust that is required to hoover
or to accelerate the quadcopter in the local Z-axis. The more thrust, the faster the
Chapter 3: Development & Construction 43
quadcopter will accelerate. But the yaw is controlled by altering the motor thrust between
the four motors. The yaw controller divides the total force to the two motor pairs, 1-2 and
3-4. This way the total force is kept constant and a moment is applied to yaw the
quadcopter around the body Z-axis.
Since the relationship of the motor thrust and moment is constant the quadcopter will not
yaw as long as the total thrust is equal for the two motor pairs [29].
values can be interpreted in terms of time: P depends on the present error I on the
accumulation of past errors D is a prediction of future errors, based on current rate of
change Depending on your flight controller there will be PID’s associated with a number
of flight modes [27].
What is I?
You have tuned P gain, leaving I and D at default values. When you are flying, you will
notice that you have to hold the pitch/roll stick to get the machine to move, as soon as
you let go of the stick the machine just breaks and stay in hovering again. It might even
cause a few osculation’s or wobbles if the change of control is rapid.
That is because your P is doing its job, trying to stabilize your quadcopter. Look at I gain
as the stick follower, by adding a little I gain you will find that the plane will now fly
forward more smoothly. But the side-effect is when you let go of the stick the copter will
keep on flying to that direction. This is the effect of I, keeping the last stick position.
To understand it, think of the quadcopter is trying to reduce the position error, but the
error is not reducing, it will just keep trying! This is the effect of the I term. In technical
terms, it is integrating the error over time, the longer the error persists, the greater the
force is applied. When the I gain is not zero, a small error can persist forever (which is
not necessary a bad thing in real flying!)
Some people use I gain to make flying more smoothly, while some people purely just like
this “stick following” behavior. However, with too much I your quadcopter will start to
oscillate with a lower frequency at high throttle. When I gain is too low, your quadcopter
will wobble when descend.
Normally default I gain works pretty well already. But if you notice wobble when
descending, increase I should help. But when I is too high, you might notice slow
vibrations at punch-outs (high throttle ascend).
What is D?
D isn’t very useful to many people. In fact you can ignore D completely and your
quadcopter will fly just fine. That’s why the KK2 does not allow you to tune D, because
they want to make it really simple and effective, without D it’s not going to affect the
flight performance too much. D is sometimes used to get rid of the jerkiness of the
quadcopter movement.
D is like the opposite of P. If P is a hand to keep pushing the machine back to a stable
position, then D is a spring between the hand and the machine, which absorbs the shocks.
By adding D gain, you can “soften” the movement just like adding a spring to it. However
too much D is not good, because again it will introduce oscillations. Also, your copter
will be really sluggish and mushy.
Basically, D changes the force applied to correct an position error, when it sees a decrease
or increase in the position error. Just like if you are hungry, you eat a lot faster, when you
are nearly full, your eating will slow down. That’s why you see a softer movement in the
quadcopter when D is used.
When you see vibrations, don’t rush to decrease P, try to increase D and see if you can
eliminate the vibrations. Also, If you see some bumpiness or slight vibration at high
throttle, or doing flips and rolls, give it a bit more D should also help. The cost is you
have mushier control and stick responsiveness.
46 A thesis on Quadcopter
This article uses two NRF24L01 modules, one through the SPI interface with the flight
controller connected to a communication, through a USB to serial port module to connect
with the PC. NRF24L01 is a work in the 2.4-2.5GHz world common ISM band wireless
transceiver chip.
In this diagram, thin red, orange and red wires signifies +5V, black wire Signal and GND
resectively.
embedded processor, its on-chip resources sufficient to achieve various types of sensor
communication needs. The three-axis acceleration and geomagnetic horizontal
components are acquired and the attitude angle is calculated in real time. The output
control quantity is calculated according to the designed control scheme algorithm. The
data is transmitted through the wireless communication module and the ground.
Receiving remote control commands to change the flight status and so on.
Its performance is as follows: Operating frequency is 72MHz, with 32-bit RISC core,
high-speed embedded memory (up to 128K bytes of Flash memory and 20K bytes of
SRAM memory), configured to connect to two APB bus 80 high-speed I / O port. There
are two internal 12-bit ADCs, four timers (three general purpose 16-bit timers and one
PWM timer), and multiple standard and advanced communication interfaces (2 I²C and
SPI interfaces, 3 USART interfaces, 1 USB interface and a CAN interface).
obtained [52].
In fact, when the quadcopter flight, the geomagnetism is not horizontal, set non-horizontal
state, the geomagnetic coordinate system along the axis of the three components were
h_x, h_y and h_z, geomagnetism tilt compensation, available The magnetic field
component in the horizontal direction is [53]:
hx
H cos θ sin Ф sin θ − sin θ cos Ф h
[ X] = [ ] [ y] (3.8)
HY 0 cos Ф sin Ф
hz
The resulting azimuth angle is:
H 180
360 − arctan (HY ) ∗ HX > 0, HY > 0
X π
H 180
180 − arctan (HY ) ∗ HX > 0, HY <0
α= X π (3.9)
HY 180
−arctan (H ) ∗ HX < 0
X π
{ 180 + sgn(HY ) ∗ 90 HX = 0
And then can be obtained quadcopter forward and the north pole of the angle A is
A= α+β (3.10)
Figure 4.1: Simulation model of relationship between motor speed and four forces
In this simulation model, simulation should be carried out before the simulation set, for
the four rotorcraft, the algorithm type selection variable step size algorithm, the algorithm
in the simulation process to change the time interval to calculate the model of continuous
state; calculation method selection ode45, This is based on the Runge-Kutta (4,5) and
Dormand-Prince combination algorithm, which is a one-step algorithm, which is
characterized by only the solution of the previous point in time, and then can immediately
calculate the current point in time equation solution. This algorithm for most of the
simulation model, it should first use ode45 to solve the model, because of this, ode45 is
simulink default algorithm, the specific settings shown in Table 4.1.
Figure 4.6: Block diagram of the overall control system for a four-rotor vehicle
Φd is the target attitude angle, K p 、K i 、K d are the three control points of the PID controller,
which are the actual roll angle, pitch angle, yaw angle, Фd 、θd 、ψd , which are measured
and calculated respectively. Parameters, the value of the experiment through a specific
model to be.
The brief description of the three parameters is as follows:
Kp is the proportional coefficient. The control signal outputted from the proportional
link is proportional to the system error, and the control output is developed to reduce the
error [22]. The greater the proportion coefficient, the more sensitive the system response,
the higher the accuracy, but also make regulation more severe shocks, and even cause
system instability. At the same time, the proportional control can only reduce the error,
can not eliminate the error. Ki is the integral coefficient, the integral control output signal
proportional to the integral error, integral regulation can eliminate the system's steady-
state error, but also caused the system phase lag. The larger the integral coefficient, the
faster the steady-state error can be eliminated, but if the integral coefficient is too large,
large overshoots and long-term fluctuations occur. Kd is the differential coefficient, the
differential link output control signal and the error rate of change is proportional to the
main role of differential regulation is to make changes to the system early warning,
resulting in early regulation. Differential control can make the system phase ahead, offset
the role of integration caused by phase lag, while reducing overshoot, but the differential
coefficient is too large, may cause system instability.
62 A thesis on Quadcopter
The obtained target height acceleration z is input to the calculation module of the lift force
U1. According to the line motion equation of the system dynamics model, the third
equation g is moved to the left side of the equation, and the lift force U1 , The expression
is:
m
U1 = cos Фcos θ (K pz (zd − z) + K iψ ∫(zd − z)dt + K dz (ż d − ż ) + g) (4.4)
At this point, the controller design is completed. Position control loop output control
signal U1 and attitude control loop output control signals U2, U3, U4 into speed input to
the motor module to drive the aircraft to complete the corresponding movement, the use
of sensors to measure the position and attitude of the aircraft signal as a feedback signal
to form a closed-loop Feedback system, by constantly adjusting the PID control
parameters, the system to achieve the desired value and remain stable.
Figure 4.7: Simulation model of attitude control corresponding to motor speed variation
simulation. Simulation time is set to 100 seconds, so you can adjust the PID parameters
of the control system to adapt to changes in system simulation time. Figure 4.8 is a
simulation stop simulation model:
After analyzing the feedback of the three attitude angles and height, we find that the curve
of Roll is stable for the longest time. So we will consider the stability of Roll as the
benchmark to determine the stability of the whole system. Since the real-time attitude
angle is first differentiated, there is an error, so that the first-order differential curve has
crossed the abscissa, but did not stop the simulation problem. Therefore, the first
differential curve to determine the sign, and then through the signal transition to judge.
Table 4.4 shows the optimal values for all control parameters
The simulation results show that the final four motors remain at about 571 rad / s and
maintain the corresponding attitude angle movement.
The acceleration value (x ̈, y ̈) of the horizontal position is used as the input signal of the
inverse resolving module. For the kinetic model, the first equation is obtained by
multiplying sinψ by the second equation by multiplying by cosψ,
which is
mẍ
θd = arcsin (( U − sin Ф sin ψ)⁄cos Ф cos ψ) (4.9)
1
(4.7) and (4.8), the input signal Φd, θd of the inner loop attitude control loop can be
obtained. Φd, θd as the attitude control loop closed-loop PID reference value.
For the overall simulation model framework, we finally decided to adopt dual closed-
loop control, the inner loop for the attitude control loop, the outer loop for the position
control loop. Double closed-loop control can enhance the anti-interference ability of the
control system. The interference can be eliminated quickly in the inner loop attitude
control mediation. The inner loop attitude control directly affects the stability and control
precision of the system. The output of the outer loop is the input of the inner loop. Since
the height control channel and the yaw angle do not have a coupling relation or a single
channel, the input of the control system is Xd, Yd, Zd and ψd, and the output is U1, U2,
U3, U4, Figure 5.12 is the corresponding control system block diagram.
Among them, Figure 4.14 is the output of the four force-related motor speed
transformation relationship:
Figure 4.14: The simulation model of the speed-conversion of the force-corresponding motor
Chapter 4: Control Scheme Design and Simulation 69
The final motor speed stable at 293.4rad / s, or 2801.9r / min or so, hover motor speed
and aircraft gravity mainly related.
Therefore, the above analysis shows that the PID algorithm used in the quadcopter has
good control effect for the fixed-point flight hover control, and the error is small.
1. Hover experiment
When only the remote control throttle channel, the other channel does not move, that is,
three attitude angles are zero, four-rotor will produce movements, four rotor will produce
movements, when the throttle to the size of 1850, the four rotor in the air To achieve the
hover, but the direction of the nose some deflection, may be due to start the motor when
the four motor speed inconsistency or yaw angle caused by the initial offset changes.
When the throttle size is greater than 1850, the four-rotor rise in motion, less than 1850,
the four-rotor will decline, Figure 4.18 is the hover experiment.
72 A thesis on Quadcopter
4000
3500 3573.61
3427.495
3235.54 3206
3000 3032.125 3079
2801.97 2759 2801
2688
2500
2000
1500
1000
500
0
1.22kg 1.42kg 1.62kg 1.82kg 2.02kg
Figure 4.19: Motor speed and aircraft quality simulation and measured contrast
Figure 4.19 is the control motor simulation model to change the quality of the theoretical
motor speed and the measured comparison chart, can be seen through the comparison, the
two curves have a clear linear relationship between theoretical and actual speed error of
about 10%, the main Is due to the simulation model ignores many factors, and the actual
model gap, and because of the lift coefficient b and anti-torque coefficient d measurement
complexity, the accuracy of these two values is not high, and the actual hardware model,
2 motor Rotation resistance other motor to be high, which have affected the deviation of
the theoretical speed.
2.Rolling Experiment
When a certain size of the throttle signal, the four-rotor off, this time the other channel
does not move, only to the roll angle channel a positive signal, the four-wing to the right
side of the fuselage direction of movement, when the negative-angle signal, The left side
of the fuselage movement, the signal to the greater speed to the left faster for the safety
of four rotor flight considerations, the attitude angle in the program to limit the range of
Chapter 4: Control Scheme Design and Simulation 73
As the roll of flight experiment, the small angle of deflection is more difficult to
accurately measure, only according to the scale on the remote control to estimate, and the
size of the deflection angle on the screen approximation that the aircraft to achieve the
corresponding deflection angle. According to the previous simulation experiments, we
can know that in order to keep the attitude angle of the aircraft in the roll-flight experiment,
the change of the motor is a first acceleration or deceleration respectively. When the target
value reaches the target value, the four motors rotate at the same speed to keep the attitude
angle . It is difficult to measure the complete change process of the motor, so we only
estimate the size of the throttle when the motor keeps the corresponding attitude angle.
The specific method is to push the throttle before takeoff, the first given the target attitude
angle, and then slowly push the throttle, when the quadcopter just left the ground, record
the corresponding throttle size. Figure 4.21 is a comparison between the results obtained
from the previous simulation model and the actual value of the hold-up motor speed
stabilization value obtained from the actual flight test.
2920
2900
2880
2860
2840
2820
2800
2780
2760
2740
5° 10° 15° 20°
Figure 4.21: Comparison of Steady Value of Motor Speed and Simulation Results for Actual Flight
Holding Corresponding Attitude Angle
74 A thesis on Quadcopter
From the above experiment, we can see that the quadcopter can realize the basic flight
action, which shows the effectiveness of the proposed control scheme.
Chapter 5: Future Quadcopter 75
Even though the goals of the thesis were not fully reached the contribution of this thesis
is fully functional nonlinear mathematical model and linear systems representing the
quadrotor’s movement which can be used as a development environment and testbed for
future work.
The last thing to be noted is that even though the position control is developed and
functional it needs more testing on the real system. One has not to forget that the
controllers are designed for the hover trim point. When more aggressive or more robust
control is desired e.g. recovering from extreme positions, more trim points have to be
introduced and some gain scheduling algorithm implemented to select or interpolate
suitable control law for the given flight envelope. Once the interface for the Gums tix
computers is operational this feature is possible. Then more advanced control algorithms
can be implemented as well, such as already mentioned LQR and H∞ minimization or
model predictive control (MPC) algorithm as a higher-level control and planning platform.
This algorithm can use the already developed inner loops as a low-level control interface
providing optimal control therefore lowering the power consumption and improving the
performance.
Chapter 6: Conclusions
This paper studied mathematical modelling and control of a quadcopter. The
mathematical model of quadcopter dynamics was presented and the differential equations
were derived from the Newton-Euler and the Euler-Lagrange equations. The model was
verified by simulating the flight of a quadcopter with Matlab. Stabilization of attitude of
the quadcopter was done by utilizing a PD controller. A heuristic method was developed
to control the trajectory of the quadcopter. The PD controller was integrated into the
heuristic method for better response to disturbances in the flight conditions of the
quadcopter.
The simulation proved the presented mathematical model to be realistic in modelling the
position and attitude of the quadcopter. The simulation results also showed that the PD
controller was efficient in stabilizing the quadcopter to the desired altitude and attitude.
However, the PD controller did not considered positions x and y. Thus, the values of x
and y variated from their original values during the stabilization process. This was a result
of the deviation of the roll and pitch angles from zero values.
According to the simulation results, the proposed heuristic method produced good flight
trajectories. The heuristic method required only three parameters to generate the values
for the jounce of the position. The position and its other derivatives were calculated from
the jounce values. The total thrust and the pitch and roll angles to achieve given
accelerations were solved from the linear differential equations. Then, the torques were
determined by the angular accelerations and angular velocities calculated from the angles.
Finally, the required control inputs were solved from the total thrust and the torques. The
simulation results indicated that the quadcopter could be controlled accurately with the
control inputs given by the method.
The proposed heuristic method does not consider unmodeled disturbances, such as wind,
and thus the PD controller was integrated into the control method. The integrated PD
controller operated well in the example simulation. The quadcopter followed the given
trajectory and began to stabilize after reaching the final destination. However, the PD
controller can perform poorly if the parameter values are not properly selected and are
too small or high [38].
The presented mathematical model only consists of the basic structures of the quad-
copter dynamics. Several aerodynamical effects were excluded which can lead to
unreliable behavior. Also, the electric motors spinning the fours rotors were not modelled.
The behavior of a motor is easily included in the model but would re- quire estimation of
the parameter values of the motor. The position and attitude information was assumed to
be accurate in the model and the simulations. However, the measuring devices in real life
are not perfectly accurate as random variations and errors occur. Hence, the effects of
imprecise information to the flight of the quadcopter should be studied as well. Also,
methods to enhance the accuracy of the measurements should be researched and
implemented to improve all aspects required for robust quadcopter maneuvers.
The presented model and control methods were tested only with simulations. Real
experimental prototype of a quadcopter should be constructed to achieve more realistic
and reliable results. Even though the construction of a real quadcopter and the estimation
78 A thesis on Quadcopter
of all the model parameters are laborious tasks, a real quadcopter would bring significant
benefits to the research. With a real prototype, the theoretical framework and the
simulation results could be compared to real-life measurements. This paper did not
include these highlighted matters in the study but presented the basics of quadcopter
modelling and control. This paper can thus be used as a stepping-stone for future research
in more complex modelling of the quadcopter.
List of Abbreviations 79
List of Abbreviations
CRC - Cyclic Redundancy Check
DCM - Direction Cosine Matrix
ESC - Electronic Speed Controller
FEM - Finite Element Method
FPGA - Field Programmable Gate Array
IMU - Inertial Measurement Unit
MV - Measured values
PWM - Pulse Width Modulation
RC - Remote Control
rpm - Revolutions per minute
Rx - Receive
sbRIO - Single Board Reconfigurable Input/output
SP - Set points for the controller
SPI - Serial Peripheral Interface
Tx - Transmit
UART - Universal Asynchronous Receiver/Transmitter
VI - Virtual Instrument, a LabVIEW program
subVI - Subroutine in a LabVIEW VI
lipo - lithium polymer
UAV- Unmanned Aerial Vehicle
BLDC- Brushless Direct Current
P- Proportional
MATLAB- Matrix Laboratory
M-file- MATLAB text editor file
ESC- Electronic Speed Controller
GPS- Global Positioning Syste
80 A thesis on Quadcopter
Reference
[17] Cook, M.V., 1997. Flight Dynamics Principles 1st ed., John Wiley & Sons. De
Lellis, Marcelo, 2011. Modeling, Identification and Control of aQuadrotor
Aircraft. Czech Technical University in Prague.
[18] Dorf, R.C. & Bishop, R.H., 2007. Modern Control Systems 11th ed., Prentice Hall.
[19] Franklin, G., Powell, J.D. & Emami-Naeini, A., 2005. Feedback Control of
Dynamic Systems 5th ed., Prentice Hall.
[20] Hoffmann, G.M. et al., 2007. Quadrotor helicopter flight dynamics and control:
Theory and experiment. In Proceedings of the AIAA Guidance, Navigation, and
Control Conference. p. 1– 20.
[21] Kıvrak, A., Ö., 2006. Design of control systems for quadrotor flight vehicles.
Mechatronics Engineering Department: Atılım University.
[22] Serway, R.A. & Jewett, J.W., Physics for Scientists and Engineers - 6th edition
6th ed., Thomson; Brooks Cole - Custom.
[23] Skogestad, S. & Postlethwaite, I., 1996. Multivariable Feedback Control:
Analysis and Design 1st ed., Wiley.
[24] G. M. Hoffmann, H. Huang, S. L. Waslander, and C. J. Tomlin, “Quadrotor
helicopter flight dynamics and control: Theory and experiment,” Proceedings of
the AIAA Guidance, Navigation and Control Conference and Exhibit, Aug. 2007.
[25] 34 S. L. Waslander, and C. J. Tomlin, “Aerodynamics and control of autonomous
quadrotor helicopters in aggressive maneuvering,” IEEE International Conference
on Robotics and Automation, pp. 3277–3282, May 2009.
[26] S. Bouabdallah, A. Noth, and R. Siegwart, “PID vs LQ control techniques applied
to an indoor micro quadrotor,” IEEE/RSJ International Conference on Intelligent
Robots and Systems, vol. 3, pp. 2451–2456, 2004.
[27] T. Madani and A. Benallegue, “Backstepping control for a quadrotor heli- copter,”
IEEE/RSJ International Conference on Intelligent Robots and Sys- tems, pp.
3255–3260, 2006.
[28] K. M. Zemalache, L. Beji, and H. Marref, “Control of an under-actuated system:
Application to a four rotors rotorcraft,” IEEE International Conference on Robotic
and Biomimetics, pp. 404–409, 2005.
[29] G. V. Raffo, M. G. Ortega, and F. R. Rubio, “An integral predictive/nonlinear H∞
control structure for a quadrotor helicopter,” Automatica, vol. 46, no. 1, pp. 29–
39, 2010.
[30] P. Castillo, R. Lozano, and A. Dzul, “Stabilisation of a mini rotorcraft with four
rotors,” IEEE Control Systems Magazine, pp. 45–55, Dec. 2005.
[31] H. Bouadi and M. Tadjine, “Nonlinear observer design and sliding mode control
of four rotors helicopter,” Proceedings of World Academy of Science, Engineer-
ing and Technology, vol. 25, pp. 225–230, 2007. K. J. ˚Astro¨m and T. H¨agglund,
Advanced PID Control. ISA - Instrumentation, Systems and Automation Society,
2006.
82 A thesis on Quadcopter
[32] A.J. Baerveldt and R. Klang. A low-cost and low-weight attitude estimation
system for an autonomous
[33] Cuong C. Quach Edward F. Hogge Thomas H. Strom Boyd L. Hill Sixto L.
Vazquez Kai Goebel
[34] Bhaskar Saha, Edwin Koshimoto. Battery health management system for electric
uavs. Aerospace
[35] Vardan Semerjyan Corentin Cheron, Aaron Dennis and YangQuan Chen. A
multifunctional hil testbed for multirotor vtol uav actuator. Mechatronics and
Embedded Systems and Applications (MESA), 2010 IEEE/ASME International
Conference, 2010.
[36] Jorge Miguel Brito Domingues. Quadrotor prototype. Master’s thesis, Instituto
Superior Técnico,
[37] Universidade Técnica de Lisboa, 2009.
[38] S. Theil F. Holzapfel. Advances in Aerospace Guidance, Navigation and Control.
Springer-Verlag, 2011.
[39] Christopher Jekeli. Inertial navigation systems with geodetic applications. Walter
de Gruyter GmbH & co, 2000.
[40] Peter I. Corke Jonathan M. Roberts and Gregg Buskey. Low-cost flight control
system for small autonomous helicopter. IEEE International Conference on
Robotics and Automstion, 2003.
[41] Øyvind Magnussen Kjell E. Skjønhaug. The quadcopter investigation. Technical
report, University of Agder, 2010.
[42] Jack B. Kuipers. Quaternions and rotation sequences. Princeton University Press,
2002.
[43] http://www.ga-asi.com/products/aircraft/predator.php
[44] http://www.sciencedaily.com/releases/2011/07/110701203725.htm
[45] http://www.uavforge.net/
[46] http://diydrones.com/
[47] http://www.helikraft-rchelicopters.com/store/1909/futaba/6ex-2-4g-airp-heli-
radio-set-no- servo-with-r617fs-6ex-ss.html (picture of RC controller)
[48] http://www.onlineethics.org
[49] Google.com/quadcopter
[50] Wikipidea.com/quadcopter
[51] http://foreignpolicy.com/issue_of_quadcopter
[52] Hu Ning Bo, Li Jian, Zhao Juyun. Design of electronic compass based on [J].
HMC5883L2011,6:35-38.
[53] Yan Dong, Taiwan Chang. High precision electronic compass based on magneto
resistance sensor [Z].2011:23.
[54] Design of high precision air pressure and temperature measurement system based
Appendix 83
Appendix
• HAE UAV ACTD (High altitude Endurance Unmanned Ariel Vehicle Advance
Concept Technology Demonstrator)
ESC:
• SBEC: 5.5v / 4A
• Size: 70 x 32 x 17mm
• Weight: 61g
Appendix 85
BLDC Motor:
Current
• Weight: 21 gra
• IC: Atmega644 PA
• Gyro/Acceleration: 6050MPU
• Auto-level: Yes
Servo Motor:
• Modulation: Analog
• Torque: 4.8V: 122.0 oz-in (8.78 kg-cm) 6.0V: 153.0 oz-in (11.02 kg-cm)
Li-Po Battery:
• Capacity: 3300mAh
• Voltage: 11.1V
• Weight: 284g
• Dimensions: 133*42*23mm
-The End-