0% found this document useful (0 votes)
31 views10 pages

Control Design For Unmanned Aerial Vehic

Uploaded by

Cebas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views10 pages

Control Design For Unmanned Aerial Vehic

Uploaded by

Cebas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Interdisciplinary Description of Complex Systems 14(2), 236-245, 2016

CONTROL DESIGN FOR UNMANNED


AERIAL VEHICLES WITH FOUR ROTORS

Denis Kotarski1, *, Zoran Benić2 and Matija Krznar3

1
Karlovac University of Applied Sciences
1
Karlovac, Croatia
2
Končar D&ST
2
Zagreb, Croatia
3
Peti Brod
2
Zagreb, Croatia
DOI: 10.7906/indecs.14.2.12 Received: 7 February 2016.
Regular article Accepted: 9 March 2016.

ABSTRACT
Altitude and attitude controlled quadcopter model is used for the behavior and control algorithm
testing, before the implementation on the experimental setup. The main objective is the control system
design which will achieve good task performance in the combination with the quadcopter dynamic
model. Also, for the control model, it is important to be relatively easy to modify for the use of other
control algorithms and to be easy to implement on the experimental setup. At the beginning of this
article, the control system design process is described. Quadcopter dynamics equations are simplified
by applying several assumptions and in that form are used for the controller synthesis. Quadcopter
control system is split into inner and outer control loop because the quadcopter is underactuated
system which means that the direct control of all of the degrees of freedom is not possible. In the
second part, the PI-D control algorithm is described which is applied on the simplified quadcopter
dynamic model. The inner loop controls roll, pitch and yaw angles together with the quadcopter
altitude. Its outputs are four control variables. Outer loop controls quadcopter X and Y position. Its
outputs are roll and pitch desired angles. Regulated quadcopter model behavior is shown for the three
types of task. First, the achieving of position in space is simulated. Second, the reference trajectory
tracking is shown. Last task shown is the reference trajectory tracking with added periodical
disturbances. Simulations show bounded positions error of the regulated quadcopter system using PI-
D controller for the different types of tasks performed under different conditions.

KEY WORDS
quadcopter, control design, inner control loop, outer control loop, PI-D controller

CLASSIFICATION
JEL: Z19
PACS: 07.05.Tp, 87.19.Iu

*Corresponding author, : [email protected]; +385 92 2415118;


*Komor Začretski 30, HR – 49 223 Sveti Križ Začretje, Croatia
Control design for unmanned aerial vehicles with four rotors

INTRODUCTION
In order for the quadcopter to be able to execute tasks, control algorithms are needed to be
implemented. The goal of the control system design is stabilization of the system state around
the desired reference state, or changing that state according to some law, regardless of the inner
or outer disturbances. That is achieved with the feedback, which allows comparison of the
measured value of the process with the desired one. Prior the control algorithm implementation
on the experimental setup, it must be tested in combination with the dynamic model [1].
Quadcopter has six degrees of freedom (6 DOF) and four control variables which means that
the quadcopter is underactuated and dynamically unstable system. The only moving parts are
the propulsor propellers which are rotating with respect to the fixed propulsor axis.
Quadcopter frame has a cross (+) configuration where 𝑋𝐵 and 𝑌𝐵 axes go through the
propulsors. 𝑋𝐵 and 𝑌𝐵 are body coordinate frame axes (body coordinate frame (system) ℱ 𝐵 is
fixed to the quadcopter body (frame)). Quadcopter frame is assumed to be a rigid structure.
The only variable thing is considered to be the propellers revolutions per minute (RPM) that
influence the quadcopter movement.

CONTROL SYSTEM DESIGN


Quadcopter dynamics is derived from the quadcopter dynamic model [2]. The main equations
are quadcopter accelerations as functions of the control variables:
𝑈1
𝑋̈ = (cos𝜓sin𝜃cos𝜙 + sin𝜓sin𝜙) (1)
𝑚
𝑈1
𝑌̈ = (sin𝜓sin𝜃cos𝜙 − cos𝜓sin𝜙) (2)
𝑚
𝑈1
𝑍̈ = −𝑔 + (cos𝜃cos𝜙) (3)
𝑚
𝐼𝑦𝑦 − 𝐼𝑧𝑧 𝐽𝑇𝑃 𝑈2
𝑝̇ = 𝑞𝑟 − 𝑞𝛺 + (4)
𝐼𝑥𝑥 𝐼𝑥𝑥 𝐼𝑥𝑥
𝐼𝑧𝑧 − 𝐼𝑥𝑥 𝐽𝑇𝑃 𝑈3
𝑞̇ = 𝑝𝑟 + 𝑝𝛺 + (5)
𝐼𝑦𝑦 𝐼𝑦𝑦 𝐼𝑦𝑦
𝐼𝑥𝑥 − 𝐼𝑦𝑦 𝑈4
𝑟̇ = 𝑝𝑞 + , (6)
𝐼𝑧𝑧 𝐼𝑧𝑧
where 𝑋̈, 𝑌̈, 𝑍̈ are acceleration in the earth fixed coordinate frame (ℱ 𝐸 ). 𝜙, 𝜃, 𝜓 are roll, pitch
and yaw angles with respect to ℱ 𝐸 . 𝑈1 , 𝑈2 , 𝑈3 , 𝑈4 are control variables. 𝑚 is quadcopter
mass, 𝑔 is gravitational acceleration. 𝐼𝑥𝑥 , 𝐼𝑦𝑦 , 𝐼𝑧𝑧 are moments of inertia with respect to ℱ 𝐵 .
𝐽𝑇𝑃 is the propulsors rotor and propeller moment of inertia. 𝛺 is overall propeller speed. 𝑝, 𝑞,
𝑟 are angular velocities with respect to ℱ 𝐵 , while 𝑝̇ , 𝑞̇ , 𝑟̇ are angular accelerations with
respect to ℱ 𝐵 .
Control variables are a function of squared angular velocities of the propellers:
𝑈1 = 𝑏(𝜔1 2 + 𝜔2 2 + 𝜔3 2 + 𝜔4 2 ) (7)
𝑈2 = 𝑙𝑏(−𝜔2 2 + 𝜔4 2 ) (8)
𝑈3 = 𝑙𝑏(−𝜔1 2 + 𝜔3 2 ) (9)
𝑈4 = 𝑑(−𝜔1 2 + 𝜔2 2 − 𝜔3 2 + 𝜔4 2 ) (10)
𝛺 = −𝜔1 + 𝜔2 − 𝜔3 + 𝜔4 , (11)

237
D. Kotarski, Z. Benić and M. Krznar

where 𝑙 is the distance between the quadcopters center of gravity and propulsors axis, 𝑏 is the
thrust coefficient, 𝑑 is the drag coefficient, 𝜔𝑖 is angular velocity of the propeller 𝑖.
The objective of quadcopter stabilization is finding the values of the propellers angular
velocities in a way that keeps the quadcopter in desired position and attitude. This is done by
the means of the inverse kinematics, i.e. inverse dynamics. Unlike the direct problem, inverse
operations are not always possible and are not always unique. Quadcopter dynamics has to be
simplified in order to get simple inverse model that can be easy implemented in control algorithms.
Equations (1)-(6) have to be simplified with keeping in mind the following assumptions:
 angular contributions to the accelerations are quite complex because they depend on a
couple of parameters, most of which are a vector product of angular velocities. Keeping in
mind that the quadcopter movement is near hover state, there are very little changes in
angles, therefor those contributions can be ignored.
 angular accelerations are linked with the change of angles with respect to ℱ 𝐸 . They are not
equal to the accelerations of the Euler angles in ℱ 𝐵 . Transformation matrix 𝐓 defines the
relation between the angular velocities with respect to ℱ 𝐸 and the ones in ℱ 𝐵 . Quadcopter
movement being close to hovering state, 𝐓 is close to the identity matrix, making the
angular acceleration equations the same in ℱ 𝐸 and ℱ 𝐵 .
 control algorithm gives the control signals to the propulsors. With four control variables,
in a single loop, it is not possible to regulate more than four DOF. Inner loop controls the
altitude and attitude, while the outer loop controls quadcopter position by giving the
attitude references to the inner loop.
Quadcopter dynamics equations that are used in control synthesis are:
𝑈1
𝑍̈ = −𝑔 + (cos𝜃cos𝜙) (12)
𝑚
𝑈2
𝜙̈ = (13)
𝐼𝑥𝑥
𝑈3
𝜃̈ = (14)
𝐼𝑦𝑦
𝑈4
𝜓̈ = , (15)
𝐼𝑧𝑧
where 𝜙̈, 𝜃̈, 𝜓̈ are angular acceleration with respect to ℱ 𝐸 .
Control algorithm as inputs has sensor data (or calculated data from the dynamic model) and
reference data. Outputs of control algorithm are the angular velocities of four propellers, which
can be, through dynamic model, translated to the pulse-width modulation (PWM) signal.
Quadcopter, being an underactuated system, does not allow direct control of all of the DOFs.
Control of positions 𝑋 and 𝑌 is achieved indirectly through control of roll and pitch angles in
outer control loop. Quadcopter cannot move translationally without the rotation around one
of the quadcopter axes. Outer control loop analyses sensor data and desired task data, and its
outputs are desired angle values for the inner control loop which then controls the roll, pitch
and yaw angles. Inner control loop is the core of the control algorithm. It analyses sensor and
outer control loop data together with desired altitude task data. Its outputs are control
variables which stabilize the position error through four basic quadcopter movements. From
the equations (7)–(10) control variables can be retrieved for the desired accelerations. PI-D
controller is used for the desired accelerations assessment.
Inverted movement matrix is used for the calculation of the squared angular propeller
velocities for four control variables:

238
Control design for unmanned aerial vehicles with four rotors

TASK

X des Z des
Y des ψ des

CONTROL ALGORITHM

ϕ des 2
OUTER θdes INNER Ui INVERTED ωi
QUADCOPTER
CONTROL CONTROL MOVEMENT
DYNAMICS
LOOP LOOP MATRIX

ϕ mes
X mes
Y mes Z mes θ mes
ψ mes

SENSORS

Figure 1. Quadcopter control diagram.


1 1 1
𝜔1 2 = 𝑈1 − 𝑈3 − 𝑈 (16)
4𝑏 2𝑏𝑙 4𝑑 4
1 1 1
𝜔2 2 = 𝑈1 − 𝑈2 + 𝑈 (17)
4𝑏 2𝑏𝑙 4𝑑 4
1 1 1
𝜔3 2 = 𝑈1 + 𝑈3 − 𝑈 (18)
4𝑏 2𝑏𝑙 4𝑑 4
1 1 1
𝜔4 2 = 𝑈1 + 𝑈2 + 𝑈. (19)
4𝑏 2𝑏𝑙 4𝑑 4

PI-D CONTROLLER
Classic PID structure has a derivative term calculated from the error signal, which is a
downside of that structure when it comes to the quadcopter control. If the task takes the form
of the step function, output of the derivator will be an impulse which could bring the
propulsors to the state of saturation and push the system outside of the linear space. That is
the reason for the PI-D structure of the controller (Figure 2) in which the derivative term is
being calculated from the sensor data.

1 KI
s

TASK + e + + u
KP
- -
SENSORS s KD
(matematical model)

Figure 2. PI-D controller structure.

239
D. Kotarski, Z. Benić and M. Krznar

INNER CONTROL LOOP


Inner control loop controls quadcopter altitude and attitude. Input variables for inner loop
can be divided in two parts, task and sensor variables as shown in figure 2. Task variables
are desired altitude and yaw angle that are given by the task that quadcopter needs to
accomplish and desired roll and pitch angles, that are calculated in the outer control loop.
Sensors give measured altitude, roll angle, pitch angle and yaw angle. Inner loop outputs
are four control variables.

Altitude control
Equation for the thrust force control variable 𝑈1 is:
𝑈1 = 𝐾𝑃𝑍 𝑒𝑍 + 𝐾𝐼𝑍 ∫ 𝑒𝑍 − 𝐾𝐷𝑍 𝑍̇𝑚𝑒𝑠 + 𝑚𝑔, (20)
where 𝐾𝑃𝑍 , 𝐾𝐼𝑍 and 𝐾𝐷𝑍 are three altitude PI-D controller parameters. 𝑒𝑍 is the altitude error,
where 𝑒𝑍 = 𝑍𝑑𝑒𝑠 − 𝑍𝑚𝑒𝑠 . 𝑍𝑑𝑒𝑠 is the desired altitude and 𝑍𝑚𝑒𝑠 is the measured altitude.

Roll control
Equation for the roll moment control variable 𝑈2 is:
𝑈2 = 𝐾𝑃𝜙 𝑒𝜙 + 𝐾𝐼𝜙 ∫ 𝑒𝜙 − 𝐾𝐷𝜙 𝜙̇𝑚𝑒𝑠 , (21)
where 𝐾𝑃𝜙 , 𝐾𝐼𝜙 and 𝐾𝐷𝜙 are three roll angle PI-D controller parameters. 𝑒𝜙 is the roll angle
error, where 𝑒𝜙 = 𝜙𝑑𝑒𝑠 − 𝜙𝑚𝑒𝑠 . 𝜙𝑑𝑒𝑠 is the desired roll angle and 𝜙𝑚𝑒𝑠 is the measured roll
angle.

Pitch control
Equation for the pitch moment control variable 𝑈3 is:
𝑈3 = 𝐾𝑃𝜃 𝑒𝜃 + 𝐾𝐼𝜃 ∫ 𝑒𝜃 − 𝐾𝐷𝜃 𝜃̇𝑚𝑒𝑠 . (22)
Similar to the roll control, 𝐾𝑃𝜃 , 𝐾𝐼𝜃 and 𝐾𝐷𝜃 are three pitch angle PI-D controller parameters.
𝑒𝜃 is the pitch angle error, where 𝑒𝜃 = 𝜃𝑑𝑒𝑠 − 𝜃𝑚𝑒𝑠 . 𝜃𝑑𝑒𝑠 is the desired pitch angle and 𝜃𝑚𝑒𝑠
is the measured pitch angle.

Yaw control
Equation for the yaw moment control variable 𝑈4 is:
𝑈4 = 𝐾𝑃𝜓 𝑒𝜓 + 𝐾𝐼𝜓 ∫ 𝑒𝜓 − 𝐾𝐷𝜓 𝜓̇𝑚𝑒𝑠 , (23)
where 𝐾𝑃𝜓 , 𝐾𝐼𝜓 and 𝐾𝐷𝜓 are three yaw angle PI-D controller parameters. 𝑒𝜓 is the yaw angle
error, where 𝑒𝜓 = 𝜓𝑑𝑒𝑠 − 𝜓𝑚𝑒𝑠 . 𝜓𝑑𝑒𝑠 is the desired yaw angle and 𝜓𝑚𝑒𝑠 is the measured yaw
angle.

OUTER CONTROL LOOP


Outer control loop is used because the quadcopter is underactuated system and it is not
possible to control all of the quadcopter DOF directly. As said before, the inner loop directly
controls 4 DOF, those being three angles and altitude. To be able to indirectly control 𝑋𝐸 and
𝑌𝐸 position, outer loop is used. Outer control loop, as its outputs, give desired roll and pitch
angles to the inner loop for the desired 𝑋𝐸 and 𝑌𝐸 position. Outer control loop is superior to
the inner control loop.
Equations (1) and (2) can be singled out which are the equations for the quadcopter 𝑋𝐸 and 𝑌𝐸
linear accelerations:

240
Control design for unmanned aerial vehicles with four rotors

𝑈1
𝑋̈ = (cos𝜓sin𝜃cos𝜙 + sin𝜓sin𝜙) (24)
𝑚
𝑈1
𝑌̈ = (sin𝜓sin𝜃cos𝜙 − cos𝜓sin𝜙) . (25)
𝑚
Quadcopter dynamics of the 𝑋𝐸 and 𝑌𝐸 linear accelerations can be simplified in the similar
way as the quadcopter dynamics equations (12) – (15). Again, the quadcopter movement is
observed as a hovering state, i.e. roll and pitch angles are very small (close to 0). Keeping
that in mind, the equations (24) and (25) can be transformed to:
𝑈1
𝑋̈ = (cos𝜓 𝜃 + sin𝜓 𝜙) (26)
𝑚
𝑈1
𝑌̈ = (sin𝜓 𝜃 − cos𝜓 𝜙) . (27)
𝑚
Matrix notation of the equations (26) and (27):
̈ 𝑈1 sin𝜓 cos𝜓 𝜙
[𝑋 ] = [ ] [ ]. (28)
𝑌̈ 𝑚 −cos𝜓 sin𝜓 𝜃
From the equation (28), roll and pitch angles are being calculated. Because of the assumption
that the quadcopter movement is near the hovering state, thrust force 𝑈1 has to nullify the
gravitational force allowing for the U1/m to be changed with the gravitational acceleration 𝑔.
Equation for the desired roll and pitch angles is:
𝜙 1 sin𝜓 −cos𝜓 𝑋̈
[ 𝑑𝑒𝑠 ] = [ ] [ ]. (29)
𝜃𝑑𝑒𝑠 𝑔 cos𝜓 sin𝜓 𝑌̈

SIMULATION RESULTS
Behavior of the controlled quadcopter system depends on the dynamic model of the
quadcopter and the control algorithm. Control algorithm input values are the values defined
in the task as well as the dynamic model outputs. Control algorithm outputs are the four
control variables which are also the dynamic model inputs.

TASK MATHEMATICAL
CONTROL
MODEL OF
ALGORITHM
QUADCOPTER

Figure 3. Controlled quadcopter system.


Simulation results are given for the three cases. First case is the simulation of the achieving
the desired position. Second case is the reference trajectory tracking and the final case is the
reference trajectory tracking with the addition of the periodic disturbance.

ACHIEVING THE DESIRED POSITION


The desired point in space, defined by three coordinates with respect to ℱ 𝐸 , is arbitrarily
chosen. The control algorithm is tuned for the quickest desired point achievement. Simulation
time is 20 s.

241
D. Kotarski, Z. Benić and M. Krznar

Figure 4. Angular propeller velocities – achieving the desired position in space.


Figure 5 shows the quadcopter attitude which constantly changes until the quadcopter gets to
the desired position. After achieving that, roll and pitch angles are 0. Yaw angle is arbitrarily
chosen.

Figure 5. Quadcopter attitude – achieving the desired position in space.


Figure 6 shows that after certain amount of time (cca. 10 sec), depending of the controller
parameters, quadcopter reaches the desired position (𝑋𝐸 = 15, 𝑌𝐸 = 6, 𝑍𝐸 = 10) and holds
that state.

Figure 6. Quadcopter position – achieving the desired position in space.

REFERENCE TRAJECTORY TRACKING


Chosen trajectory is of a helix shape because of the simple generating and displaying. Helix
is a combination of three functions, two of which are of sinusoidal shape ( 𝑋𝐸 and 𝑌𝐸
position), and one is linear (𝑍𝐸 position). Simulation time is set to 100 s.

242
Control design for unmanned aerial vehicles with four rotors

Figure 7. Propeller angular velocities – reference trajectory tracking.


Figure 7 shows propeller angular velocities which depend on the reference trajectory.

Figure 8. Quadcopter attitude – reference trajectory tracking.


Figure 9 shows that quadcopter quickly gets close to the reference trajectory and that is
tracking it with bounded tracking error, being unable to achieve asymptotic error
convergence due to the variable reference state.

Figure 9. 3D view of reference trajectory tracking.

REFERENCE TRAJECTORY TRACKING WITH ADDED PERIODICAL


DISTURBANCES
In this case of trajectory tracking, periodical external force disturbances are added in XY
plane. X coordinate disturbance profile have amplitude of 2 N, period of 10 seconds, duration
of 0,5 second and phase delay of 8 seconds. Y coordinate disturbance profile have amplitude
of 1,5 N, period of 15 seconds, duration of 1 second and phase delay of 6 seconds.

243
D. Kotarski, Z. Benić and M. Krznar

Figure 10. Propeller angular velocities – reference trajectory tracking with added periodical
disturbances.
Figure 11 shows changes of angular velocities which depend on the reference trajectory and
given periodical disturbances.

Figure 11. Quadcopter attitude – reference trajectory tracking with added periodical disturbances.
Figure 12 shows quadcopter following the reference trajectory with bounded position error.
Disturbances are affecting the quadcopter position and attitude, but in the acceptable
boundaries which are not allowing the quadcopter to lose track of the reference trajectory.

Figure 12. 3D view of reference trajectory tracking with added periodical disturbances.

CONCLUSIONS
This article has shown control design and control algorithm implementation which in the
combination with the quadcopter dynamic model form regulated quadcopter system. During

244
Control design for unmanned aerial vehicles with four rotors

the control design phase, some assumptions were made in order to get simplified quadcopter
dynamics equations.
Quadcopter behavior while performing different tasks in different conditions was shown by
simulation where some control variables constraints were made with the goal of more
realistic description of quadcopter behavior. Controller parameters where chosen empirically.
Outer control loop outputs are inner control loop inputs so the outer loop parameters were
chosen in a way that in the combination with the inner loop parameters give the most suitable
control variables. Simulation results have shown the stability, robustness and error
boundedness of the PI-D controller.
Further work will include control algorithm implementation on the experimental setup. Also,
more advanced control algorithms will be tested with the objectives to improve quadcopter
system robustness and tracking performances as well as a better energy management.

REFERENCES
[1] Bresciano, T.: Modelling, Identification and Control of a Quadrotor Helicopter.
M.Sc. Thesis.
Lund University – Department of Automatic Control, Lund, 2008,
[2] Benić, Z.; Piljek, P. and Kotarski, D.: Mathematical modelling of unmanned aerial
vehicles with four rotors.
Interdisciplinary Description of Complex Systems 14(1), 88-100, 2016,
http://dx.doi.org/10.7906/indecs.14.1.9,
[3] Luukkonen, T.: Modelling and Control of a Quadcopter.
Mat-2.4108, School of Science, Espoo, 2011,
[4] Magnussen, Ø. and SkjØnhaug K.E.: Modelling, Design and Experimental Study for a
Quadcopter System Construction.
University of Agder – Faculty of Technology and Science, Kristiansand, 2011,
[5] Beard, R.W.: Quadrotor Dynamics and Control.
Brigham Young University, Provo, 2008,
[6] Raza, S.A.: Intelligent Flight Control of an Autonomous Quadrotor.
In: Casolo, F., ed.: Motion Control. University of Ottawa, Ottawa, p.580, 2010,
[7] Kasać, J.; Stevanović, S.; Žilić, T. and Stepanić, J.: Robust Output Tracking Control of a
Quadrotor in the Presence of External Disturbances.
Transactions of FAMENA 37(4), 29-42, 2013,
[8] Naidoo, Y.; Stopforth, R. and Bright, G.: Quad-Rotor Unmanned Aerial Vehicle Helicopter
Modelling & Control.
International Journal of Advanced Robotic Systems 8(4), 139-149, 2011,
http://dx.doi.org/10.5772/45710,
[9] Choi, Y.C. and Ahn, H.S.: Nonlinear Control of Quadrotor for Point Tracking: Actual
Implementation and Experimental Tests.
IEEE/ASME Transactions of Mechatronics 20(3), 1179-1192, 2015,
http://dx.doi.org/10.1109/TMECH.2014.2329945,
[10] Magsino, E.R. et al.: Stabilizing Quadrotor Altitude and Attitude through Speed and
Torque Control of BLDC Motors.
13th International Conference on Control, Automation, Robotics & Vision, IEEE, 2014,
http://dx.doi.org/10.1109/icarcv.2014.7064345.

245

You might also like