Tengis 2016

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

IFOST-2016: Robotics and Automation

State feedback control simulation of quadcopter


model
Ts. Tengis* A. Batmunkh+
Department of electronics Department of electronics
School of information and communication technology School of information and communication technology
MUST MUST
Ulaanbaatar, Mongolia Ulaanbaatar, Mongolia
* +
[email protected] [email protected]

Abstract - There are many articles related to four rotor


flying vehicle. Basic approaches of these articles are
mathematical expressions describing dynamic model of the
vehicle and proportional, integral and derivative control for
manipulating the object in 3 dimensional space. This paper
considers simulation of quadcopter control based on full state
feedback technique with linearization in MATLAB
environment and shows the results of the simulations.

Keywords – quadcopter, rotor speed, full state feedback control,


gain matrix

I. INTRODUCTION
During last decade with development of small size and
high performance microcontrollers were developed many
types of unmanned flying vehicles with multiple rotors.
Among them the quadcopter takes important role due to its Fig 1. Forces acting on quadcopter and propeller rotational directions
optimality, wide range of application.

Quadcopter is an air vehicle with four rotors uniformly


located along a circle as shown in Figure 1 [2]. The
machine mass is concentrated in the center of the circle.
Each motor produces some force acting on the vehicle as
lifting thrust. From Figure 1 seen that rotational direction
of two rotors located diagonally is clockwise and other
two’s direction is counterclockwise. Rotating direction of
the rotors not changed in time but their rotating velocity
changed according to the movements in 3D space [1- 5].
Figure 2 shows direction of movement of the quadcopter
controlled by speeds of four rotors which are the control
inputs for the model. Bold circled arrow points the higher
Fig 2. Rotor speed and various movement direction of the vehicle
speed and the thin circled arrow notes lower speed.
A. Example one
Below shown brief description of several papers
describing mathematical models of quadcopter based on In [1] using kinematics were derived state equations (1).
state space approach and must be noted that in each of the Here, ‫ݔ‬ଵ ǡ ‫ݔ‬ଶ are 3D positions and linear velocities, ‫ݔ‬ଷ ǡ ‫ݔ‬ସ
articles have been used PID feedback control. are 3D angles and angular velocities in inertial frame,
ܴǡ ܶ஻ ǡ ‫ܨ‬஽ are, accordingly, rotation matrix, thrust and force
We will focus only on final state equations of the due to friction, ߬ఝ ǡ ߬ఏ ǡ ߬ట are torque and ‫ܫ‬௫ ǡ ‫ܫ‬௬ ǡ ‫ܫ‬௭ are inertia
systems because all equations related to dynamics of along each axis and ߱௫ ǡ ߱௬ ǡ ߱௭ are the angular
quadcopter were derived in below considered papers. velocities of the quadcopter .

978-1-5090-0855-1/16/$31.00 ©2016 IEEE 553


IFOST-2016: Robotics and Automation

‫ݔ‬ሶ ଵ ൌ ‫ݔ‬ଶ roll angle equal to zero in units of degree for the below
Ͳ considered problem. Under these conditions the vehicle
ଵ ଵ
‫ݔ‬ሶ ଶ ൌ ൥ Ͳ ൩ ൅ ܴܶ஻ െ ‫ܨ‬஽ will launch up and will be suspended at heights dictated by
௠ ௠
െ݃
the reference and will track according to the various
ͳ Ͳ െܵఏ ିଵ reference heights in form of step and sine function.
‫ݔ‬ሶ ଷ ൌ ቎Ͳ ‫ܥ‬ఝ ‫ܥ‬ఏ ܵఝ ቏ ‫ݔ‬ସ (1)
Ͳ ܵఝ ‫ܥ‬ఏ ‫ܥ‬ఝ II. STATE SPACE REPRESENTATION OF A QUADCOPTER
߬ఝ Τ‫ܫ‬௫ ൫‫ܫ‬௬ െ ‫ܫ‬௭ ൯߱௬ ߱௭ Τ‫ܫ‬௫ Nowadays, it is well known that one of main
‫ݔ‬ሶ ସ ൌ ቎߬ఏ Τ‫ܫ‬௬ ቏ െ ൦ ሺ‫ܫ‬௭ െ ‫ܫ‬௫ ሻ߱௫ ߱௭ Τ‫ܫ‬௬ ൪ advantages of the state space method is modelling of
߬ట Τ‫ܫ‬௭ ൫‫ܫ‬௫ െ ‫ܫ‬௬ ൯߱௫ ߱௬ Τ‫ܫ‬௭ multiple-input and multiple-output control system. When
the equations of a system under control is highly nonlinear
B. Example two it is necessary to applicate linearization. But linearization
Dynamic behavior of the system expressed in [2] using could be done either slightly or highly depending on limits
Newton-Euler and Euler-Lagrange equations is of state variables. As seen from (1) - (3) the state matrix
contains sine, cosine functions which means the
‫ݔ‬ሷ Ͳ Ͳ ‫ܣ‬ଵ Ͳ Ͳ ‫ݔ‬ሶ mathematical model is nonlinear.
ி
൥‫ݕ‬ሷ ൩ ൌ ൥ Ͳ ൩ ൅ ൥Ͳ൩ െ ൥ Ͳ ‫ܣ‬ଶ Ͳ ൩ ൥‫ݕ‬ሶ ൩

‫ݖ‬ሷ െ݃ ͳ Ͳ Ͳ ‫ܣ‬ଷ ‫ݖ‬ሶ  (2) It is well known that at small angles of about ± 25 °,

ߟሷ ൌ ൫ܹఎିଵ ൯ߥ ൅ ܹఎିଵ ߥሶ the function ܵ݅݊ሺߠሻ  ൎ ߠ and ‫ݏ݋ܥ‬ሺߠሻ  ൎ ͳ. Consequently
ௗ௧
can be achieved that the rotation matrix R can be replaced
where ߟis the matrix of angular accelerations along three by the identity matrix by the aforementioned conditions
axis, ‫ܣ‬ଵ ǡ ‫ܣ‬ଶ ǡ ‫ܣ‬ଷ are drag coefficients, ‫ܨ‬ǡ ݉lifting force and with ߠ ൌ Ͳ and ߮ ൌ Ͳ and the second component of the
mass respectively, ߥ is angular velocities in 3D space and right-hand side of the second equation of (2) is zero
ܹ is transformation matrix from inertial to body frame. because of its small values [4]. It can be seen in (3), each
of the last three equations contains only one component of
neglecting small inertia values.
C. Example three
Further, in [6] the equations of motion which represent Taking in account the drag force coefficients ‫ܣ‬ଵ ǡ ‫ܣ‬ଶ ǡ ‫ܣ‬ଷ
dynamics of quadcopter in the inertial frame using of (2) and considering above conditions and summarizing
Coriolis equation has been derived as (3). all information explained in the previous section the
dynamic equations for the quadcopter can be written in the
Ͳ െ‫ܥ‬ఝ ܵఏ ܵట െ ܵ߮ܵ߰
following main state space form (4).
ሾ‫݌‬ሷ ሿ ൌ ൥ Ͳ ൩ ൅ ቎െ‫ܵ߮ܥ‬ఏ ܵ߰ ൅ ܵ߮‫߰ܥ‬቏ ‫ܨ‬Ȁ݉
݃ െ‫ܥ‬ఝ ‫ܥ‬ఏ ߮ሷ Ͳ Ͳ Ͳ Ͳ ߮ሶ Ͳ
(3) ‫ ۍ‬ሷ ‫ͳۍ ې‬ Ͳ
Ͳ Ͳ ‫ߠ ۍ ې‬ሶ ‫ېͲۍ ې Ͳ ۍ ې‬
Ͳ
߮ሷ ൌ ߬ఝ Τ‫ܫ‬௫ Ͳ Ͳ
‫Ͳ ێ ۑ ߠێ‬ ͳ ‫ۑ ێۑ‬
ߠሷ ൌ ߬ఏ Τ‫ܫ‬௬ ‫߰ێ‬ሷ ‫ ۑ‬ൌ ‫Ͳ ێ‬ Ͳ ͳ Ͳ Ͳ Ͳ ‫߰ێ ۑ‬ሶ‫ ۑͲێ ۑۑ Ͳ ێێ ۑ‬ி
‫ݔ ێ‬ሷ ‫Ͳێ ۑ‬ Ͳ Ͳ‫ܣ‬௫ Ͳ Ͳ ‫ݔ ێ ۑ‬ሶ ‫ ۑ‬െ ‫ ۑ Ͳ ێ‬൅ ‫ ۑۑͲێێ‬௠ (4)
߰ሷ ൌ ߬ట Τ‫ܫ‬௭ ͲͲ ‫ܣ‬௬ Ͳ ‫ݕ ێ ۑ‬ሶ ‫ۑͲێ ۑ Ͳ ێ ۑ‬
‫ݕ ێ‬ሷ ‫Ͳێ ۑ‬ Ͳ
‫ݖ ۏ‬ሷ ‫Ͳۏ ے‬ Ͳ ͲͲ Ͳ ‫ܣ‬௭ ‫ݖ ۏ ے‬ሶ ‫ےͳۏ ے݃ۏ ے‬
where ‫ܨ‬ǡ ݉ are lifting force and mass, ሾ‫݌‬ሷ ሿ ൌ
ሾ‫ݔ‬ሷ ǡ ‫ݕ‬ሷ ǡ ‫ݖ‬ሷ ሿ் is accordingly 3D linear acceleration of the The full state space equations, (5), would be expressed
vehicle, ߬ఝ ǡ ߬ఏ ǡ ߬ట are torques and ‫ܫ‬௫ ǡ ‫ܫ‬௬ ǡ ‫ܫ‬௭ are inertia for the open loop system by decomposing (4). Here, the
along each axis. state variables are ߮ ൌ ‫ݔ‬ଵ ǡ ߠ ൌ ‫ݔ‬ଷ ǡ ߰ ൌ ‫ݔ‬ହ angles in body
frame and ‫ ݔ‬ൌ ‫ ଻ݔ‬ǡ ‫ ݕ‬ൌ ‫ݔ‬ଽ ǡ ‫ ݖ‬ൌ ‫ݔ‬ଵଵ positions in inertial
Each of the above articles uses PID control method due frame. The force, F, consists of some constant and squared
to its simplicity for controlling and tracking of a angular velocities, ሾ߱௞ଶ ሿ, of rotors as described below.
quadcopter.

In contrast with the above considered articles and


basing on the above information and results of the
experiments we set a goal to derive simplified linear
dynamic equations for a quadcopter in the state space form
with state feedback. It was assumed that the reference
input parameters are various heights in meters, pitch and

554
IFOST-2016: Robotics and Automation

‫ݔ‬ሶ ଵ ൌ ‫ݔ‬ଶ this article we tried to consider usage of full state feedback
‫ݔ‬ሶ ଶ ൌ ݈݇ሺ߱ସଶ െ ߱ଶଶ ሻΤ‫ܫ‬௫௫ control and its simulation in MATLAB. As known, the
‫ݔ‬ሶ ଷ ൌ ‫ݔ‬ସ reference input of the closed loop system is the control
‫ݔ‬ሶ ସ ൌ ݈݇ሺ߱ଷଶ െ ߱ଵଶ ሻൗ‫ܫ‬௬௬ input for tracking and control for the quadrotor system.
‫ݔ‬ሶ ହ ൌ ‫଺ݔ‬ Through the reference input will be dictated 3D motion of
‫ݔ‬ሶ ଺ ൌ ܾሺ߱ଵଶ െ ߱ଶଶ ൅ ߱ଷଶ െ ߱ସଶ ሻΤ‫ܫ‬௭௭ sixth degree of freedom in space. Figure 3 illustrates block
‫ݔ‬ሶ ଻ ൌ ‫଼ݔ‬ (5)
scheme of the state feedback. The control input, u, consists
‫ݔ‬ሶ ଼ ൌ ‫ܣ‬௫ ‫ݔ‬ଵ of 4 angular velocities, ሾ߱ሿ, of rotors and it is formed by
‫ݔ‬ሶ ଽ ൌ ‫ݔ‬ଵ଴ the sum of reference input multiplied by the gain matrix G
‫ݔ‬ሶ ଵ଴ ൌ ‫ܣ‬௬ ‫ݔ‬ଷ
and internal states multiplied by the feedback matrix K.
‫ݔ‬ሶ ଵଵ ൌ ‫ݔ‬ଵଶ

‫ݔ‬ሶ ଵଶ ൌ ‫ܣ‬௭ ‫ݔ‬ହ െ ݃ ൅ ሺ߱ଵଶ ൅ ߱ଶଶ ൅ ߱ଷଶ ൅ ߱ସଶ ሻ A. Pole placement

Feedback gain matrix K would be defined after pole
where ߱ଵଶ ǡ ߱ଶଶ ǡ ߱ଷଶ ǡ ߱ସଶ are squares of angular velocities placement procedure of the characteristic equation of the
of rotors which are derived from propeller formula and system. The procedure of pole placement set such that the
produce the corresponding lifting forces, ݈ǡ ݇ǡ ܾǡ ݉ǡ ݃ are rise time, overshoot and settling time are set in the same
radius of quadcopter circle, lift and drag coefficients, mass manner as in [7, 8, 9]. We present, intuitively, the settling
of the vehicle and gravity constant respectively and ‫ܫ‬௫௫ ǡ time for real model of quadcopter about 2 seconds and
‫ܫ‬௬௬ ǡ ‫ܫ‬௭௭ are inertia for each axis. Consequently equation overshoot about no more 4%. Then using the pole
(5) can be rewritten in the standard matrix form of (6) and dominant criterion we can choose the poles which are one
(7) for the open system. of many variants as -2+1.96j; -2-1.96j; two -2.0; two -4.0;
Ͳ ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ
two -5.0; two -8.0; and two -3.0;
‫Ͳ ۍ‬ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ‫ې‬ ‫ې Ͳ ۍ‬
‫Ͳ ێ‬ Ͳ Ͳ ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ‫ۑ‬ ‫ۑ Ͳ ێ‬
‫Ͳ ێ‬
B. Reference input gain
Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ‫ۑ‬ ‫ۑ Ͳ ێ‬
‫Ͳ ێ‬ Ͳ Ͳ Ͳ Ͳ ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ‫ۑ‬ ‫ۑ ێ‬ For the system the state feedback control references are
‫ێ‬ ‫ۑ‬ ‫ۑ Ͳ ێ‬
Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ‫ۑ‬ Ͳ pitch, roll angles equal to zero and the height of the copter
ሾ‫ݔ‬ሶ ሿ ൌ ‫ێ‬ ሾ‫ݔ‬ሿ ൅ ‫ ۑ ێ‬൅
‫Ͳ ێ‬ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ ͳ Ͳ Ͳ Ͳ Ͳ‫ۑ‬ ‫ۑ Ͳ ێ‬
‫ܣێ‬௫ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ‫ۑ‬ ‫ۑ Ͳ ێ‬
is h. Using state feedback law the relationship between
‫Ͳێ‬ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ ͳ Ͳ Ͳ‫ۑ‬ ‫ۑ Ͳ ێ‬ plant input, u, and reference, ref, is written as (8).
‫Ͳێ‬ Ͳ ‫ܣ‬௬ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ‫ۑ‬ ‫ۑ Ͳ ێ‬
‫Ͳێ‬ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ ͳ‫ۑ‬ ‫ۑ Ͳ ێ‬
‫Ͳۏ‬ Ͳ Ͳ Ͳ ‫ܣ‬௭ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ‫ے‬ ‫ۏ‬െ݃‫ے‬ ‫ ݑ‬ൌ ‫ ܩ‬ή ‫ ݂݁ݎ‬െ ‫ݔܭ‬ (8)
Ͳ Ͳ Ͳ Ͳ
‫ Ͳ ۍ‬െ݈݇Ȁ‫ܫ‬ Ͳ ݈݇Ȁ‫ܫ‬௫௫ ‫ې‬
‫ێ‬ ௫௫
‫ۑ‬ Assuming that all state variables are readable
Ͳ Ͳ Ͳ Ͳ
‫ێ‬െ݈݇Ȁ‫ܫ‬ Ͳ ݈݇Ȁ‫ܫ‬௬௬ Ͳ ‫ۑ‬ (measureable) and using state feedback law, (8), and
௬௬
‫ێ‬ ‫ۑ‬
‫ێ‬ Ͳ Ͳ Ͳ Ͳ ‫ۑ‬ allowing the reference input, ‫݂݁ݎ‬, we get the state
‫ܾ ێ‬Ȁ‫ܫ‬௭௭ െܾȀ‫ܫ‬௭௭ ܾȀ‫ܫ‬௭௭ െܾȀ‫ܫ‬௭௭ ‫ ۑ‬ሾ߱ሿ (6)
feedback control system with reference input as shown in
‫ێ‬ Ͳ Ͳ Ͳ Ͳ ‫ۑ‬
‫ێ‬ Ͳ Ͳ Ͳ Ͳ ‫ۑ‬ figure 2. The system on the figure demonstrates
‫ێ‬ Ͳ Ͳ Ͳ Ͳ ‫ۑ‬
‫ێ‬ Ͳ Ͳ Ͳ Ͳ ‫ۑ‬ quadcopter structure with input ‫ ݑ‬ൌ ሾ߱ଵଶ ߱ଶଶ ߱ଷଶ ߱ସଶ ሿ் and
‫ێ‬ Ͳ Ͳ Ͳ Ͳ ‫ۑ‬ reference ‫ ݂݁ݎ‬ൌ ሾ߰௥ ߠ௥ ߮௥ ‫ݔ‬௥ ‫ݕ‬௥ ‫ݖ‬௥ ሿ் . To get full
‫ۏ‬ ݇ ݇ ݇ ݇ ‫ے‬
correspondence between feedback states and reference
ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ input there should be used relation, G, that is expressed as
‫Ͳۍ‬ Ͳ ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ‫ې‬
‫ێ‬ ‫ۑ‬ follows (9).
ሾ‫ݕ‬ሿ ൌ ‫Ͳێ‬ Ͳ Ͳ Ͳ ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ‫ ۑ‬ሾ‫ݔ‬ሿ (7)
‫Ͳێ‬ Ͳ Ͳ Ͳ Ͳ Ͳ ͳ Ͳ Ͳ Ͳ Ͳ Ͳ‫ۑ‬
‫Ͳێ‬ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ ͳ Ͳ Ͳ Ͳ‫ۑ‬ ‫ ܩ‬ൌ െ‫ିܤ‬ଵ ሺ‫ ܣ‬െ ‫ܭܤ‬ሻ‫ି ܥ‬ଵ (9)
‫Ͳۏ‬ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ Ͳ ͳ Ͳ‫ے‬
Inserting (8) into standard state space equations would
where ሾ‫ݔ‬ሿ ൌ ሾ‫ݔ‬ଵ ǡ ‫ݔ‬ଶ ǡ Ǥ Ǥ Ǥ ǡ ‫ݔ‬ଵଶ ሿ் -the internal states such as be created closed loop feedback equations of the control
positions in inertial frame, angles around each axis and system that is follows as (10).
their first derivatives, ሾ߱ሿ ൌ ሾ߱ଵଶ ǡ ߱ଶଶ ǡ ߱ଷଶ ǡ ߱ସଶ ሿ் -squared
angular velocities of rotors and ሾ‫ݕ‬ሿ ൌ ሾ‫ݕ‬ଵ ǡ ‫ݕ‬ଶ ǥ‫ ଺ݕ‬ሿ் -the ‫ݔ‬ሶ ൌ ሺ‫ ܣ‬െ ‫ܭܤ‬ሻ‫ ݔ‬൅ ‫ ܩܤ‬ή ‫݂݁ݎ‬
(10)
outputs. ‫ ݕ‬ൌ ‫ݔܥ‬

III. STATE FEEDBACK CONTROL


As described in introduction, control and tracking of
quadcopter carried out using PID control method, but in

555
IFOST-2016: Robotics and Automation

TABLE I. ROTOR SPEED


Relative speed of rotors
back forward left right up

߱ଵ 20 20 10 40 30
߱ଶ 10 40 20 20 30
߱ଷ 20 20 40 10 30
߱ସ 40 10 20 20 30

Fig 3. State feedback control with reference

IV. DISCRETE TIME STATE SPACE MODEL


In the last section we derived the linearized and simplified
model of the quadcopter dynamics in continuous time
domain. Now it is necessary to discretize the model as if it
was a real model based on digital microcontroller system.
It is known, that discretized version of continuous time
system is derived through the Laplace transform and Z
transform and using the corresponding MATLAB
functions equations (8), (9), (10) are converted into
discrete time form of (11), (12).

ܲௗ ൌ ‡š’ሺܶ௦ ሾ‫݌‬ሿሻ
‫ܭ‬ௗ ൌ ܿʹ݀ሺ‫ܭ‬ሻ (11)
‫ܩ‬ௗ ൌ െ‫ܤ‬ௗିଵ ሺ‫ܣ‬ௗ െ ‫ܤ‬ௗ ‫ܭ‬ௗ ሻ‫ܥ‬ௗିଵ
Fig 4. Results of 3D representation of open loop control in
‫ݔ‬ሾ݊ ൅ ͳሿ ൌ ሺ‫ܣ‬ௗ െ ‫ܤ‬ௗ ‫ܭ‬ௗ ሻ‫ݔ‬ሾ݊ሿ ൅ ‫ܤ‬ௗ ‫ܩ‬ௗ ‫ݑ‬ሾ݊ሿ correspondence with the values in TABLE 1. Shown five directions of
(12)
‫ݕ‬ሾ݊ሿ ൌ ‫ܥ‬ௗ ‫ݔ‬ሾ݊ሿ movement denoted by ‘.’, ‘+’, ‘o’ and square.

where ܲௗ is poles on Z plan, ‫ܣ‬ௗ ǡ ‫ܤ‬ௗ ǡ ‫ܥ‬ௗ ǡ ‫ܭ‬ௗ ǡ ‫ܩ‬ௗ are B. Closed loop control and reference input
discrete time matrices and ‫ݔ‬ሾ݊ሿǡ ‫ݕ‬ሾ݊ሿǡ ‫ݑ‬ሾ݊ሿare values of Below shown part of MATLAB code for the system
the states, outputs and control inputs at ݊ െ ‫ ݄ݐ‬time step illustrated in Figure 3 and the “FOR” statement
correspondingly. demonsrates the program loop of state feedback control.

V. SIMULATION %------------- OS, settling time-------------


Tsetl=2;
The simulation has been done in two steps. First is OS=4;
open loop control and second is closed loop control with zt=-log(OS/100)/sqrt(pi^2+log(OS/100)^2);
reference. In the simulation some constant values as drag wn=Tsetl/zt;
fn=wn/2/pi;
coefficients ‫ܣ‬௫ ൌ ͲǤʹͷǡ ‫ܣ‬௬ ൌ ͲǤʹͷǡ ‫ܣ‬௭ ൌ ͲǤʹͷ and inertia bt=sqrt(1-zt^2);
‫ܫ‬ெ ൌ ͵Ǥ͵ͷ͹‫ ܧ‬െ ͷǡ ܾ ൌ ͳǤͳͶ‫ ܧ‬െ ͹ǡ ݇ ൌ ʹǤͻͺ‫ ܧ‬െ ͸ are wd=wn*bt;
taken from [2]. Values of mass of the copter, m, distance p=[-8 -8 -4 -4 -2 -2 -3 -3 -5 -5-zt*wn+bt*wn*i -zt*wn-bt*wn*i];
dt=0.01;
from center of the copter to any of the rotor center, l, are t=0:dt:10;
could be chosen randomly. The sample time step ‫ݐ‬௦ ൌ hold on
ͲǤͲͳ‫ ܿ݁ݏ‬and duration of simulation time is within 10 for i=1:length(t)
Rt=rotate(x(1,1),x(3,1),x(5,1));
seconds.
[a,b,c]=square(l,x(7,1),x(9,1),x(11,1));
A. Open loop control e=[a;b;c];
ee=Rt*e;
This simulation was done to show effects of rotor % plot3(x(7,1),x(9,1),x(11,1),'r.')
speed control for controlling movement of quadcopter in plot3(e(1,:),e(2,:),e(3,:),'k')
3D space. The numbers shown in TABLE 1 are only % plot(i*dt,x(7,1),i*dt,x(9,1),'-',i*dt,x(11,1))
% plot(i*dt,u(1),'+',i*dt,u(2),'.',i*dt,u(3),'--',i*dt,u(4),'*')
relative speed of each rotors and Figure 4 shows various u=(Gd*ref(:,i)-Kd*x);
positioning of the copter in accordance with the values of x=Ad*x+Bd*u;
the speed of rotors. end

556
IFOST-2016: Robotics and Automation

Here, the square() subroutine draws quadcopter body


square frame, rotate() subroutine translates from body to
inertial frame. The reference signal could be chosen of any
form. As an example, the copter starts at position (0, 0, 0)
and launches up to 80 meters and moves one circle of
motion with radius of 8 meters and remains at position
(5.76, -5.77, 78). Below shown the reference input matrix.
‫ݏ݋ݎ݁ݖ‬ሺ‫݁ݖ݅ݏ‬ሺ‫ݐ‬ሻሻ
‫ۍ‬ ‫ې‬
‫ݏ݋ݎ݁ݖ‬ሺͳǡ ݈݁݊݃‫݄ݐ‬ሺ‫ݐ‬ሻሻ
‫ێ‬ ‫ۑ‬
‫݋ݎ݁ݖ‬ሺͳǡ ݈݁݊݃‫݄ݐ‬ሺ‫ݐ‬ሻሻ ‫ۑ‬
‫ ݂݁ݎ‬ൌ ‫ێ‬
‫ ێ‬ͺ ‫݊݅ݏ כ‬ሺʹ ‫ݐ כ ݅݌ כ‬Ȁܶሻ ‫ۑ‬
‫ ێ‬ͺ ‫ݏ݋ܿ כ‬ሺʹ ‫ݐ כ ݅݌ כ‬Ȁܶሻ ‫ۑ‬
‫ۏ‬ͺͲ ‫ݏ݁݊݋ כ‬ሺͳǡ ݈݁݊݃‫݄ݐ‬ሺ‫ݐ‬ሻሻ‫ے‬

C. Simulation results in graphics Fig 7. Trajectory in 3D space. Result of


plot3(e(1,:),e(2,:),e(3,:),'k') line.
Figures 5, 6 correspondingly show timing diagrams and
Figure 7 shows 3D imagination of trajectory of the plant. CONCLUTION
We tried to show by the simulation quadcopter model
based on state feedback control. The method uses
simplified mathematical model considering several
simplification as linearization, zeroing of some nonlinear
functions. Although the model was highly simplified but
the simulation result shows relatively realistic dynamics.
The linearized model is simulated in open loop and closed
loop modes. During the simulation there was chosen
reference input control as vertical launch, circular motion.
The results are simulated and shown graphically in
MATLAB environments.

REFERENCES
[1] Andrew Gibiansky. Quadcopter Dynamics, Simulation and Control.
Fig 5. Result of Plot(i*dt,x(7,1),i*dt,x(9,1),'-',i*dt,x(11,1)) line. [2] Teppo Luukkonen. Modelling and control of quadcopter. Aalto
Small circle denotes the height or z-position, thin line x-position University. School of science. 2011
end thick line shows y-position. [3] Lucas M. Argentim, Willian C. Rezende, Paulo E. Santos, Renato
A. Aguiar. PID, LQR and LQR-PID on a Quadcopter Platform.
[4] Katherine Karwoski. Quadrocopter Control Design and Flight
Operation. NASA USRP – Internship Final Report. Marshall Space
Flight Center. May 2011.
http://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/20110015820.p
df.
[5] Ȼ.Ⱦɚɝɜɚɫԛɪɷɧ, Ⱥ.Ȼɚɬɦԧɧɯ. ɌɨɝɬɜɨɪɝΟɣ ɫɢɫɬɟɦɢɣɧ
ɬɷɧɰɜɷɪɠɢɥɬ. Ⱦԧɪɜԧɧ ɫɷɧɫɬ. ɆɆɌ2015. ɯ 163-167
[6] Randal W. Beard. Quadrotor Dynamics and Control. Brigham
Young University. 2008.
[7] Abas Ab.Wahab, Rosbi Mamat, Syariful Syafiq Shamsudin. The
effectiveness of pole placement method in control system design for
an helicopter model in hovering flight. International Journal of
Integrated Engineering.
[8] http://homes.esat.kuleuven.be/~maapc/static/files/CACSD/Slides/ch
apter3.pdf. p.108-117
[9] http://ocw.mit.edu/courses/mechanical-engineering/2-004-
dynamics-and-control-ii-spring-2008/lecture-notes/lecture_21.pdf.
p. 1-8
Fig 6. Vertically zoomed in timing diagrams of 4 control inputs.
Result of plot(i*dt,u(1),'+',i*dt,u(2),'.',i*dt,u(3),'--',i*dt,u(4),'*')
line

557

You might also like