Solution 9.10.2.8
The MATLAB statements
load bodeid8
topm = size(bodeid8)
top = topm(1,1)
w=bodeid8(1:top,1);;
mag = bodeid8(1:top,2);;
phase = bodeid8(1:top,3);;
semilogx(w,mag);;
grid on
axis([0.1,100,-100,40])
print -deps 91028mag.eps
semilogx(w,phase);;
grid on
axis([0.01,1000,-270,-200])
print -deps 91028phase.ep
can be used to load the data and plot the magnitude response. Figure 1
shows the magnitude data with the asymptotes added. Our rst guess at the
transfer function mightbetransfer function weobtain from the asymptotes
is then
G(s)=
K(s+3:5)
s
3
(s+50)
:
However, looking at the phase plot in Figure 2 wesee that the phase starts
out at ;270
but goes all the way backto;200
before returning to ;270
.
If wehave only a single pole antzero, then wewould not expect to see that
much phase shift. To demonsrate this we nd the gain and then compare
the transfer function abovetothe actual data. Atlowfrequency the only
twotermsthat contribute are K and 1=s
3
.Theterm 1=s
3
byitself passes
through ! =1at 0 dB. The actual plot crosses ! =1at;6 dB. Thus we
have
K =10
;6=20
=0:5
Thus, our rst guess is
G(s) =
0:5(s+3:5)
s
3
(s +50)
=
0:035(z+1)
s
3
(s +50)
1
10
-1
10
0
10
1
10
2
-100
-80
-60
-40
-20
0
20
40
Figure 1: ABode magnitude plot
2
10
-2
10
-1
10
0
10
1
10
2
10
3
-270
-260
-250
-240
-230
-220
-210
-200
Figure 2: Bode phase plot
3
10
-1
10
0
10
1
10
2
10
3
-100
-80
-60
-40
-20
0
20
40
Figure 3: Comparison of actual and derived Bode magnitude plots
4
10
-2
10
-1
10
0
10
1
10
2
10
3
-270
-260
-250
-240
-230
-220
-210
-200
Figure 4: Comparison of actual and derived Bode phase plots
5
10
-1
10
0
10
1
10
2
10
3
-100
-80
-60
-40
-20
0
20
40
Figure 5: Comparison of actual and derived Bode magnitude plots
Wecheckthe accuracy of the model bycomparing the actual magnitude and
phase to the phase of the derived transfer function, as shown in Figures 3
and 4 The magnitude t is prettygood, but the phase t is not as good.
As suggested, wecannot get enough positive phase out of a single zero. It
looks likethere is an additional zero, and hence an additional pole, all close
together. Totest this hypothesis welet
G(s) =
0:5(s+3:5)(s+ 5))
s
2
(s+10)(s+50)
=
0:0175(z+3:5)(s+5)
s
2
(s+10)(s+50)
:
As shown in Figures 5 and 6, the t is nowbetter. However, the zeros
6
10
-2
10
-1
10
0
10
1
10
2
10
3
-270
-260
-250
-240
-230
-220
-210
-200
Figure 6: Comparison of actual and derived Bode phase plots
7
10
-1
10
0
10
1
10
2
10
3
-100
-80
-60
-40
-20
0
20
40
Figure 7: Comparison of actual and derived Bode magnitude plots
appear to be too close to the origin, so wetry
G(s) =
0:5(s+5)(s+8)
s
3
(s+10)(s+40)
=
0:5(z +5)(z =8)
s
3
(s+10)(s+40)
:
The magnitude and phase plots, shown in Figures 7 and 8, show that we
probably need to movethepole at s = ;10 to the left, so wetry
G(s) =
0:5(s+5)(s+8)
s
3
(s+20)(s+40)
=
0:25(z +5)(z +8)
s
3
(s+20)(s+40)
:
Figures 9 and 11 showthatwearevery close. It is now just a matter of ne
8
10
-2
10
-1
10
0
10
1
10
2
10
3
-270
-260
-250
-240
-230
-220
-210
-200
Figure 8: Comparison of actual and derived Bode phase plots
9
10
-1
10
0
10
1
10
2
10
3
-100
-80
-60
-40
-20
0
20
40
Figure 9: Comparison of actual and derived Bode magnitude plots
tuning. Wetry
G(s) =
0:6(s+5)(s+10)
s
3
(s+20)(s+40)
=
0:375(z+5)(z +10)
s
3
(s+20)(s+40)
:
As shown in Figures 11 and 12, wenowhaveaperfect t. The complete
MATLAB program that does this analysis is
load bodeid8
topm = size(bodeid8)
top = topm(1,1)
w=bodeid8(1:top,1);;
mag = bodeid8(1:top,2);;
phase = bodeid8(1:top,3);;
10
10
-2
10
-1
10
0
10
1
10
2
10
3
-270
-260
-250
-240
-230
-220
-210
-200
Figure 10: Comparison of actual and derived Bode phase plots
11
10
-1
10
0
10
1
10
2
10
3
-100
-80
-60
-40
-20
0
20
40
Figure 11: Comparison of actual and derived Bode magnitude plots
12
10
-2
10
-1
10
0
10
1
10
2
10
3
-270
-260
-250
-240
-230
-220
-210
-200
Figure 12: Comparison of actual and derived Bode phase plots
13
semilogx(w,mag);;
grid on
axis([0.1,100,-100,40])
print -deps 91028mag.eps
semilogx(w,phase);;
grid on
axis([0.01,1000,-270,-200])
print -deps 91028phase.eps
z1 = 3.5
p1 = 0
p2 = 0
p3 = 0
p4 = 50
Ktc = 0.5
K=(Ktc * p4)/(z1)
wp = logspace(-2,3,20);;
jw = j*wp;;
mag1 = 20*log10( (K*abs(jw + z1) )
./ ( abs(jw +p1).* abs(jw + p2).*abs(jw+p3).*abs(jw+p4)));;
semilogx(w,mag,'k-',wp,mag1,'kd')
grid on
axis([0.1,1000,-100,40])
print -deps 91028mag1.eps
phase1 = (angle(jw + z1) -angle(jw +p1) -angle(jw + p2)
-angle(jw+p3)-angle(jw + p4) )*180/pi;;
semilogx(w,phase,'k-',wp,phase1,'kd')
grid on
axis([0.01,1000,-270,-200])
print -deps 91028phase1.eps
z1 = 3.5
z2 = 5
p1 = 0
p2 = 0
p3 = 0
p4 = 10
p5 = 50
Ktc = 0.5
K=(Ktc * p4 * p5)/(z1*z2)
mag2 = 20*log10( (K*abs(jw + z1).*abs(jw + z2) )
./ ( abs(jw +p1).* abs(jw + p2).*abs(jw+p3).*abs(jw + p4).*abs(jw + p5) ) );;
semilogx(w,mag,'k-',wp,mag2,'kd')
grid on
axis([0.1,1000,-100,40])
print -deps 91028mag2.eps
phase2 = (angle(jw + z1) + angle(jw + z2) -angle(jw +p1) -angle(jw + p2)
14
- angle(jw+p3)-angle(jw + p4)-angle(jw + p5) )*180/pi;;
semilogx(w,phase,'k-',wp,phase2,'kd')
grid on
axis([0.01,1000,-270,-200])
print -deps 91028phase2.eps
z1 = 5
z2 = 8
p1 = 0
p2 = 0
p3 = 0
p4 = 10
p5 = 40
Ktc = 0.5
K=(Ktc * p4 * p5)/(z1*z2)
mag3 = 20*log10( (K*abs(jw + z1).*abs(jw + z2) )
./ ( abs(jw +p1).* abs(jw + p2).*abs(jw+p3).*abs(jw + p4).*abs(jw + p5) ) );;
semilogx(w,mag,'k-',wp,mag3,'kd')
grid on
axis([0.1,1000,-100,40])
print -deps 91028mag3.eps
phase3 = (angle(jw + z1)+ angle(jw + z2) -angle(jw +p1)
-angle(jw + p2) - angle(jw+p3)-angle(jw + p4)-angle(jw + p5) )*180/pi;;
semilogx(w,phase,'k-',wp,phase3,'kd')
grid on
axis([0.01,1000,-270,-200])
print -deps 91028phase3.eps
z1 = 5
z2 = 8
p1 = 0
p2 = 0
p3 = 0
p4 = 20
p5 = 40
Ktc = 0.5
K=(Ktc * p4 * p5)/(z1*z2)
mag4 = 20*log10( (K*abs(jw + z1).*abs(jw + z2) )
./ ( abs(jw +p1).* abs(jw + p2).*abs(jw+p3).*abs(jw+p4).*abs(jw + p5) ) );;
semilogx(w,mag,'k-',wp,mag4,'kd')
grid on
axis([0.1,1000,-100,40])
print -deps 91028mag4.eps
phase4 = (angle(jw + z1)+ angle(jw + z2) -angle(jw +p1) -angle(jw + p2)
- angle(jw+p3)-angle(jw + p4)-angle(jw + p5) )*180/pi;;
semilogx(w,phase,'k-',wp,phase4,'kd')
grid on
15
axis([0.01,1000,-270,-200])
print -deps 91028phase4.eps
z1 = 5
z2 = 10
p1 = 0
p2 = 0
p3 = 0
p4 = 20
p5 = 40
Ktc = 0.6
K=(Ktc * p4 * p5)/(z1*z2)
mag5 = 20*log10( (K*abs(jw + z1).*abs(jw + z2) )
./ ( abs(jw +p1).* abs(jw + p2).*abs(jw+p3).*abs(jw + p4).*abs(jw + p5) ) );;
semilogx(w,mag,'k-',wp,mag5,'kd')
grid on
axis([0.1,1000,-100,40])
print -deps 91028mag5.eps
phase5 = (angle(jw + z1)+ angle(jw + z2) -angle(jw +p1) -angle(jw + p2)
-angle(jw+p3)-angle(jw + p4)-angle(jw + p5) )*180/pi;;
semilogx(w,phase,'k-',wp,phase5,'kd')
grid on
axis([0.01,1000,-270,-200])
print -deps 91028phase5.eps
16