You are on page 1of 20

1

CHITTAGONG UNIVERSITY OF ENGINEERING AND TECHNOLOGY


DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING
CHITTAGONG-4349, BANGLADESH.
COURSE NO.: EEE 364
CONTROL SYSTEM LABORATORY

Experiment No. 01
Introduction to System Representation and Observation Using MATLAB.

OBJECTIVE:
The objectives of the experiment are –
(1) To obtain a transfer function for a system using MATLAB.
(2) To observe the impulse and step response for systems.
(3) To convert a transfer function to state space system and vice versa.
TOOLS:
• MATLAB
THEORY:
The transfer function is the ratio of the output Laplace Transform to the input Laplace
Transform assuming zero initial conditions. Many important characteristics of dynamic or
control systems can be determined from the transfer function. Zeros are the value(s) for “s”
where the numerator of the transfer function equals zero. Poles are the value(s) for “s” where
the denominator of the transfer function equals zero. Mathematically,
Sn +an−1 Sn−1 +⋯………………+a1 s+a0 K(s−z1)(s−z2)……….(s−zn)
T(s)= =
Sm +bm−1 Sm−1+⋯………………+b1 s+b0 (s−p1)(s−p2)……….(s−pn)
A state space representation is a mathematical model of a physical system as a set of input,
output and state variables related by first-order differential equations. The state space
representation (also known as the "time-domain approach") provides a convenient and
compact way to model and analyze systems with multiple inputs and outputs.
The input state equation is given by, [𝒙]̇= [A][x] + [B][u]
The output equation is written as, [y]=[C][x] +[D][u]

MATLAB CODES:
Code to obtain transfer function from given poles and zeroes:
clear all;
clc;
close all;
z=[-1];
p=[-2 -3];
k=2;
[num,den]=zp2tf(z,p,k);
sys=tf(num,den);
step(sys);
figure;
impulse(sys);

Prepared By: Md. Shamsul Arifin, EEE, CUET


2

Code to convert a transfer function to state space representation:


clear all;
clc;
close all;
num=24;
den=[1 2 26 24];
T=tf(num,den);
step (T);
figure;
impulse (T);
figure;
[A,B,C,D]=tf2ss(num,den);
T1=ss(A,B,C,D);
step (T1);
figure;
impulse (T1);

Code to convert a state space representation to transfer function:


clear all;
clc;
close all;
A=[-2 -26 -24;1 0 0;0 1 0];
B=[1 0 0]';
C=[0 0 24];
D=0;
sys=ss(A,B,C,D);
step (sys);
figure;
[num,den]=ss2tf(A,B,C,D);
sys1=tf(num,den);
step (sys1);
figure;
impulse (sys1);

PROCEDURE:
1. Open MATLAB and you will find the window. Then click on “New Script” as indicated
in fig. 1. Then an editor window will come.

Fig. 1 MATLAB Command Window.

Prepared By: Md. Shamsul Arifin, EEE, CUET


3

Fig. 2 MATLAB Editor.


2. Write MATLAB program in the MATLAB editor window.
3. Then save and run the program. Modify the program if it is necessary to perform lab-
work given by the instructor.
4. Observe the results and responses of different system.
5. Now find those outputs theoretically for the given transfer function and compare it with
the output obtained practically.

EXERCISE:
1. Obtain transfer function, impulse and step responses for a system having poles of -3, -5, -9
and zeroes of -7 and gain 19.
2. Obtain transfer function, impulse and step responses for the following systems:
(a) (b)

3. Obtain the state space representation, impulse and step responses for the following
systems:
(a) (b)

REPORT:
Submit all the lab works and exercises with necessary codes, results and MATLAB plots.
Report must be submitted into prescribed format.

Prepared By: Md. Shamsul Arifin, EEE, CUET


4

CHITTAGONG UNIVERSITY OF ENGINEERING AND TECHNOLOGY


DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING
CHITTAGONG-4349, BANGLADESH.
COURSE NO.: EEE 364
CONTROL SYSTEM LABORATORY

Experiment No. 02
Introduction to Second Order Systems and Feedback Systems

OBJECTIVE:
The objectives of the experiment are –
(1) To observe the impulse and step response for different second order systems.
(2) To observe the impulse and step response for systems with feedbacks.
TOOLS:
• MATLAB
THEORY:
Types of second order systems:
b
A second order system is represented by T(s) = S2 +aS+b .There are four types of systems:

Fig. 1 Types of second order systems.

Prepared By: Md. Shamsul Arifin, EEE, CUET


5

System with feedback:

A system of having transfer function G(s) with feedback function H(s) is represented by:

G(s)
T(s) =
1±G(s)H(s)

Fig. 2 Systems with feedback.

MATLAB CODES:
Code to observe the step response for different second order systems:
clear all;
clc;
close all;

%%%Overdamped%%%
num1=9;
den1=[1 9 9];
T1=tf(num1,den1);
step (T1);
figure;

%%%Underdamped%%%
num2=9;
den2=[1 2 9];
T2=tf(num2,den2);
step (T2);
figure;

%%%Undamped%%%
num3=9;
den3=[1 0 9];
T3=tf(num3,den3);
step (T3);
xlim([0 7]);
figure;

%%%Critically damped%%%
num4=9;
den4=[1 6 9];

Prepared By: Md. Shamsul Arifin, EEE, CUET


6

T4=tf(num4,den4);
step (T4);

Code to observe the step response for systems with and without feedback:
clear all;
clc;
close all;
G=tf([9],[1 2 9]);
H=tf([1],[1 2]);
sys1=feedback(G,H);
step (sys1);
figure;
sys2=tf([1 2],[1 4 13 27]);
step(sys2);
figure;
sys3=G/(1+G*H);
step (sys3);

PROCEDURE:
6. Open MATLAB and you will find the window. Then click on “New Script” as indicated
in fig. 1. Then an editor window will come.

Fig. 3 MATLAB Command Window.

Prepared By: Md. Shamsul Arifin, EEE, CUET


7

Fig. 4 MATLAB Editor.


7. Write MATLAB program in the MATLAB editor window.
8. Then save and run the program. Modify the program if it is necessary to perform lab-
work given by the instructor.
9. Observe the results and responses of different system.
10. Now find those outputs theoretically for the given transfer function and compare it with
the output obtained practically.
EXERCISE:
1. Obtain step response for the following systems and comment which type of second order
systems they are.

2.Obtain the transfer function and step responses for the following system:
(a) (b)

REPORT:
Submit all the lab works and exercises with necessary codes, results and MATLAB plots.
Report must be submitted into prescribed format.

Prepared By: Md. Shamsul Arifin, EEE, CUET


8

CHITTAGONG UNIVERSITY OF ENGINEERING AND TECHNOLOGY


DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING
CHITTAGONG-4349, BANGLADESH.
COURSE NO.: EEE 364
CONTROL SYSTEM LABORATORY

Experiment No. 03
Introduction to System Representation and Observation Using MATLAB-
Simulink.
OBJECTIVE:
The objectives of the experiment are –
(1) To draw the systems and observe the impulse, step and ramp response for systems.
TOOLS:
• MATLAB
• MATLAB- Simulink
THEORY:
Simulink
Simulink is an extended application to MATLAB. In Simulink, we can construct block diagram
models of dynamic systems instead of text code. It is easy to model complex nonlinear systems.
Simulink can model both continuous and discrete-time components.
Simulink Introduction
Double click the MATLAB R2017a icon on the desktop. The MATLAB window should appear
as shown in Fig. 1. As shown in Fig. 2, click on the Simulink icon on the MATLAB menu bar,
or run Simulink command on the MATLAB command window, and select Blank Model to
open a new Simulink window. As shown in Fig. 3, click Library Browser icon on the Simulink
window and select the libraries of Simulink blocks that are available for constructing a new
Simulink model. For opening an existing model. As shown in Fig. 3, click Library Browser
icon on the Simulink window and select the libraries of Simulink Blocks that are available for
constructing a new Simulink model.

Fig. 1: MATLAB window layout.

Prepared By: Md. Shamsul Arifin, EEE, CUET


9

Fig. 2: Simulink starting window diagrams


(a) New Model (b) Simulink Blocks in Library Browser.

Fig. 3: Simulink new model window diagrams.

Build a Second Order System Model and Simulate the Step Response
Double click on the transfer function block and the window will open as in Fig. 4. Enter the
coefficient values for the system transfer function given.
9
T(s) =
S2 +2S+9

Fig. 4 Building transfer function and parameter settings.

Prepared By: Md. Shamsul Arifin, EEE, CUET


10

Fig. 5 Solver settings in Simulink


Run Simulation
First open the scope window by double-clicking on it. Then go to Simulation Start. When the
simulation has completed you will see the output on the scope. You should see something
similar to Fig. 6.

Fig. 6 Transfer function plot in oscilloscope.


LAB WORKS:
1. Draw the following systems and obtain the impulse, step and ramp response for the
following systems:

Fig. 7 Systems for lab exercise 1.

Prepared By: Md. Shamsul Arifin, EEE, CUET


11

The step, impulse and ramp responses should be like the following figure.

Fig. 8 Responses for the systems for lab exercise 1.


2. Draw the following state space-based systems and obtain the impulse, step and ramp
response for the following system:

Fig. 9 Systems for lab exercise 2.


3. Draw the following state space-based systems and obtain the impulse, step and ramp
response for the following systems:

Fig. 10 Systems for lab exercise 3

Prepared By: Md. Shamsul Arifin, EEE, CUET


12

PROCEDURE:
11. Start MATLAB-Simulink and open a blank model as per given instruction.
12. Draw the block as shown in exercise below. Then save and run the model. Modify the
model if it is necessary to perform lab-work given by the instructor.
13. Observe the results and responses of different system and draw a conclusion on it.

EXERCISE:
1. Draw the following systems and obtain the impulse, step and ramp response for the following
systems and comment which type of second order systems they are.

2. Draw the following state space-based systems and obtain the impulse, step and ramp
response for the following systems
(a) (b)

25
3.Draw a system having forward path transfer function of T(s) = and the feedback
S2 +5S+25
path has (i)the gain of unity (negative) (ii) the gain of unity (positive) and (iii) transfer function
1
of T(s) =
S+5

REPORT:
Submit all the lab works and exercises (Simulink Model Files) with MATLAB plots. Report
must be submitted into prescribed format.

Prepared By: Md. Shamsul Arifin, EEE, CUET


13

CHITTAGONG UNIVERSITY OF ENGINEERING AND TECHNOLOGY


DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING
CHITTAGONG-4349, BANGLADESH.
COURSE NO.: EEE 364
CONTROL SYSTEM LABORATORY

Experiment No. 04
Develop Models for RC, RL, RLC Series Circuits & DC Motor and
Observe Their Responses Using MATLAB/MATLAB-Simulink

OBJECTIVE:
The objectives of the experiment are –
(1) To develop models for RC, RL, RLC series circuits and observe their responses.
(2) To develop a model for DC motor and observe the responses.
TOOLS:
• MATLAB
• MATLAB- Simulink
THEORY:
Transfer Function of a RC series circuit:

Fig. 1 The circuit diagram of a RC series circuit

The transfer function of a RC series circuit can be obtained by


Vo 1/(sC) 1/RC
= 1 =
Vi R+( ) s+1/RC
sC
Transfer Function of a RLC series circuit:

Fig. 2 The circuit diagram of a RLC series circuit


The transfer function of a RLC series circuit can be obtained by
Vo 1/sC 1/LC
= =
Vi R+sL+1/sC s2 +(R/L)s+1/LC

Prepared By: Md. Shamsul Arifin, EEE, CUET


14

Transfer Function of a DC Motor:


A DC motor can be modelled by the following equations:

Fig. 3 Equivalent circuit of a DC Motor.

We can construct the following model using equation 1.

Fig. 4 Simulink model for a DC motor.


MATLAB CODES:
Code for RC series circuit:
clear all;
clc;
close all;
C=10*10^(-6);
R=100;
a=1/(R*C);
sys=tf([a],[1 a]);
step(sys);
Code for RLC series circuit:
clear all;
clc;
close all;
L=10*10^(-3);
C=10*10^(-6);
R=10;
a=R/L;
b=1/(L*C);
sys=tf([b],[1 a b]);
step(sys);

Prepared By: Md. Shamsul Arifin, EEE, CUET


15

LAB WORKS:
1. Develop a transfer function (Vo/Vi) model for the RC series circuit in both in MATLAB
and MATLAB-Simulink and observe the step response for R=10 Ω and c=10μF.
2. Develop a transfer function (Vo/Vi) model for the RLC series circuit in both in MATLAB
and MATLAB-Simulink and observe the step response for R=10 Ω, L=10mH and c=10μF.
3. Draw the model for DC motor in MATLAB-Simulink and observe the response of speed
for impulse, step and ramp type Ea. Use parameters, Ra=0.1Ω, Kt=0.5, Kb=2, La=0.001,
Jm=12, Dm=10. Step response of the DC motor is more or less like the fig 5.

Fig. 5 Responses for the systems for lab exercise.


PROCEDURE:
14. Start MATLAB/MATLAB-Simulink and open a blank model as per given instruction.
15. Draw the block or write codes as shown in exercise below. Then save and run the model.
Modify the model if it is necessary to perform lab-work given by the instructor.
16. Observe the results and responses of different system and draw a conclusion on it.
EXERCISE:
1. Observe the step response for RC series circuit only in MATLAB-Simulink R=100 Ω and
c=100μF.
2. Observe the step response for RLC series circuit only in MATLAB-Simulink R=100Ω,
L=1mH and c=100μF.
3. Develop a transfer function (Vo/Vi) for the following RL series circuit in both in MATLAB
and MATLAB-Simulink and observe the step response for R=10 Ω and L=100mH.

Fig. 6 The circuit diagram of a RL series circuit

4. Observe the response of angular position for the DC motor for impulse, step and ramp type
Ea (only in MATLAB-Simulink). Use parameters, Ra=0.1Ω, Kt=0.5, Kb=2, La=0.001,
Jm=12, Dm=10. Add or modify any part of the model if necessary. Comment about the
observed output. [Hints:

REPORT:
Submit all the lab works and exercises (MATLAB codes and Simulink Model Files) with
MATLAB plots. Report must be submitted into prescribed format.

Prepared By: Md. Shamsul Arifin, EEE, CUET


16

CHITTAGONG UNIVERSITY OF ENGINEERING AND TECHNOLOGY


DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING
CHITTAGONG-4349, BANGLADESH.
COURSE NO.: EEE 364
CONTROL SYSTEM LABORATORY

Experiment No. 05
Poles and Zeros Representation in “S” Plane and Draw the Root Locus for
a System Using MATLAB.

OBJECTIVE:
The objectives of the experiment are –
(1) To represent the poles and zeros in “s” plane for a system.
(2) To draw the root locus for a system.

TOOLS:
• MATLAB

THEORY:
Poles and zeros representation in “s” plane:
Fig. 1 represents the poles and zeros in “s” plane for a system.

Fig.1 (a) The system (b) poles and zeros representations in “s” plane for the system.

Root Locus:
The root locus gives the closed-loop pole trajectories as a function of the gain k (assuming
negative feedback). Root loci are used to study the effects of varying feedback gains on
closed-loop pole locations. In turn, these locations provide indirect information on the time
and frequency responses.
If sys has transfer function G(s)= n(s)/d(s) the closed-loop poles are the roots of d(s)+kn(s)=0

Prepared By: Md. Shamsul Arifin, EEE, CUET


17

Fig. 2 A system having unity feedback gain.

The properties of root locus:


1.The number of branches of the root locus equals the number of closed-loop poles.
2.The root locus is symmetrical about the real axis.
3.On the real axis, for K > 0, the root locus exists to the left of an odd number of real axis,
finite open-loop poles and/or finite open-loop zeros.
4.The root locus begins at the finite and infinite poles of G(s)H(s) and ends at the finite and
infinite zeros of G(s)H(s).
5.The root locus approaches straight lines as asymptotes as the locus approaches infinity.
Further, the equation of the asymptotes is given by the real-axis intercept, σa and angle, θa as
follows:

An Example:
Fig. 3 represents the root locus for a system as shown in that figure.

Fig. 3 The root locus for a system

Prepared By: Md. Shamsul Arifin, EEE, CUET


18

MATLAB CODES:
Code to represent the poles and zeros in “s” Code to draw the root locus:
plane: clear all;
clear all; clc;
clc; close all;
close all; num=poly([-3 -4]);
p = [1 3 2]; den=poly([-1 -2]);
r = roots(p) sys=tf(num,den);
num=poly([-3 -4]); rlocus(sys);
den=poly([-1 -2]);
sys=tf(num,den);
pzmap(sys);

LAB WORKS:
1. Plot the poles and zeros in “s” map and draw the root locus for the following unity
feedback systems having transfer function of:
(a)

(b)

(c)

PROCEDURE:
17. Open MATLAB and click on “New Script”. Then an editor window will come.
18. Write MATLAB program in the MATLAB editor window.
19. Then save and run the program. Modify the program if it is necessary to perform lab-
work given by the instructor.
20. Observe the results and responses of different system.
21. Now find those outputs theoretically for the given transfer function and compare it with
the output obtained practically.

EXERCISE:
1. Plot the poles and zeros in “s” map and draw the root locus for the following unity feedback
systems having transfer function of:
(a)

(b)

(c)

REPORT:
Submit all the lab works and exercises (MATLAB codes) with MATLAB plots. Report
must be submitted into prescribed format.

Prepared By: Md. Shamsul Arifin, EEE, CUET


19

CHITTAGONG UNIVERSITY OF ENGINEERING AND TECHNOLOGY


DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING
CHITTAGONG-4349, BANGLADESH.
COURSE NO.: EEE 364
CONTROL SYSTEM LABORATORY

Experiment No. 06
Bode plot for a System and Determine Phase Margin, Gain Margin and
Crossover Frequencies
OBJECTIVE:
The objectives of the experiment are –
(1) To observe the bode plot for a system.
(2) To determine Phase margin, Gain margin and Crossover frequencies for a system.

TOOLS:
• MATLAB
THEORY:
Bode Plot:
The log-magnitude and phase frequency response curves as functions of log ɷ are called Bode plots
or Bode diagrams. Sketching Bode plots can be simplified because they can be approximated as a
sequence of straight lines. Straight-line approximations simplify the evaluation of the magnitude and
phase frequency response.
Consider the following transfer function:

So,

Phase margin, Gain margins and crossover frequencies:


Gain Margin: gain perturbation that makes the system marginally stable.
Phase Margin: negative phase perturbation that makes the system marginally stable.
Phase margin, gain margin and crossover frequencies are explained in fig. 1.

Prepared By: Md. Shamsul Arifin, EEE, CUET


20

Fig. 1 Phase margin, Gain margin and Crossover frequencies.


MATLAB CODES:
clear all;
clc;
close all;
num=poly([-3]);
den=poly([0 -1 -2]);
sys=tf(num,den);
bode(sys);
[Gm,Pm,Wgm,Wpm] = margin(sys);
LAB WORKS:
1. Bode Plot the following systems and determine Phase margin, Gain margin and Crossover
frequencies.
(a)

(b)

(c)

PROCEDURE:
22. Open MATLAB and click on “New Script”. Then an editor window will come.
23. Write MATLAB program in the MATLAB editor window.
24. Then save and run the program. Modify the program if it is necessary to perform lab-
work given by the instructor.
25. Observe the results and responses of different system.
26. Now find those outputs theoretically for the given transfer function and compare it with
the output obtained practically.
EXERCISE:
1. Plot the poles and zeros in “s” map and draw the root locus for the following unity feedback
systems having transfer function of:
(a)

(b)

(c)

REPORT: Submit all the lab works and exercises (with MATLAB codes) with MATLAB
plots. Report must be submitted into prescribed format.

Prepared By: Md. Shamsul Arifin, EEE, CUET

You might also like