Professional Documents
Culture Documents
Comparing_LQR_and_PID_Controllers_for_Quadcopter_Control_Effectiveness_and_Cost_Analysis
Comparing_LQR_and_PID_Controllers_for_Quadcopter_Control_Effectiveness_and_Cost_Analysis
Comparing_LQR_and_PID_Controllers_for_Quadcopter_Control_Effectiveness_and_Cost_Analysis
1
Conference on Systems and Control, Sousse, Tunisia,
December 18-20, 2023
Abstract— Quadcopters, a type of Unmanned Arial Vehicle, The main challenge that many researchers have with the
have gained a major area of interest due to their various quadcopter is that its dynamics are coupled with nonlinear
applications, small size, low cost, and maneuverability. The multiple input multiple output (MIMO) and passive
flight principle of a quadcopter regulates its thrust and dynamics [4]. This complexity is further complicated by the
moments to control movements. This paper investigates linear fact that the quadcopter has 6DoF degrees of freedom (three
controllers for non-linear systems based on linearized systems, translational and three rotational) with only four independent
comparing PID and LQR with integral control, examining inputs (rotor speeds). The resulting dynamics are highly
input/output disturbance effects, and comparing cost and
nonlinear, especially after accounting for complex
performance. The results of this investigation show that the
aerodynamic effects [5].
LQR controller outperforms the PID controller in controlling
quadcopters with satisfactory performance and cost results. It In the literature, Quadcopter modeling and design with
offers a balance between performance and cost, handling LQR and PID controllers reveals several studies that have
constant disturbances efficiently. In the non-linear model, there been conducted on this topic. In one study [6], A PID
is a minimal difference in performance and controllers' costs controller with manual adjustment was used to control a
due to the strong coupling between system states and constant quadcopter, demonstrating its effectiveness in stabilizing
disturbances. altitude and attitude. Another study [7] the study introduced
full-state feedback and PID control methods for a quadcopter
Keywords—Quadcopter, LQR, Integral Control, PID, Cost,
Performance
model, demonstrating their functionality with suitable initial
parameters. A third study analyzed and tested the
I. INTRODUCTION performance of an LQR control algorithm for quadrotor
helicopters. A fourth study [8] presented a neural network
Quadcopters are unmanned aerial vehicles (UAVs) used control model for quadcopter stabilization, utilizing a classic
for military, commercial, and recreational purposes. They are PID controller and comparing its results with machine
popular due to their low cost, ease of use, and versatility. learning controllers. A fifth study [9] built a PD controller for
Designing and modeling quadcopters are crucial for various altitude stability and succeeded with a simple quadcopter
engineering disciplines due to their complex dynamics, prototype. Finally, these studies demonstrate the
interdisciplinary nature, and safety benefits. effectiveness of LQR and PID controllers in quadcopter
Quadcopters, or multirotor helicopters with four rotors, modeling and design, as well as the potential for using
have a history dating back to the early 1900s. The first machine learning and meta-heuristic algorithms to optimize
quadcopters appeared in 1907 with the Gyroplane No. 1 [1], controller performance. This paper investigates linear
but were unstable and impractical. The development controller application to non-linear quadcopter model using
continued in the 1920s in France, but quadcopters gained PID and LQR with integral control, compares controllers'
widespread popularity later [2]. Early designs had complex cost and performance, and examines input and output
control systems, but by the late 2000s, advancements in GPS, disturbance effects.
battery life, and Electronic Speed Controllers made them
more popular. Today, studies focus on enhancing II. QUADCOPTER FLIGHT CONTROL MODEL
quadcopters' autonomy and cooperation, with Raffaello In order to represent the drone, we need two coordinate
D'Andrea demonstrating a Kinect-controlled quadcopter frames: an Inertial Frame (IF) and a Body Frame (BF), as
during a TED Global 2013 talk [3]. shown in Fig. 1. To know the relationship between the inertial
Quadcopter flight principle uses four propellers for frame and the body frame, we need the rotation matrix 𝑅
propulsion, controlling thrust, moments, attitude, and represented in the following equation:
position. Four types of movement, including upward 𝑐𝜃 𝑐𝜓 𝑐𝜓 𝑠𝜃 𝑠𝜑 − 𝑠𝜓 𝑐𝜑 𝑐𝜓 𝑠𝜃 𝑐𝜑 + 𝑠𝜓 𝑠𝜑
downward, forward backward, leftward rightward, and yaw, 𝑅 = [𝑐𝜃 𝑠𝜓 𝑠𝜓 𝑠𝜃 𝑠𝜑 + 𝑐𝜓 𝑐𝜑 𝑠𝜓 𝑠𝜃 𝑐𝜑 − 𝑐𝜓 𝑠𝜑 ] (1)
compensate for weight. −𝑠𝜃 𝑠𝜑 𝑐𝜃 𝑐𝜑 𝑐𝜃
Fig. 2 Euler angles represent rotation matrix in steps: (a) Around Z-axis.
(b) Around Y-axis. (c) Around X-axis.
𝑝 0 0 𝜑̇
𝝎𝒃 = [𝑞 ] = 𝑒3𝑏 [ 0 ] + 𝑏2𝑏 [𝜃̇] + 𝑛1𝑏 [ 0 ] (4)
𝑟 𝜓̇ 0 0
𝑒3𝑏 Frame (a) rotation around 𝑒3 vector
𝑏2𝑏 Frame (b) rotation around 𝑏2 vector
𝑛1𝑏 Frame (c) rotation around 𝑛1 vector
The quadcopter's control system uses four inputs and six The feedback law after the design of the K matrix by LQR
outputs to regulate altitude, position, and attitude. A basic is [11]
PID is sufficient for altitude and yaw, but a cascade PID is 𝒙
𝒖 = −[𝑘 𝑘𝐴 ] [𝒙 ] , 𝐾 = [𝑘 𝑘𝐴 ] (25)
needed for attitude and horizontal position. An efficient 𝑨
cascade system consists of two loops, with the inner loop As a starting point for assigning the weights of the Q and
closed for efficient response. The inner loop should respond R matrices, we use Bryson's rule, which is a widely used
faster than the outer loop [10]. heuristic that provides a good initial guess for the weighting
To tune a quadcopter's control system using PID Tuner matrices Q and R. So what is Bryson's rule?
tool in SIMULINK: (1) Tune inner loop controllers for faster The rule is that if [11]
response; (2) Tune outer loop controllers; and (3) Ensure
responsiveness in non-linear system as shown in Table 2. 𝑦1 = 𝛼𝑚1 , 𝑦2 = 𝛼𝑚2 , 𝑦3 = 𝛼𝑚3 (26)
Where m's are the maximum acceptable error deviation of n
II. THE TUNED PARAMETER OF PID CONTROLLERS states, and if Q is a diagonal matrix, then
PID parameters 𝑞11 𝑦12 = 𝑞22 𝑦22 = 𝑞33 𝑦32 (27)
PID controller name
kp ki kd N Thus
Altitude controller 0.45 0.053 0.99 100
𝑞11 𝛼 2𝑚12 = 𝑞22 𝛼 2 𝑚22 = 𝑞33 𝛼 2 𝑚32 (28)
position controller 0.004 0.0001 0.036 100
Then the diagonal matrix elements are satisfactorily
attitude controller 0.015 0.0003 0.135 100 solved by understanding the accepted dynamic parameters of
Yaw controller 0.005 0.0005 0.01 100 the quadcopter and applying them to the following equations
[11]
a. N is filter coeficient.
State K State K
𝑧 32.7412 𝑥 0.5427