0% found this document useful (0 votes)
52 views11 pages

Lab 3: Task 1 Part A:: All All

The document contains MATLAB code for modeling and analyzing control systems. It defines transfer functions for various plant and controller models, applies feedback loops, and analyzes the step response. It contains three tasks: 1) modeling a plant and controller with feedback, 2) analyzing performance for a step input with and without feedback, and 3) analyzing step response for different damping ratios. Plots and performance metrics are generated.

Uploaded by

Saud Mudassar
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)
52 views11 pages

Lab 3: Task 1 Part A:: All All

The document contains MATLAB code for modeling and analyzing control systems. It defines transfer functions for various plant and controller models, applies feedback loops, and analyzes the step response. It contains three tasks: 1) modeling a plant and controller with feedback, 2) analyzing performance for a step input with and without feedback, and 3) analyzing step response for different damping ratios. Plots and performance metrics are generated.

Uploaded by

Saud Mudassar
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/ 11

Lab 3:

Task 1 part a:
clc; clear all; close all;
Ra=1;
Kt=10;
Kb=0.1;
J=2;
b=0.5;
%Disturbance Input zero
num1=[1];
denum1=[J b];
sys1=tf(num1,denum1);
num2=[-Kb*Kt];
denum2=[Ra];
sys2=tf(num2,denum2);
%Without FeedBack
Wfeed=feedback(sys1,sys2,+1);
[y,t]=step(Wfeed);
y(length(t))
plot(y)

Result:

Part b:
clc; clear all; close all;
Ra=1;
Kt=10;
Kb=0.1;
J=2;
b=0.5;
%Disturbance Input zero
num1=[1];
denum1=[J b];
sys1=tf(num1,denum1);
num2=[(-54-Kb)*Kt];
denum2=[Ra];
sys2=tf(num2,denum2);
%Without FeedBack
Wfeed=feedback(sys1,sys2,+1);
Ufeed=feedback(Wfeed,-1);
[y,t]=step(Wfeed);
length(t)
y(length(t))
plot(y)
Result:

Task 2a:
clc; clear all; close all;
Ra=1;
Kt=10;
Kb=0.1;
J=2;
b=0.5;
%Performance Input Step
num1=[Kt/Ra];
denum1=[J b];
sys1=tf(num1,denum1);
num2=[Kb];
denum2=[1];
sys2=tf(num2,denum2);
%Without FeedBack
Wfeed=feedback(sys1,sys2);
stepinfo(Wfeed)
% ess=abs(dcgain(1-Wfeed))

Result':

Part b:
clc; clear all; close all;
Ra=1;
Kt=10;
Kb=0.1;
J=2;
b=0.5;
%Performance Input Step Closed loop
num1=[Kt/Ra];
denum1=[J b];
sys1=tf(num1,denum1);
num2=[Kb];
denum2=[1];
sys2=tf(num2,denum2);
%Without FeedBack
Wfeed=54*feedback(sys1,sys2);
Ufeed=feedback(Wfeed,1,-1);
stepinfo(Ufeed)
ess=abs(dcgain(1-Ufeed))

Result:
Post Lab:

Exercise 1: Original Plotting Using Simulink:

After reduction Using LabView:


Since the results remain same thus our reduction technique is correct.

Exercise 2:
clc; clear all; close all;
R=2.2.*10.^3;
C=2.2.*10.^-6;
num1=[1];
denum1=[R*C 1];
sys1=tf(num1,denum1)
[y,t]=step(8.*sys1);
plot(t,y);
Labview:

Result:

Exercise 3:
clc; clear all; close all;
Wn=1;
zeta=0.1;
num1=[Wn];
denum1=[1 2.*Wn.*zeta 0];
sys1=tf(num1,denum1)
fprintf('Result for zeta 0.1:\n')
Ufeed=feedback(sys1,1,-1);
[y,t]=step(Ufeed);
subplot 321
plot(t,y);
title('zeta 0.1');
stepinfo(Ufeed)
ess=abs(dcgain(1-Ufeed))
zeta=0.4;
num1=[Wn];
denum1=[1 2.*Wn.*zeta 0];
sys1=tf(num1,denum1);
fprintf('Result for zeta 0.4:\n')
Ufeed=feedback(sys1,1,-1);
[y,t]=step(Ufeed);
subplot 322
plot(t,y);
title('zeta 0.4');
stepinfo(Ufeed)
ess=abs(dcgain(1-Ufeed))
zeta=0.7;
num1=[Wn];
denum1=[1 2.*Wn.*zeta 0];
sys1=tf(num1,denum1);
fprintf('Result for zeta 0.7:\n')
Ufeed=feedback(sys1,1,-1);
[y,t]=step(Ufeed);
subplot 323
plot(t,y);
title('zeta 0.7');
stepinfo(Ufeed)
ess=abs(dcgain(1-Ufeed))
zeta=1;
num1=[Wn];
denum1=[1 2.*Wn.*zeta 0];
sys1=tf(num1,denum1);
fprintf('Result for zeta 1.0:\n')
Ufeed=feedback(sys1,1,-1);
[y,t]=step(Ufeed);
subplot 324
plot(t,y);
title('zeta 1.0');
stepinfo(Ufeed)
ess=abs(dcgain(1-Ufeed))
zeta=2;
num1=[Wn];
denum1=[1 2.*Wn.*zeta 0];
sys1=tf(num1,denum1);
fprintf('Result for zeta 2.0:\n')
Ufeed=feedback(sys1,1,-1);
[y,t]=step(Ufeed);
subplot 325
plot(t,y);
title('zeta 2.0');
stepinfo(Ufeed)
ess=abs(dcgain(1-Ufeed))
Result:
Plot:

You might also like