See discussions, stats, and author profiles for this publication at: [Link]
net/publication/358635499
Modeling and Control of X-Shape Quadcopter
Article in IOSR Journal of Mechanical and Civil Engineering · February 2022
DOI: 10.9790/1684-1901034657
CITATIONS READS
0 531
3 authors, including:
Abdelrady Okasha Elnady
October 6 University
45 PUBLICATIONS 87 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
Autonomous Airplane View project
CNC, Mechatronics View project
All content following this page was uploaded by Abdelrady Okasha Elnady on 16 February 2022.
The user has requested enhancement of the downloaded file.
IOSR Journal of Mechanical and Civil Engineering (IOSR-JMCE)
e-ISSN: 2278-1684,p-ISSN: 2320-334X, Volume 19, Issue 1 Ser. III (Jan. – Feb. 2022), PP 46-57
[Link]
Modeling and Control of X-Shape Quadcopter
Hatem M. Kandeel, Ebrahim A. Abdelmaksod, Abdelrady Okasha Elnady
Mechatronics Department, Faculty of Engineering, October 6 University, Egypt
Abstract: A quadcopter is a form of unmanned aerial vehicle with several rotors. Surveillance, military
operations, fire detection, agriculture, spyware, and a variety of other applications are all new to it. Because of
their dependability, cost effectiveness, and multi-functionality, they are frequently used in many locations. The
quadrotor project still facing some drawbacks and challenges since it is a highly nonlinear, underactuated
system. It has six degrees of freedom but only four actuators which make it very difficult to be controlled. A
detail derivation of the mathematical model of Quadcopter is presented. The quadcopter’s model is divided into
two subsystems; rotational subsystem (roll, pitch and yaw) and translational subsystem (altitude, x and y
position). The rotational subsystem is fully actuated whereas the translational subsystem is underactuated. The
model is controlled using a PID controller. The PID gains; , , and . are obtained using auto tuning and
fined using manual tuning. The responses for heading, altitude, x-position and y-position are acceptable.
Keywords: Quadcopter – PID Control – UAV
---------------------------------------------------------------------------------------------------------------------------------------
Date of Submission: 02-02-2022 Date of Acceptance: 15-02-2022
---------------------------------------------------------------------------------------------------------------------------------------
I. Introduction
A quadcopter, drone, or quad-rotor all refer to the same thing as a helicopter but have four motors. Its
motors are oriented upwards and distributed in a square configuration at an equal distance from the center of
mass. Quadcopters falls in the category of vertical take-off and landing (VTOL) UAVs [1].
The control of the quadcopter in hovering, maneuvers and take off is done by controlling the speed of
four rotors. On the beginning of the UAVs, it is limited to the military applications with very large sizes then
after the very fast development, the size of UAVs is gotten more small and compact size.
This paved the way for its entry into many other applications such as Aerial Photograph, Agriculture, 3-D
Mapping, Shipping, and delivery [3]. The problem facing the control of the quadcopter is that the quadcopter is
a highly nonlinear, multi-variable system and since it has a six Degrees of Freedom (DOF) but only four
actuators so, it is an underactuated system [2].
Since the quadcopter has 6-DOFs, 6 variables will be used to express its position and orientation in
space (x, y, z, φ, θ, ψ). The distances of the quadrotor's center of mass along the x,y and z axes respectively
from a fixed inertial frame will be presented as x, y and z. The three Euler angles; φ, θ and ψ represent the
orientation of the quadrotor. The roll and pitch movement (φ, θ) represents the attitude of the quadcopter, while
ψ (yaw) referred to the heading of the quadcopter and z refered to the altitude [3].
There are many different methods to control the quadcopter, PID controller, back-stepping control,
non-linear control, LQR controllers and nonlinear controllers with nested saturations The PID-controller is the
most popular method [3].
In this article a mathematical model for an under actuated six-degrees of freedom (6 DoF) quadcopter
is derived based on Newton-Euler method. In addition the actuation forces are considered by modelling the
aerodynamic forces and coefficients. A detail derivation of the mathematical model of Quadcopter is presented.
The quadcopter’s model is divided into two subsystems; rotational subsystem (roll, pitch and yaw) and
translational subsystem (altitude, x and y position). The rotational subsystem is fully actuated whereas the
translational subsystem is underactuated. The model will be controlled using a PID controller. The PID gains;
, , and . are obtained using auto tuning and fined using manual tuning. The responses for heading,
altitude, x-position and y-position show a good behavior and they are acceptable.
II. System Modeling
Before talking about the kinematic and dynamic model of the quadcopter, A brief introduction about
how to generate a thrust, roll, pitch and yaw with only four motors will be presented. And also show how the
spin direction allows us to decouple one motion from the other.
Spinning a propeller of a motor causes the thrust motion since it pushes air down causing the reaction
force in the opposite direction that is up. If the motor is placed at the center of gravity of an object the applied
DOI: 10.9790/1684-1901034657 [Link] 46 | Page
Modeling and Control of X-Shape Quadcopter
force will cause the net object to move in pure translation as shown Fig. 1 .The object will hover in place in case
the thrust force is truly equal and opposite to the gravity force as shown in Fig. 2.
Fig.1: Lift force generated by motor Fig.2: Hovering due to equality of lift and gravity
forces
By applying a force at a certain distance from the center of gravity, both a torque as well as a translational
motion will be produced about the center of gravity as shown in Fig. 3.
Fig. 3: Force produces torque
By applying a counter force in the right side of the center of the gravity and each force is half of the weight, the
bar will remain stationary since forces and torques will cancel each other as shown in Fig. 4.
Fig. 4: Counter forces and torques cancel each others
The torque will be doubled and the bar will start to rotate in case the both motors are spinning in the same
direction as shown in Fig. 5.
Fig. 5: Rotating bar due to doubled torques
Now, the two motors should be spin in the opposite directions to counter this torque. It does not matter
where the counter rotating motors are placed as long as two of them spin in one direction and the other in the
opposite direction. Designers of quadcopter choose to have opposite motors to spin in the same direction. It’s
due to the way yaw or the flat spinning motion interacts with roll and pitch.
We can command the yaw motion by slowing down two motors that are running in the same direction
and speeding up the other two. As a result, we will be able to yaw without affecting thrust.
Similarly, roll and pitch can be considered. To roll, we decrease one of the front pairs and increase the other,
resulting in a rolling torque. To pitch, we decrease one of the front pairs and increase the other, resulting in a
pitching torque; both of these motions have no effect on yaw.
Newton-Euler formalism will be used to derive the kinematics and dynamics models of a quadrotor with
assuming the following points:
The structure is rigid and symmetrical.
The center of gravity of the quadrotor coincides with the body fixed frame origin.
The propellers are rigid.
Thrust and drag are proportional to the square of propeller's speed.
DOI: 10.9790/1684-1901034657 [Link] 47 | Page
Modeling and Control of X-Shape Quadcopter
A. Kinematic model
To define the coordinate frames shown in Fig.6, the fixed reference frame with , and axes and
the body frame with , and axes. The fixed frame is an inertial frame on a specific location at ground
level, where the axes point to the North, East and Downwards respectively. The body frame is located in the
center of the quadrotor body, while the x-axis is located between propeller 1 and propeller 3, the y-axis is
located between propeller 1 and propeller 4, and the z-axis pointing downward [3].
Fig.6: Quadcopter reference frame
The distance between the origin of the fixed frame and the origin of the body frame represents the
absolute position of the quadrotor's center of mass .The orientation of the quadrotor is described
by the rotation R from the body frame to the inertial frame. The quadrotor's orientation is specified by roll,
pitch, and yaw angles (φ; θ and ψ), which indicate rotations about the , and -axes respectively.
Assuming the sequence of rotation to be roll (φ), pitch (θ) then yaw (ψ) [3].
There are some ways to get the orientations of the vehicle such as trigonometric functions, Euler angles
and quatrains. Use Euler angles to find the final orientation of the vehicle with respect to the body frame by
using the transformation of an inertial frame to body frame [1].
The transformation matrix R shown in equation (1) which will be used for inertial to body frame transformation
is calculated by multiplying all the three rotational matrices.
(1)
Where;
θ
R=
To get information on the angular velocity of the quadcopter, an on-board Inertial Measurement Unit (IMU) is
generally utilized, which provides the velocity in the body coordinate frame. To relate the Euler rates =
that are measured in the inertial frame and angular body rates = , a transformation is obtained
in equation (2).
(2)
Where:
Around the hover position, small angle assumption is made where cos , cos θ and sin = sin θ = 0,
thus can be simplified to an identity matrix I [3].
B. Dynamic model:
The quadcopter’s motion can be divided into two subsystems; rotational subsystem (roll, pitch and yaw) and
translational subsystem (altitude, x and y position). The rotational subsystem is fully actuated whereas the
translational subsystem is underactuated.
DOI: 10.9790/1684-1901034657 [Link] 48 | Page
Modeling and Control of X-Shape Quadcopter
III. Rotational equation of motion:
Newton-Euler method is used to derive the rotational equations of motion
+ + = (3)
Where:
Quadrotor's diagonal inertia Matrix
Angular body rates
Gyroscopic moments due to rotors' inertia
Moments acting on the quadrotor in the body frame
Drag moment caused by aerodynamic effects.
The Gyroscopic moments are defined to be
So the rotational equation of motion can be rewritten as,
(4)
Where:
rotors' inertia
rotors' relative speed
= + – +
where Rotors’ angular speeds
To get a time-independent inertia matrix, we must calculate the rotational equations of motion in the body frame
rather than the inertial frame.
Diagonal Inertia Matrix (J)
The inertia matrix for the quadcopter is a diagonal matrix, its diagonal elements are , which
represents the mass moments of inertia about the principal axes in the body frame.
(5)
Gyroscopic Moment
The gyroscopic moment of rotor is a physical effect in which gyroscopic torques or moments attempt to align
the spin axis of the rotor along with the inertial z-axis [3].
Moments Acting on the Quadcopter ( )
Each rotor in the quadcopter creates an upward thrust force and generates a moment with the
direction opposite to the direction of rotation of the corresponding rotor i.
(6)
(7)
Where:
Air density.
A Blade area.
Thrust coefficient.
Drag moment coefficient.
r Blade length.
Angular velocity of rotor i.
Because the aerodynamic forces and moments are dependent on the propeller shape and air density, and the
quadcopter's maximum altitude is generally limited, the air density may be assumed to be constant [3]. As a
result the equations (6) and (7) can be rewritten as follows,
(8)
(9)
From the previous explanation of the quadcopter motion and how it generates its moments about and
axes, now we will express the moment about each axis as follows:
The total moment about the x-axis,
(10)
DOI: 10.9790/1684-1901034657 [Link] 49 | Page
Modeling and Control of X-Shape Quadcopter
The total moment about the y-axis,
(11)
The total moment about the z-axis, the moment is caused by the rotation of the rotors, thus the equation can be
written as,
(12)
Combining equations (10), (11) and (12) in vector form, we get,
(13)
Where:
Aerodynamic force constant.
Aerodynamic moment constant.
The length of the quadcopter arm from the (C.G) to the propeller.
IV. Translational Equations of Motion
The quadcopter's translation equations of motion are derived in the inertial frame and are based on Newton's
second law.
(14)
Where:
ξ= Quadcopter’s distance from the inertial frame.
m Quadcopter’s mass.
g Gravitational acceleration g = 9.81 .
Non-gravitational forces acting on the quadcopter in the bodyframe.
The drag force caused by aerodynamic effects.
The nongravitational force is the thrust force acting on the quadcopter in the vertical direction (there is no
rolling or pitching). This force can be expressed as follows,
(15)
Because the thrust is upwards and the positive z-axis in the body frame is pointing downwards, the sign is
negative.
is multiplied by the rotation matrix R to transform the rotor thrust forces from the body frame to the inertial
frame, allowing the equation to be used in any quadcopter configuration.
Aerodynamic Effects
1. Drag Force
The force generated due to the friction of the moving quadcopter body with the air, as the velocity of the
quadcopter increases the drag force in turn increase. The drag force can be approximated by,
(16)
where is a constant matrix called the aerodynamic translation coefficient matrixand is the time derivative of
the position vector ξ.
2. Drag Moment
Drag moment is the moment generated due to the friction of the moving quadcopter body with the air. The drag
moment can be approximated to be,
(17)
DOI: 10.9790/1684-1901034657 [Link] 50 | Page
Modeling and Control of X-Shape Quadcopter
Where; is a constant matrix called the aerodynamics rotation coefficient matrix and is the Euler rates.
V. State Space Model
In this section the mathematical equations of motion in a state space representation will be discussed, and this
will help to make the control of the quadcopter easier to tackle.
A. State Vector X
Since the quadcopter has six degrees of freedom, the state vector that represents the position of the quadcopter
in space and its angular and linear velocities will include twelve elements given in equations (18) and (19).
(18)
(19)
B. Control Input Vector U
A control input vector U, consisting of four inputs; through is defined as,
Where:
(20)
(21)
(22)
(23)
Equations (20) to (23) it can be rewritten in matrix form as follows,
(24)
The rotor’s velocity can be calculated from the control input as follows,
(25)
The rotors' velocities can be calculated from the control inputs by taking the square root of the previous equation
as follows,
(26)
(27)
(28)
(29)
C. Rotational Equation of motion in state space form
The equation of the total moments acting on the quadcopter body becomes,
(30)
By expanding the rotational equation of motion we get,
(31)
Expanding equation (31), leads to,
DOI: 10.9790/1684-1901034657 [Link] 51 | Page
Modeling and Control of X-Shape Quadcopter
(32)
Using equation (32), the angular accelerations can be written in terms of the other variables as:
(33)
(34)
(35)
To simplify equations (33) to (35), the inertia terms are written as:
, ,
, ,
,
Equations (33) through (35) can be rewritten in a simple form in terms of the system states, using the above
definition of a1 to a5 and b1 to b3
(36)
(37)
(38)
D. Translational Equations of motion in state space form
The equation of the upward force acting on the Quadcopter becomes,
(39)
By expanding the translational equation of motion (14) and using equation (16) we get,
(40)
Rewriting Equation (40) to have the accelerations in terms of the other variables, we get,
(41)
(42)
(43)
Rewriting in terms of the state variable X,
(44)
(45)
(46)
VI. Quadcopter Control
The quadcopter model will be controlled using a PID controller. PID controller block diagram is shown
in Fig. 7. Knowing that the quadcopter has six degrees of freedom and only four controllers as the position in x
and y depends on the roll and pitch orientation, so it is considered to be an underactuated system. This leads the
attitude controller subsystem to be cascaded with position controller subsystem. The other two controller
subsystems are the altitude controller which represents the control on the z-position and the heading controller
which represents the orientation about the z-axis.
DOI: 10.9790/1684-1901034657 [Link] 52 | Page
Modeling and Control of X-Shape Quadcopter
Fig.7: Block diagram for PID controller
A. Altitude Controller
The feedback signal from the quadcopter dynamics subsystem will be compared with the desired z-position and
this error signal will be input to the altitude controller which modifies it using PID controller and produces the
control signal shown in Fig. 8.
Fig. 8: Block diagram for altitude controller subsystem
B. Heading Controller
The feedback signal from the quadcopter dynamics subsystem is compared with the desired yaw angle and the
error signal is input to the heading controller, then the controller modify the error signal using PID controller to
produce a control signal that will be input to the rotational subsystem shown in Fig. 9.
Fig.9: Block diagram for attitude and heading controller
C. Attitude Controller
The roll and pitch angles are feedback from the quadcopter dynamics subsystem and compared with the desired
roll and pitch come from the position controller, the error signal is input to the attitude controller, then the
controller modify the error signal using PD controller to produce a control signals that will be input to the
rotational subsystem shown in Fig. 9.
D. Position Controller
The x and y positions are feedback from the quadcopter subsystem which compared with the desired x and y
positions, the error signal is feed to the position controller to modify this error. The position controller also has a
DOI: 10.9790/1684-1901034657 [Link] 53 | Page
Modeling and Control of X-Shape Quadcopter
conversion from the inertial frame to body frame to make sure that the quadcopter is heading to the right
position. The position controller block is shown in Fig.10.
Fig.10: Block diagram for position controller
VII. Matlab Simulink
After these controllers are built and each controller produces one of the control input signal from U1
through U4, there is a need for subsystem to produce the input (rotors’ relative speed) to the quadcopter
subsystem, thus a motor speed subsystem is built to calculate the speed of each rotor according to equations
from (26) to (29) then create a relative speed subsystem to calculate the relative speed of rotors. Table.1 shows
the input parameters of the quadcopter model.
The Simulink model is shown in Fig. 11. The quadcopter subsystem block contains two subsystems
rotational subsystem which applied the three rotational equations (36) through (38) and the translational
subsystem which applied the three translational equations (44) through (46). The two subsystems are shown in
Fig. 12.
TABLE 1: QUADCOPTER INPUT PARAMETERS
Parameters Description Value Units
Mass moment inertia about body frame's x-axis 0.01
Mass moment inertia about body frame's y-axis 0.01
Mass moment inertia about body frame's z-axis 0.01
m Quadrotor’s mass 0.62 kg
Moment arm 0.187 m
Rotor inertia 6e-5
Aerodynamic force constant 3.13e-5
Aerodynamic moment constant 7.5e-7
Motor circuit resistance 0.6
Motor torque constant 5.2
Aerodynamic translation coefficient
Aerodynamic rotation coefficient
DOI: 10.9790/1684-1901034657 [Link] 54 | Page
Modeling and Control of X-Shape Quadcopter
Fig. 11: Quadcopter MATLAB Simulink Model
Fig. 12: Translational and Rotational subsystems
VIII. Simulink Results
The results shown in TABLE 2 are obtained using the PID tuner toolbox in MATLAB 2018a. The auto tuning
method is used to determine the PID gains, since the result firstly not acceptable, then the values is fine-tuned
manually.
TABLE 2: THE VALUE OF PID TUNED GAINS
Desired Settling Over-shooting Rising Time
value Time [sec] [sec]
Altitude 1m -0.11817 -7.4193e-3 -4.01806e-1 19.00 12.3% 1.98
X-Position 1m 2. 7236e-09 0 1.7165e-05 90.00 5.0% 24.48
Y-Position 1m -1.0440e-08 0 -2.3970e-05 97.00 8.0% 27.72
Heading 2.9623e-3 0 9.24190e-2 9.22 10.0% 1.55
For the PID gains of altitude, position and heading controllers it is specified as acceptable or not
acceptable referring to settling time, rising time and maximum overshoot. The response of each controller;
altitude response, heading response, x-position response and y-position response for the results shown in
TABLE 2 is shown in Fig. 13 to Fig. 16.
DOI: 10.9790/1684-1901034657 [Link] 55 | Page
Modeling and Control of X-Shape Quadcopter
Fig.13: Altitude Response
Fig.14: Heading Response
Fig.15: X-position Response
Fig.16: Y-position Response
IX. Conclusions
The quadrotor is an underactuated system. The mathematical model for an under actuated six-degrees
of freedom (6 DoF) quadcopter is derived based on Newton-Euler method. The model is divided into two
subsystems; rotational subsystem (roll, pitch and yaw) and translational subsystem (altitude, x and y position).
The rotational subsystem is fully actuated whereas the translational subsystem is underactuated. The model is
controlled using PID controller. The PID gains; , , and . are obtained using auto tuning and fined using
manual tuning. The responses for heading, altitude, x-position and y-position show a good behavior and they are
acceptable.
DOI: 10.9790/1684-1901034657 [Link] 56 | Page
Modeling and Control of X-Shape Quadcopter
References
[1]. Muhammad Usman. Quadcopter Modelling and Control with MATLAB/Simulink Implementation. LAB University of Applied
Sciences, 2019
[2]. Arda OzgurKivrak, "Design of Control Systems for a Quadrotor Flight Vehicle equipped with inertial Sensors", pg 4 to 29, Mast ers
Thesis, Atilim University Turkey, 2006. W.-K. Chen, Linear Networks and Systems (Book style). Belmont, CA: Wadsworth, 1993,
pp. 123–135.
[3]. Heba Elkholy, Maki K. Habib. "chapter 1 Introductoin", IGI Global, 2019
[4]. Gergely Regula. Formation control of autonomous aerial vehicles. Phd thesis, Budapest University of Technology and Economics,
2013.
[5]. 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.
Hatem M. Kandeel, et. al. “Modeling and Control of X-Shape Quadcopter.” IOSR Journal of
Mechanical and Civil Engineering (IOSR-JMCE), 19(1), 2022, pp. 46-57.
DOI: 10.9790/1684-1901034657 [Link] 57 | Page
View publication stats