Modelling and Control of A Quadrocopter

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

AiMT Advances in Military Technology

Vol. 5, No. 2, December 2010

Modelling and Control of a Quadrocopter


F. Šolc*
Department of Control and Instrumentation, Faculty of Electrical Engineering and
Communication, Brno University of Technology, Brno, Czech Republic

The manuscript was received on 31 May 2010 and was accepted after revision for publication on
14 September 2010.

Abstract:
The paper describes model and development of full control of a quadrotor aerial robot.
The mathematical model of quadrotor is nonlinear system based on Newton law of
motion of rigid body. Control system of the quadrotor is designed with help of state
variable approach and also with help of corresponding physical approach which was
inspired by the former one. The quality of the model and its control is tested by
simulation and on a real flying model as well.

Keywords:
Quadrocopter, quadrotor, control, flying robot, VTOL aircraft, robot

1. Introduction
Quadrocopter or quadrotor is VTOL (Vertical Take-Off and Landing) aerial vehicle
belonging to the class of multirotor helicopters. They differ from the standard
helicopters in using rotors with fixed-pitch blades, thus their rotor pitch does not vary
as the blades rotate. Quadrotor uses 4 rotors, but one can meet constructions with 6 or
8 rotors. Perhaps the first multirotor helicopter with fixed pitch blades rotors appeared
in 1923 (De Bothezat), but technology at that time was not ready for applicable
construction of such a machine. The main problem was inherent instability of the
vehicle and thus pilot workload which was too high. Standard helicopters though more
mechanically complex [1] proved to be more applicable. Later progress in technology
removed the most serious obstacles in controllability of quadrotor type aircraft. Thus
the idea of construction of extremely simple helicopter appeared again, this time in
hobby industry. First commercially available hobbyist quadrotor Draganflyer appeared
around 2000 [2]. Since then the development of light batteries, brushless actuators and
MEMS sensors allowed considerable improvement in construction and control of this

*
Corresponding author: Department of Control and Instrumentation, Faculty of Electrical
Engineering and Communication, Brno University of Technology, Kolejní 4, CZ-612 00 Brno,
Czech Republic, phone:+420 541 141 158, E-mail: [email protected]
30 F. Šolc

type of helicopter. Today‟s quadrocopters are not only radio-controlled toys but they
are robust and simple helicopters that are able to bear nearly two kilograms payload
[3]. They have started to be used as UAV (Unmanned Aerial Vehicles) or aerial robots
mainly for reconnaissance purposes. Military applications are ready to come soon.
Apart from technological issues, quadrocopter modelling and control studies are
still attractive themes for researchers. Lots of control strategies are studied in great
number of articles starting with standard methods using PID control technique [4] up
to complicated nonlinear techniques [5, 6] or techniques of softcomputing [7].
This article describes a simple method of control that can be easily implemented
on microprocessor and it has proved to be applicable for full control of light indoor
quadrotor.

2. Mathematical Model of Quadrocopter


Mathematical model of the quadrotor can be derived according to Newton‟s laws of
motion in the same manner as for ordinary aircraft [8]. Kinematic scheme of the
quadrotor is depicted in Fig. 1.

Fig. 1 Kinematic scheme of the quadrotor

Origin of reference frame (X,Y,Z)r that is firmly coupled with quadrotor is placed
in its centre of gravity. Fig. 1 also shows positive directions of rotation ωi, resp.
positive direction of thrusts Ti, resp. positive direction of reactive torques Mi of
individual propellers.
Newton‟s laws of motion are written in vector form [8],
 d 
 F  dt (mV ) , (1)
0
31 Modelling and Control of a Quadrocopter 31


 dH
 M  dt , (2)
0

where the left-hand sides represent the sum of all forces resp. all moments acting on

the quadrotor‟s body. Subscript 0 denotes time derivative of momentum ( mV ) and

moment of momentum ( H ) with respect to inertial frame.
Orientation of quadrotor reference frame with respect to inertial frame – Earth
(X,Y,Z)0 is depicted in Fig. 2.

Fig. 2 Orientation of frames


Mutual orientation of frames is described by matrix of rotation R0r [9],
cc  sc  css  ss  csc 
R0 r   sc cc  sss  cs  ssc  , (3)
  s cs cc 
where c stands for cos and s stands for sin. Angles Φ, Θ, Ψ are angles of roll, pitch and
yaw.
Equation (1) can be conveniently expressed in quadrotor reference frame
 Fxr  m(vxr  vzr yr  v yr zr ),
 Fyr  m(v yr  vxr zr  v zr xr ), (4)

 Fzr  m(vzr  v yr xr  vxr yr ).


32 F. Šolc

Left-hand sides (4) represent sums of components of all forces acting on quadrotor in
individual axis. vir, ωir are components of velocity and angular velocity in respective
axis i.
Equation (2) can be expressed in quadrotor reference frame as well, but one must
know the distribution of mass in the quadrotor body. One can realistically suppose that
the mass of the quadrotor is distributed with respect to planes (XY)r (XZ)r and (YZ)r
symmetrically. Then the products of inertia can be neglected and (2) can be written as
follows
 M xr  J x xr   yr zr ( J z  J y ),
 M yr  J y yr   zr xr ( J x  J z ), (5)

 M zr  J z zr   xr yr ( J y  J x ).
Left-hand sides (5) represent sums of components of all moments acting on quadrotor
in respective axis i. Ji are moments of inertia with respect to respective axis i. Due to
symmetry of quadrotor one can also assume that Jx = Jy.
Now one must express motion of quadrotor in inertial frame (X,Y,Z)0 , see Fig. 2.
Well known relation between angular velocity of a body in inertial and in aircraft
frame is given by the projection of pitch roll and yaw rate in aircraft frame and vice
versa [8].
   cos    cos ,
yr zr
     sin  tan    cos  tan ,
 (6)
zr yr zr

   sin    cos  .
 yr zr
cos  cos 
Relation between velocity in inertial and aircraft frame can be expressed in the
following form.
v x0  v xr 
 v   R v 
 y0  0 r  yr  . (7)
 v z 0   v zr 
Finally forces and moments acting on quadrotor must be specified, which is the
most complicated problem. Only slow motions of hovering quadrotor will be supposed
further on. Then the main forces acting on quadrotor are thrusts of propellers and
gravity. Thus
 Fxr  mg sin ,
 Fyr  mg cos  sin , (8)

 Fzr  T1  T2  T3  T4  mg cos  cos ,


where Ti stands for thrust of ith propeller.
Main moments are reactive and gyroscopic moments of propellers and moments
due to thrust of propellers.
33 Modelling and Control of a Quadrocopter 33

 M xr   LT2  LT4  J mp yr (1  2  3  4 ),


 M yr  LT1  LT3  J mp xr (1  2  3  4 ), (9)

 M zr  k MT (T1  T2  T3  T4 ).
where L is the length of arm of quadrotor, see Fig. 1. Jmp is moment of inertia of a
motor with propeller and ωi represents angular velocity of individual propellers.
Reactive moments of propellers are assumed to be proportional to thrust of propeller,
thus kMT represents the ratio of reactive moment and thrust of used propellers.
Similarly angular velocities of propellers are assumed to be proportional to thrusts of
propellers, ωi = kωTTi. Equations (4)-(9) are used for simulation of flight of quadrotor
and for testing of control law. They can be transformed to state variable form as
follows,
v xr  v zr yr  v yr  zr  gs,
v yr  v xr  zr  v zr xr  gcs,
T
v zr  v yr  xr  v xr  yr  gcc  ,
m
1  k T 
 xr    yr  zr ( J z  J y )  M x  J mp M z yr ,
Jx  k MT 
1  k T 
 yr    xr  zr ( J x  J z )  M y  J mp M z xr ,
Jy  k MT 
Mz
 zr  ,
Jz
   c   s,
 yr zr
     s tan    c tan ,
 xr yr zr

   s   c ,
yr zr
c c
x  ccv xr  ( sc  css )v yr  ( ss  csc )v zr ,
y  scv xr  (cc  sss )v yr  (cs  ssc )v zr ,
z   sv xr  csv yr  ccv zr , (10)
T
where [x,y,z] represents position of quadrotor in inertial frame (X,Y,Z)0.
In (10) the natural manipulated variables (thrusts of propellers) are replaced by
new ones (total thrust and moments). These variables are related by the following one -
to-one relation
 T   1 1 1 1  T1 
M   0 L 0 L  T 
 x   2  . (11)
M y   L 0 L 0  T3 
    
 M z   k MT k MT k MT k MT  T4 
34 F. Šolc

3. Control Law Design


The quadrotor is supposed to be used for reconnaissance missions mainly, then its
prevailing state will be hovering in equilibrium or slow flight. All state variables are
equal to zero during hovering in equilibrium. Substituting these zero values in (10)
yields equilibrium values of manipulated variables
T0  mg ,
(12)
M x 0  M y 0  M z 0  0.
Now one can linearize state equations (10) assuming small values of state variables
and small differences of manipulated variables from equilibrium. Using standard
linearization technique [10] yields standard equation of linear system
x  Ax  Bu , (13)
where

x  v xr v yr v zr  xr  yr  zr    x y 
z T,
u  T M x M y 
M z T ,
 A11 A12 A14 
A13  B11 B12 
A A22 A23
A24   B B22 
A   21 , B   21 , (14)
 A31 A32 A34 
A33 B31 B32 
   
 A41 A42 A43
A44  B41 B42 
0 1 0   0  1 / J x 0 0 
A32    
 1 0 0 , A41  I , B11   0  , B22   0  1/ J y 0  .
0 0 1  1 / m  0 0 1 / J z 
Other matrices are (33) Aij = 0, (31) Bi1 = 0, (33) Bi2 = 0.
Of course linear model is valid for low velocities and for small angles of
orientation of quadrotor.
System (13) proved to be controllable by full state variable feedback
u  Kx . (15)
Linearized state variable equations reveal simple structure of controlled plant that is
displayed in Fig. 3. The structure shows also the fact that movement in water level
plane is possible only because of pitching and banking of quadrotor. Because of small
values of angles Θ, Ф and Ψ, there is small difference between corresponding
velocities in quadrotor and fixed inertial frame.
Motion of controlled plant in altitude, rolling, pitching and yawing is completely
decoupled and can be easily controlled; e.g. for pitch angle the simplified model of
motion is
1
  M y . (16)
Jy
This model can be controlled by simple PD controller in form
M  J ( K   K   K  ) ,
y y y   r (17)
where Θr is the reference value.
35 Modelling and Control of a Quadrocopter 35

Fig. 3 Structure of linearized controlled plant


Combination of control law (17) with model (16) yields equation that describes
pitch motion of quadrotor together with controller
  Ky  K   K r , (18)
Comparison of (18) with standard equation of second-order linear system (19)
  2 
   2   2 , (19)
n n n r

yields rule for choice of controller parameters.


K   n2 Ky  2 K  . (20)
The higher ωn, the faster will transient response of complete system be. ξ ≥ 0.5 gives
reasonable damping of the response. Because ωyr ≈ dΘ/dt one can use as velocity
feedback signal ωyr that can be easily measured by MEMS rate gyro. Control law (17)
will be then
M y  J y ( Ky yr  K  Kr ) . (21)

Signal Θ can be measured by MEMS accelerometer (inclinometer).


Controllers of other angles of orientation and controller of altitude can be
designed in the same way. Thus control law of controller – stabilizer of altitude and
orientation only, will be
36 F. Šolc

M x  J x ( K x xr  K    K   r ) ,
M y  J y ( K y yr  K    K   r ) ,
(22)
M z  J z ( K z zr  K    K  r ) ,
T  mg  m( K vz z  K z z  K z z r ) ,
where usually will be Θr = Фr = Ψ = 0 and zr = const.
Control of position (x and y) can be done via angles of pitch and roll. Achieving
fast response of control of these values one can suppose that at any time it will be
valid Θ(t) = Θr (t) and Ф(t) = Фr(t). Thus one can write (see Fig. 3.):
x   g r ,
(23)
y  g r .
Similarly as in previous case, the controller of x and y can be designed in form
1
r  ( K vx x  K x x  K x xr ) ,
g
(24)
1
 r  ( K vy y  K y y  K y y r ) .
g
These control laws result in equations that describe x, y motion of quadrotor together
with controller
x  K vx x  K x x  K x xr ,
(25)
y  K vy y  K y y  K y yr ,
where xr and yr are reference values of position. Parameters of the controller can be
calculated in the same way as in the previous case. Thus law of full control of
quadrotor is given by equations (22) and (25).
The full control of quadrotor has been simulated with the following parameters
m = 0.8 kg, Jx = Jy = 1.8  10–3 kgm2, Jz = 1.5  10–3 kgm2, L = 0.2 m, k = 0.1 m.
Parameters for the controller of orientation and altitude were ωn = 10 s–1, ξ = 1.
Parameters for the controller of position x, y were ωn = 1 s–1, ξ = 1. Maximum possible
thrust of each propeller is 3.9 N.
Fig. 4 shows motion of quadrotor and forces of its propellers in response for
ramp input of reference xr. One can clearly see that the forward motion of the
quadrotor is due to pitch. One can also observe how pitch was attained by change of
thrust of individual propellers.

4. Conclusion
This article describes a relatively simple method of control of highly unstable
helicopter – quadrotor. The main advantage of the proposed control law is in its clear
physical interpretation that allows final tuning of control parameters during flight. The
control law has been implemented in radio controlled micro quadrotor of approximate
weight and size mentioned above. The proposed control law requires fast response of
actuators (thrust) to actuating variable and fast processing of control algorithm. In our
implementation there have been used fast and light brushless motors LAU 20-1300
(mass approx. 0.025 kg and power approx. 40 W) [11]. The control law was
implemented in microcontroller ATMEGA644P. Because of the problems with sensors
37 Modelling and Control of a Quadrocopter 37

of positions x, y, and z, only the stabilizer of orientation Θ, Ф ,Ψ has been


implemented. The control of position is still performed manually by human operator.
We suppose to use the quadrotor as a flying robot in a swarm of mobile
reconnaissance robots.

Angle of pitch
5
[deg]

-5
0 1 2 3 4 5 6 7 8 9 10
Position
6
Xr
4 X

0
0 1 2 3 4 5 6 7 8 9 10
Thrust of propellers
1.97
T1
T2
1.965
[N]

1.96
0 1 2 3 4 5 6 7 8 9 10
Thrust of propellers
1.97
T3
T4
1.965
[N]

1.96
0 1 2 3 4 5 6 7 8 9 10
[s]

Fig. 4 Results of simulation

References
[1] WAGTENDONK, WJ. Principles of Helicopter Flight. Newcastle, WA :
Aviation Supplies & Academics, 2006. 304 p. ISBN 1-56027-649-5.
[2] Mc KERROW, P. Modelling the Draganflyer four-rotor helicopter. In
Proceedings of the 2004 International Conference on Robotics & Automation,
New Orleans, LA : IEEE, 2004. p. 3596-3600.
[3] POUNDS, P., MAHONY, R. and CORKE, P. Modelling and Control of a Quad-
Rotor Robot. In Proceedings of the Australasian Conference on Robotics and
Automation, Auckland, New Zealand : Australian Robotics & Automation
Association, 2006, p. 501-510.
[4] BOUABDALLAH, S., NOTH, A. and SIEGWART, R. PID vs LQ Control
Techniques Applied to an Indoor Micro Quadrotor. In Proceedings of 2004
IEEE/RSJ International Conference on Intelligent Robots and Systems, Sendai,
Japan : IEEE, 2004, p. 2451-2456.
38 F. Šolc

[5] BOUABDALLAH, S. and SIEGWART, R. Backstepping and Sliding-mode


Techniques Applied to an Indoor Micro Quadrotor. In Proceedings of the 2005
IEEE International Conference on Robotics and Automation, Barcelona, Spain :
IEEE, 2005, p. 2247-2252.
[6] BOUABDALLAH, S. and SIEGWART, R. Full Control of Quadrotor. In
Proceedings of the 2007 IEEE/RSJ International Conference on Intelligent
Robots and Systems, San Diego, CA : IEEE, 2007, p. 153-158.
[7] DUNFIED, J., TARBOUCHI, M. and LABONTE, G. Neural Network Based
Control of a Four Rotor Helicopter. In 2004 IEEE International Conference on
Industrial Technology (ICIT), Hammamet, Tunisia : IEEE, 2004, p. 1543-1548.
[8] BLAKELOCK, JH. Automatic Control of Aircraft and Missiles. New York :
Wiley, 1991. 672 p. ISBN 978-0-471-50651-5.
[9] SPONG, M. and VIDYASAGAR, M. Robot Dynamics and Control. New York :
Wiley, 1989. 352 p. ISBN: 978-0-471-61243-8.
[10] FRANKLIN, GF., POWELL, JD. and EMAMI-NAEINI, A. Feedback Control of
Dynamic Systems. New Yok : Addison-Wesley, 1994. 777 p. ISBN: 0-201-
52747-2.
[11] LAheli [on line]. Jeníkov 145, Czech Republic : E-shop. [cited 2010-09-27].
Available from: <http://www.laheli.com>

Acknowledgement
The work presented in this paper has been supported by the by the Ministry of
Education of the Czech Republic (research project No. 1M0567).

You might also like