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

Lab Manual Control System

Whole lab manual

Uploaded by

sa9727118
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Lab Manual Control System

Whole lab manual

Uploaded by

sa9727118
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

SECAB INSTITUTE OF ENGINEERING AND TECHNOLOGY, VIJAYAPUR

(Approved by AICTE, New Delhi and Affiliated to VTU, Belagavi)


Department of Electronics and Communication Engineering
------------------------------------------------------------------------------------------------------------------
Expt 1: Block diagram reduction

ng1=[1];

dg1=[1 10];

sysg1=tf(ng1,dg1);

ng2=[1];

dg2=[1 1];

sysg2=tf(ng2,dg2);

ng3=[1 0 1];

dg3=[1 4 4];

sysg3=tf(ng3,dg3);

ng4=[1 1];

dg4=[1 6];

sysg4=tf(ng4,dg4);

nh1=[1 1];

dh1=[1 2];

sysh1=tf(nh1,dh1);

nh2=[2];

dh2=[1];

sysh2=tf(nh2,dh2);

nh3=[1];

dh3=[1];

sysh3=tf(nh3,dh3);

sys1=sysh2/sysg4;

sys2=series(sysg3,sysg4);

sys3=feedback(sys2,sysh1,+1);

sys4=series(sysg2,sys3);

sys5=feedback(sys4,sys1);

sys6=series(sysg1,sys5);

sys=feedback(sys6,[1])

1
SECAB INSTITUTE OF ENGINEERING AND TECHNOLOGY, VIJAYAPUR
(Approved by AICTE, New Delhi and Affiliated to VTU, Belagavi)
Department of Electronics and Communication Engineering
------------------------------------------------------------------------------------------------------------------
Results:

sys =

s^5 + 4 s^4 + 6 s^3 + 6 s^2 + 5 s + 2

----------------------------------------------------------------

12 s^6 + 205 s^5 + 1066 s^4 + 2517 s^3 + 3128 s^2 + 2196 s + 712

Expt 2: Zeros and Poles

ng1=[1];

dg1=[1 10];

sysg1=tf(ng1,dg1);

ng2=[1];

dg2=[1 1];

sysg2=tf(ng2,dg2);

ng3=[1 0 1];

dg3=[1 4 4];

sysg3=tf(ng3,dg3);

p1=pole(sysg1)

z1=zero(sysg1)

p2=pole(sysg2)

z2=zero(sysg2)

p3=pole(sysg3)

z3=zero(sysg3)

RESULTS:

p1 = -10

z1 =

0×1 empty double column vector

p2 = -1

z2 =

2
SECAB INSTITUTE OF ENGINEERING AND TECHNOLOGY, VIJAYAPUR
(Approved by AICTE, New Delhi and Affiliated to VTU, Belagavi)
Department of Electronics and Communication Engineering
------------------------------------------------------------------------------------------------------------------
0×1 empty double column vector

p3 = -2

-2

z3 =

0.0000 + 1.0000i

0.0000 - 1.0000i

Expt 3: Time response specification of second order under damped system

num=[0 0 25]

den=[1 6 25]

H=tf(num,den)

step(H)

RESULTS:

Expt 4: Implement freq response of secnod order system


num=[0 0 5]

den=[1 6 25]

w=0:0.01:pi;

h=freqz(num,den,w);

mag=abs(h);

phase=angle(h);

figure

subplot(2,1,1)

plot(w,mag)
3
SECAB INSTITUTE OF ENGINEERING AND TECHNOLOGY, VIJAYAPUR
(Approved by AICTE, New Delhi and Affiliated to VTU, Belagavi)
Department of Electronics and Communication Engineering
------------------------------------------------------------------------------------------------------------------
subplot(2,1,2)

plot(w,phase)

RESULTS:

Expt 5:Lead Lag compensator


num=[1 18.31*10^3 47.84*10^6]

den=[1 33.44*10^3 47.84*10^6]

bode (num,den);

RESULTS:
num =

1 18310 47840000

den =

1 33440 47840000

Expt 6: Routh-Hurwitz criterion

4
SECAB INSTITUTE OF ENGINEERING AND TECHNOLOGY, VIJAYAPUR
(Approved by AICTE, New Delhi and Affiliated to VTU, Belagavi)
Department of Electronics and Communication Engineering
------------------------------------------------------------------------------------------------------------------
% Define the coefficients of the characteristic polynomial

coeffs = [1, -5, -6, 0];

% Check stability using Routh-Hurwitz criterion


stable = routhCriterion(coeffs);

% Display the result


if stable
disp('The system is stable.');
else
disp('The system is unstable.');
end

% Routh-Hurwitz stability criterion function


function stable = routhCriterion(coeffs)
% Check the number of coefficients
n = length(coeffs);

% Initialize the first and second rows of the Routh-Hurwitz table


rhTable = zeros(n, ceil(n/2)*2);
rhTable(1:2:n, 1) = coeffs(1:2:n);
rhTable(2:2:n, 1) = coeffs(2:2:n);
% Fill in the rest of the table
for i = 2:n-1
for j = 2:ceil(n/2)
rhTable(i, j) = ...
(rhTable(i-1, 1) * rhTable(i+1, j-1) - rhTable(i+1, 1) * rhTable(i-1, j-1)) / rhTable(i-1, 1);

% Handle numerical issues (if denominator is zero)


if isnan(rhTable(i, j))
rhTable(i, j) = eps; % Replace with a small positive number
end
end
end

% Check the first column of the completed Routh-Hurwitz table


if all(rhTable(:, 1) > 0)
stable = true;
else
stable = false;
end
end

Result: The system is unstable

Expt 7: Root locus


num=[0 1 2];

den=[1 7 12];

rlocus(num,den)

5
SECAB INSTITUTE OF ENGINEERING AND TECHNOLOGY, VIJAYAPUR
(Approved by AICTE, New Delhi and Affiliated to VTU, Belagavi)
Department of Electronics and Communication Engineering
------------------------------------------------------------------------------------------------------------------
grid;

title('root locus plot of G(s)=k(s+2)/[(s+3)(s+4)]')

RESULTS:

Expt 8: Bode plots


num=[0 1 2];

den=[1 7 12];

bode(num,den)

grid;

title('bode plot of G(s)=k(s+2)/[(s+3)(s+4)]')

RESULTS:

Expt 19: Nyquist plot


num=[0 1 2];

den=[1 7 12];

6
SECAB INSTITUTE OF ENGINEERING AND TECHNOLOGY, VIJAYAPUR
(Approved by AICTE, New Delhi and Affiliated to VTU, Belagavi)
Department of Electronics and Communication Engineering
------------------------------------------------------------------------------------------------------------------
nyquist(num,den)

grid;

title('nyquist plot of G(s)=k(s+2)/[(s+3)(s+4)]')

RESULTS:

Expt 10: Obtaine the time response from state model of a system
A=[0 1;-2 -3];

B=[0;1];

C=[1 -1];

D=[0];

mysys=ss(A,B,C,D)

qo=[1;2];

initial(mysys,qo)

RESULTS:
mysys =

A=

x1 x2

x1 0 1

x2 -2 -3

B=

u1

x1 0

7
SECAB INSTITUTE OF ENGINEERING AND TECHNOLOGY, VIJAYAPUR
(Approved by AICTE, New Delhi and Affiliated to VTU, Belagavi)
Department of Electronics and Communication Engineering
------------------------------------------------------------------------------------------------------------------
x2 1

C=

x1 x2

y1 1 -1

D=

u1

y1 0

Expt 11: Implement PI and PD controllers


den=[1 3 1]

sys= tf(num,den)

H=[1]

M= feedback (sys,H)

step (M)

hold on

grid on

Kp=2;

Kd=1;

Ki=1;

% PI controller

num1= [Kp Ki*Kp]

8
SECAB INSTITUTE OF ENGINEERING AND TECHNOLOGY, VIJAYAPUR
(Approved by AICTE, New Delhi and Affiliated to VTU, Belagavi)
Department of Electronics and Communication Engineering
------------------------------------------------------------------------------------------------------------------
den1=[1 0]

dr= conv(den1,den)

sys1=tf(num1,dr)

G2=feedback(sys1,H)

step(G2)

A=[Kd*Kp Kp];

B=conv(A,num);

sys2=tf(B,den)

sys3=feedback(sys2,H)

step(sys3)

grid on

RESULTS:

num =

den =

1 3 1

sys =

-------------

s^2 + 3 s + 1

H=

M=

9
SECAB INSTITUTE OF ENGINEERING AND TECHNOLOGY, VIJAYAPUR
(Approved by AICTE, New Delhi and Affiliated to VTU, Belagavi)
Department of Electronics and Communication Engineering
------------------------------------------------------------------------------------------------------------------
-------------

s^2 + 3 s + 2

num1 =

2 2

den1 =

1 0

dr =

1 3 1 0

sys1 =

2s+2

---------------

s^3 + 3 s^2 + s

G2 =

2s+2

---------------------

s^3 + 3 s^2 + 3 s + 2

sys2 =

2s+2

-------------

s^2 + 3 s + 1

sys3 =

2s+2

-------------

10
SECAB INSTITUTE OF ENGINEERING AND TECHNOLOGY, VIJAYAPUR
(Approved by AICTE, New Delhi and Affiliated to VTU, Belagavi)
Department of Electronics and Communication Engineering
------------------------------------------------------------------------------------------------------------------
s^2 + 5 s + 3

Expt 12: PID controllers

clear all

clc

% Plant

num=[1]

den=[1 3 1]

sys= tf(num,den)

H=[1]

M= feedback (sys,H)

step (M)

hold on

grid on

Kp=2;

Kd=1;

Ki=1;

% PID controller

num1= [Kp Ki*Kp]

den1=[1 0]

dr= conv(den1,den)

sys1=tf(num1,dr)

G2=feedback(sys1,H)
11
SECAB INSTITUTE OF ENGINEERING AND TECHNOLOGY, VIJAYAPUR
(Approved by AICTE, New Delhi and Affiliated to VTU, Belagavi)
Department of Electronics and Communication Engineering
------------------------------------------------------------------------------------------------------------------
step(G2)

sys1=tf(num1,den)

G=feedback (sys1,H)

K=dcgain(G)

step=G

esspid= 1/(1+K)

RESULTS:

num = 1

den =

1 3 1

sys =

-------------

s^2 + 3 s + 1

H= 1

M=

-------------

s^2 + 3 s + 2

num1 =

1 1

den1 =

1 0

dr =

1 3 1 0
12
SECAB INSTITUTE OF ENGINEERING AND TECHNOLOGY, VIJAYAPUR
(Approved by AICTE, New Delhi and Affiliated to VTU, Belagavi)
Department of Electronics and Communication Engineering
------------------------------------------------------------------------------------------------------------------
sys1 =

s+1

---------------

s^3 + 3 s^2 + s

G=

s+1

---------------------

s^3 + 3 s^2 + 2 s + 1

K=

step =

s+1

---------------------

s^3 + 3 s^2 + 2 s + 1

esspid =

0.5000

13
SECAB INSTITUTE OF ENGINEERING AND TECHNOLOGY, VIJAYAPUR
(Approved by AICTE, New Delhi and Affiliated to VTU, Belagavi)
Department of Electronics and Communication Engineering
------------------------------------------------------------------------------------------------------------------

Expt 13: PI,PD,PID

clear all

clc

% Plant

num=[1]

den=[1 3 1]

sys= tf(num,den)

H=[1]

M= feedback (sys,H)

step (M)

hold on

grid on

Kp=2;

Kd=1;

Ki=1;

% PI controller

num1= [Kp Ki*Kp]

den1=[1 0]

dr= conv(den1,den)

sys1=tf(num1,dr)

G2=feedback(sys1,H)

step(G2)

% PD controller

A=[Kd*Kp Kp];

B=conv(A,num);

sys2=tf(B,den)
14
SECAB INSTITUTE OF ENGINEERING AND TECHNOLOGY, VIJAYAPUR
(Approved by AICTE, New Delhi and Affiliated to VTU, Belagavi)
Department of Electronics and Communication Engineering
------------------------------------------------------------------------------------------------------------------
sys3=feedback(sys2,H)

step(sys3)

grid on

% PID controller

numc= [Kp Ki*Kp];

num1=conv(num,[1 Ki])

den1=[1 0]

dr= conv(den1,den)

sys1=tf(num1,dr)

G=feedback (sys1,H)

K=dcgain(G)

step=G

esspid= 1/(1+K)

RESULTS:

num = 1

den = 1 3 1

sys =

-------------

s^2 + 3 s + 1

H=

M=

-------------

s^2 + 3 s + 2
15
SECAB INSTITUTE OF ENGINEERING AND TECHNOLOGY, VIJAYAPUR
(Approved by AICTE, New Delhi and Affiliated to VTU, Belagavi)
Department of Electronics and Communication Engineering
------------------------------------------------------------------------------------------------------------------
num1 =

2 2

den1 = 1 0

dr =

1 3 1 0

sys1 =

2s+2

---------------

s^3 + 3 s^2 + s

G2 =

2s+2

---------------------

s^3 + 3 s^2 + 3 s + 2

sys2 =

2s+2

-------------

s^2 + 3 s + 1

sys3 =

2s+2

-------------

s^2 + 5 s + 3

num1 = 1 1

den1 = 1 0

dr =

1 3 1 0
16
SECAB INSTITUTE OF ENGINEERING AND TECHNOLOGY, VIJAYAPUR
(Approved by AICTE, New Delhi and Affiliated to VTU, Belagavi)
Department of Electronics and Communication Engineering
------------------------------------------------------------------------------------------------------------------
sys1 =

s+1

---------------

s^3 + 3 s^2 + s

G=

s+1

---------------------

s^3 + 3 s^2 + 2 s + 1

K=1

step =

s+1

---------------------

s^3 + 3 s^2 + 2 s + 1

esspid =

0.5000

17

You might also like