Tengis 2016
Tengis 2016
Tengis 2016
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.
ݔሶ ଵ ൌ ݔଶ 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.
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. ݕൌ ݔܥ
555
IFOST-2016: Robotics and Automation
߱ଵ 20 20 10 40 30
߱ଶ 10 40 20 20 30
߱ଷ 20 20 40 10 30
߱ସ 40 10 20 20 30
ܲௗ ൌ ሺܶ௦ ሾሿሻ
ܭௗ ൌ ܿʹ݀ሺܭሻ (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.
556
IFOST-2016: Robotics and Automation
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