0% found this document useful (0 votes)
0 views

Control System lab (7)

The document outlines a series of experiments for a Control System Lab at Aliah University, focusing on MATLAB and its Control System toolbox. It includes objectives for each experiment, such as familiarization with MATLAB, block diagram reduction, simulation of linear systems, and determination of root locus. Each section provides theoretical background, procedures, and MATLAB commands to achieve the specified objectives.

Uploaded by

Sayok Sanyal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Control System lab (7)

The document outlines a series of experiments for a Control System Lab at Aliah University, focusing on MATLAB and its Control System toolbox. It includes objectives for each experiment, such as familiarization with MATLAB, block diagram reduction, simulation of linear systems, and determination of root locus. Each section provides theoretical background, procedures, and MATLAB commands to achieve the specified objectives.

Uploaded by

Sayok Sanyal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Control System Lab.

(EE393)
Electrical Engineering Department
Aliah University

Experiment No.1
Title: Introduction to MATLAB and Familiarization with MATLAB
Control System toolbox & SIMULINK.
many
Object: To become familiar with the software package MATLAB which contains
built-in subroutines and to familiar with controlsystem toolbox.

Introduction to MATLAB:

> MATLAB Stands for MATrix LABoratory. The system was designed
to make matrix
computation particularly easy.
What is MATLAB?
and visualization
MATLAB is a computer program that combines computation
power that makes it particularly useful tool for engineers. with a list of
MATLAB is an executive program, and a script can be made
MATLAB commands like other programming language.

> The MATLAB environment allows the user to:


manage variables
import and export data
perform calculations
generate plots

M-file editor:
Create and edit scripts of commands called M-files.

> Graphic (Figure) Window:


Displays plots and graphs
Created in response to graphics commands.
command window:
> Getting Help: Type one of following commands in the
helplists all the help topic
help topic -provides help for the specified topic
help comnmand-provides help for the specified command
help help- provides information on use of the help command
helpwin - opens a separate help window for navigation
lookfor keyword -Search all M-files for keyword
variables.
> Matlab is case sensitive, i.e. a & A are different command, the result is not displayed.
> when a semi-colon ": is placed at the end of each
System Lab. (EE393)
ControlEngineering
Electrical Department
Aliah University

Experiment No.2
determination of pole and zero from
Title: Block diagram reduction &
transfer Function.

Object: using series, parallel and feedback


1. To reduce linear systems block diagram
configuration.
function and pole-zero-gain
2. To represent LTI systems in terms of transfer
representations.
3. To plot the poles and zeros of LTIsystem.

MATLAB Representation of system:


The transfer function of asystem is represented by two arrays of numbers. Considera system with transfer
n,s+ no
function G(s) = This system can be represented as two arrays, each containing the co
d,s' +d,s +do
efficient of the polynomials in decreasing power ofsas follows:
num = [nË no]
den =[ d, dË do ]
G= tf(num,den)

Determination of series (cascaded), parallel and feedback (closed-loop) transfer


function with MATLAB:

Suppose that two systems with transfer functions G1s) and Gz(s) are connected in series where
numl nun2
G(s) = denl ,G,(s) = den2
The transfer function of the cascaded system can be determined using series command.
Gl= tf(num1,denl)
G2= tf(num2,den2)
sys= series(G1,G2)

If G1 and G2 are in parallel, then MATLAB command


sys= parallel(G1,G2)

For a closed- loop system with forward path transfer function G(s) and feedback path transfer function
H(s), the command feedback results in closed-loop transfer function.
sys= feedback(G,H,-1) %for Negative feedback system
sys= feedback(G,H,+1) % for Positive feedback system
For a unity feedback system with forward path transfer function G the closed-loop transfer function is
given by sys= feedback(G,1,-1) % for Negative feedback system
sys= feedback(G, 1,+1) %for Positive feedback system
Control System Lab. (EE393)
Electrical Engineering Department
Aliah University
Partial fraction expansion with MATLAB:
num
Consider a system G(s) =
den

The command [r,p,k]= residue(num,den) finds the residues(r), poles(p) and direct terns(k) of the
partial fraction expansion of the ratio of two polynomials .
The residue command can also be used to form he polynomials from its partial fraction expansion
[num,den]= residue(r,p,k)

Finding zeros and poles of system with MATLAB:


MATLAB has a command [2,p,kJ= tf2zp(num,den) to obtain the zeros, poles and gain Kof
num
G(s) =
den
If the zeros, poles and gain Kare given, then MATLAB command- num,den]= zp2tf(z,p,k)

Assignment-1
1. (0) Write a program to obtain the transfer functions
10
a) G, (s) = b) G, (s) = (s+1)
s(s +5) s(s +3s+10)
() Find out the transfer function of the resultant system when Gi() and Gz(s) are connected in series and
parallel.
(üi) Find out the closed-loop transfer function of the system G1(s) with unity feedback (positive and
negative).
2. Two systems with transfer functions G.()= 3
& G, (s) = are connected in such a way that
s+5 s+4
Gi(s) is in the forward path and Ga(s) is in feedback path. Find out the resultant transfer function. When
Gs) is in forward path and G1(s) is in feedback path then determine the resultant transfer function.
3. Determine overall transfer function of the system as shown in figure below using MATLAB
(MATLAB program).
4
1 s'+1
s+10 +4s+ 4

3
Control System Lab. (EE393)
Electrical Engincering Department
Aliah University
figure below using MATLAB
function of the system as shown in
4. Detemine overall transfer
(Simulink block diagram).

s+1
s'+s+1

1
s+3

SAssignment-2
transfer functions.
1. i) Obtain the partial fraction of the following
2 s² +2s +3
s(s +1)(2s +1) s+3s +3s +1

ii) Find the poles, zeros and gain of the following systems
(4s² +5s+10) s² +2s +3
(s +13s² +44s +41) s+ 3s +3s+1
function:
ii) From poles & zeros and gain of a system determine the transfer s++( n )
a) z=[-3 -1]: p=[0 -6 4 -21; k=[4]
) S -1 0]:; p-[6 5 3 2] ;k=[6]
2. Consider the block diagram of a unity feedback system shown below.

Gts+1)

2P* +22P(re
equation
Find out the open-loop poles and zeros using MATLAB. Determine the roots of the characteristic
and sketch a pole-zero map.
Control System Lab. (EE393)
Electrical Engincering Department
Aliah University

Experiment No. 3
Title: Simulation of linear systems to different inputs.
Object:
1. To determine the step, impulse and ramp responses of LTI systems. from
2. To determine the time-domain specifications for unit system stability
step and impulse response.
3. To determine the stability of the system from responses.
4. To determine steady state error and static error constants.

Theory:
system as shown in figure below.
Consider the general block diagram of a second-order

R(S) C(s)
s(s + 2go,)

So the transfer function of the closed-loop system is


C(s)
2
R(s) s² +2w,s +o," damping ratio.
< <1. The transient response of the system changes for different values of
where 0 terms of step
Standard performance measures for a second order feedback system are defined in
.
response of a system.

For unit step input, the output is C(s) = s(s+ 2o,s + o,')
e o,

So the transient output of the system is


ct) =1-: -sin(®,t +0)

where oa is the darmped frequency and = tan

is shown in figure below.


The response of the second order system
Control System Lab. (EE393)
Electrical Engincering Department
Aliah University

10
o9
L0

Time
Settling
time ime

Rise rne

Type of the system:


Consider the following open-loop transfer function G(s)H(s):
G(s)H (S) =
K(T,s+1)(T,s + 1).(T,s +1)
s(Ts+1)(T,s +1)..(T,S +1)
It involves the term sN in the denominator, representing a pole of multiplicityNat the origin.
The system may be classified on the basis of the no. of integrators present at the origin. A system is
called type-0, type-1, type-2... if N=0, N=1, N=2.. respectively.
Stability:
Stability is an important property of the system. Stability can be determined from the response of the
system. If for a bounded input, output is also bounded then the system is known as slable. But if for a
bounded input output is unbounded then the system is unstable. But for a unbounded input we can not
say anything about system stability. So from impulse response and step response the stability can be
determined. For the impulse response if the area under the curve is finite then the system is said to be
stable and if the area under the curve is infinite then the system is said to be unstable.

Procedure:

Determination of step response using MATLAB:


If num and den are known, MATLAB commands such as
step(num,den), step(num,den,t)
will generate plots of unit-step responses (t in the step command is the user specified time)
The unit impulse response of a control system may be obtained by using MATLAB command
impulse (num,den)
To obtain the response to an arbitrary input, the command Isim may be used.
Isim (num, den,r,t)
will generate the response to input time function r.
The time response can be analyzed using the LTI Viewer, which is a graphical user interface for
viewing and manipulating response plots of LTI models.
Itiview('step', sys)
Control System Lab. (EE393)
Electrical Engineering Department
Aliah University
willopen a window displaying the step response of the LTI model sys.

Procedure for drawing SIMULINK model:


Step 1: Enter simulink command at the MATLAB prompt. Select New from the File menu on
the menu bar of the simulink and then select Model to open a new file.
Step 2: Expand the node labeled "Simulink". Select required source from Sources library and
drag this to the file.
Step 3: Select Transfer function from Continuous library and drag this to the file.
Step 4: For closed-loop system select Sum from Math library drag this to the file.
Step 5: Select Seope from the Sinkslibrary drag this to the file.
Step 6: Connect these blocks as per your system.
Step 7: Double click on each blocks and change different paramneters as per problems given.
Step 8: Use Simulation Start to simulate. Click on the Time Scope to observe the nature of
output.

Example:
1
1. Consider a unity feedback system with forward path transfer function G(s) = s(s+1) Find out
step response and time domain specifications and also comment on system stability.
Program: >>n=[1;
>> =(110]:
>> =tf(n,d):
>> step(S)
>>sl=feedback(s,1,-1);
>> step(Sl)
Output:

dd 1.19
SYn80
1

TneDc)
Control System Lab. (EE393)
Electrical Engineering Department
Aliah University

The step response here bounded signal. So the closed loop system is a stable.
2. Find out the step response of a type-0 system with unity fecdback using SIMULINK toolbox.
SIMULINK block diagram of the system:ent

st1
Step Transfer Fcn Scope

STEP response of the system:

0.5

0.4

03

02

0.1

0 2 4 6 8 10

Assignment 1
From help menu note the following commands: damp,,step,
: impulse, Isim, Itiview.
16
Consider the transfer functionG(s) = Determine damping ratio and natural frequency of SyS 2 +5LJ
the system.
(2/ Consider a unity feedback system with open loop transfer 25
(n, 2)-lantsyg
function G(s) = Find'out unit
s(s +4)
step, impulse responses of the system and comment on stability.
3. Consider the system shown in figure below where E is damping ratio.

R(S)
s(s + 2g0,) C(s)
Control System Lab. (EE393)
Electrical Engineering Departmnent
Aliah University
Determine the unit step responses and transient response specifications for =0, 0.2, 0.7, 1,3 and
also compare the transient response specifications.
4. Consider the transfer functions of a type-0, type-1 and type-2 control systems. Find out unit step.
impulse responses of the system and comment on stability.
.odl 16 Find out
S. Consider a unity feedback system with open loop transfer function G(s) = s(s +4)
toolbox.
unit step closed-loop response of the system using SIMULINK
with transfer function
6. UsingIsim" command obtain the unit ramp response of the system
C(s) 1
R(s) (s +s+1)
open-loop transfer function
7. A unity-feedback system is characterized by the
.Determine the eror constants Kp,K, and K.
G(S) = s(0.5s + 1(0.2s + 1)

adegu' n(6n n)

Yv veloeity Co Sent
Aeearatiom
Kez positiom
Control System Lab. (EE393)
Electrical Engineering Department
Aliah University

Experiment No. 4
Title: Determination of Root Locus using Matlab Control System
toolbox.
Object: To determine system's stability and relative stability using Root Locus
technique.

Theory:
The root-locus technique is a graphical method for drawing the locus of roots in the s-plane as a
parameter of the system is varied. The gain of the open-loop transfer function is the parameter to
be varied from zero to infinity. The root-locus method enables us to find the closed-loop poles from
the open-loop poles and zeros with the gain as variable parameter.
From root locus we can determine the stability and relative stability of the system. The value of the
parameter for a desired root location can be determined from the locus. Root locus is a powerful
technique as it brings into focus the complete dynamic response of the system and designer can
visualize the effects of varying various system parameters on root locations.

Procedure:
num
Consider open-loop transfer function G(s) = then characteristic equation
den
den +K num =0.
Here MATLAB command used for plotting root loci is
TG=tf(num,den)
rlocus(G)
The gain factor K is automatically determined.
The function rlocfind returns the feedback gain associated with aparticular set of poles on the root
locus.
[K, poles]=rlocfind(G)
is used for interactive gain selection. The function rlocfind puts up a cross hair cursor on the root
locus plot that you use to select a particular pole location. The root locus gain associated with this
point is returned in K and the column vector poles contains the closed-loop poles for this gain.
For Example:
1.Consider the systems whose open-loop transfer function G(s)H(s) are given by
s(s+1)\s +2)
Plot root-loci and find the maximum value of k for stability.
Program: >>k=1;
>>n=[k];
>>d=conv([1 10),(1 2]);
Control System Lab. (EE393)
Electrical Engineering Department
Aliah University
>>s=tf(n,d):
>>rlocus(s)
>> |k.poles]=rlocfind(s)
Select a point in the graphics window
selected_point = Matlle
-0.0022 + 1.3259i
k=
5.2755
poles =
-2.9316
-0.0342 + 1.3410i
-0.0342 - 1.3410i
Output:
Rogt L0Oug

Rel Ads

Themaximum value of k for stability 5.2755.

Assignment
1. From help menu note the following commands: rlocus, rlocfind.
2. Consider the system where, open-loop transfer function G(s) H (s) = Using
s(s +3)(s +5)
MATLAB plot the root locus and find the maximum value of k for stability and at the
breakaway point.
3. Consider the unity-feedback control system with the following feed-forward transfer
k
function G(s) = .Plot the root loci and determine the value of k where damping
s(s +4s +13)
ratio = 0.5.
Control System Lab. (EE393)
Electrical Engincering Department
Aliah University
4. Consider the unity-feedback control system with the following feed-forward transfer
K
function G(S) = .Plot the root loci and find the maximum value of k for
ea2)(s+4)(s+6)(s+8)
stability and for (=1.
5. Consider the unity-feedback control system with the following feed-forward transfer
function G(S) = K(s+8)(s+6)
(s+2)(s+4)
.Plot the root loci and find the value ofk for (=1.

6. Consider the unity-feedback control system with the following feed-forward transfer
K
function GS)=ss*26ss133.Plot the root loci and find the value of kfor (=1.
7. Consider the unity-feedback control system with the following
feed-forward transfer
function G(s) = (s+5)K(s+8)
($2+4s+13) .Plot the root loci.
Control System Lab. (EE393)
Electrical Engineering Department
Aliah University
Experiment No. 5
Title: Determination of Bode Plot using Matlab Control System
toolbox.

Object: To determine system's stability and relative stability from the Bode plot.

Theory:
Bode plot is one of the frequency response analysis. Bode plot consists of two graphs. One is a
plot of the logarithm of the magnitude of asinusoidal transfer function vs. frequency in log scale
and the other is aplot of the phase angle vs. frequency in log scale. Magnitude plot and Phase plot
are known as Bode plot in honor of H.W. Bode who did the basic work in this area. Bode plot can
be constructed by using straight-line approximations that are the asymptotic to the actual plot. So
Bode plot is also known as asymptotic plot. The standard representation of the logarithmic
magnitude of G(jo) is 20log1oGj0). The unit used in this representation of the magnitude is the
decibel, usually abbreviated dB. In the logarithmic representation, the curves are drawn on semi
log graph paper, using the log scale for frequency and the linear scale for either magnitude or
phase angle.
Using Bode plot stability and also relative stability can be determined. Here also the
measures of relative stability gain-margin (GM), phase margin (PM), gain crossover frequency
and phase crossover frequency can be determined.

Procedure:
num
For the system with open-loop transfer function G(s)= den MATLAB command
G=tf(num,den)
generates the
bode(G)
Bode frequency-response plots. This function automatically selects the frequency
values by placing more points in regions where the frequency response is changing quickly.
To specify the frequency range, use the command
w=logspace(d1,d2,n)
Here MATLAB generatesbode(G,w)
n points logarithmically equally spaced between decades 10dand 102,
Command- [mag,phase,w]=bode(G,w) returns the frequency response of the system in matrices
mag, phase and w.
[Gm,Pm, Wep,Wcgl=MARGIN(SYS)
returns the gain margin Gm, the phase margin Pm, Wep phase cross-over frequency and Wcg gain
cross-over frequency of the given SISO open-loop model SYS (continuous or discrete).

For Example:
(s+2)
The open-loop transfer function of a system is (s+1)(0.ls + 1)-.Determine the Bode plot and
find the gain margin, phase margin, gain cross-over frequency and phase crossover frequency of
the system and comment on stability of the closed-loop system.
Control System Lab. (EE393)
Electrical Engineering Department
Aliah University

Program:>>=[12]:
>> d=conv([1 1].[0.1 1]);
>tf(n,d);:ot
>> bode(s)
>> margin(s)

Output:

Bode Dlegrem
Gm- h, Pn- 145 deg(4.1 redsec)

10

20

90
40 10 10
Frequenoy (redsec)

Here phase crossover frequency is greater than the gain crossover frequency. So here the closed
loop system is stable.

Assignment
1. From help menu note the following commands: bode, margin.

2. Obtain Bode plot of the systems


1
whose open-loop transfer functions are G(s)H(S)=100,
G(s)H(S) =G(s)Hs) = G(s)H(S) = s, G(S)H(5) = s².G(s)H(s) = s2+2s+4
3. Obtain the Bode plot of the system whose open-loop transfer function is
100
G(s)H(s)= Sia242ss and find the gain margin, phase margin, gain cross-over frequency
and phase crossover frequency of system and comment on stability.

4. Obtain the Bode plot 1of the system whose open-loop transfer function is
G(s)H(s) = s(s+2)(s24+2s+4) and find the gain margin, phase margin, gain cross-over frequency
and phase crossover frequency of system and comment on stability.

5. Obtain the Bode plot of the system whose open-loop transfer function is
10(s+2)
G(s)H(S) = s(2s+1)(s'ts+1) and find the gain margin, phase margin, gain cross-over frequency
and phase crossover frequency of system and comment on stability.
Control System Lab. (EE393)
Electrical Engincering Department
Aliah University

Experiment No. 6
Title: Determination of Nyquist Plot using Matlab Control System
toolbox.

Object: Todetermine system's stability and relative stability frorn the Nyquist plot.

Theory:
Nyquist stability criterion provides the information on the absolute stability and also on the relative
stability of a control system.
Nyquist stability criterion: If open-loop transfer function G(s)H(S) has Kpoles in the right half
s-plane, then for stability the G(s)H(S) locus as a representative points traces on the modified
Nyquist path in the clock-wise direction, must encircle the (-1+j.0) point Ktimes in the counter
clock-wise direction.
Phase crossöver frequency: The frequency at which the phase angle is 180º is called the phase
crossover frequency.
Gain crossover frequency: The frequency at which the magnitude of G(jo)Hjo) is equal to l is
known as gain crossover frequency.
Gain Margin (GM): It is the factor by which the system gain can be increased to drive it to the
verge of instability.Gain margin is the reciprocal of gain at phase crossover frequency.
Phase Margin (PM): The phase margin is the amount of additional phase lag at the gain crossover
frequency required to bring the system to the verge of instability.
For a stable system phase crossover frequency is greater than gain crossover frequency.

Procedure:
num
The command nyquist(G) draws the Nyquist plot of the transfer function G(s) =
den
The command nyguist(G,w),calculates the frequency response at the frequency points in radians
per second.
MATLAB command [re,im,w]=nyquist(G)
returns-the frequency response of the system in the matrices re, im, w. The matrices re and im
contains the real and imaginary parts of the frequency response of the system, evaluated at the
frequency points specified in the vector w.

For Example:
1
given and
Obtain Nyquist plot of the system whose open-loop transfer functions is s²+s+1
analyze the result for stability.
Program: >> =[1);
>> =[1 1 1];
>>s=tf(n,d);
Control System Lab. (EE393)
Electrical Engineering Department
Aliah University
>> nyquist(s)
Output:
Nyust Diegem

System.s
lmaghery
A Galn Morgin (dB)) nf
A ftrequency (red/sec nt
dosed Loop Stabe? Yes

Systems
Peak gn (de): 1 25
(rodsec)0707
Frequency (re

-06 04 04 06
Real Ais

Assignmnent
1. From help menu note the following commands: nyquist
2. Obtain the Nyquist100plot of the system whose open-loop transfer function is
Gs)H(s)= s(s+2)(s+4)and find the gain margin, phase margin, gain cross-over frequency and
phase crossover frequency of system and comment on stability.
3. Obtain the Nyquist1plot of the system whose open-loop transfer function is
G(s)H(S)= s(s+2)(s+4)-and find the gain margin, phase margin, gain cross-over frequency and
phase crossover frequency of system and comment on stability.
4. Obtain the Nyquist plot of the system whose open-loop transfer function is
io(s+2) and find the gain margin, phase margin, gain cross-over frequency and
G(s)H(S) = (sZ+s+1)
phase crossover frequency of system and comment on stability.
5. Obtain the Nyquist plot of the 'system whose open-loop transfer function is
(s²+2)
G(S)H(s)= Gts+1) and find the gain margin, phase margin, gain cross-over frequency and
phase crossover frequency of system and comment on stability.

You might also like