You are on page 1of 5

ISSN (Online) 2321 – 2004

ISSN (Print) 2321 – 5526

INTERNATIONAL JOURNAL OF INNOVATIVE RESEARCH IN ELECTRICAL, ELECTRONICS, INSTRUMENTATION AND CONTROL ENGINEERING
Vol. 2, Issue 1, January 2014

MATLAB Simulation for Control System


V. K. Singh
Assistant Professor, Department of Electronics & Communication, BTKIT Dwarahat, Almora, India

Abstract: This paper presents the MATLAB simulation of control system and discusses open loop and closed loop
properties of control system. In this paper we start with transfer function of control system and their pole zero plots to
frequency response through MATLAB simulation coding. This paper also explains time domain and frequency domain
response of control system to different-different input, frequency domain analysis three techniques like root locus, bode
plot and nyquist plot are discussed. It is thus important to learn first how to generate transfer function and then applied
MATLAB commands to them to applicable in control system analysis, which are the main objectives of this paper. A
secondary objective is to learn the application of some basic MATLAB commands and how to apply them in simple control
system problems.

Keywords: Transfer function, Open & Closed loop, Frequency response, MATLAB, Simulink.

I. INTRODUCTION >>Transfer function:


Control engineering is based on the foundations of
feedback theory and linear system analysis, and it generates 2s+5
the concepts of network theory and communication theory. ---------------
Accordingly, control engineering is not limited to any 2 s^2 + 3 s + 2
engineering discipline but is applicable to aeronautical,
chemical, mechanical, environmental, civil, and electrical
engineering. A control system is an interconnection of III. POLE & ZEROS PLOT
components forming a system configuration that will 𝐬−𝟐
provide a desired system response. The basis for analysis 𝑮 𝒔 =
of a system is the foundation provided by linear system, 𝐬+𝟓
which assumes a cause effect relationship for the MATLAB SCRIPTS
components of a system. Main objective of this paper for G= tf([1 -2],[1 5]);
beginner can easily understand concepts of control system pzmap(G)
with the help of MATLAB simulation.
Pole-Zero Map
1
II. TRANSFER FUNCTION GENERATION
0.8
𝟒𝐬
𝑮 𝒔 = 0.6
𝐬+𝟓 0.4
Imaginary Axis

0.2
MATLAB SCRIPTS
a=[4 0]; % numerator coefficient 0

b=[1 5]; % denominator coefficient -0.2

gf=tf(a,b) -0.4
>>Transfer function: -0.6
4s -0.8
-----
-1
s+5 -5 -4 -3 -2 -1 0 1 2
Real Axis

𝟐𝐬 + 𝟓 Fig. 1. Pole zeros plot for transfer function


𝑮 𝒔 = 𝟐
𝟐𝐬 + 𝟓
𝟐𝐬 + 𝟑𝐬 + 𝟐 𝑮 𝒔 =
𝟐𝐬 𝟐 + 𝟑𝐬 + 𝟐
MATLAB SCRIPTS
a=[2 5]; % numerator coefficient MATLAB SCRIPTS
b=[2 3 2]; % denominator coefficient G= tf([2 5],[2 3 2]);
gf=tf(a,b) pzmap(G)

Copyright to IJIREEICE www.ijireeice.com 760


ISSN (Online) 2321 – 2004
ISSN (Print) 2321 – 5526

INTERNATIONAL JOURNAL OF INNOVATIVE RESEARCH IN ELECTRICAL, ELECTRONICS, INSTRUMENTATION AND CONTROL ENGINEERING
Vol. 2, Issue 1, January 2014

B. Unit Step Response for Second order system


Pole-Zero Map
0.8

0.6
2s+1
0.4
1
5s2+s+2
Out1
0.2 Step Transfer Fcn
Imaginary Axis

-0.2

-0.4
Fig. 5. Simulink model for second order system
-0.6

-0.8
-2.5 -2 -1.5 -1 -0.5 0 0.7

Real Axis
Fig. 2. Pole zeros plot for transfer function 0.6

unit step response for second order system


0.5

IV. UNIT STEP RESPONSE OF SYSTEM


0.4

A. Unit Step Response for First order system


0.3

0.2
4
1 0.1
3s+5
Out 1
Step Transfer Fcn 0
0 2 4 6 8 10 12 14 16 18 20
time (sec)

Fig. 6. Unit step response for second order system

V. P,PI & PID CONTROLLER RESPONSE


Fig. 3. Simulink model for first order system
A. Without Any Controller Response
0.45

0.4 Let the transfer function of system


0.35 𝟏
𝑮 𝒔 =
𝐬𝟐 + 𝟏𝟎𝐬 + 𝟐𝟎
unit step response

0.3

0.25
1
0.2 1
s2 +10s+20
0.15 Out 1
Step Transfer Fcn
0.1

0.05

0
0 2 4 6 8 10
time (sec)
Fig. 7. Simulink model for without any controller
Fig. 4. Unit step response for first order system

Copyright to IJIREEICE www.ijireeice.com 761


ISSN (Online) 2321 – 2004
ISSN (Print) 2321 – 5526

INTERNATIONAL JOURNAL OF INNOVATIVE RESEARCH IN ELECTRICAL, ELECTRONICS, INSTRUMENTATION AND CONTROL ENGINEERING
Vol. 2, Issue 1, January 2014

0.05
C. P-I CONTROLLER RESPONSE (KP =100, KI= 100)
0.045

0.04 -K-
Response without any controller

0.035 KP

0.03
1
1 1
0.025 -K- s2 +10 s+20
s Out 2
Step 1 KI Integrator Transfer Fcn 1
0.02

0.015

0.01
Fig. 11. Simulink model for with PI controller
0.005

0
0 5 10 15 20 25 30 35
time (sec) 1.4
without controller
Fig. 8. Unit step response without any controller with PI controller
1.2 with P (Kp=10) controller
Steady State error (ess) = 0.965
Rise Time ≡ 3 second 1

Unit step response


B. P CONTROLLER RESPONSE (KP =10)
0.8

1 0.6
10 1
s2 +10 s+20
Out 1
Step Gain Transfer Fcn
0.4

0.2

0
Fig. 9. Simulink model for with P controller 0 1 2 3 4 5 6 7 8 9 10
time (sec)

Fig. 12. Unit step response with PI controller


0.35

Steady State error (ess), Rise Time decreased compare to P


0.3 controller.

0.25
D. P-I-D CONTROLLER RESPONSE
P controller response

0.2
(KP =100, KI= 100 Kd = 10)
without controller
0.15 P controller -K-

KP

0.1 1
1 1
-K- s2 +10 s+20
s Out 2
0.05 Step 1 KI Integrator Transfer Fcn 1

10 du /dt
0
0 5 10 15 20 25 30 35 Kd Derivative
time (sec)

Fig. 10. Unit step response with P controller


Fig. 13. Simulink model for with PID controller
Steady State error (ess), Rise Time decreased compare to
without controller.

Copyright to IJIREEICE www.ijireeice.com 762


ISSN (Online) 2321 – 2004
ISSN (Print) 2321 – 5526

INTERNATIONAL JOURNAL OF INNOVATIVE RESEARCH IN ELECTRICAL, ELECTRONICS, INSTRUMENTATION AND CONTROL ENGINEERING
Vol. 2, Issue 1, January 2014

MATLAB SCRIPTS
1.4 G = tf([1],[1 10 20]);
without contoller
PI controller
bode(G)
1.2
P controller >>
PID controller
1
Bode Diagram
Unit step response

-20
0.8
-40

Magnitude (dB)
0.6 -60

-80
0.4
-100

0.2
-120
0
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
-45
time(sec)

Phase (deg)
Fig. 14. Unit step response with PID controller -90

Steady State error (ess), Rise Time decreased compare to -135

PI controller.
-180
-1 0 1 2 3
10 10 10 10 10
Frequency (rad/sec)
VI. FREQUENCY RESPONSE OF TRANSFER
Fig. 16. Bode plot of system
FUNCTION
C. Bode Plot of System
A. Root Locus of System
𝟒𝐬
𝟐𝐬 + 𝟓 𝑮 𝒔 =
𝑮 𝒔 = 𝐬+𝟓
𝟐𝐬 𝟐 + 𝟑𝐬 + 𝟐
MATLAB SCRIPTS
MATLAB SCRIPTS G = tf([4],[1 5]);
G = tf([2 5],[2 3 2]); nyquist (G)
rlocus(G) >>
>>
Nyquist Diagram
Root Locus
2 0.4

1.5
0.3

1
0.2
0.5
Imaginary Axis

0.1
0
Imaginary Axis

-0.5 0

-1
-0.1
-1.5

-0.2
-2
-9 -8 -7 -6 -5 -4 -3 -2 -1 0 1
Real Axis
-0.3
Fig. 15. Root locus of system
-0.4
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8
B. Bode Plot of System
Real Axis

𝟏 Fig. 17. Nyquist plot of system


𝑮 𝒔 =
𝐬𝟐 + 𝟏𝟎𝐬 + 𝟐𝟎

Copyright to IJIREEICE www.ijireeice.com 763


ISSN (Online) 2321 – 2004
ISSN (Print) 2321 – 5526

INTERNATIONAL JOURNAL OF INNOVATIVE RESEARCH IN ELECTRICAL, ELECTRONICS, INSTRUMENTATION AND CONTROL ENGINEERING
Vol. 2, Issue 1, January 2014

VII. CONCLUSION
This paper helps lots of beginner those who are
interested to learn Control system with MATLAB
programming, because this paper start with basic control
system concept programming and goes to various
mathematical operations, frequency domain analysis
programming. Main features of this paper unit step response
of various controller.

REFERENCES
[1] Online resources like www.google.com
[2] Online resources like www.mathwork.com
[3] Online Books, Notes.

Copyright to IJIREEICE www.ijireeice.com 764

You might also like