Professional Documents
Culture Documents
Control System Lab-2019 (Even) PDF
Control System Lab-2019 (Even) PDF
No: 01
Experiment Name: Introduc on of MATLAB so ware and determining the roots of a polynomial
equa on.
MATLAB:
i. Express the following equa on into the MATLAB so ware and hence nd out the roots of this
equa on
P(s) = s 4 + 6s 3 + 5s 2 + 8s + 20
Result:
clc -5.1906 + 0.0000i
clear -1.6881 + 0.0000i
P=[1 6 5 8 20]; 0.4394 + 1.4455i
rootsP=roots(P) 0.4394 - 1.4455i
pause
ii. Express the following equa on into the MATLAB so ware and hence nd out the roots of this
equa on
Result:
clc
clear -25.7389 + 0.0000i -0.9031 + 0.0000i
P=conv([1 0 6 5 8 20],[1 26 7 8 20]);
rootsP=roots(P) -0.0000 + 2.0000i 0.3210 + 0.8703i
pause
-0.0000 - 2.0000i 0.3210 - 0.8703i
0.6641 + 1.8230i
0.6641 - 1.8230i
-1.3283 + 0.0000i
ti
ti
ti
ft
ti
ti
ti
ti
ft
ft
ft
fi
fi
Experiment No: 02
Experiment Name: Consider the following transfer function, determine partial fraction expansion using
MATLAB software.
C(s) 2s 3 + 5s 2 + 3s + 6
= 3
R(s) s + 6s 2 + 11s + 6
Result:
clc r =
clear p =
num=[2 5 3 5]; -6.5000
den=[1 6 11 6]; -3.0000
[r,p,k]=residue(num,den) -3.0000
-2.0000
2.5000
C(s) 2s3 + 5s 2 + 3s + 6 -1.0000
= 3 k =
R(s) s + 6s 2 + 11s + 6
2
−6.5 −3 2.5
= + + +2
s+3 s+2 s+1
Experiment No: 03 a
Experiment Name: Demonstrate the rational expression in frequency domain using MATLAB software
where given
Numerator = [1 2 7]
Denominator = [1 5 4 0]
Program:
clc
Result:
clear
T =
num=[1 2 7];
den=[1 5 4 0]; s^2 + 2 s + 7
-----------------
T=tf(num,den) s^3 + 5 s^2 + 4 s
Experiment No: 03 b
Experiment Name: Demonstrate the state space expression using MATLAB software where given
0 1 0 0
[10]
ẋ = 0 0 1 x+ 0 r
−3 −2 −5
y = [1 0 0]x + 0 r
Result:
StaeSpace =
Program:
a =
clc b =
clear x1 x2 x3
A=[0 1 0;0 0 1;-3 -2 -5]; u1
B=[0;0;10]; x1 0 1 0
C=[1 0 0]; x1 0
D=[0]; x2 0 0 1
StaeSpace=ss(A,B,C,D) x2 0
x3 -3 -2 -5
x3 10
c =
x1 x2 x3
d =
y1 1 0 0
u1
y1 0
Experiment No: 04 a
C(s) 25
= 3 Result:
R(s) s + 13s 2 + 36s + 25 B = C =
A =
1 0 0 25
-13 -36 -25
Program: 0
1 0 0
0
clc 0 1 0 D =
clear
num=[25]; 0
den=[1 13 36 25];
[A,B,C,D]=tf2ss(num,den)
% StateSpace=ss(A,B,C,D)
Experiment No: 04 b
Experiment Name: Convert the following state space equation into transfer function, G(s)=Y(s)/
R(s)
0 1 0 0
[10]
ẋ = 0 0 1 x+ 0 r
−3 −2 −5
10
---------------------
s^3 + 5 s^2 + 2 s + 3
Experiment No: 05
Software: MATLAB
Theory: A common actuator in control systems is the DC motor. It directly provides rotary
motion and, coupled with wheels or drums and cables, can provide translational motion. The
electric circuit of the armature and the free-body diagram of the rotor are shown in the following
figure
we will assume that the input of the system is the
voltage source (V) applied to the motor's
armature, while the output is the rotational speed
·
of the shaft θ. The rotor and shaft are assumed to
be rigid. We further assume a viscous friction
model, that is, the friction torque is proportional
to shaft angular velocity.
The physical parameters for our example are:
(J) moment of inertia of the rotor 0.01 kg.m^2
(b) motor viscous friction constant 0.1 N.m.s
(Ke) electromotive force constant 0.01 V/rad/sec
(Kt) motor torque constant 0.01 N.m/Amp
(R) electric resistance 1 Ohm
(L) electric inductance 0.5 H
In general, the torque generated by a DC motor is propor onal to the armature current and the strength
of the magne c eld. In this example we will assume that the magne c eld is constant and, therefore,
that the motor torque is propor onal to only the armature current i by a constant factor Kt as shown in
the equa on below. This is referred to as an armature controlled motor.
T = Kt i
ti
ti
fi
ti
ti
ti
fi
The back emf e, is propor onal to the angular velocity of the sha by a constant factor Ke.
·
e = Ke θ
In SI units, the motor torque and back emf constants are equal, that is Kt = Ke ; therefore, we
will use K to represent both the motor torque constant and the back emf constant.
Applying Newton's law and Kirchoff's law to the motor system to generate the following
equations:
Simulink Model:
ti
ft
Experiment No: 06
Software: MATLAB
Theory:
Overdamped responses:
Poles: Two real at σ1; σ2
Natural response: Two exponentials with time constants equal to the reciprocal of the
pole locations, or
c
K1eσ1t K2eσ2t
Underdamped responses:
Poles: Two complex at σd jωd
Natural response: Damped sinusoid with an exponential envelope whose time
constant is equal to the reciprocal of the pole’s real part. The radian frequency of
the sinusoid, the damped frequency of oscillation, is equal to the imaginary part of the
poles, or
c
Aeσdt cos
ωdt
Undamped responses
Poles: Two imaginary at jω1
Natural response: Undamped sinusoid with radian frequency equal to the imaginary part
of the poles, or
c
A cos
ω1t
The step responses for the four cases of damping has been determined by MATLAB simulation
software as follows
t
t
t
t
ϕ
ϕ
The general second order equation can be written as
b
s 2 + as + b
MATLAB Simulation:
1. Overdamped:
2. Undamped:
Underdamped:
3. Critically Damped
Discussion:
Math program:
Overdamped:
G= ([9],[1 9])
G =
9
-----
s + 9
Con nuous- me transfer func on.
Undamped:
G =
9
-------
s^2 + 9
Con nuous- me transfer func on.
>> step(G);
tf
ti
ti
tf
ti
ti
ti
ti
Overdamped:
G =
9
-------------
s^2 + 2 s + 9
Con nuous- me transfer func on.
G =
9
-------------
s^2 + 6 s + 9
Con nuous- me transfer func on.
>> step(G)
Experiment No: 07
Theory:
Software: MATLAB
Program:
clc
clear
p1=[1 3+7*i]; % Define polynomial containing first pole.
ti
ti
ti
tf
tf
ti
ti
ti
ti
zeta=(deng(2)/deng(1))/(2*omegan)
% Calculate damping ratio, % ((b/a)/2*wn).
pause
Result:
omegan =
7.6158
zeta =
0.3939
Ts =
1.3333
Tp =
0.4488
pos =
26.0176
Discussion:
Experiment No: 08
Experiment Name: For the system shown in the following figure, find the peak time, percent
overshoot, and settling time by using MATLAB software.
clc
clear
numg=[25]; % Define numerator of G(s).
Result:
Step Response
1.4
T=
1.2
25
System: T
-------------- Peak amplitude: 1.16
1
s^2 + 5 s + 25 Overshoot (%): 16.3
At time (seconds): 0.718
function.
0.6
wn = 5
0.4
z =0.5000
0.2
Ts =1.6000
Tp = 0.7255 0
0 0.5 1 1.5 2 2.5
Time (seconds)
pos =16.3034
Discussion:
Experiment No: 08
Experiment Name: Find the range of gain, K, for the system of Figure 6.10 that will cause the
system to be stable, unstable, and marginally stable. Assume K > 0 by using MATLAB software.
Software: MATLAB
Program:
clc
clear
K=[1:1:2000];
for n=1:length(K);
dent=[1 18 77 K(n)];
poles=roots(dent);
r=real(poles);
if max(r)>=0,
poles
K=K(n)
break
end
end
pause
Result:
poles =
-18.0025 + 0.0000i
0.0012 + 8.7775i
0.0012 - 8.7775i
K=
1387
Discussion:
Experiment No: 09
Experiment Name: For the system of the following figure, evaluate the static error constants
and find the expected error for the standard step, ramp, and parabolic inputs.
Theory:
Software:
Program:
clc
clear
numg=500*poly([-2 -5 -6]);
deng=poly([0 -8 -10 -12]);
G=tf(numg,deng);
' Check Stability'
T=feedback(G,1);
poles=pole(T)
' Step Input'
Kp=dcgain(G)
ess=1/(1+Kp)
' Ramp Input'
numsg=conv([1 0],numg);
densg=poly([0 -8 -10 -12]);
sG=tf(numsg,densg);
sG=minreal(sG);%if any s or higher order of s is common between numerator and
denominator
Kv=dcgain(sG)
ess=1/Kv
' Parabolic Input'
nums2g=conv([1 0 0],numg);
dens2g=poly([0 -8 -10-12]);
s2G=tf(nums2g,dens2g);
s2G=minreal(s2G);
Ka=dcgain(s2G)
ess=1/Ka
pause
Result:
Check Stability
poles =
-516.9544
-5.7623
-5.4278
-1.8554
ans =
Step Input
Kp =
Inf
ess =
ans =
Ramp Input
Kv =
31.2500
ess =
0.0320
ans =
Parabolic Input
Ka =
ess =
Inf
Discussion:
Exp No: 10
Theory:
Program:
clc
clear
numgh=[1 -4 20];
dengh=poly([-4 -6]);
'G(s)H(s)'
GH=tf(numgh,dengh)
rlocus(GH)
Output:
Result: From the figure it is cleared that for the stability gain K≤2.5
Discussion:
Exp No: 11
Theory:
Program:
clc
clear
numgh=[1 -4 20];
dengh=poly([-2 -4]);
'G(s)H(s)'
GH=tf(numgh,dengh)
rlocus(GH)
z=0.2:0.05:0.5;
wn=0:1:5;
sgrid(z,wn)
% axis([-6 3 -5 5])
title('Root Locus')
pause
rlocus(GH)
axis([-3 1 -4 4])
title('Close Up')
z=0.45;
wn=0;
sgrid(z,wn)
for k=1:3
[K,p]=rlocfind(GH)
end
pause
K=
0.4153
p=
-1.5327 + 3.0286i
-1.5327 - 3.0286i
K = 1.5017
p=
0.00 + 3.8991i
0.00 - 3.8991i
K = 0.0248
p = -2.8792 + 0.000i
-2.8792 - 0.000i
Result:
Discussion:
Exp No: 12
Experiment Name: Study of an Ideal PI Controller/Compensator and compare the following
system before and after compensate.
Theory:
Program: Fig. : Closed-loop system for Example 9.1: a. before compensa on; b. a er ideal
clc integral compensa on
clear
num=[0 1];
numt=conv([1 .1],[0 0 1]);
den=conv([1 1],[1 2]);
dent=conv(den,[1 10]);
rlocus(num,dent); % Before Compensation
v=[-15 1 -6 6];
axis(v);
axis('square');
sgrid(0.174,[])
[K,r]=rlocfind(num,dent)
pause
ti
ti
ft
dentt=conv(dent,[1 0]);
rlocus(numt,dentt); % After Compensation
v=[-15 1 -6 6];
axis(v);
axis('square');
sgrid(0.174,[])
[K,r]=rlocfind(numt,dentt)
pause
Output:
Brfore Compensation:
selected_point = -0.6891 + 3.8943i
K = 162.0131
r=
-11.5940 + 0.0000i
-0.7030 + 3.8993i
-0.7030 - 3.8993i
After Compensation:
selected_point =-0.6673 + 3.8455i
K = 159.2149
r=
-11.5626 + 0.0000i
-0.6736 + 3.8477i
-0.6736 - 3.8477i
-0.0902 + 0.0000i
Discussion:
Discussion:
Exp No: 18
Bode Plot
Exp No 19:
PLC
Experiment No: 03 b
Experiment Name: Demonstrate the state space expression using MATLAB software where given
0 1 0 0 Result:
[10]
ẋ = 0 0 1 x + 0 r
StaeSpace =
−3 −2 −5
a =
b =
x1 x2 x3
y = [1 0 0]x + 0 r u1
x1 0 1 0
x1 0
x2 0 0 1
x2 0
A=[0 1 0;0 0 1;-3 -2 -5]; x3 -3 -2 -5
B=[0;0;10]; x3 10
C=[1 0 0];
D=[0];
c =
StaeSpace=ss(A,B,C,D)
x1 x2 x3
d =
StaeSpace.a y1 1 0 0
x1 x2 x u1
x1 0 1 y1 0
x2 0 0
x3 -3 -2 -
StaeSpace.b
u
x1
x2
x3 1
StaeSpace.c
x1 x2 x
y1 1 0
StaeSpace.d
u
y1
[ b , a ] = ss2tf( A , B , C , D
b = 10.000
a
K=tf(b,a
10
y1: --------------------
s^3 + 5 s^2 + 2 s +
P=[1 5 2 3
P= 1 5 2
octave:10> roots(P
ans
-4.7106 + 0
-0.1447 + 0.7848
-0.1447 - 0.7848
=