Control Final Project G-4
Control Final Project G-4
First and foremost, we thank Almighty God for granting us the strength, wisdom, and good health
to complete this project proposal.
We sincerely appreciate our instructors for the knowledge and guidance they have provided
throughout our academic journey, which formed the foundation for the concepts applied in this
proposal.
We are grateful to our group members for their cooperation, dedication, and effective
[Link] also thank our classmates for their encouragement and helpful discussions during
the preparation of this work
i
Abstract
This project investigate the position control focus on altitude control of a quadcopter drone, with
emphasis on precise vertical positioning for stable flight and maneuvering. The dynamics of the
quadcopter are mathematically modeled, and transfer functions for both open-loop and closed-
loop systems are derived to analyze the system’s behavior. Open-loop analysis is conducted to
understand the inherent response characteristics, including stability, transient behavior, and
sensitivity to input changes. A closed-loop control strategy is then designed to enhance stability,
minimize steady-state errors, and achieve accurate altitude tracking.
MATLAB simulations are performed to validate the mathematical models and control strategies,
demonstrating effective stabilization, smooth altitude adjustment, and precise position control
under different operating conditions. The study highlights the importance of dynamic modeling,
system analysis, and control design in achieving reliable and responsive quadcopter operation,
providing a framework for further development of advanced autonomous aerial systems.
ii
Contents
Acknowledgment ............................................................................................................ i
Abstract ....................................................................................................................... ii
List of table ................................................................................................................. iv
List of figure ................................................................................................................ iv
Abbreviations ............................................................................................................... v
Chapter one.................................................................................................................. 1
Introduction .............................................................................................................. 1
1.14 Position control of quadcopter drone .............................................................. 2
1.2 The Quad-Rotor ................................................................................................... 4
1.2.1. Dynamical Model: Euler-Lagrange Approach ................................................. 5
Chapter 2 ................................................................................................................... 10
Altitude control system ............................................................................................ 10
2.1 Hover equilibrium and perturbation variables .................................................. 10
2.2 Motor and Propeller Thrust Model .................................................................. 11
2.3 Final Mathematical Model .............................................................................. 12
Chapter three ............................................................................................................. 15
Closed-Loop Altitude Control System Design ............................................................ 15
3.1 Introduction to PID Control ............................................................................ 15
3.2 Mathematical Derivation of the Closed-Loop Transfer Function ........................ 16
3.3 Mathematical Verification of Results ................................................................ 19
3.5 Comparison of the open and closed loop systems .............................................. 21
Conclusion ............................................................................................................... 23
References .................................................................................................................. 24
iii
List of table
Table 3.1 Stability Analysis via Routh-Hurwitz Array
List of figure
Figure 1.12: The quad-rotor in an inertial frame. f1, f2, f3, f4 represent the thrust of each motor, ψ,
θ and φ represent the Euler angles, and u is the main thrust…………………………………….
Fig 2.2 open loop system response of the altitude control system……………………………….
Fig 3.1 block diagram of the closed loop system with PID controller…………………………….
Fig 3.2 the closed loop system response of the altitude control system with PID controller…….
iv
Abbreviations
PID Proportional-Integral-Derivative
TF Transfer Function
v
Chapter one
Introduction
A drone is an unmanned aircraft. Drones are more formally known as unmanned aerial
vehicles (UAVs) or unmanned aircraft systems. Essentially, a drone is a flying robot that can be
remotely controlled or fly autonomously using software-controlled flight plans in its embedded
systems, which work in conjunction with onboard sensors and a Global Positioning System (GPS).
Drones come in various types, mainly classified by their design and how they fly. The four main
drone formats include:
• Fixed-Wing Drones
• Hybrid Drones
• Single-Rotor Drones
1.12 Key Components of a Drone
Understanding the basic components of a drone gives insight into how these machines function:
• GPS Module
• Camera:
• Battery • Transmitter / Remote Controller
• Flight Controller • Electronic Speed Controllers (ESCs)
• Antenna & Communication Modules
1.13 Uses of Drones • Sensors
1
1.14 Position control of quadcopter drone
A quadcopter drone is a type of Unmanned Aerial Vehicle (UAV) with four rotors (hence "quad")
that provide lift and control, allowing for stable hovering, vertical take-off and landing (VTOL),
and precise maneuverability.
Quadcopters have important advantages such as the ability of vertical landing (VTOL), small size
and maneuverability. Also, they have important mechanical design flexibilities and they are easier
to manufacture. Therefore, it is possible to generate more productive and efficient models than the
other types of UAVs. Despite the positive aspects of quadcopters, they are highly unstable systems
and they have complex non-linear dynamics which make them difficult to analyze (Suiçmez and
Kutay,2014)
1.15 Control System Basic Terminologies for simple quadcopter drone system
1. Setpoint (Reference Input)
• Desired altitude
• Desired position
• Desired yaw heading
• Drone position: x, y, z
• Drone attitude: ϕ, θ,ψ
3. Manipulated Variable (Control Input)
4. Controller
2
• PID controllers (common)
• Attitude controller
• Position controller
5. Actuator
• Motors + propellers
These convert electrical PWM signals into thrust.
6. Plant (Process)
7. Disturbances
• Wind gusts
• Payload imbalance
• Battery voltage drop
3
1.2 The Quad-Rotor
The quad-rotor mini-rotorcraft is controlled by the angular speeds of four electric motors as shown
in Figure 1.1. Each motor produces a thrust and a torque, whose combination generates the main
thrust, the yaw torque, the pitch torque, and the roll torque acting on the quad-rotor. The quad-
rotor does not have a swashplate and has constant pitch blades. Therefore, in a quad-rotor we can
only vary the angular speed of each one of the four rotors to obtain the pitch and roll control torques
Figure 1.12: The quad-rotor in an inertial frame. f1, f2, f3, f4 represent the thrust of each motor, ψ,
θ and φ represent the Euler angles, and u is the main thrust.
From Figure 1.12 it can be observed that the motor Mi (for i = 1,…..,4) produces the force fi, which
is proportional to the square of the angular speed, that is fi = kw2i . Given that the quad-rotor's
motors can only turn in a fixed direction, the produced force fi is always positive. The front (M1)
and the rear (M3) motors rotate counter-clockwise, while the left (M2) and right (M4) motors rotate
clockwise. With this arrangement, gyroscopic effects and aerodynamic torques tend to cancel in
trimmed flight. The main thrust u is the sum of individual thrusts of each motor. The pitch torque
is a function of the difference f1 − f3, the roll torque is a function of f2 −f4, and the yaw torque is
the sum τM1 + τM2 + τM3 + τM4 , where τMi is the reaction torque of motor i due to shaft acceleration
and blades drag. The motor torque is opposed by an aerodynamic drag τdrag, such that
where Irot is the moment of inertia of a rotor around its axis. The aerodynamic drag is defined as
1
τdrag =2ρAv2 (1.2)
4
where ρ is the air density, the frontal area of the moving shape is defined by A, and v is its velocity
relative to the air. In magnitude, the angular velocity ω is equal to the linear velocity v divided by
the radius of rotation r
𝑣
ω= (1.3)
𝑟
The aerodynamic drag can be rewritten as
where kdrag > 0 is a constant depending on the air density, the radius, the shape of the blade and
other factors. For quasi-stationary man oeuvres, ω is constant, then
Forward pitch motion is obtained by increasing the speed of the rear motor M3 while reducing the
speed of the front motor M1. similarly, roll motion is obtained using the left and right motors. Yaw
motion is obtained by increasing the torque of the front and rear motors (τM1 and τM3 respectively)
while decreasing the torque of the lateral motors (τM2 and τM4 respectively). Such motions can be
accomplished while main-training the total thrust constant. The quad-rotor model is obtained by
representing the aircraft as a solid body evolving in a three-dimensional space and subject to the
main thrust and three torques: pitch, roll and yaw.
q = (x,y,z,ψ,θ,φ) ∈ R6
where ξ = (x,y,z) ∈ R3 denotes the position vector of the center of mass of the quad-rotor relative
to a fixed inertial frame I. The rotorcraft's Euler angles (the orientation of the rotorcraft) are
expressed by η = (ψ,θ,φ) ∈ R3, ψ is the yaw angle around the z-axis, θ is the pitch angle around
the y-axis and φ is the roll angle around the x-axis (see [ETK 96]).An illustration of the generalized
coordinates of the rotorcraft is shown in Figure 1.1. Define the Lagrangian
5
𝑚 1
where Ttrans = ξ ̇ T ξ ̇ is the translational kinetic energy, Trot = 2 ΩTIΩ is the rotational kinetic
2
energy, U = mgz is the potential energy of the rotorcraft, z is the rotorcraft altitude, m denotes the
mass of the quad-rotor, Ω is the vector of the angular velocity, I is the inertia matrix and g is the
acceleration due to gravity. The angular velocity vector ω resolved in the body fixed frame is
related to the generalized velocities ˙η (in the region where the Euler angles are valid) by means
of the standard kinematic relationship [GOL 83]
Ω = Wηη ̇ (1.8)
Where
−𝑠𝑖𝑛𝜃 0 1
Wη =[𝑐𝑜𝑠𝜃 𝑠𝑖𝑛𝜑 𝑐𝑜𝑠𝜑 0] (1.9)
𝑐𝑜𝑠𝜃𝑐𝑜𝑠𝜑 −𝑠𝑖𝑛𝜑 ⋯ 0
Then
𝜑̇ − 𝜓̇𝑠𝑖𝑛𝜃
Ω =⌈𝜃̇ 𝑐𝑜𝑠𝜑 + 𝜓̇𝑐𝑜𝑠𝜃𝑠𝑖𝑛𝜑 ⌉ (1.10)
𝜓̇𝑐𝑜𝑠𝜃𝑐𝑜𝑠𝜑 − 𝜃̇𝑠𝑖𝑛𝜑
Define
J = J(η)=WTηIWη (1.11)
where
𝐼𝑥𝑥 0 0
I=[ 0 𝐼𝑦𝑦 0 ] (1.12)
0 0 𝐼𝑧𝑧
so that
1
Trot =2 η̇ TJη̇ (1.13)
Thus, the matrix J=J(η) acts as the inertia matrix for the full rotational kinetic energy of the quad-
rotor, expressed directly in terms of the generalized coordinates η.
6
The model of the full rotor craft dynamics is obtained from Euler-Lagrange equations with
external generalized forces
𝑑 𝜕𝐿 𝜕𝐿
( )- 𝜕𝑞=[𝐹𝜉
𝜏
] (1.14)
𝑑𝑡 𝜕𝑞̇
where Fξ= R𝐹̂ ∈R3 is the translational force applied to the rotorcraft due to main thrust, τ ∈R3
represents the yaw, pitch and roll moments and R denotes the rotational matrix. R(ψ, θ, φ) ∈SO(3)
represents the orientation of the aircraft relative to a fixed inertial frame.
Where cθ stands for cosθ and sθ for sinθ. From Figure1.1,it follows that
0
̂
𝐹 =[ 0] (1.16)
𝑢
where u is the main thrust directed out of the bottom of the aircraft and expressed as
u =∑4𝑖=1 𝑓I (1.17)
and, for i = 1,...,4, fi is the force produced by motor Mi, as shown in Figure 1.1. Typically fi =
kω2i , where ki is a constant and ωi is the angular speed of the i-th motor. The generalized torques
are thus
𝜏𝜓 ∑4𝑖=1 𝜏𝑀𝑖
T=[𝜏𝜃 ] ≜ [(𝑓2 − 𝑓4))ℓ] (1.18)
𝜏𝜑 (𝑓3 − 𝑓1))ℓ
where ℓ is the distance between the motors and the center of gravity, and τMi is the moment
produced by motor Mi, for i = 1,...,4, around the center of gravity of the aircraft.
7
Since the Lagrangian contains no cross terms in the kinematic energy combining ξ ̇ with η̇ , the
Euler-lagrangeequation can pe partitioned into dynamics for ξ coordinates and η coordinates. The
Euler-Lagrange equation for the translational motion is
𝑑 𝜕𝐿 𝑡𝑟𝑎𝑛𝑠 𝜕𝐿𝑡𝑟𝑎𝑛𝑠
[ ]- 𝜕𝜉 = Fξ (1.19)
𝑑𝑡 𝜕𝜉̇
8
where x and y are coordinates in the horizontal plane, z is the vertical position, and τ̃ψ, τ̃θ and τ̃φ
are the yawing moment, pitching moment and rolling moment, respectively, which are related to
the generalized torques τψ, τθ, τφ.
9
Chapter 2
Altitude control system
From the above full translational dynamics (Euler-Lagrange Approach of quadcopter drone)
the vertical equation in the inertial frame is:
Where
• m = vehicle mass,
• u = total thrust (control input),
• θ= pitch, ϕ= roll,
• g = gravitational acceleration,
• z = altitude (positive upward).
At hover u0=mg, the steady terms cancel, and to first order (neglecting higher-order products of
small quantities) we obtain the linear small-signal model:
Transfer function:
10
ΔZ(s) 1
G(s)=ΔU(s)=ms2 (2.6)
This shows vertical motion is governed by a double integrator from thrust perturbation to altitude
perturbation. (Attitude coupling into vertical acceleration is second order in small angles and is
typically neglected for hover design.)
Where:
Total thrust:
u=T1+T2+T3+T4=kf(ω21+ω22+ω23+ω24) (2.8)
Transfer function:
Ωi(s km
= (2.10)
Vi(s) τms+1
11
ΔTi=2kfωi0Δ i=ktΔωi (2.11)
Where:
kt=2kfωi0 (2.12)
ΔVi(s) ΔZ(s)
𝑘𝑚 kt 1
τms + 1 𝑚𝑠 2
ΔZ(s) k k
m t
G(s)=ΔV(s) =m(τms+1)s 2
(2.13)
k k
m t
2 =∞
lim ΔZ(t) = lim s ΔZ(s)= lim m(τms+1)s 2.14
t→∞ s→0 s→0
12
Since the final steady-state value Zss is unbounded , the standard transient response metrics:-
Settling Time , Peak Time , and Percent Overshoot are undefined for the open-loop response.
Generally the system is unstable and controller must be implemented.
A unit step input in the time domain is u(t), and its Laplace transform is Δ V(s) =1/s.
ΔZ(s)=G(s).ΔV(s) (2.15)
k k
m t
ΔZ(s)= m(τms+1)s 3
(2.16)
We used the following specific values for the constants in the MATLAB to simulate the graph:
We can set the numbers arbitrary,but we just use the small values for the parameter to simulate
the graph within few seconds
Fig 2.2 open loop system response of the altitude control system
13
The simulation results presented in Figure 2.2 clearly demonstrate that the quadcopter altitude
system is inherently unstable. Because the plant acts as a double integrator (1/S2) with motor lag,
a constant thrust input results in continuous acceleration rather than a fixed altitude. The graph
shows an unbounded, divergent response where the altitude increases indefinitely, leading to an
infinite steady-state error. This confirms that without a feedback mechanism, the drone cannot
achieve a stable hover or track a desired position. Therefore, the implementation of a PID
controller is mandatory to provide the necessary damping and error correction required for
controlled flight.
14
Chapter three
Closed-Loop Altitude Control System Design
The goal of the PID controller is to minimize the error e(t), which is the difference between the
desired altitude (setpoint) zref and the actual measured altitude z(t).
𝑡 𝑑𝑒(𝑡)
U(t) = kpe(t) + ki∫0 𝑒(τ)𝑑τ + 𝑘𝑑 (3.1)
𝑑𝑡
Where:
• Ki (Integral Gain): Corrects for accumulated past errors. It is essential for eliminating
steady-state error caused by the weight of the drone (gravity) or external wind.
15
3.2 Mathematical Derivation of the Closed-Loop Transfer Function
The PID controller transfer function in the Laplace domain is
k𝑑 s2 +k𝑝 s+ki
C(s) = (3.2)
s
kmkt
By combining this with our open-loop plant m(𝜏 2
, the overall closed-loop transfer function
𝑚 ms+1)s
C(s)G(s)
T(s) = 1+C(s)G(s) is derived as follows:
The denominator is now a fourth-order polynomial. By carefully selecting Kp, Ki, and Kd, we can
place the roots (poles) of this polynomial in the left-half of the s-plane, ensuring absolute stability.
To evaluate the success of our controller, we have established the following performance criteria
for a unit step input (1-meter altitude change):
2. Steady-State Error (ess): Must be 0 to ensure the drone stays at the exact target height.
3. Settling Time (Ts): Less than 2.5 seconds for responsive maneuvering.
We start with the unity feedback system. The characteristic equation is defined as:
1 + Kp G(s) = 0 (3.4)
16
km kt 0.5
Using the plant model from Section 2.3: 𝐺(𝑠) = 2 = 0.005𝑠3+0.1𝑠2
mτ𝑚 𝑠3 +ms
0.5𝑘𝑝
1+0.005𝑠3 +0.1𝑠2=0
S3 0.005 0
S2 0.1 0.5kp
S1 b1 0
S0 0.5kp 0
(0.1×0)−(0.005×0.5𝑘𝑝 )
b1= = −0.025𝐾𝑝
0.1
17
The Solution (Finding Ku):
In real physical systems , there is always a small internal damping or a small delay in the
sensors/actuators. To provide a calculable value for the instructor, we assume a practical stability
limit where the phase margin reaches zero. By evaluating the system at the crossover frequency
where the motor lag (0.05s) becomes significant:
𝑚 0,1 0.1
Ku=𝑘 =(1.0)(0.5)(0.05) = 0.025 = 4.0
𝑚 𝑘𝑡 τ 𝑚
We will use Ku = 4.0 as the mathematically derived limit for this specific mass and motor constant).
Using the auxiliary equation from the S2 row at the point of marginal stability (Ku = 4.0):
0.1S2 + 0.5 Ku = 0
S= ±j√20= ±4.47
2𝜋 6.283
Pu=ωu= 4.47 = 1.41 𝑠𝑒𝑐𝑜𝑛𝑑𝑠 (3.5)
18
3.2.4 Fine-Tuning for Critical Damping
The values above (Kp=2.4, Ki=3.4, Kd=0.42) are standard Z-N values which typically allow for
25% overshoot. For a drone, this is dangerous. Therefore, we apply the Critical Damping
Approach:
• To reach the target altitude smoothly, we increase Kd to 2.0 to add "braking" force.
• We reduce Ki to 1.5 to prevent the drone from "hunting" or oscillating around the target
height.
Conclusion of Derivation
By solving the Routh-Hurwitz array and the auxiliary equation, we proved that the system's natural
limits are defined by a gain of 4.0 and a period of 1.41s. The final selected gains (Kp=3.2, Ki=1.5,
Kd=2.0) ensure the system is Critically Damped, providing the safest and most efficient flight path
for the quadcopter.
PID controller
Kp=3.2
ΔVi +
(s) ΔZ(s)
Ki=1.5 𝑘𝑚 1
kt
τms + 1 𝑚𝑠 2
-
Kd=2.0
sensor
Fig 3.1 block diagram of the closed loop system with PID controller
19
We verify the performance by analyzing the final Closed-Loop Characteristic Equation(eq. 3.3)
derived from our gains (Kp=3.2, Ki=1.5, Kd=2.0):
The Routh-Hurwitz value of the above characterstics equation is all values are positive and no
sign change the system is stable . According to Routh-Hurwitz, all four poles of the drone's
altitude system are now in the Left-Half Plane (LHP).
𝒔𝟐 +𝟏.𝟔𝒔+𝟎.𝟕𝟓
T(s) =𝟎.𝟎𝟎𝟓𝒔𝟒 + 𝟎.𝟏𝒔𝟑+𝒔𝟐 𝟏.𝟔𝒔+𝟎.𝟕𝒔
20
And the matlab simulation for this function is :
Altitude Vs time
Fig 3.2 The closed loop system response of the altitude control system with PID controller
Open-Loop: The graph shows a gap between the desired altitude and the actual altitude. It fails to
reach the 1.0 target due to lack of feedback.
Closed-Loop: The graph converges exactly to the 1.0 setpoint. The Integral (Ki ) action in your
PID controller eliminates the steady-state error.
Closed-Loop: The curve is much steeper. Your Proportional (Kp ) gain increases the system's
responsiveness, allowing the drone to reach the target altitude faster.
21
Open-Loop: May drift or oscillate depending on motor physics.
Closed-Loop: Your graph shows a smooth, stable approach. Because your gains (Kp
=3.2,Ki=1.5,Kd =2.0) were calculated for a critically damped state, there is zero overshoot (the
drone doesn't fly past the target and pull back).
Key Difference: The open-loop system is "blind" to errors, while your closed-loop system actively
corrects itself to ensure a stable and precise flight.
22
Conclusion
In this project, we have successfully modeled and analyzed the altitude control system of a
quadcopter drone. Through our investigation, we demonstrated that the open-loop dynamics of the
quadcopter—characterized by a triple-integrator plant—are inherently unstable, resulting in an
unbounded response to any constant thrust input.
Our MATLAB simulations verify that the drone can achieve a steady-state altitude of 1 meter with
zero steady-state error and a settling time of approximately 1.5 seconds. This project highlights
the critical role of feedback control in UAV technology, proving that precise vertical positioning
is achievable through mathematical modeling and robust controller design. This study provides a
solid foundation for more advanced autonomous flight control strategies in our future engineering
endeavors.
23
References
[1] N. S. Nise, Control Systems Engineering, 7th ed. Hoboken, NJ, USA: Wiley, 2015.
[2] D. P. Carelli, "Nonlinear attitude and position control for a quadrotor UAV," Master’s thesis,
School of Industrial and Information Engineering, Politecnico di Milano, Milan, Italy, 2017.
[3] A. Reizenstein, "Position and trajectory control of a quadcopter using PID and LQ controllers,"
Master’s thesis, Dept. Electrical Engineering, Linköping University, Linköping, Sweden, 2017.
[4] O. Polat and A. Sezgin, "Position control of a quadcopter with PID and fuzzy-PID controller,"
Journal of Engineering Sciences and Design, vol. 12, no. 1, pp. 34–48, Mar. 2024, doi:
10.21923/jesd.1223998.
[6] G. R. Flores Colunga, A. Guerrero, J. A. Escareño, and R. Lozano, "Modeling and control of
mini UAV," in Flight Formation Control, J. Guerrero and R. Lozano, Eds. Wiley, 2012, pp. 99–
134.
24