You are on page 1of 79

EE480.3 Digital Control Systems Part 9.

Frequency Response Method - using the bilinear transformation


Kunio Takaya
Electrical and Computer Engineering University of Saskatchewan March 26, 2008

** Go to full-screen mode now by hitting CTRL-L

Contents
1 CONTROL SYSTEM DESIGN III 2 Routh-Hurwitz stability criterion 3 Phase Lead or Lag Compensator 4 DIGITAL CONTROLLER DESIGN 3 5 PID Controller Design 3 10 17 22 56

CONTROL SYSTEM DESIGN III

Bilinear Transformation
Consider integration based on trapezoidal rule.
y(k) y(k-1)

x(k) x(k-1) T

Let the integrated area to k be y (k). Then, using the area to k 1 given by y (k 1), the approximated area under the curve is y (k) = y (k 1) + T [x(k) + x(k 1)] 2
3

T y (k) = y (k 1) + [x(k) + x(k 1)] 2 Taking the z-transform, Y (z ) (1 z


1

= = =

z 1 Y (z ) +

T [X (z ) + z 1 X (z )] 2

)Y (z ) Y (z ) X (z )

T (1 + z 1 )X (z ) 2 T 1 + z 1 2 1 z 1 1 equal to the s

We let integration in the Laplace transform integration in the z-domain. 1 T 1 + z 1 = s 2 1 z 1

Then, we dene the bilinear transformation, 2 z1 2 1 z 1 = s= . 1 T 1+z T z+1 Since this is a new mapping function between s-domain and z -domain, we use w instead of s. The bilinear transformation denes w-domain as 2 z1 2 1 z 1 = w= , 1 T 1+z T z+1 2 z1 w= T z+1 1+ z= 1
T 2w T 2w

whereas the Laplace s-domain relates to the z -domian by z = esT Both mapping functions make the stable system poles be jz j < 1.
5

MATLAB function for the bilinear transformation is bilinear and corresponding impulse invariant transformation is impinvar. The following program shows the transformation applied to 2 G(s) = (s + 1)(s + 2)
% s-domain: s=2/(s+1)(s+2) z=[]; p=[-1,-2]; T=0.1; K=2; csys=tf(K*poly(z),poly(p)) [numd,dend]=bilinear(K*poly(z),poly(p),1/T) roots(numd) pbl=roots(dend) plot(pbl,[0,0],rx); axis([-1,1,-1,1]); axis square; hold on; [numd,dend]=impinvar(K*poly(z),poly(p),1/T) roots(numd) piv=roots(dend) plot(piv,[0,0],bx); axis([-1,1,-1,1]); axis square; hold on;

The impulse invariant transformation is z G(z ) = 0.0172 (z 0.9048)(z 0.8187) The bilinear transformation is (z 1)2 G(z ) = 0.0043 (z 0.9048)(z 0.8182) The poles are very close to each other, though the zeros are dissimilar. Exercise: Transform the following continuous time system to its Bilinear Transform. Sampling frequency is 10 samples per sec, or T = 0.1. 1 E (s) = s(s + 1)

Nonlinear frequency relationship


2 1 z 1 T 1 + z 1 =
z =ejT

2 1 ejT T 1 + ejT
T T T

2 ej 2 (ej 2 ej 2 ) = T T T ej T 2 (ej 2 + ej 2 ) 2 T = j tan T 2 = jw Thus, w has a nonlinear relation ship with given by w = 2 T tan . T 2

In the relationship between s-domain and z -domain, z = esT , analog frequency is dened by s = j whereas digital (discrete d jd jT time) frequency d is dened by e =e . Therefore, = . T

frequency range in , d and w


d w = s 2fs = = 2 2 T = 0 d = T T T T = 0 w = tan tan = 2 2 2 2 0

This means that one zone of periodic frequency axis produced by sampling, in s-domain, corresponds to 0 w < in the T frequency axis of w-plane. The frequency axis is the imaginary axis j . Therefore, the inside of the unit circle in z -plane is mapped into the entire LHP in the w-plane. Thus, we can see that the Routh-Hurwitz stability criteion becomes applicable if bilinear transformation is applied to a discrete time transfer function in z -transform and converted to w-domain.
10

Routh-Hurwitz stability criterion


K + z+1 z(z-1)

Test the stability of this closed loop system. Determine the range of K that keeps the system stable. The open loop transfer function is z+1 G(z ) = K . z (z 1) 2 z1 w= T z+1 G(w) = K z+1 z (z 1) 1+ z= 1
T 2w T 2w

z=

1+ T w 2 1 T w 2

11

1+ T 2w +1 T 1 2w K T w 1+ T 1 + 2 2w ( 1) T T 1 2w 1 2w T 1 w 2 K T T (1 + w) w 2 2

The characteristic equation is T w 2 1 + G(w) = 1 + K =0 T T (1 + w) w 2 2 1 T T ( )2 w2 + (1 K )w + K = 0 2 2


12

w2 w1 w0

2 (T ) 2 T 2 (1

K 0 0

K)

Therefore, 0 < K < 1 is necessary for the system to be stable.

Routh Hurwitz stability criterion


When the characteristic equation is given by bn wn + bn1 wn1 + + b1 w + b0 = 0

13

wn wn1 wn2 wn3 . . . c1 =

bn bn1 c1 d1 . . .

bn2 bn3 c2 d2 . . . c2 =

bn4 bn5 c3 d3 . . .

bn1 bn2 bn bn3 bn1 c1 bn3 c2 bn1 d1 = c1

bn1 bn4 bn bn5 bn1 c1 bn5 c3 bn1 d2 = c1

The number of sign changes in the rst column gives the number of unstable poles.

14

Example An open loop transfer function z+1 G(z ) = K (z 1)2 yields G(w) = K The characteristic equation is T 2 w2 KT w + 2K = 0. w2 w1 w0 T2 KT 2K 2K 0 0 2 Tw (T w)2

15

Since the number of sign changes is 2, this system is always unstable regardless of the value of K . This system is the same as 1 analog system, 2 . So, the unity gain feedback always results in s instability.

16

Phase Lead or Lag Compensator

A discrete time phase lead/lag compensator is designed by using the bilinear transformation that maps the inside of the unit circle in z -plane to the entire LHP of w-plane. The phase lead/lag compensator is designed in w-domain utilizing the techniques available for continuous time compensator design, then map it back to the z -domain by the bilinear transformation. The rst order w-domain compensator is given by analogy to s-domain as w 1+ w0 D(w) = a0 w 1+ wp

17

A pole is at w = wp and a zero is at w = w0 .

18

Phase lead compensator: wp > w0 Phase lag compensator: w0 > wp


19

Substituting w = function,

2 z1 for w in the compensator transfer T z+1 z1 1+ z+1 w0 a0 2 z1 T z+1 1+ wp


2 T

D(z ) =

2 z1 w0 wp + wp T z+1 a0 2 z1 w0 wp + w0 T z+1 w0 wp T (z + 1) + 2wp (z 1) a0 w0 wp T (z + 1) + 2w0 (z 1)

20

w0 T wp (w0 T + 2) w0 T = a0 wp T w0 (wp T + 2) z+ wp T z z0 = Kd z zp z+ Thus, Kd

2 +2 2 +2

z0

zp

wp (w0 T + 2) wp (w0 + = a0 = a0 w0 (wp T + 2) w0 (wp + 2 w0 w0 T 2 T = = 2 w0 T + 2 w0 + T 2 wp wp T 2 T = = 2 wp T + 2 wp + T


21

2 T) 2 T)

DIGITAL CONTROLLER DESIGN 3

Frequency Response Method


+ Kd T

z - z0 z - zp

ZOH

G(s)

Design a phase lead or phase lag compensator D(z ) = Kd z z0 z zp

such that the (open loop) system satises a given phase margin of m 100 so that the (closed loop) system has damping ratio of .

22

Since the frequency response method based on phase margin and gain margin established in the Laplace domain (s-domain) is used here, the frequency response of D(z ) combined with a plant transfer function G(z ) with ZOH must be transformed into w-domain by using the bilinear transformation. Because, the stable region of the z -plane that is the inside of a unit circle, is mapped into the entire LHP (Left Half Plane) of the w-plane. The parameters Kd , z0 and zp of the rst order phase lead/lag compensator are determined in terms of a0 , w0 , wp dened in the w-domain.

23

Calculations of Frequency Response in w-domain


In order to obtain frequency response (Bode plot) in w-domain, do the following steps. 1. Find the transfer function in the z -transform, G(z ) = (1 z
1

G(s) )Z s

2. Calculate the frequency response G(ejT ) for 0 T with a proper step size. Record the actual frequncy scale of 0 s = T 3. Calculate corresponding frequency w to the frequencies used to calculate G(ejT ). w = 2 T tan T 2

24

4. Make a frequency response table to help drawing the Bode diagram. . . . jG(ejT )j . . . G(ejT ) . . . w . . .

5. Draw the Bode Diagram, both for jG(ejT )j and G(ejT ) using the frequency scale of w , not . This process is often called as frequency pre-warping.

25

Design Approach

Digital controller design to determine D(z ) by the frequency response method uses phase margin m as a key parameter. Design is to make the phase margin of the open loop trnasfer function D(w)G(w) have a specied phase margin m at a frequency w1 .
26

Finding the new cross-over frequency w1 requires several conditions to be met, and also requires try and error until a satisfactory value is found. We are designing (determining) w w0 D(w) = a0 w 1+ wp 1+ where, a pole is at w = wp and a zero is at w = w0 .

27

Characteristic Equation of the Closed Loop Systems


The only mathematical condition required at w1 is D(jw1 )G(jw1 ) = 1 (180 + m ) = 1 (+180 + m ) For magnitude, jD(jw1 )j jG(jw1 )j = 1 jD(jw1 )j = For phase, D(jw1 ) + G(jw1 ) = 180 + m = D(jw1 ) = 180 + m G(jw1 ) 1 jG(jw1 )j

28

Mathematical Design Formula for Phase Lead/Lag Compesators


The phase margin of the open loop trnasfer function D(w)G(w) satises a specied phase margin m at a frequency w1 , if the parameters a1 and b1 of w a1 1 + 1+ w a1 w + a0 w0 a0 = a0 = a0 D(w) = w b1 w + 1 1 + b1 w 1+ wp where, are set to satisfy w0 = a0 a1 and wp = 1 b1

29

a1 b1

= =

1 a0 jG(jw1 )j cos w1 jG(jw1 )j sin cos a0 jG(jw1 )j w1 sin

where, = D(jw1 ) = 180 + m G(jw1 ). The DC gain a0 must be known from other criteria such as steady state error ess or DC gain.

30

Verication (check)
1 a0 jG(jw1 )j cos j w1 + a0 ja1 w1 + a0 w1 jG(jw1 )j sin = cos a0 jG(jw1 )j jb1 w1 + 1 w1 + 1 j w1 sin 1 j (1 a0 jGj cos ) + a0 jGj sin jG(jw1 )j j (cos a0 jGj) + sin

D(jw1 ) =

= Thus, D(jw1 )
2

= = =

1 (1 a0 jGj cos )2 + (a0 jGj sin )2 jGj2 (cos a0 jGj)2 + sin2


2 j G j 1 1 2a0 jGj cos + a2 0 2 jGj2 1 2a0 jGj cos + a2 0 jGj 1 jGj2

31

For phase angle, a1 1 + j w1 a0 1 + jb1 jw1 1 a1 w1 tan1 b1 w1 tan a0 1 a1 w1 tan tan1 b1 w1 tan tan a0 a1 1 + tan tan1 w1 tan tan1 b1 w1 a0 a1 w b1 w1 a0 1 a1 1 + w1 b1 w1 a0

D(jw1 )

= =

tan D(jw1 )

32

Substituting, a1 w1 = 1 a0 jGj cos jGj sin and b1 w1 = cos a0 jGj sin

tan D(jw1 )

2 sin (1 2a0 jGj cos + a2 0 jGj ) = 2 cos (1 2a0 jGj cos + a2 0 jGj ) = tan

Thus, the compensator D(jw1 ) satises 1 jD(jw1 )j = jG(jw1 )j and D(jw1 ) =

33

Range to choose w1 for Phase-Lead Case


This formula based method is straightforward and works well as long as the choice of w1 is proper. The range of frequency w from which w1 should be chosen is specied by the following conditions for phase lead compensators. 1. = D(jw1 ) = 180 + m G(jw1 ) > 0 requires to choose w1 to satisfy a phase condition G(jw1 ) < 180 + m . 2. Since jD(jw )j > a0 , jD(jw1 )j > a0 . Then, w1 should satisfy a gain condition, jG(jw1 )j = 1 1 < jD(jw1 )j a0

3. In the transfer function D(w), a0 , a1 and b1 must be all


34

positive as w0 compensators. Referring to a1 w1

a0 1 = and wp = . sin > 0 for phase lead a1 b1

1 a0 jGj cos = jGj sin

and

b1 w1

cos a0 jGj = . sin

the numerators must be positive as well. 1 a0 jGj cos > 0 and cos a0 jGj > 0

1 > cos > a0 jG(jw1 )j a0 jG(jw1 )j This condition is written for jG(jw1 )j as 1 cos < jG(jw1 )j < a0 a0 cos

35

Thus, cos jG(jw1 )j < , a0 which is more restrictive than the condition derived from the 1 gain, jG(jw1 )j < . a0

36

Range to choose w1 for Phase-Lag Case


The range of frequency w from which w1 should be chosen is specied by the following conditions for phase lag compensators. 1. = D(jw1 ) = 180 + m G(jw1 ) < 0 requires to choose w1 to satisfy a phase condition G(jw1 ) > 180 + m . 2. Since jD(jw )j < a0 , jD(jw1 )j < a0 . Then, w1 should satisfy a gain condition, 1 1 jG(jw1 )j = > jD(jw1 )j a0 3. In the transfer function D(w), a0 , a1 and b1 must be all 1 a0 positive as w0 = and wp = . sin < 0 for phase lag a1 b1
37

compensators. Referring to a1 w1 = 1 a0 jGj cos jGj sin and b1 w1 = cos a0 jGj . sin

the numerators must be negative as well. 1 a0 jGj cos < 0 and cos a0 jGj < 0

1 < cos < a0 jG(jw1 )j a0 jG(jw1 )j This condition yields, jG(jw1 )j > Thus, jG(jw1 )j >
38

1 cos > a0 cos a0 1 . a0 cos

1 This is more restrictive than jG(jw1 )j > . a0

39

Design specic to Phase lag Compensator


The rst order phase lag compensator can be designed by the formula similarly as in the case of phase lead compensator. However, there is a basic dierence in the principle of compensating for a required phase margin. Phase lead compensators add a positive phase to increase the phase margin without drastically changing the 0 dB crossover frequency. A phase lag compensators is used to lower the overall gain to shift the 0 dB crossover frequency to a much smaller value so that a larger phase margin is obtained. Since the 0 dB crossover frequency w1 is shifted to a lower frequency where the phase response of the Bode diagram is not aected by the compensator, selecting w1 can be done on the Bode
40

diagram of G(w) alone without being aected by the compensator. First, nd a new crossover frequency w1 where the condition, G(jw1 ) = 180 + m + 5 is satised. 5 accounts for a slight phase angle derease by the phase lag compensator. The rule of thumb to set w0 in the compensators transfer function, w 1+ a1 w + a0 w0 D(w) = a0 w = b1 w + 1 1+ wp is to pick one decade lower than the w1 , i.e. w0 = 0.1 w1 .

41

For a phase lag compensator, wp < w0 . w1 1+j w0 w 1+j 1 wp wp 1 = a0 w0 G(jw1 )

jD(w1 )j = a0

Thus, wp = w0 0.1 w1 = a0 jG(jw1 )j a0 jG(jw1 )j

42

Example 8.1 page 294


The servo motor is to control the horizontal (azimuth) angle for pointing a radar antenna. The transfer function is given by 1 G(s) = s(s + 1)(0.5s + 1) The z-transform of this system combined with ZOH is G(z ) = 4.0140 10
5

(z + 3.5954)(z + 0.2580) . (z 1)(z 0.9512)(z 0.9048)

The Bode diagram drawn for w-domain with respect to the frequency axis of w is shown.

43

Magnitude Response 20

Magnitude in dB

20

40

60 1 10

10 frequency in rad/s Phase Response

10

50 100

Phase in degrees

150 200 250 300 1 10

10 frequency in rad/s

10

44

Design a phase lag compensator that achieves a phase margin of m = 55 for a0 = 1. G(jw1 ) = 180 + 55 + 5 = 120 By the Bode diagram, w1 0.36. At this frequency jG(jw1 )j = 2.57 = 8.2dB. Therefore, w0 = 0.1 w1 = 0.036 wp = 0.1 w1 = 0.0140 a0 jG(jw1 )j z 0.9982 . z 0.9993

Using these values of a0 , w0 and wp , D(z ) = 0.3891

The frequency response after compensation is shown in the frequency axis of w .


45

Magnitude Response 20 0

Magnitude in dB

20 40 60 80 1 10

10 frequency in rad/s Phase Response

10

50 100

Phase in degrees

150 200 250 300 1 10

10 frequency in rad/s

10

46

Example 8.2 page 302 Phase lead compensator design


The servo motor is to control the horizontal (azimuth) angle for pointing a radar antenna. (same system as Example 8.1) The transfer function is given by 1 G(s) = s(s + 1)(0.5s + 1) Try a phase lead compensator that satises the phase margin of m = 55 . We keep a0 = 1 as the previous phase lag case. We need to select a w1 to use the formula that determine the compensator coecients a1 and b1 . Refer to the three conditions. G(jw1 ) < 180 + m . 1 1 jG(jw1 )j = < D(jw1 ) a0
47

cos , a0 where, = D(jw1 ) = 180 + m G(jw1 ) > 0. jG(jw1 )j < The range that the rst condition G(jw1 ) < 180 + m = 125 , w1 > 0.45 according to the Bode diagram (phase). 1 requres w1 > 0.75 from The second condition jG(jw1 )j < a0 the Bode diagram (gain). So, try w1 > 1.2 to see if the third condition is satised. = 180 + m G(jw1 ) > 0. G(jw1 ) = 172.8 . Therefore, = 180 + 55 (172.8) = 47.8 . cos = 0.6709 and a0 jG(jw1 )j = 0.4576. Thus, the third condition is met. Therefore, the choice of w1 1.2 is acceptable for the use of the
48

formula. i.e. w1 = 1.2 Using the formula, a1 = We nd, a1 = 1.7016 and b1 = 0.2397 The parameters of the discrete time domain transfer function of the compensator z z0 D(z ) = Kd z zp are Kd z0 = = wp (w0 T + 2) wp (w0 + a0 = a0 w0 (wp T + 2) w0 (wp + w0 w0 T 2 = w0 T + 2 w0 +
49 2 T 2 T 2 T) 2 T)

1 a0 jGj cos w1 jGj sin

and

b1 =

cos a0 jGj w1 sin

= 6.5230

= 0.9710

zp

w T 2 w p = p wp T + 2 wp +

2 T 2 T

= 0.8111

The frequency response of D(jw )G(jw ) in the w-domain is shown below. This shows that the phase margin was increased. The graph shows increased gain in a high frequency range caused by the phase lead compensator.

50

Magnitude Response 40 20

Magnitude in dB

0 20 40 60 1 10

10 frequency in rad/s Phase Response

10

50 100

Phase in degrees

150 200 250 300 1 10

10 frequency in rad/s

10

51

Matlab program to assist phase lead compensator design.


% % Example 8.1 page 294 % G(s)=1/s(s+1)(0.5s+1)=2/s(s+1)(s+2) % % num=2; den=poly([0,-1,-2]); sys=tf(num,den); w=logspace(-1,1,100); jw=j*w; H=polyval(num,jw)./polyval(den,jw); mag=20*log10(abs(H)); radians=angle(H); phase=unwrap(radians)*180/pi; subplot(211),semilogx(w,mag,b),grid title(Magnitude Response Analog); xlabel(frequency in rad/s),ylabel(Magnitude in dB); subplot(212),semilogx(w,phase,b),grid title(Phase Response Analog); xlabel(frequency in rad/s),ylabel(Phase in degrees); figure(2); T=0.05; 52

zeroG=[]; poleG=[0, -1, -2]; gainG=2; [zdG, pdG, kdG]=c2dzp(zeroG, poleG, gainG, T); numdG=poly(zdG)*kdG; dendG=poly(pdG); [numW, denW]=z2w(numdG,dendG,T); w=logspace(-1,1,100); jw=j*w; H=polyval(numW,jw)./polyval(denW,jw); mag=20*log10(abs(H)); radians=angle(H); phase=unwrap(radians)*180/pi; subplot(211),semilogx(w,mag,b),grid title(Magnitude Response); xlabel(frequency in rad/s),ylabel(Magnitude in dB); subplot(212),semilogx(w,phase,b),grid title(Phase Response); xlabel(frequency in rad/s),ylabel(Phase in degrees); %bode(kdG*numW, denW, W); print -dps exmpL8_1.ps % Phase lead compensator design a1*w +a0 / b1 w + 1 = a0 (w/(a0/a1) + 1)/(w/(1/b1)+1) Ww=input(Select Omega_w_1=);

53

Phmar=input(Specify Phase margin(+ in degrees)=); a0=input(compensator DC gain a0=) [G,GdB,Ph]=Gpha(numW,denW,Ww) theta=-180+Phmar-Ph theta=theta*pi/180; a1=(1-a0*G*cos(theta))/(Ww*G*sin(theta)) b1=(cos(theta)-a0*G)/(Ww*sin(theta)) % check disp(angle G(j omega_w_1) < -180 + Phmar); Ph -180+Phmar disp(gain G(j omega_w_1) < 1/a0); G 1/a0 disp(cos theta > a0 * gain G(j omega_w_1)); cos(theta) a0*G pause; figure(3); sysW=tf(numW,denW); w0=a0/a1; wp=1/b1; cmsW=tf(a1*[1, w0], b1*[1, wp]);

54

%cmsW=tf(0.014*[1,0.036],0.036*[1,0.014]) ttlW=sysW*cmsW; ttWmin=minreal(ttlW); [numW,denW]=tfdata(ttWmin,v); [G,GdB,Ph]=Gpha(numW,denW,Ww); w=logspace(-1,1,100); jw=j*w; H=polyval(numW,jw)./polyval(denW,jw); mag2=20*log10(abs(H)); radians=angle(H); phase2=unwrap(radians)*180/pi; subplot(211),semilogx(w,mag,k--,w,mag2,b),grid title(Magnitude Response); xlabel(frequency in rad/s),ylabel(Magnitude in dB); subplot(212),semilogx(w,phase,k--,w,phase2,b),grid title(Phase Response); xlabel(frequency in rad/s),ylabel(Phase in degrees); print -dps exmpL8_1c.ps disp(discrete time, z-domain compensator Kd(z-z0)/(z-zp)); Kd=a0*(wp*(w0+2/T))/(w0*(wp+2/T)) z0=(2/T-w0)/(2/T+w0) zp=(2/T-wp)/(2/T+wp)

55

PID Controller Design

A digital PID (Proportional, Integral and Dierential) controller is given by T z+1 1 D(z ) = KP + KI + KD (1 z 1 ), 2 z1 T whereas an analog PID controller is 1 + KD w w KD w 2 + KP w + KI = w w w (1 + )(1 + ) w1 w2 = KI w From the last expression, we can obtain the frequency response (Bode diagram) of D(w). D(w) = KP + KI
56

PID contoller is widely used as a compensator to stabilize closed-loop systems by adjusting the phase margin and gain margin. Here, we try to primarily adjust the phase margin to a 2 T desired value. Since w = tan , due to the term KD w, T 2 jD(jw )j when,
57

T .

We do not use w =

2 z1 for D-action. Instead we use T z+1 1 z1 (1 z 1 ) = . T Tz

w w w = = = w w 1+ T w T 2 z= 1+ 1 + s 1+ w 1 T w 2 2 2 ( ) ( ) T Therefore, the corner frequency at w = s s < 2

z1 Tz

prevents the gain of D-action from going to . In another word, the pole at z = 1 is unstable but not the pole at z = 0. We use the following D(w) for the purpose of PID controller design with

58

an assumption that the actual frequency D(w) = KP + KI

s s < . 2

1 + KD w. w

1 + jKD w D(jw ) = KP jKI w 1 = KP + j KD w KI w = jD(jw )j jD(jw )j = =


2 KP

tan

1 2 ) + (KD w KI w 1 K K D w I w 1 KP

59

PID controller design


Determine KP , KI and KD such that the phase margin is m at a cross-over frequency w1 . This requirement is D(jw1 )G(jw1 ) = 1 180 + m For gain, 1 jD(jw1 )j = jG(jw1 )j For phase, D(jw1 ) + G(jw1 ) = 180 + m D(jw1 ) = 180 + m G(jw1 ). Since KP + j KD w1 1 KI w1 = jD(jw1 )jej

60

= =

jD(jw1 )j (cos + j sin ) 1 (cos + j sin ) jG(jw1 )j 1 cos jG(jw1 )j 1 sin jG(jw1 )j
1 KD w1 < KI w 1 KD w1 > KI w
1

KP KD w1 KI phase lag: phase lead: 1 w1

= =

<0 >0

sin < 0 sin > 0

Increasing KD increases bandwidth. Increasing KI decreases steady state error ess provided that the system retains an acceptable gain margin. If the above two conditions are staised, varying KI and KD will change the gain margin, while the phase
61

margin remains unchanged. From the relationship, D(jw1 ) = 180 + m G(jw1 ) = the cross-over frequency w1 must be chosen depending on whether the PID controller should be of leading phase or lagging phase. w1 should be chosen where G(jw1 ) < 180 + m , if leading phase (more D-action than I-action). w1 should be chosen where G(jw1 ) > 180 + m , if lagging phase (more I-action than D-action).

62

PI and PD Controller

Referring to the Bode diagram of PID controller, PID controller increases its gain both at low frequecy and at high frequency. A large gain at low frequency decreases steady state error, ess . A large gain at high frequency may shift the cross-over frequency to a higher frequency causing the decrease of phase margin, but it adds
63

a leading phase up to 90 . A larger gain at high frequency makes the bandwidth wider. The previously described design method for PID controller does not give a unique solution for KI and KD . The PI or PD controller drops D-action or I-action, respectively. In the case where both D-action and I action need not to be present, one can use PI or PD controller for which the solution for KI or KD becomes uniquely determinable. In PID case, KP + j KD w1 KI 1 w1 = 1 (cos + j sin ) jG(jw1 )j

PI controller, < 0
1 1 KP jKI = (cos + j sin ) w1 jG(jw1 )j
64

KP KI

1 = cos jG(jw1 )j 1 sin = w1 jG(jw1 )j

65

PD controller, > 0
KP + jKD w1 1 = (cos + j sin ) jG(jw1 )j 1 cos jG(jw1 )j 1 sin w1 jG(jw1 )j

KP KD

= =

Exact Solutions The digital PID controller 1 T z+1 + KD (1 z 1 ), D(z ) = KP + KI 2 z1 T is mapped to w-domain exactly as D(w) = KP + KI 1 + KD w w T 1+ w 2

66

The solutions derived from 1 D(w) = KP + KI + KD w w s s provided for the actual frequency to be < are 2 approximations. The frequency response is D(jw ) = KP jKI 1 + KD w jw T 1 + jw 2

At the cross-over frequency w1 , D(jw1 ) = KP jKI 1 + KD w1 jw1 T 1 + jw1 2

1 (cos + j sin ) jG(jw1 )j


67

The real part gives 2 ) cos T KP + = 2 jG(jw1 )j 2 ( )2 + w 1 T The imaginary part gives
2 KD w ( 1

2 2 KD w ( ) 1 sin T KI = 2 w1 jG(jw1 )j 2 ( )2 + w 1 T For PI controller with KD = 0, the equations for KP and KI remain the same as the approximated solutions. However, PD controller gains KD and KP are given as follows. 2 2 2 ( ) + w 1 sin T KD = 2 jG(jw1 )j ( )2 w1 T
68

KP =

cos 2 jG(jw1 )j 2 ( )2 + w 1 T

2 KD w ( 1

2 ) T

69

PI controller for the servo-motor for a radar antenna


For the same system of G(s) = 1 , s(s + 1)(0.5s + 1)

design a PI controller to have phase margin of 55 at w1 = 0.4. Using the design program below, Kp = 0.4392 and Ki = 0.0040 were found.

70

Magnitude Response 20 0

Magnitude in dB

20 40 60 80 1 10

10 frequency in rad/s Phase Response

10

50 100

Phase in degrees

150 200 250 300 1 10

10 frequency in rad/s

10

71

% % Example 8.4 and 8.5 page 317 and 318 % G(s)=1/s(s+1)(0.5s+1)=2/s(s+1)(s+2) % num=2; den=poly([0,-1,-2]); sys=tf(num,den); %-----------------dSys=c2d(sys,0.05,zoh); [dSyszeros,dSyspoles,Ksys,ts]=zpkdata(dSys,v); zeros=[dSyszeros]; poles=[dSyspoles]; num=poly(zeros); den=poly(poles); %-----------------w=logspace(-1,1,100); jw=j*w; H=polyval(num,jw)./polyval(den,jw); mag=20*log10(abs(H)); radians=angle(H); phase=unwrap(radians)*180/pi; subplot(211),semilogx(w,mag,b),grid title(Magnitude Response); xlabel(frequency in rad/s),ylabel(Magnitude in dB);

72

subplot(212),semilogx(w,phase,b),grid title(Phase Response); xlabel(frequency in rad/s),ylabel(Phase in degrees); figure(2); T=0.05; zeroG=[]; poleG=[0, -1, -2]; gainG=2; [zdG, pdG, kdG]=c2dzp(zeroG, poleG, gainG, T); numdG=poly(zdG)*kdG; dendG=poly(pdG); [numW, denW]=z2w(numdG,dendG,T); w=logspace(-1,1,100); jw=j*w; H=polyval(numW,jw)./polyval(denW,jw); mag=20*log10(abs(H)); radians=angle(H); phase=unwrap(radians)*180/pi; subplot(211),semilogx(w,mag,b),grid title(Magnitude Response); xlabel(frequency in rad/s),ylabel(Magnitude in dB); subplot(212),semilogx(w,phase,b),grid title(Phase Response);

73

xlabel(frequency in rad/s),ylabel(Phase in degrees); print -dps exmpL8_5.ps % PID controller design D(w)=Kp + Ki/w + Kd*w Ww=input(Select Omega_w_1=); Phmar=input(Specify Phase margin(+ in degrees)=); [G,GdB,Ph]=Gpha(numW,denW,Ww) theta=-180+Phmar-Ph theta=theta*pi/180; if theta>0 disp(D action > I action); else disp(I action > D action); end Kp=cos(theta)/G type=input(Which do you specify, Ki or Kd? ,s); notOK=1; while(notOK) if (type==Ki | type==ki) Ki=input(Enter value of Ki =); notOK=0; Kd=(sin(theta)/G+Ki/Ww)/Ww else if (type==Kd | type==kd) Kd=input(Enter value of Kd =);

74

notOK=0; Ki=(Kd*Ww-sin(theta)/G)*Ww end end end figure(3); sysW=tf(numW,denW); pidW=tf([Kd,Kp,Ki],[0,1,0]) ttlW=sysW*pidW; ttWmin=minreal(ttlW); [numW,denW]=tfdata(ttWmin,v); w=logspace(-1,1,100); jw=j*w; H=polyval(numW,jw)./polyval(denW,jw); mag2=20*log10(abs(H)); radians=angle(H); phase2=unwrap(radians)*180/pi; subplot(211),semilogx(w,mag,k--,w,mag2,b),grid title(Magnitude Response); xlabel(frequency in rad/s),ylabel(Magnitude in dB); subplot(212),semilogx(w,phase,k--,w,phase2,b),grid title(Phase Response);

75

xlabel(frequency in rad/s),ylabel(Phase in degrees); print -dps exmpL8_5c.ps

76

PID controller for the servo-motor for a radar antenna


For the same system of 1 G(s) = , s(s + 1)(0.5s + 1) design a PID controller to have phase margin of 55 at w1 = 1.2. Specifying Ki = 0.004 in the PID design program, Kp = 1.4661 and Kd = 1.3530 were found.

77

Magnitude Response 40 20

Magnitude in dB

0 20 40 60 1 10

10 frequency in rad/s Phase Response

10

50 100

Phase in degrees

150 200 250 300 1 10

10 frequency in rad/s

10

78

Assignment No. 6
Work on a series of questions related to the same system in Figure P8-2 (page 329). 1. 8-2 textbook page 328 2. 8-3 textbook page 329 3. 8-10 textbook page 330 4. 8-11 textbook page 330

79

You might also like