0% found this document useful (0 votes)
26 views5 pages

Exercise CP 2

The document contains code for analyzing the step response of two closed loop control systems using transfer functions. It defines transfer functions for a plant and controller, then analyzes the step response of the closed loop systems with and without reference input.

Uploaded by

張一
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)
26 views5 pages

Exercise CP 2

The document contains code for analyzing the step response of two closed loop control systems using transfer functions. It defines transfer functions for a plant and controller, then analyzes the step response of the closed loop systems with and without reference input.

Uploaded by

張一
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/ 5

%exercise CP

2.10k=[0.01:0.01:10];nu
mG=[1];denG=[1 20
20];G=tf(numG,denG);for
i=1:length(k);numGc=[k];
denGc=[1];Gc=tf(numGc,
denGc);%closed loop with
input
R(s).sys_cl=feedback(Gc*
G,1,-1);%closed loop with
R(s)=0 and
Td(s).sys_Td=feedback(G,
Gc,1);y1=step(sys_cl);Ys1
(i)=y1(end);y2=step(sys_
Td);Ys2(i)=y2(end);endpl
ot(k,Ys1,k,Ys2,':');
%exercise CP 2.5 %Part
(a)t=[0:0.1:100];J=10.8e
+8; %nominal momento
of inertia
[slug.ft^2]k=10.8e+8;
%controller
parameter.a=1;
%controller
parameter.b=8;
%controller
parameter.numGc=k*[1
a]; %controller
numerator.denGc=[1 b];
%controller
denominator.Gc=tf(numG
c,denGc); %controller
transfer function.
numG=[1]; %System
numerator.denG=J*[1 0
0]; %system
denominator.G=tf(numG,
denG); %System transfer
function.%steps to find
the closed loop (find the
resultant transfer function
in%series then find the
closed loop with negative
feedback.sys1=series(Gc,
G);
sys_cl=feedback(sys1,1,-
1);

You might also like