AV 315 Control System: Raman Chawla SC12B042
AV 315 Control System: Raman Chawla SC12B042
AV 315 Control System: Raman Chawla SC12B042
AV 315 Control
System
Raman Chawla
SC12B042
Raman Chawla
11/11/2014
SESSION-1
Program 1
A program to convert transfer function to zero pole map.
Source Code
clear all
clc
num = [1 2 3];
den = [1 4 0 5];
sys = tf(num,den);
[Z,P,K] = tf2zp(num,den);
[R,P,K] = residue(num,den);
pzmap(sys);
Result
Program 2
A program to calculate equivalent transfer function of two transfer
function in series
Source Code
clear all
clc
num1 = [1];
den1 = [1 1];
sys1 = tf(num1,den1)
num2 = [3];
den2 = [1 2];
sys2 = tf(num2,den2)
[num,den] = series(num1,den1,num2,den2);
sys = tf(num,den)
Result
Transfer function:
1
----s + 1
Transfer function:
3
----s + 2
Transfer function:
3
------------s^2 + 3 s + 2
Program 3
A program to calculate equivalent transfer function of two transfer
function in parallel
Source Code
clear all
clc
num1 = [1];
den1 = [1 1];
sys1 = tf(num1,den1)
num2 = [3];
den2 = [1 2];
sys2 = tf(num2,den2)
[num,den] = parallel(num1,den1,num2,den2);
sys = tf(num,den)
Result
Transfer function:
1
----s + 1
Transfer function:
3
----s + 2
Transfer function:
4 s + 5
-------------
s^2 + 3 s + 2
Program 4
A program to calculate feedback equivalent
Source Code
clear all
clc
num1 = [1];
den1 = [1 1];
sys1 = tf(num1,den1)
num2 = [3];
den2 = [1 2];
sys2 = tf(num2,den2)
[num,den] = feedback(num1,den1,num2,den2);
sys = tf(num,den)
Result
Transfer function:
1
----s + 1
Transfer function:
3
----s + 2
Transfer function:
s + 2
------------s^2 + 3 s + 5
Program 5
Source Code
clear all
clc
n1 = 1;
d1 = 1;
n2 = 1;
d2 = 2;
n3 = 4;
d3 = [1 4] ;
n4 = 1;
d4 = [1 2];
n5 = 1;
d5 = [1 3];
n6 = 2;
d6 = 1;
n7 = 5;
d7 =1;
n8 =1;
d8 = 1;
nblocks = 8;
blkbuild
q = [1 0 0 0 0
2 1 -6 -7 -8
3 2 0 0 0
4 3 0 0 0
5 4 0 0 0
6 3 0 0 0
7 4 0 0 0
8 5 0 0 0] ;
iu = [1];
io = [5];
[A,B,C,D] = connect(a,b,c,d,q,iu,io);
[num,den] = ss2tf(A,B,C,D);
sys = tf(num,den)
Result
Transfer function:
1
----s + 1
Transfer function:
3
----s + 2
Transfer function:
s + 2
-------------
s^2 + 3 s + 5
Program 6
Program to study conv() and deconv() command
Source Code
clear all
clc
p1 = [1 2];
p2 = [1 4];
p = conv(p1,p2)
[q,r] = deconv(p1,p2)
Result
Transfer function:
1
----s + 1
Transfer function:
3
----s + 2
Transfer function:
s + 2
------------s^2 + 3 s + 5
Assignment Problem
Source Code
n1=1;
d1=1;
n2=1;
d2=[1 10];
n3=1;
d3=[1 7];
n4=[1 0 1];
d4=[1 4 4];
n5=[1 1];
d5=[1 6];
n6=[1 1];
d6=[1 2];
n7=2;
d7=1;
n8=1;
d8=1;
nblocks=8;
blkbuild
q=[1 0 0 0 0;2 1 -8 0 0;3 -2 -7 0 0;4 3 -6 0 0;5 4 0 0 0;6 5 0 0 0;7 4 0 0
0;8 5 0 0 0];
iu=1;
iv=5;
[A B C D]=connect(a,b,c,d,q,iu,iv)
[num,den]=ss2tf(A,B,C,D);
sys=tf(num,den)
Result
State model [a,b,c,d] of the block diagram has 8 inputs and 8 outputs.
Transfer function:
2.132e-014 s^5 - 0.5 s^4 - 1.5 s^3 - 1.5 s^2 - 1.5 s - 1
-------------------------------------------------------------s^6 + 25 s^5 + 231.5 s^4 + 1048 s^3 + 2608 s^2 + 3377 s + 1834
SESSION-2
Program 1
A program to plot responses of un-damped and different damped
systems
Source Code
num1 = 25;
den1 = [1 10 25];
sys1=tf(num1,den1);
num2=25;
den2=[1 0 25];
sys2=tf(num2,den2);
num3=25;
den3=[1 20 25];
sys3=tf(num3,den3);
num4=25;
den4=[1 4 25];
sys4=tf(num4,den4);
a=step(sys1);
b=step(sys2);
c=step(sys3);
d=step(sys4);
subplot(2,2,1),plot(a)
subplot(2,2,2),plot(b)
subplot(2,2,3),plot(c)
subplot(2,2,4),plot(d)
Result
Program 2
A program to obtain step response
Source Code
num4=4;
den4=[1 0.8 4];
sys4=tf(num4,den4);
step(sys4)
hold on
ginput(2)%2 is the no. of points picked
Result
Program 3
Use Simulink to find step response of a given transfer function
Simulink Model
Result
Program 4
Obtain response of exponential input (exp(-t)) to a given system:
( )
( )
num=25;
den=[1 4 25];
t=0:0.01:10;
u=exp(-t);
sys=tf(num,den);
lsim(sys,u,t);
Result
SESSION-3
Program 1
A program to plot root locus of a given system:
( )
(
(
)(
)(
)
)(
Source Code
num=[1 -2 2];
den=poly([-2 -4 -5 -6]);
sys=tf(num,den);
rltool(sys)
Result
Program 2
A program to obtain root locus of a given system:
( )
Source Code
num=poly([1 2]);
den=poly([0 -1]);
sys=tf(num,den);
rltool(sys)
Result
: -0.366
Break in point
: 1.37
J points
: 0.707j, -0.707j
)(
(
)
)
SESSION-4
Program 1
A program to plot root locus of a given system:
(
)(
)
( )
(
)(
)(
)
Source Code
num=poly([-10 -20]);
den=conv([1 30],[1 -20 225]);
sys=tf(num,den);
rltool(sys)
Result
Program 2
A program to obtain root locus of the given system:
( )
Source Code
num=1;
den=poly([-1 -2 -4]);
sys=tf(num,den);
rltool(sys)
Result
)(
)(
: 14.1
: 4.19 s, 1.92 s
: 0.707j, -0.707j
SESSION-5
Program 1
A program to plot root locus of a given system using sisotool:
(
)(
)
( )
(
)(
)
Source Code
num=conv([1 2],[1 0 4]);
den=poly([2 -4]);
sys=tf(num,den);
sisotool(sys)
Result
Program 2
A program to obtain root locus of the given system using siso tool:
(
)(
)
( )
Source Code
num=poly([-2 -6]);
den=[1 8 25];
sys=tf(num,den);
sisotool(sys)
Result
: 0<k <1
SESSION-6
Program 1
A program to plot root locus of a given system using sisotool
and for what k is OS=52%:
(
)
( )
(
)(
)
Source Code
num=conv([1 1.5])
den=poly([0 -1 -10]);
sys=tf(num,den);
sisotool(sys)
Result
Location of
Third pole
K(Gain)
Zero
-9.25
-8.61
-1.80
-9.25
-8.61
-39.64
-1.5
-1.5
-1.5
2nd order approximation is valid for case 3, because the location of the closed loop pole is
very near to the open loop zero.
Program 2
Obtain value of k, steady state error and settling time for
transfer function given below at %OS=57.4:
( )
)(
)(
Result
Proportional Gain
Steady State Error
: 165
: 0.108
For designing a controller with steady state error zero we need a PI controller:
: 0.3
Ts
ess
Tp
: 5.94 s
: 0
: 0.997 s
Z
Ts
ess
Tp
:0.2
:9.84 s
:0
:0.811 s
Z
Ts
ess
Tp
: 0.1
: 19 s
: 0
: 0.955 s
Z
Ts
ess
Tp
: 0.01
: 196 s
: 0
: 0.897 s
SESSION-7
Program 1
Design a phase lag compensator to reduce steady state error of
step input by a factor of 10 for :
( )
)(
)(
Ans.
Net angle
E(s)
ess
= tan-1(/z) tan-1(/p)
=R(s)/(1+G(s))
=lim{s*E(s)}, s0
=s*R(s)/(1+G(s))
=s*(1/s)/(1+(G(s)) , s0
=1/(1+Kp)
Source Code
clear all; clc;
num = 160;
den = poly([-2 -1 -10]);
sys = (tf(num,den));
syst = feedback(sys,1);
%rlocus(sys)
%rltool(sys)
sisotool(sys)
------------(A)
Result
=>
Kp (new)=89
(By A)
----------(B)
Where z/p=11.125 ( by B)
Assuming any values for z and p close to origin for k=160 and Kp = 89 :
p
z
%OS
Ts
-0.01
-0.11125
41.8
14.55
-0.03
-0.33375
50.3
6.95
-0.1
-1.125
77.5
17.35
-1
-11.125
K=160 ; PO=41.8%
;Ts=14.6s
;Tp=0.914s
;ess=0.011
Program 2
A program to obtain root locus of the given system and design a
PD controller for reducing the Ts to 1/3 of its value:
( )
)(
Source Code
num=1;
den=poly([-1 -4 -6]);
sys=tf(num,den);
rltool(sys)
Result
Program 3
A program to obtain root locus of the given system and find k for
OS 30% and design a Phase Lead compensator for reducing the Ts
to 1/2 of its value:
( )
Ans
For OS 30 %
K=90
Ts= 3.97s
For making Ts = Ts/2 =
The new points are -1.975.142j
Lead compensator :
Assuming z= -5, we get p = -37.78.
Before compensation
)(
SESSION-8
Program 1
Design a PID cotroller such that Tp is reduced to 2/3 of its value ,
uncompensated system at 20% OS with 0 steady state error for
step input.
( )
(
(
)(
)
)(
Source Code
num=[1 8];
den=poly([-2 -4 -5 -6]);
sys=tf(num,den);
rltool(sys)
Result
After P compensator
For OS=20%
Proportional Controller
K=41
Tp=0.66s
Ts=0.7s
)(
(new)=0.456
d (new)=15.7
Hence new point for root locus=-8.047+15.7j
By appropriate calculations zp = -56.48
Tp=0.202
OS=20.1%
For making steady state error zero we add an ideal integrator 1/s.
Tp =1.59
Os=20.6%
Steady State Error=0
SESSION-9
Program 1
Draw nyquist plot of following transfer function:
( )
)(
Source Code
num= [4 1];
den1 =conv([1 1],[2 1]);
den=conv(den1,[1 0 0]);
sys=tf(num,den);
nyquist(sys)
Result
Program 2
Draw nyquist plot of following transfer function:
( )
)(
Source Code
num=poly([1 2]);
den=poly([0 -1]);
sys=tf(num,den);
rltool(sys)
Result