Professional Documents
Culture Documents
Solution to HW7
AP8.4 We are given the forward and feedback path transfer functions for a unity negative
feedback system. The forward path transfer function is
1
G(s) =
s2 + 3.2s + 16
and the feedback path transfer function is
1
H(s) = .
0.5s + 1
We are asked to sketch the Bode diagram for G(s)H(s).
Solution: First we find the corner frequencies . For H(s) we have a pole at s = 2,
hence a corner at = 2 and for G(s) we have n = 4 and = 3.2/(2n ) = 0.4. Thus for
the complex pole pair, q
r = n 1 2 2 = 3.2
and
1
Mp = |G(r )| = p = 1.36.
2 1 2
To determine the magnitude for low frequencies, we must rewrite the transfer function as
1/16
G(s)H(s) = .
(s2 /16 + 3.2s/16 + 1)(s/2 + 1)
Then for frequencies below = 2 we have horizontal asymptote |G()H()| = 20 log 10 (1/16) =
24 dB. From = 2 to = 4 our asymptote has a slope of 20 dB/decade. Superimposed
on this is a peak of height 20 log 10 (Mp ) about r . Beyond = 4, we have asymptotic
slope 60 dB/decade since there are a total of three poles. For the phase plot, we have an
asymptote that decreases from 0 to 90 degrees over the frequency range 2/10 to 2 10
rad/s (2 decades centered at = 2 rad/s). Another goes from 90 to 180 over the
range 4/10 to 4 10 rad/s (2 decades centered at = 4 rad/s). We add these to get the
asymptotic phase curve which goes from zero degrees at frequencies below = 2/10 to
270 degrees at = 4 10 and above.
From this information we could generate the plots by hand. The exact magnitude and
phase curves generated by Matlab are shown in Figure 1. The transcript of the Matlab
session is given below.
Transfer function:
0.0625
------------------------------------
0.03125 s^3 + 0.1625 s^2 + 0.7 s + 1
30
40
50
Magnitude (dB)
60
70
80
90
100
110
120
0
90
Phase (deg)
180
270
2 1 0 1 2
10 10 10 10 10
Frequency (rad/sec)
then
s2 + 9s + 10 G(s) = 10(s + 1) (1 + G(s))
and solving for G(s) yields
10(s + 1)
G(s) = .
s(s 1)
If we assume positive feedback, we would similarly obtain
10(s + 1)
G(s) = .
s2 + 19s + 20
(b) The logmagnitudephase plots for the three transfer functions are given in Figure 2.
In the plot legend, NF stands for negative feedback and PF stands for positive
feedback. The Matlab script that generated this figure is given below.
clsys = tf([10 10],[1 9 10]);
olsysn = tf([10 10],[1 -1 0]);
olsysp = tf([10 10],[1 19 20]);
w = logspace(-1,3,1000);
[magc,pc,wc] = bode(clsys,w);
[magon,pon,won] = bode(olsysn,w);
[magop,pop,wop] = bode(olsysp,w);
plot(squeeze(pc),20*log10(squeeze(magc)))
hold on
plot(squeeze(pon),20*log10(squeeze(magon)),--)
plot(squeeze(pop),20*log10(squeeze(magop)),-.)
legend(Closed-Loop,Open-Loop, NF,Open-Loop, PF)
a = find(wc >= 1);
b = find(wc >= 10);
c = find(wc >= 50);
d = find(wc >= 110);
e = find(wc >= 500);
omega_index = [a(1) b(1) c(1) d(1) e(1)]
wc(omega_index)
for index = omega_index,
plot(pc(1,1,index),20*log10(magc(1,1,index)),xr)
plot(pon(1,1,index),20*log10(magon(1,1,index)),xr)
plot(pop(1,1,index),20*log10(magop(1,1,index)),xr)
end;
title(Log-Magnitude-Phase Plot for AP8.5b)
xlabel(Phase (deg))
ylabel(Magnitude (dB))
grid
print -depsc ap8_5.eps
(c) The poles of the given closedloop system are 1.3 and 7.7 so the closedloop system
is stable. If we assume negative feedback, the openloop system obtained has a pole
ECE382/ME482 Spring 2004 Homework 7 Solution April 4, 2004 4
20
10
Magnitude (dB)
10
20
30
40
50
100 50 0 50 100 150 200 250 300
Phase (deg)
in the righthalf plane, hence is unstable. If we assume positive feedback, the poles
are 1.12 and 17.88, hence stable.
DP8.2 We are given a negative unity feedback system with a controller preceding the plant in
the forward path. The controller transfer function is G c (s) = K(s + 1)/(s + 5) and the
plant transfer function is
1
G(s) = 2
.
s(s + 2s + 10)
We are asked to sketch the Bode diagrams for the open and closedloop transfer functions
when K = 20. We are then asked to determine the frequencies for which the gain is 0
dB and for which the phase is 180 degrees in the openloop case. Next, we are asked to
determine Mp , r and B for the closedloop transfer function for two different values of
the gain, K = 20 and K = 40. Finally, we are asked to choose the one of these gains that
gives the shortest settling time while keeping the overshoot in response to a step input less
than 35%.
Solution:
ECE382/ME482 Spring 2004 Homework 7 Solution April 4, 2004 5
Transfer function:
20 s + 20
---------------------------
s^4 + 7 s^3 + 20 s^2 + 50 s
Transfer function:
20 s + 20
--------------------------------
s^4 + 7 s^3 + 20 s^2 + 70 s + 20
Gm =
3.1772
ECE382/ME482 Spring 2004 Homework 7 Solution April 4, 2004 6
Figure 3: Bode plot generated by Matlab for Problem DP8.2, parts (a) and (b)
Magnitude and Phase Plots for DP8.2
50
0
Magnitude (dB)
50
100
0 OpenLoop
ClosedLoop
90
Phase (deg)
180
270
2 1 0 1 2
10 10 10 10 10
Frequency (rad/sec)
Pm =
103.6808
Wcg =
4.0269
Wcp =
0.4433
ans =
ECE382/ME482 Spring 2004 Homework 7 Solution April 4, 2004 7
10.0410
>> K = 40;
>> olsys2 = tf(K*[1 1],conv([1 5 0],[1 2 10]))
Transfer function:
40 s + 40
---------------------------
s^4 + 7 s^3 + 20 s^2 + 50 s
Transfer function:
40 s + 40
--------------------------------
s^4 + 7 s^3 + 20 s^2 + 90 s + 40
num2 =
0 0 0 40 40
ECE382/ME482 Spring 2004 Homework 7 Solution April 4, 2004 8
Figure 4: Bode plots generated by Matlab for Problem DP8.2, part (c)
Magnitude and Phase Plots for DP8.2, part (c)
50
0
Magnitude (dB)
50
100
150
0 K=20
K=40
90
Phase (deg)
180
270
2 1 0 1 2 3
10 10 10 10 10 10
Frequency (rad/sec)
den2 =
1 7 20 90 40
poles2 =
-5.9844
-0.2632 + 3.6872i
-0.2632 - 3.6872i
-0.4891
>> [num,den]=tfdata(clsys,v)
num =
ECE382/ME482 Spring 2004 Homework 7 Solution April 4, 2004 9
0 0 0 20 20
den =
1 7 20 70 20
poles =
-5.5518
-0.5689 + 3.3590i
-0.5689 - 3.3590i
-0.3104
p1 =
p2 =
zeta1 =
0.1670
zeta2 =
0.0712
>> wn1=sqrt(p1(3))
wn1 =
3.4068
ECE382/ME482 Spring 2004 Homework 7 Solution April 4, 2004 10
>> wn2=sqrt(p2(3))
wn2 =
3.6966
wr1 =
3.3105
wr2 =
3.6778
Mpw1 =
3.0367
Mpw2 =
7.0394
(d) Here we plot the step responses, shown in Figure 5, for the transfer functions corre-
sponding to the two gains. The peak overshoot is less than 35% in both cases. We see
that the settling times appear to be identical, so to check more carefully, we isolate
the segment of the step response between 98% and 102% of the final value. This is
shown in Figure 6, which indicates that the 2% settling times are essentially identical,
whereas the K = 20 system has a shorter 1% settling time than the K = 40 system.
If we are only concerned with the settling time we would choose K = 20. Otherwise,
if the rise time were the most important remaining factor in determining our choice
of K we would choose the faster system with K = 40 but if large oscillations were
undesirable we would tend to choose the slower system with K = 20. The Matlab
ECE382/ME482 Spring 2004 Homework 7 Solution April 4, 2004 11
Figure 5: Step responses generated by Matlab for Problem DP8.2, part (d)
Step responses for DP8.2
1.4
K=20
K=40
1.2
0.8
0.6
0.4
0.2
0
0 5 10 15 20 25 30
Time (s)
Figure 6: Close-up of step responses generated by Matlab for Problem DP8.2, part (d)
Closeup Plot, DP8.2 Step Response
1.025
K=20
K=40
1.02
1.015
1.01
Truncated Response
1.005
0.995
0.99
0.985
0.98
0 5 10 15 20 25 30
Time (s)
DP8.4 We are given a negative unity feedback system with a controller preceding the plant in
the forward path. The controller transfer function is G c (s) = K( s + 1)/(s/10 + 1) and
ECE382/ME482 Spring 2004 Homework 7 Solution April 4, 2004 13
1
M p = p 1.5
2 1 2
holds if q
1 1.5(2) 1 2.
Squaring both sides and rearranging terms we determine that the condition is equivalent
to 4 2 + 1/9 0, so solving the quadratic yields the constraint 0.3464 < < 0.9327.
Next, we will apply a twostep root locus procedure (following the method of section 7.5,
pp. 354359 of the text) to the closedloop transfer function
Gc (s)G(s) K( s + 1)
T (s) = = .
1 + Gc (s)G(s) (s/10 + 1)(s/2 + 1)2 + K( s + 1)
40K s
1+ = 0. (1)
s3 + 14s2 + 44s + 40(1 + K)
We then apply the root locus procedure to the denominator of the second term. Dividing
both sides of
s3 + 14s2 + 44s + 40(1 + K) = 0
by s3 + 14s2 + 44s + 40 yields
40K
1+ = 0.
s3 + 14s2 + 44s + 40
ECE382/ME482 Spring 2004 Homework 7 Solution April 4, 2004 14
15
System: untitled1
Gain: 13.9
10 Pole: 0.0212 + 6.54i
Damping: 0.00324
Overshoot (%): 99
Frequency (rad/sec): 6.54
5
Imaginary Axis
10
15
20
30 25 20 15 10 5 0 5 10
Real Axis
The root locus for this equation in shown in Figure 7, and the limiting value for the gain
K is determined by finding the value of K for which the loci cross the imaginary axis.
This yields an upper bound on K for the system to remain stable. We choose K = 13.9,
corresponding to poles at 0.0212 6.54j (slightly to the left of the imaginary axis).
Now we substitute the value K = 13.9 into (1) to obtain
40(13.9) s
1+ = 0.
s3 + 14s2 + 44s + 40(13.9)
The root locus for is now shown in Figure 8. We will achieve a larger bandwidth when
we have a larger r so we choose = 0.35 near the lower bound on . We choose a point on
the root locus where the damping is approximately 0.35 and find that the corresponding
gain is 0.483, so we select = 0.48. The resulting closedloop transfer function is then
(13.9)(48s/100 + 1)
T (s) = .
(s/10 + 1)(s/2 + 1)2 + 13.9(48s/100 + 1)
To verify that we have met our design objectives we generate the Bode plot shown in
Figure 9 using the following commands.
ECE382/ME482 Spring 2004 Homework 7 Solution April 4, 2004 15
40
System: untitled1
30
Gain: 0.483
Pole: 5.95 + 15.9i
Damping: 0.35
20 Overshoot (%): 30.9
Frequency (rad/sec): 17
10
Imaginary Axis
10
20
30
40
50
14 12 10 8 6 4 2 0
Real Axis
By clicking on the plot we find that the peak value of the magnitude plot is approximately
2.86 dB, which is within 20 log 10 (1.5) = 3.52 dB of the low frequency value 0 dB at = 0.1
rad/s. Similarly, we find that B is approximately 23.2 rad/s.
MP8.5 We are given a unity negative feedback system in which the controller with transfer
function Gc (s) precedes the plant, whose transfer function is G(s), in the forward path.
We are asked to obtain Bode plots of both the open and closedloop transfer functions for
this system.
Solution: The magnitude and phase plots are shown in Figure 11.
A transcript of the Matlab commands that generated the plots is shown below.
10
0
System: untitled1
System: untitled1
10 Frequency (rad/sec): 0.103 Frequency (rad/sec): 23.2
Magnitude (dB): 0.0015
Magnitude (dB)
30
40
50
60
70
80
0
45
Phase (deg)
90
135
180
1 0 1 2 3
10 10 10 10 10
Frequency (rad/sec)
Transfer function:
10
---------------------
s^3 + 4 s^2 + 4 s + 1
Transfer function:
10
----------------------
s^3 + 4 s^2 + 4 s + 11
Figure 10: Magnitude and Phase Plots generated by Matlab for Problem MP8.5
Magnitude and Phase Plots for MP8.5
20
20
Magnitude (dB)
40
60
80
100
0 OpenLoop
ClosedLoop
90
Phase (deg)
180
270
2 1 0 1 2
10 10 10 10 10
Frequency (rad/sec)
MP8.6 We are given the forward path transfer function for a unity negative feedback system.
The forward path transfer function is
1
G(s) = .
s(s + 2p)
We are asked to use Matlab to plot the bandwidth vs. the parameter p for 0 < p < 1.
Solution: The closedloop transfer function is
1
G(s) = ,
s2 + 2ps + 1
which corresponds to n = 1 and = p.
The following script Matlab script generates the requested plot, which is given in Fig-
ure 11.
ECE382/ME482 Spring 2004 Homework 7 Solution April 4, 2004 18
p = [0:0.001:1];
w = logspace(-1,1,2000);
num = 1;
for index = 1:length(p),
den = [1 2*p(index) 0];
clsys = feedback(tf(num,den),1);
[mag,phase,w] = bode(clsys,w);
a = find(mag<0.707);
wb(index) = w(a(1));
end;
figure(10)
plot(p,wb);grid;
xlabel(p)
ylabel(Bandwidth \omega_b (rad/s))
title(Plot for MP8.6)
print -deps mp8_6.eps
Figure 11: Plot of system bandwidth vs. value of p for Problem MP8.6
Plot for MP8.6
1.6
1.5
1.4
1.3
Bandwidth (rad/s)
1.2
b
1.1
0.9
0.8
0.7
0.6
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
p