Content uploaded by Hithesan Pandian

Author content

All content in this area was uploaded by Hithesan Pandian on Nov 02, 2016

Content may be subject to copyright.

Simulation of the Mathematical Model of a Quad Rotor Control System

using Matlab Simulink

Akhil M.

1

, M. Krishna Anand

2

, Aditya Sreekumar

3

and P.Hithesan

4

1

Aerospace Engineering Department,

Amrita Vishwa Vidyapeetham, Coimbatore, India

2

Electrical and Electronics Engineering Department,

Amrita Vishwa Vidyapeetham, Coimbatore, India

3

Electrical and Electronics Engineering Department,

Amrita Vishwa Vidyapeetham, Coimbatore, India

4

Electrical and Electronics Engineering Department,

Amrita Vishwa Vidyapeetham, Coimbatore, India

1

akhilmulloth@gmail.com；

2

mkanand89@gmail.com

3

aditya.sreekumar@gmail.com;

4

phithesan@gmail.com

Keywords— Quad rotor, Model Based Design, Unmanned Aerial Vehicle

Abstract— Quad rotor vehicles are gaining prominence as Unmanned Aerial Vehicles (UAVs)

owing to their simplicity in construction and ease of maintenance. They are being widely developed

for applications relating to reconnaissance, security, mapping of terrains and buildings, etc. The

control of the quad rotor is a complex problem. As a precursor to developing a model based design,

the simulation of the mathematical model of the quad rotor is implemented. This will facilitate

easier implementation of the model based design using Matlab Simulink©.

N

OMENCLATURE

th

F Force due to i rotor

i

I Moment of inertia about x axis

xx

I M oment of inertia about y axis

yy

I Moment of inertia about z axis

zz

J Rotor Moment of ine

rrtia

th

PWM Pulse Width Modulation signal corresponding to i motor

i

U Net rotor thrust in vertical direction

1*

U Effective force in vertical direction

1

U Component of force

2responsible for pure roll

U Component of force responsible for pure pitch

3

U Component of force responsible for pure yaw

4

a x intercept of force vs pwm graph corresponding t

ith

o i motor

th

b Slope of force vs pwm graph corresponding to i motor

i

b Thrust coefficient of rotor rotating in clock wise direction

cw

b Thrust coefficient of rotor rotating in

aw

anti - clock wise direction

b Thrust coefficient of rotor

d Drag coefficient of rotor rotating in clock wise direction

cw

d Drag coefficient of rotor rotating in anti - clock w

aw

ise direction

e Altitude error

altitude

e Roll error

roll

e Pitch error

pitch

e Yaw error

yaw

g Acceleration due to gravity

l Arm length

k Proportional constant

palt for altitude

Applied Mechanics and Materials Vols. 110-116 (2012) pp 2577-2584

© (2012) Trans Tech Publications, Switzerland

doi:10.4028/www.scientific.net/AMM.110-116.2577

All rights reserved. No part of contents of this paper may be reproduced or transmitted in any form or by any means without the written permission of TTP,

www.ttp.net. (ID: 110.225.102.136-03/10/11,11:42:43)

k Proportional constant for roll

k Proportional constant for pitch

k Proportional constant for yaw

k Integral constant for altitude

i

k Integral constant for roll

i

ki

proll

ppitch

pyaw

alt

roll

pitch Integral constant for pitch

k Integral constant for yaw

i

k Derivative constant for altitude

d

k Derivative constant for roll

d

k Derivative constant for pitch

d

k Derivative c

d

yaw

alt

roll

pitch

yaw onstant for yaw

m Mass

u Actuation signal from altitude controller

1

u Actuation signal from roll controller

2

u Actuation signal from pitch controller

3

u Act

4uation signal from yaw controller

x Acceleration in the x direction

y Acceleration in the y direction

z Acceleration in the z direction

Αngular movementφ

about the x axis, Roll

θ Αngular movement about the y axis, Pitch

ψ Αngular movement about the x axis, Yaw

th

τ Torque due to the i motor

i

Ω RPM of the

i

th

i motor

Introduction

A quad rotor is an aerial vehicle that generates lift with four rotors. It is an inherently unstable

system in the open loop [1]. The motion in x and y directions is coupled with pitch and roll. Thus,

developing a closed loop control for maintaining the stability of the quad rotor is essential. The

modelling of the system is a precursor to implementing the control strategy. The mathematical

model of the system gives the state of the quad rotor in accordance with the physical parameters

such as velocity, force, thrust, etc.

This paper begins with an introduction to quad rotor motion, model based design and the

mathematical modelling. In the next section, the coefficients from the quad rotor structure are

incorporated into the modelling of the quad rotor. The implementation of the modeling using

Simulink is explained in the subsequent section. The results of the modeling and the implications of

it on the control strategy are discussed next, followed by conclusions from the study.

2578 Mechanical and Aerospace Engineering

Quad rotor modeling

The quad rotor motion is controlled by varying the rpm of the motors and not by using any

mechanical actuators. The craft requires active control of six degrees of freedom to fly.

Figure 1. Quad Rotor Layout top view

The quad rotor layout is shown in Figure 1. There are two arms, each having motors at both their

ends. The motors 1 and 3 rotate in the clockwise direction while the motors 2 and 4 rotate in the

anti-clockwise arrangement [2]. The motors at opposite ends of the same arm rotate in the same

direction to prevent torque imbalance during linear flight.

Model based design is used to develop the control system for the quad rotor.

The quad rotor model is simulated using Matlab Simulink, which represents the change in state of

the quad rotor when any disturbance occurs or input is provided.

A. Mathematical Model

The mathematical model of the quad rotor can be represented with the following equations [2], [3],

[4], [5], [6]:-

U1

x = (cos( )sin(

θ)cos(ψ) + sin( )sin(ψ)) (2

.1)

m

φ φ

U1

y = (cos( )sin(θ)sin(ψ) -sin( )cos(ψ)) (

2.2)

m

φ φ

U1

z = -g + (cos( )cos(θ))

(2.3)

m

φ

I - I J l

yy zz r

=

θψ + θΩ + U (2.4)

2

d

I I I

xx xx xx

φ

I - I J l

zz xx r

θ = ψ - Ω + U (2.5)

3

d

I I I

yy yy yy

φ φ

I - I 1

xx yy

ψ = θ + U (2.6)

4

I I

zz yy

φ

B. Assumptions and Decoupling

The quad rotor is assumed to have very low linear and angular velocities when in motion and

assumed not to tilt beyond 15

0

in pitch and roll. The quad rotor is always flying at near hovering

conditions and Coriolis and rotor moment of inertia terms can be neglected [7],[4].

Attitude is controlled by manipulating the four degrees of freedom involved – viz. altitude (z), roll

(

φ

), pitch (

θ

) and yaw (

ψ

). The equations representing the four degrees of freedom are [4], [6]:-

Applied Mechanics and Materials Vols. 110-116 2579

U1

z = -g + (cos( )cos(θ))

(2.7)

m

l

= U

(2.8)

2

Ixx

l

θ = U

3

Iyy

φ

φ

(2.9)

1

ψ = U

(2.10)

4

Iyy

Implementation

The mathematical model of the quad rotor was implemented using Matlab Simulink. Matlab

Function Blocks were used for different modules of the simulation.

A. Reference Model Creator Block (Manual input block):

This block is used to obtain the reference values for rotational parameters - roll, pitch and yaw –

and the translational parameter– z, which are manual inputs in the simulation. The block can be

modified to accept input from an outer control loop for position in future.

B. Controller Block

This block is used to compare the reference values of the rotational parameters - roll, pitch and

yaw - and the translational parameter, z, with the actual values obtained as feedback from the quad

rotor’s mathematical model. The error obtained from the comparison is given to a PID control block

which performs the control action and the necessary control signals are generated. Four PID

controllers control the parameters of the system. The outputs from this block are [4]:-

u

1

=actuation signal from altitude controller

u

2

=actuation signal from roll controller

u

3

=actuation signal from pitch controller

u

4

=actuation signal from yaw controller

The PID controller equations obtained from Matlab Simulink are:-

alt alt alt

roll roll roll

pitch pitch pitch

u (s) 1 s

1

= k + k + k (3.1)

pi d

e s 0.1s +1

altitude

u (s) 1 s

2

= k + k + k (3.2)

pi d

e s 0.1s +1

roll

u (s) 1 s

3

= k + k + k (3.3)

pi d

e s 0.1s +1

pitch

u (s)

4

ey

yaw yaw yaw

1 s

= k + k + k (3.4)

pi d

s 0.1s +1

aw

C. PWM Signal Generation Block

The signals from the controller block are given to the PWM Signal Generation block. This block

generates the PWM signals to be given to the four motors of the quad rotor. The equations used for

this calculation is available in literature and are as follows [4]:-

2580 Mechanical and Aerospace Engineering

1 1 b

F = u + u + u

(3.5)

1 1 3 4

4 2 4d

1 1 b

F = u - u + u

(3.6)

2 1 3 4

4 2 4d

1 1 b

F = u + u - u

(3.7)

3 1 2 4

4 2 4d

1 1 b

F = u - u - u

4 1 2 4

4 2 4d

(3.

8)

The thrust factor for the clockwise and anti-clockwise rotating propellers is different, and the

equations were modified as:-

b

1 1 cw

F = u + u + u (3.9

)

1 1 3 4

4 2 4dcw

b

1 1 aw

F = u - u + u (3.1

0)

2 1 3 4

4 2 4daw

b

1 1 cw

F = u + u - u (3.1

1)

3 1 2 4

4 2 4dcw

b

1 1 aw

F = u - u - u

4 1 2 4

4 2 4daw

(3.12)

The PWM signal to be generated based on the input to the controller [4]:-

1

PWM = (F - a )

(3.13)

1 1 1

b1

1

PWM = (F - a )

(3.14)

2 2 2

b2

1

PWM = (F - a )

(3.15)

3 3 3

b3

1

PWM = (F - a

4 4

b

4

)

(3.16)

4

D. Motor Dynamics Block

This block is used for estimating the thrust generated by the motor for a particular input PWM

signal. The block uses a first order algebraic equation, and converts the input PWM signal to

equivalent force.

The relation between the PWM signal and the thrust developed by the motor is [4]:-

F = b .PWM + a

(3.17)

i i i i

The output from the block represents the resultant force acting on the system resolved into

components responsible for altitude, roll, pitch and yaw. To achieve this the equations are [2],[4],

[5], [8],[6]:-

2 2 2 2

U = b(

Ω + Ω + Ω + Ω ) (3.18

)

1 1 2 3 4

2 2

U = b(-Ω + Ω )

(3.19)

2 2 4

2 2

U = b(-Ω + Ω )

(3.20)

3 1 3

2 2 2 2

U = d(-Ω + Ω - Ω + Ω

4 1 2 3 4

) (3.21)

Applied Mechanics and Materials Vols. 110-116 2581

The equations were modified for implementation as follows.

The force and torque produced by the motors can be related to their RPM,

Ω

as:-

Force due to the i

th

motor

2

= F = b

Ω (3.22)

cw

i i

Torque due to the i

th

motor

2

=

τ = d Ω (3.23)

cw

i i

Where i = 1 or 3

Force due to the i

th

motor

(3.24)

aw

2

= F = b Ω

i i

Torque due to the i

th

motor

(3.25)

aw

2

= τ = d Ω

i i

Where i = 2 or 4

The output from the block is:-

2 2 2 2

U = b (

Ω + Ω ) + b (Ω + Ω ) (3.26)

1 cw 1 3 aw 2 4

*

U = U - mg

(3.27)

1 1

2 2

U = b (-Ω + Ω )

(3.28)

2 aw 2 4

U = b (

3 cw 2 2

-Ω + Ω )

(3.29)

1 3

2 2 2 2

U = -b (

Ω + Ω ) + b (Ω + Ω ) (3.30)

4 cw 1 3 aw 2 4

E. Mathematical Model Block

The forces from the motor dynamics block are the inputs to the mathematical model block. This

block gives the positional parameters of the system. Three of the decoupled transfer functions that

represent roll, pitch and yaw are [4], [6]:-

(3.31)

(s) l

=2

U (s) s I

xx

2

φ

(3.32)

(s) l

=2

U (s) s Iyy

3

θ

(3.33)

(s) 1

=2

U (s) s Izz

4

ψ

A transfer function for the altitude was introduced. This is:-

(3.34)

(s) cos( )cos(θ)

=2

*s m

U (s)

1

z

φ

F. Inertial Measurement Unit Block

The acceleration and torque of the system is interpreted in terms of rotational and translational

parameters using this block. It is used for providing feedback to the controller.

Results

The PID parameters were tuned and the values are shown in Table I. The plots illustrate the ability of

the control system in stabilizing the quad rotor. The four single input single output loops for altitude,

roll, pitch and yaw, work simultaneously to effectively control the quad rotor.

TABLE I. PID

GAIN VALUES

Proportional

Gain (Kp)

Integral Gain

(Ki)

Derivative

Gain (Kd)

ROLL

0.0763 -0.0070 0.0987

PITCH

0.0763 -0.0070 0.0987

YAW

0.0763 -0.0070 0.0987

ALTITUDE

-0.0195 -0.0099 -0.0831

In each of the plots shown, the x axis represents time. The duration of the simulation is 35s.

The plot in Figure 2 represents the reference input given for the altitude and the graph in Figure 3

represents the actual altitude of the system. Here, the y axis represents the altitude of the quad rotor

in metres.

2582 Mechanical and Aerospace Engineering

Figure 2. Reference Altitude

Figure 3. Actual Altitude

The plots in Figures 4 to 9 represent the reference values and the actual values of the rotational

parameters – viz. roll, pitch and yaw. The y axis represents the angle of the respective parameter in

radians.

Figure 4. Reference Roll

Figure 5. Actual Roll

Figure 6. Reference Pitch

Figure 7. Actual Pitch

Figure 8. Reference Yaw

Figure 9. Actual Yaw

Applied Mechanics and Materials Vols. 110-116 2583

Conclusion

The paper describes the simulation developed as a precursor to a model based design of quad rotor

control system. The equations available in the literature that are relevant to the simulation were

examined and appropriate modifications have been made to represent the system behavior better.

The plots in Figures 2 to 9 prove the ability of the control system to stabilize the quad rotor. Future

work involves comparison of various control algorithms for quad rotor control and conversion of the

simulation to a control system to be used on the actual flying quad rotor.

Acknowle

D

gment

The authors would like to thank Dr. J. Chandrasekhar and Prof. Radhamani Pillay, our project guides

from the Aerospace Engineering and Electrical and Electronics Engineering departments

respectively and Mr.Sharath S. Nair for their valuable guidance, and Smruthi Ranjan, Neerav Harsh,

S. Maitreyi, Preethi Kumar, Diwakar Mandal and Rajesh for their assistance with the whole project.

References

[1] Guilherme V. Raffo, Manuel G. Ortega, Francisco R. Rubio, “MPC with Nonlinear H∞

Control for Path Tracking of a Quad-Rotor Helicopter,” Proceedings of the 17

th

World

Congress of The International Federation of Automatic Control, July 6-11, 2008, Seoul, Korea,

http://www.nt.ntnu.no/users/skoge/prost/proceedings/ifac2008/data/papers/2578.pdf

[2] S. Bouabdallah and R. Siegwart, “Backstepping and Sliding-mode Techniques Applied to an

Indoor Micro Quadrotor,” Proceedings of the 2005 IEEE International Conference on Robotics

and Automation, 2005, pp. 2247-2252

[3] M.B. Srikanth, Z.T. Dydek, A.M. Annaswamy, and E. Lavretsky, “A robust environment for

simulation and testing of adaptive control for mini-UAVs,” American Control Conference,

2009. ACC’09., IEEE, 2009, p. 5398–5403

[4] Y. Wu, “Development and Implementation of a Control System for a quadrotor UAV,” MSc.

Thesis, University of Applied Science Ravensburg, Weingarten, Baden-Wurttemberg ,

Germany, March, 2009

[5] Robert Barclay, “A Generic Simulator for Quad-Rotor Unmanned Aerial Vehicles,”

Undergraduate Project Dissertation, University of Sheffield, United Kingdom, 2005

[6] M. Önkol and M. Efe, “Experimental Model Based Attitude Control Algorithms for a

Quadrotor Unmanned Vehicle,” 2

nd

International Symposium on Unmanned Aerial Vehicles,

June 8-10, 2009, Nevada, USA, http://www.onderefe.etu.edu.tr

[7] Tommaso Bresciani, “Modelling, identification and control of a quadrotor helicopter,” Master

Thesis, Lund University, Lund, Sweden, October, 2008 ,

www.roboticsclub.org/redmine/attachments/467/Quadrotor_Bible.pdf

[8] I.D. Cowling, O.A. Yakimenko, J.F. Whidborne, and A.K. Cooke, “A Prototype of an

Autonomous Controller for a Quadrotor UAV,” Proceedings of the European Control

Conference, Kos, Greece, 2007,

http://www2.engr.arizona.edu/~sprinkjm/research/c2wt/uploads/Main/paper1.pdf

[9] Smruti Ranjan Dora, Neerav Harsh, S. Maitreyi, “Design and Implementation of an Indoor

Quad Rotor”, Undergraduate Project Dissertation, Amrita Vishwa Vidyapeetham, Coimbatore,

Tamil Nadu, India, 2010

[10] Preethi Kumar, Diwakar Mandal, “Design and Development of a Compact Integrated

Telecommand and Telemetry System for an Unmanned Aerial Vehicle”, Undergraduate

Project Dissertation, Amrita Vishwa Vidyapeetham, Coimbatore, Tamil Nadu, India, 2010

2584 Mechanical and Aerospace Engineering