Comsats University Islamabad Control Systems: Lab Report # 07
Comsats University Islamabad Control Systems: Lab Report # 07
Control Systems
Lab report # 07
BEE-5B
Submitted by:
M Muzammil Nadeem
FA17-BEE-051
Submitted to:
Submission Date:
November 15,2019
Pre-Lab
MATLAB Code
C = tf([1],[1 1]);
G = tf([1],[1 2]);
S1 = series(C,G);
F1 = tf([1],[1]);
feed = feedback(S1,F1,+1);
step(feed)
Lab Tasks
Lab Task 1:
MATLAB Code
num = [1];
den1 = [1 1];
den2 = [1 1];
den3 = [1 1];
sys1 = tf(num,den1);
sys2 = tf(num,den2);
sys3 = tf(num,den3);
%Series
G = series(sys1,sys2);
Gs = series(G,sys3);
subplot(3,1,1)
step(Gs);
Simulink
Series
Parallel
Feedback
Lab Task 2:
MATLAB Code
G1 = tf([1],[1 1]);
G2 = tf([1],[1 2]);
G3 = tf([1],[1 3]);
G4 = tf([1],[1 4]);
G5 = tf([1],[1 5]);
G6 = tf([1],[1 6]);
G7 = tf([1],[1 7]);
G1.inputname='i'; G1.outputname='j';
G2.inputname='a'; G2.outputname='b';
G3.inputname='a'; G3.outputname='d';
G4.inputname='a'; G4.outputname='e';
G5.inputname='i'; G5.outputname='h';
G6.inputname='k'; G6.outputname='c';
G7.inputname='c'; G7.outputname='l';
sum1=sumblk('a','l','r','j','-+-');
sum2=sumblk('i','b','d','++');
sum3=sumblk('f','e','d','++');
sum4=sumblk('k','h','c','f','+-+');
sys=connect(G1,G2,G3,G4,G5,G6,G7,sum1,sum2,sum3,sum4,'r','c')
t=0:0.1:10;
x=ones(1,length(t));
F=lsim(sys,x,t);
plot(t,F)
xlabel('Time')
ylabel('Amplitude')
title('Step Response')
MATLAB Code
G1 = tf([1],[1 1]);
G2 = tf([1],[1 2]);
G3 = tf([1],[1 3]);
G4 = tf([1],[1 4]);
G5 = tf([1],[1 5]);
G6 = tf([1],[1 6]);
G7 = tf([1],[1 7]);
G8 = tf([1],[1 8]);
G1.inputname='e'; G1.outputname='k';
G1 = tf([1],[1 1]);
G2 = tf([1],[1 2]);
G3 = tf([1],[1 3]);
G4 = tf([1],[1 4]);
G5 = tf([1],[1 5]);
G6 = tf([1],[1 6]);
G7 = tf([1],[1 7]);
G8 = tf([1],[1 8]);
G1.inputname='e'; G1.outputname='k';
G2.inputname='l'; G2.outputname='o';
G3.inputname='l'; G3.outputname='f';
G4.inputname='l'; G4.outputname='d';
G5.inputname='i'; G5.outputname='b';
G6.inputname='c'; G6.outputname='h';
G7.inputname='i'; G7.outputname='c';
G8.inputname='c'; G8.outputname='j';
sum1=sumblk('e','r','a','+-');
sum2=sumblk('a','o','b','++');
sum3=sumblk('l','j','k','++');
sum4=sumblk('g','f','d','++');
sum5=sumblk('i','h','g','-+');
C1=connect(G1,G2,G3,G4,G5,G6,G7,G8,sum1,sum2,sum3,sum4,sum5,'r','c');
t=0:0.1:10;
x=ones(1,length(t));
F=lsim(C1,x,t);
plot(t,F)
xlabel('Time')
ylabel('Amplitude')
title('Step Response')
Calculation
From the given fact Plant=Motor=1/[s(s+6)] and controller=k
We get that a=6
So
K=a2/2 = 6^2 / 2 = 36 / 2 = 18
K=1
Critical Analysis:
In this lab, I learnt to implement the block diagrams in MATLAB using some new commands like connect, feedback,
sum blk, series and parallel. Connect command connects the all the blocks of block diagram. Feedback command is
used to fetch the output back to the input and calculate the error between input and output. Sum blk command adds
the different inputs and outputs that are directed towards summer. Series and parallel command, simply, aid in
connecting the series and parallel blocks respectively. Step responses of different systems were observed in MATLAB
and they were verified by implementing all the models in SIMULINK. From the graphs, steady and transient responses
can be distinguished as well.