Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 61 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
61
Dung lượng
4,55 MB
Nội dung
‘ms ase ,R- of IlS- the the CIIAITEK IO: Frdquency-Domain Dynamics 363 6 1 I I I1111 I I I I1111 1 ll1llll I I I I1111 I I llllll 0.01 0.1 1.0 10 w = frequency, radians per time FIGURE 10.24 Bode plots of several systems. arguments of the individual components. This is particularly useful when there is a deadtime element in the transfer function. If you try to calculate the phase angle from the final total complex number, the FORTRAN subroutines ATAN and ATAN can- not determine what quadrant you are in. ATAN has only one argument and therefore can track the complex number only in the first or fourth quadrant. So phase angles between -90” and - 180” will be reported as +90” to 0”. The subroutine ATAN2, since it has two arguments (the imaginary and the real part of the number), can accu- rately track the phase angle between + 180” and - 180°, but not beyond. Getting the phase angle by summing the angles of the components eliminates all these problems. A complex number G always has two parts: real and imaginary. These parts can be specified using the statement G= CMPLX(X, Y) where G = complex number X = real part of G Y = imaginary part of G Complex numbers can be added (G=GI +G2), multiplied (G=GI*G2), and divided (C=GZ/G2). Th e magnitude of a complex number can be found by using the state- ment XX=CARS(G) 364 PAW 7‘1 IREE: Frequency-Domain Dynamics and Control where XX = the real number that is the magnitude of G. Knowing the compk~~ number G, we can find its real and imaginary parts by using the statements X=REAL(G) Y=AIMAG(G) A deadtime ,element Gtsj = eens Gtiw, = e- iD” = cos(Dw) - isin ( 10.55) can be calculated using the statement G=FMPLX(COS(D”W),-SIN(D*W)) where D = deadtime W = frequency, in radians per minute in the FORTRAN program The program in Table 10.1 illustrates the use of some of these complex FORTRAN statements. 10.4.2 MATLAB Program for Plotting Frequency Response Table 10.2 gives a MATLAB program that generates Nyquist, Bode, and Nichols plots for the three-heated-tank process. Figure 10.25 gives the plots. The num and den polynomials are defined in the same way as in the root locus plots in Chapter 8. The frequency range of interest is specified by a logspace function from o = 0.01 to 10 radians/time. The magnitudes and phase angles of Gfio> are found by using the [magphase, w] = bode(num,den, w) statement. The ultimate gain and frequency are found by searching through the vector of phase angles until the - 180” point is crossed. The real and the imaginary parts of Gfiwj for making.the Nyquist plot can be found in two different ways. The easiest is to use the {greaZ,gimag, w] = nyquist(num, den,w) statement. Alternatively, the real part can be calculated from the product of the magnitude and the cosine of the phase angle (in radians) at each frequency. This term-by-term multiplication is accomplished in MATLAB by using the . * operation. Handling deadtime in MATLAB is not at all obvious. Larry Ricker (private communication, 1993) suggested a method for accomplishing it using the polyval function. As illustrated in the program given in Table 10.3, the numerator and de- nominator polynomials are evaluated at each frequency point. Then these polynomi- als are divided at each frequency point by using the . /division operation. Finally, each of the resulting complex numbers is multiplied by the corresponding deadtime exp(-d*w) at that frequency by the .* multiplication operation. Another problem encountered in systems with deadtime is large phase angles. As the curves wrap around the origin for higher frequencies, it becomes difficult to track the phase angle. MATLAB has a convenient solution to this problem: the unwrap command. As illustrated in Table 10.3, the phase angles are first calculated for each frequency by using a “for” loop to run through all the frequency points. Then the unwrup(r-adiarzi) command is used to avoid the jumps in phase angle. blex 55) 4N 101s md r 8. .Ol ing ‘CY t is be lm, of his on. ate val le- ni- b, me es. ult :he ;ed rts. CIIAPTIIK ~1: Frequency-Domain Dynamics 365 MATLAB program for frequency response plots % Program “tempb0de.m ” uses Matlab to plot Bode, Nyquist % and Nichols plots for three heated tank process 70 % Form numerator and denominator polynomials num=i.333; &n=conv([o. I I],[O. I I]); den=conv(den,[O. I I]); % Specijy frequency range from 0.1 to 100 radians/hour (600 points) w=logspace( - 1,2,600); 70 % Calculate magnitudes and phase angles at all frequencies % using the “bode” function 70 [mag,phase, w/= bode(num,den, w); db=2O*loglO(mag); 70 % Calculate ultimate gain and frequency n=l; while phase(n)>= - 180;n=n+l;end kult=l/mag(n); wult=w(n); 70 % Plot Bode plot 70 C/f axis( ‘normal ‘) subplot(211) semilogx(w,db) title( ‘Bode Plot for Three Heated Tank Process’) xlabel( ‘Frequency (radians/hr)‘) ylabel(‘Log Modulus (dB) ‘) grid text(2, - lO,[ ‘Ku= ‘,num2str(kult)]) text(2, -2O,[ ‘wu= ‘,num2str(wult)]) subplot(212) semilogx( w,phase) xlabel( ‘Frequency (radians/hr) ‘) ylabel( ‘Phase Angle (degrees) ‘) grid pause print -dps pjiglO2S.p~ 70 % Make Nichols plot % elf plot(phase,db) title(‘Nicho1 Plot for Three Heated Tank Process’) .rlabel( ‘Phase Angle (degrees) ‘) .dahell ‘Log Modulus (dB) ‘) grid pause fl-ABLE 10.2 (CONTINUEU) MATLAB program for frequency response plots % Alternatively you can USE “nichols ” command % [mugphase, w]=nichols(num.den, w); print -dps -append pjiglO25 Of0 9’0 Make Nyquist plot 70 % Using the “nyquist” command [grealgimag, w]=nyquist(num,den, w); % Alternatively you can calculate the real and imaginary parts 70 from the magnitudes and phase angles %radians=phase*3.1416/180; %greal=mag.*cos(radians); %gimag=mag.*sin(radians); elf axis( ‘square ‘) plot(greal,gimag) grid title(‘Nyquist Plot for Three Heated Tank Process’) xlabel( ‘Real(G)‘) ylabel( ‘Imag(G) ‘) pause print -dps -append p$g1025 Bode Plot for Three Heated Tank Process . . . . . . . . . . I . . . . . . I I I I11111 I I I I11111 I I I I IIIIJ 10° 10’ Frequency (radians/hr) lo* I I 1111111 I I I1 Illll I I I llil( 10-l IO0 10’ Frequency (radians/hr) 10* FIGURE 10.25 . Frequency response plots for three-heated-tank process. Nichol Plot for Three Heated Tank Process 10 0 -10 5 9 -20 2 =, B = -30 g -I -40 -50 -60 -L -300 -250 -200 -150 -100 -50 0 .y 0.2 0 -0.2 6 2 -0.4 E -0.6 -0.8 -1 Phase Angle (degrees) Nyquist Plot for Three Heated Tank Process I I I I I I I I . ~ ~ , ~ , : . . . . . . . . . . . . . . .I . . . . . . .~~~~ ~~.~~~~~ ~ -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 Real(G) FIGURE 10.25(CONTINUED) Frequency response plots for three-heated-tank process. 367 368 t+wrTtttwE: Frequency-Domain l!)ynamics and Control TABI, IO.3 MATLAB program for deadtime Bode plots 70 Program “deadtime.m” % Calculate frequency response of process with deadtime % using the Larry Ricker method. % % Process is a first-order lag with time constant tau=lO minute, 70 a steady-state gain qf kp=l and a d=S minute deadtime. 940 tau=lO; kp=l; d=S; num= I; den=(lO I]; % Specify frequency range from 0.01 to 1 radians/minute (400 points) w=logspace(-2,0,400); % Define complex variable “s” s=w*sqrt(-I); 70 % Evaluate numerator and denominator polynomials at all frequencies % Note the “.I operator which does term by term division 70 g=polyval(num,s) ./ polyval(den,s); % % Multiple by deadtime % Note the “.*” operator which does term by term multiplication 950 gdead=g . * exp( - d*s); 70 % Calculate log modulus % db=20*loglO(abs(gdead)); 70 % Calculate phase angles 70 nw=length(w); for n=l:nw radians(n)=atan2(imag(gdead(n)),real(gdead(n))); end 70 Use “unwrap” operator to remove 360 degree jumps in phase angles phase=180*(unwrap(radians))/3.1416; 70 % Plot Bode plot df axis{ ‘normal ‘) subplot(211) semilogx(w,db) title(‘Bode Plot for Deadtime Process’) xlabel( ‘Frequency (radiandmin) ‘) ylabel(‘Log Modulus (dB)‘) text(0.02, - 10, ‘Tau=lO’) text(0.02, - 15, ‘Deadtime=S’) grid CIIAITEK IO: Frequency-Domain Dynamics 369 ‘rAIiI,1( 10.3 (CONTINUED) MATLAB program For deadtime Bode plots subplot{2 12) semilogx(w,phase) xlabel( ‘Frequency (rudiandmin) ‘) ylabel( ‘Phase Angle (degrees) ‘) grid pause print - dps pjig IO26.p.~ Bode Plot for Deadtime Process : . 10-l Frequency (radians/min) . . . . . . . . . . 10-l Frequency (radians/min) loo FIGURE 10.26 Figure 10.5 10.26 gives the resulting plots for a first-order lag and deadtime process. CONCLUSION (10.56) We have laid the foundation for our adventure into the China mainland. We’ve learned the language,*and we have learned some useful graphical and computer soft- ware tools for working with it. In the next chapter we apply all these to the problem 370 PARTTHREE: Frequency-Domain Dynamics and Control of designing controllers for simple SlSO systems. In later chapters tie use these frequency-domain methods to tackle some very complex and important problems: multivariable systems and system identification. PROBLEMS 10.1. Sketch Nyquist, Bode, and Nichols plots For the following transfer functions: I (a) G(s) = (s + 1)3 1 @) G(s) = (s + l)(lOs + I)( loos 91) Cc> G(s) = 1 sqs + 1) 7-s + 1 @) Gw = (d6)s + 1 (e> G(s) = & V> G(s) = 1 (10s + l)(s2 + s + 1) 10.2. Draw Bode plots for the transfer functions: (a) Gcs) = 0.5 (b) G(s) = 5.0 10.3. Sketch Nyquist, Bode, and Nichols plots for the proportional-integral feedback con- troller Gc(,) : 10.4. Sketch Nyquist, Bode, and Nichols plots for a system with the transfer function -3s+ 1 G(s) = (s + 1)(5s + 1) 10.5. Draw the Bode plots of the transfer function G(.s) = 7.5(s + 0.2) s(s + 1)3 10.6. Write a digital computer program that gives the real and imaginary parts, log modulus, and phase angle for the transfer functions: PIlP22 - Pf2P?I (a) (Xi, = Gcc.v,- A P 22 Ills, f CIIAIW~K IO: Frequency-Domain Dynamics 371 where p~~c”) = (1 + 167s)(l + s)(l + 0.1~)~ PI2(s) = 0.85 (1 + 83s)(l + s)* p2 I (s) = 0.85 (1 + 167.x)( 1 + 0.5~)~( I + s) P 1 22(s) = (1 + 167s)(l + s)* (b) G(s) = ( O.L5 s + 1 + e-O.‘J 10.7. Draw Bode, Nyquist, and Nichols plots for the transfer functions: (a) h,(s) = G(s) 1 + Gc(s)G(s) where Gcw =K, l+’ i 7/s 1 G(s) = ___ 7,s + 1 10.8. Draw the Bode plot of K, = 6 q = 6 To = 10 1 - e-D~ G(.s, = s 10.9. A process is forced by sinusoidal input u,~Q). The output is a sine wave y,cl). If these two signals are connected to an x-y recorder, we get a Lissajous plot. Time is the parameter along the curve, which repeats itself with each cycle. The shape of the curve will change if the frequency is changed and will be different for different kinds of processes. (a) How can the magnitude ratio MR and phase angle 8 be found from this cur\,e? (6) Sketch Lissajous curves for the following systems: (9 (-4s) = K,, (ii) G ’ C.7) = ; at o = 1 radian/time 1 at w = - radians/time 70 CHAPTER II Frequency-Domain Analysis of Closedloop Systems 372 The design of feedback controllers in the frequency domain is the subject of this chapter. The Chinese language that we learned in Chapter 10 is used to tune con- trollers. Frequency-domain methods have the significant advantage of being easy to use for high-order systems and for systems with deadtime. We show in Section 11.1 that closedloop stability can be determined from the frequency response plot of the total openloop transfer function of the system (process openloop transfer function and feedback controller G~~(i~jGc(i~)). This means that a Bode plot of G M(~~~Gc(;~) is all we need. As you remember from Chapter 10, the total frequency response cuive of a complex system is easily obtained on a Bode plot by splitting the system into its simple elements, plotting each of these, and merely adding log moduli and phase angles together. Therefore, the graphical generation of the required G M(;~)G~(~~) curve is relatively easy. Of course, all this algebraic manipulation of complex numbers can be even more easily performed on a digital computer. 11.1 NYQUIST STABILITY CRITERION The Nyquist stability criterion is a method for determining the stability of systems in the frequency domain. It is almost always applied to closedloop systems. A working, but not completely general, statement of the Nyquist stability criterion is: !f (1 pd~r* plot qf’tht> total openloop transferfunction of the system GM(iwjGC(iw) wraps U~O~~IIC/ the (- 1, 0) point in the GMG~ plane as frequency w goes from zero to iilfirlit\: tilt’ s\~.vtcm is closedloop unstable. . [...]... and count the number N of encirclements of the (- 1, 0) point, we know the difference between the number of zeros 2 and the number of poles P that lie in the RHP We want to find out if there are any zeros of the function Ftsj = 1 + GM(~,Gc(~) in the RHP Therefore, we must find the number of poles of Fts, in the RHP before we can determine the number of zeros Z=N+P (11.6) The poles of the function F’(,s,... denominator of GM(.~J) Once the number of poles P is known, the number of zeros can be found from Eq (I 1.6) 11.1.2 Examples Let us illustrate the mapping of the contour that goes around the entire right half of the s plane using some examples E x A M P I, E ii I Consider the three-CSTR process I GW.Q = (s +B I)3 With a proportional feedback controller, the total openloop transfer function (process and controller)... Proportional-Integral Controller (PI) The transfer function of a PI controller is ~‘IIAIWK I I: F;requency-I>otllaitl Analysis of Closedloop Systems G(i,,) = Kc 3 97 (11.38) The Bode plot of this combination of an integrator and a first-order lead is shown in Fig 1 I 13h At low frequencies, a PI controller amplifies magnitudes and contributes -90” of phase angle lag This loss of phase angle is undesirable from a dynamic... GMcsjGctsj are the same as the poles of Gw(.s)Gc(s, It the process is openloop stable, there are no poles of GM(~,Gc(~) in the RHF? Ai1 openloop-stable process means that P = 0 Therefore, the number N of 376 PARTTHREE: Frequency-Domain Dynamics and Control Contour goes around s plane completely RHP * Re W Zeros z=2 P=O Im ( 1 + G,G,) -4 Two -Re(l +G,Gc) encirclements of origin N=2 \ (b) Im (Gd%) I FIGURE... plots for the PI controllers with the two different settings Now we are ready to find the controller settings required to give various frequency-domain specifications with P, PI, and PID controllers A Proportional controller Gain margin Suppose we want to find the value of feedback controller gain K, that gives a gain margin GM = 2 We must find the value of & that makes the Nyquist plot of G~(s)Gc(,s)... radians Thus, Z is the number of zeros inside the contour with Mth-order zeros counted M times And P is the number of poles inside the contour with Nth-order poles counted N times B Application of theorem to closedloop stability To check the stability of a system, we are interested in the roots or zeros of the characteristic equation If any of them lies in the right half of the s plane, the system is... the real and imaginary parts of G,+,M(;wjG~(iw) This, of course, is just a polar plot of GM~,~)Gc(~J, as sketched in Fig 11.3~ The plot starts (w = 0) at i K, on the positive real axis It ends at the origin, as o goes to infinity, with a phase angle of - 270 ” CR contour On the CR contour, s = Re” (11.9) R will go to infinity and 8 will take 011 values from +7r/2 through 0 to -7r/2 radians Substituting... Fig 11.4h, the contour Co is a semicircle of radius r() And I-~) is made to approach zero c*trAr~rt . three-heated-tank process. 3 67 368 t+wrTtttwE: Frequency-Domain l!)ynamics and Control TABI, IO.3 MATLAB program for deadtime Bode plots 70 Program “deadtime.m” % Calculate frequency response of process. (-4s) = K,, (ii) G ’ C .7) = ; at o = 1 radian/time 1 at w = - radians/time 70 CHAPTER II Frequency-Domain Analysis of Closedloop Systems 372 The design of feedback controllers in the frequency. the frequency response plot of the total openloop transfer function of the system (process openloop transfer function and feedback controller G~~(i~jGc(i~)). This means that a Bode plot of G M(~~~Gc(;~) is