






























































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!































































2
.
z → 1
T=0.1; %Input sampling time numf=0.16; %Numerator of F(s) denf=[1 1.32 0 0]; %Denominator of F(s) 'F(s)' %Display label F=tf(numf,denf) %Display F(s) numc=conv([1 0],numf); %Differentiate F(s) to compensate %for c2dm which assumes series zoh denc=denf; %Denominator of continuous system %same as denominator of F(s) C=tf(numc,denc); %Form continuous system, C(s) C=minreal(C,1e-10); %Cancel common poles and zeros D=c2d(C,T,'zoh'); %Convert to z assuming zoh 'F(z)' D=minreal(D,1e-10) %Cancel common poles and zeros and display rlocus(D) pos=(16.3); z=-log(pos/100)/sqrt(pi^2+[log(pos/100)]^2); zgrid(z,0) title(['Root Locus with ' , num2str(pos), ' Percent Overshoot Line']) [K,p]=rlocfind(D) %Allows input by selecting point on %graphic
ans =
F(s)
Transfer function:
s^3 + 1.32 s^
ans =
F(z)
Transfer function: 0.0007659 z + 0.
z^2 - 1.876 z + 0.
Sampling time: 0. Select a point in the graphics window
selected_point =
9.2969e-001 +1.0219e-001i
K =
9.8808e+
's-plane lead design for Challenge - Lead Comp' clf %Clear graph on screen. 'Uncompensated System' %Display label. numg=0.16; %Generate numerator of G(s). deng=poly([0 -1.32]); %Generate denominator of G(s). 'G(s)' %Display label. G=tf(numg,deng); %Create G(s). Gzpk=zpk(G) %Display G(s). pos=input('Type desired percent overshoot '); %Input desired percent overshoot. z=-log(pos/100)/sqrt(pi^2+[log(pos/100)]^2); %Calculate damping ratio. Tp=input('Type Desired Peak Time '); %Input desired peak time. wn=pi/(Tp*sqrt(1-z^2)); %Evaluate desired natural frequency. b=input('Type Lead Compensator Zero, (s+b). b= '); %Input lead compensator zero. done=1; %Set loop flag.
while done==1 %Start loop for trying lead %compensator pole. a=input('Enter a Test Lead Compensator Pole, (s+a). a = '); %Enter test lead compensator pole. numge=conv(numg,[1 b]); %Generate numerator of Gc(s)G(s). denge=conv([1 a],deng); %Generate denominator of Gc(s)G(s). Ge=tf(numge,denge); %Create Ge(s)=Gc(s)G(s). clf %Clear graph on screen.
rlocus(Ge) %Plot compensated root locus with %test lead compensator pole. axis([-5 2 -8 8]); %Change axes ranges. sgrid(z,wn) %Overlay grid on lead-compensated %root locus. title(['Lead-Compensated Root Locus with ' , num2str(pos),... '% Overshoot Line, Lead Pole at ', num2str(-a),... ' and Required Wn']) %Add title to lead-compensated root %locus. done=input('Are you done? (y=0,n=1) '); %Set loop flag. end %End loop for trying compensator %pole. [K,p]=rlocfind(Ge); %Generate gain, K, and closed-loop %poles, p, for point selected %interactively on the root locus. 'Gc(s)' %Display label. Gc=Ktf([1 b],[1 a]) %Display lead compensator. 'Gc(s)G(s)' %Display label. Ge %Display Gc(s)G(s). 'Closed-loop poles = ' %Display label. p %Display lead-compensated system's %closed-loop poles. f=input('Give pole number that is operating point '); %Choose lead-compensated system %dominant pole. 'Summary of estimated specifications for selected point on lead' 'compensated root locus' %Display label. operatingpoint=p(f) %Display lead-compensated dominant %pole. gain=K %Display lead-compensated gain. estimated_settling_time=4/abs(real(p(f))) %Display lead-compensated settling %time. estimated_peak_time=pi/abs(imag(p(f))) %Display lead-compensated peak time. estimated_percent_overshoot=pos %Display lead-compensated percent %overshoot. estimated_damping_ratio=z %Display lead-compensated damping %ratio. estimated_natural_frequency=sqrt(real(p(f))^2+imag(p(f))^2) %Display lead-compensated natural %frequency. s=tf([1 0],1); %Create transfer function, "s". sGe=sGe; %Create sGe(s) to evaluate Kv. sGe=minreal(sGe); %Cancel common poles and zeros. Kv=dcgain(KsGe) %Display lead-compensated Kv. ess=1/Kv %Display lead-compensated steady- %state error for unit ramp input. 'T(s)' %Display label. T=feedback(KGe,1) %Create and display lead-compensated %T(s). 'Press any key to continue and obtain the lead-compensated step' 'response' %Display label pause step(T) %Plot step response for lead %compensated system. title(['Lead-Compensated System with ' ,num2str(pos),'% Overshoot']) %Add title to step response of PD %compensated system. pause
'z-plane conversion for Challenge - Lead Comp' clf %Clear graph. 'Gc(s) in polynomial form' %Print label. Gcs=Gc %Create Gc(s) in polynomial form. 'Gc(s) in polynomial form' %Print label.
Gc(s)
Transfer function: 93.43 s + 123.
s + 4.
ans =
Gc(s)G(s)
Transfer function: 0.16 s + 0.
s^3 + 5.926 s^2 + 6.08 s
ans =
Closed-loop poles =
p =
-2.3030 + 3.1056i -2.3030 - 3.1056i -1.
Give pole number that is operating point 1
ans =
Summary of estimated specifications for selected point on lead
ans =
compensated root locus
operatingpoint =
-2.3030 + 3.1056i
gain =
estimated_settling_time =
estimated_peak_time =
estimated_percent_overshoot =
10
estimated_damping_ratio =
estimated_natural_frequency =
Kv =
ess =
ans =
T(s)
Transfer function: 14.95 s + 19.
s^3 + 5.926 s^2 + 21.03 s + 19.
ans =
Press any key to continue and obtain the lead-compensated step
ans =
response
ans =
z-plane conversion for Challenge - Lead Comp
ans =
Gc(s) in polynomial form
Transfer function: 93.43 s + 123.
s + 4.
ans =
Gc(s) in polynomial form
Zero/pole/gain: 93.4281 (s+1.32)
(z-1) (z-0.9869)
Sampling time: 0.
ans =
ans =
Ge(z) = Gc(z)Gp(z) in factored form
Zero/pole/gain: 0.0007322 (z+0.9956) (z-0.9869)
(z-1) (z-0.9869) (z-0.955)
Sampling time: 0.
ans =
z-
Transfer function: z - 1
Sampling time: 0.
ans =
(z-1)Ge(z)
Zero/pole/gain: 0.0007322 (z+0.9956)
(z-0.955)
Sampling time: 0.
ans =
Kv =
Transfer function: 0.0007322 z^2 + 6.387e-006 z - 0.
z^3 - 2.941 z^2 + 2.884 z - 0.
Sampling time: 0.
ANSWERS TO REVIEW QUESTIONS
SOLUTIONS TO PROBLEMS
a. f(t) = e-at^ ; f *(t) = (^) ∑
e-akTδ(t-kT) ; F *(s) = (^) ∑
δ(t-kT) ; F *(s) = (^) ∑
= 1 + z-1^ + z-2^ + z-3^ , F(z) = (^) ∑
c. f(t) = t^2 e-at^ ; f *(t) = (^) ∑
(kT) 2 e-akTδ(t-kT) ; F *(s) = T (^2) ∑
= T^2 ∑
k 2 (e-(s+a)T^ ) k^ = T^2 ∑
− 3
−aT
− aT
3
d. f(t) = cos( ω kT ); f*(t) = cos( ω kT ) δ( t − kT ); F*(s) = k = 0
∑
∞ − kTs cos( ω kT ) e k = 0
∞ ∑
∑
k = 0
T ( s − j ω ) − k
∞ ∑ ( e^ )
T ( s + j ω ) − k
ans =
F(z)
/ z
exp(-a T) |--------- - 1| \exp(-a T) / ans =
(b)
ans =
f(kT)
1 ans =
F(z)
z - 1 ans =
(c)
ans =
f(kT)
2 2 n T exp(-a n T) ans =
F(z)
2 T z exp(-a T) (z + exp(-a T))
3 (z - exp(-a T)) ans =
(d)
ans =
f(kT)
cos(w n T) ans =
F(z)
2 z - 2 z cos(w T) + 1
k
k
k
k
k
k
2
2
k k k
'(a)' syms z k F=vpa(z(z+3)(z+5)/((z-0.4)(z-0.6)(z-0.8)),4); pretty(F) f=vpa(iztrans(F),4); pretty(f) '(b)' syms z k F=vpa((z+0.2)(z+0.4)/((z-0.1)(z-0.5)*(z-0.9)),4); pretty(F)
Instant Value k Value