ECE45/55: Feedback Control Systems. 9 FREQUENCY-RESPONSE DESIGN 9.: PD and lead compensation networks The frequency-response methods we have seen so far largely tell us about stability and stability margins of a closed-loop system based on open-loop response. Now, we look at frequency-response based design methods which primarily aim at improving stability margins. Also, given the relationship between PM and performance, we have some idea of transient response as well. Start thinking of Bode-magnitude and Bode-phase plots as LEGO to make the frequency response we want. PD compensation Compensator D(s) = K ( + TD s). We have seen from root-locus that this has a stabilizing effect. Magnitude and phase effect: K 9 K. T D T D. T D T D Lecture notes prepared by and copyright 998 23, Gregory L. Plett and M. Scott Trimboli T D T D
ECE45/ECE55, FREQUENCY-RESPONSE DESIGN 9 2 PD controller increases phase for frequencies over ω./td.so, locate /T D < crossover so that phase margin at crossover is better. Problem: Magnitude response continues to increase as frequency increases. This amplifies high-frequency sensor noise. Lead compensation [ ] Ts + Compensator D(s) = K αts +, α <. Approximate PD control for frequencies up to ω = αt. Magnitude and phase effect: K α φ max K T ω max αt. T The phase contributed at frequency ω is T ω max αt αt φ = tan (T ω) tan (αt ω). To find where the maximum phase contribution is, we take the derivative of φ with respect to ω and set it to zero dφ dω = dtan (T ω) dω = T T 2 ω 2 + dtan (αt ω) dω αt α 2 T 2 ω 2 + = Lecture notes prepared by and copyright 998 23, Gregory L. Plett and M. Scott Trimboli
ECE45/ECE55, FREQUENCY-RESPONSE DESIGN 9 3 α 2 T 3 ω 2 + T = αt 3 ω 2 + αt T 3 ω 2 α(α ) = T (α ) ω max = T α. For this frequency, the amount of phase added is φ max = tan (T ω max ) tan (αt ω max ) ( ) ( ) α = tan α tan α }{{}}{{} θ θ 2 To get a simpler expression, consider the triangles to the right. + α φ max θ θ 2 We can solve for φmax using the law of cosines. This gives: α α + α 2 α α ( α) 2 = ( + α) + (α + α 2 ) 2 + α α + α 2 cos (φ max ) 2α + α 2 = + 2α + α 2 2 + α α + α 2 cos (φ max ) 4α cos (φ max ) = 2 + α α + α = 2 α 2 ( + α). Now, we remember that cos 2 (θ) + sin 2 (θ) =, so sin 2 (φ max ) = 4α ( + α) 2 = ( + α)2 4α ( + α) 2 So, we conclude that = ( α)2 ( + α) 2. Lecture notes prepared by and copyright 998 23, Gregory L. Plett and M. Scott Trimboli
ECE45/ECE55, FREQUENCY-RESPONSE DESIGN 9 4 ( ) α φ max = sin + α We can invert this to find α to add a certain phase φmax α = sin(φ max) + sin(φ max ). We can show that ωmax occurs mid-way between T and on a log αt scale ( ) ( ) ( ) log(ω max ) = log T = log + log αt T αt. = 2 [ ( ) ( )] log + log. T αt 9 8 How much can we improve phase with a lead network? φmax 7 6 5 4 3 2 2 If we need more phase improvement, we can use a double-lead compensator: D(s) = K [ ] Ts + 2. αts + Need to compromise between good phase margin and good sensor noise rejection at high frequency. /α Lecture notes prepared by and copyright 998 23, Gregory L. Plett and M. Scott Trimboli
ECE45/ECE55, FREQUENCY-RESPONSE DESIGN 9 5 9.2: Design method # for lead controllers Design specification include: Desired steady-state error. Desired phase margin. Compute steady-state error of compensated system. Set equal to desired steady-state error by computing K. Evaluate the PM of the uncompensated system using the value of K from above. ω max initially set to crossover frequency. Add a small amount of PM (5 to 2 )totheneededphaselead. (Lead network moves crossover point, so need to design conservatively): Gives φ max. Determine α = sin(φ max ) + sin(φ max ). Determine T = ω max α. Iterate if necessary (choose a slightly different ωmax or φ max ). EXAMPLE: Plant G(s) = s(s + ) Specification : Want steady-state error for ramp input <.. Specification 2: Want overshoot Mp < 25%. Start by computing steady-state error [ ] e ss = lim s R(s) s + D(s)G(s) [ ] = lim = s s + D(s) D(). (s+) Lecture notes prepared by and copyright 998 23, Gregory L. Plett and M. Scott Trimboli
ECE45/ECE55, FREQUENCY-RESPONSE DESIGN 9 6 [ ] Ts + D(s) = K αts + So, D() = K so D() = K. =.... K =. In Bode plot below, red line is original plant. Green line is plant with added gain of K =, butnoleadcompensator. We see that the new crossover is at 3 rad s,soω max = 3rads. Overshoot specification Mp < 25% gives PM > 45. Evaluating (red line) Bode diagram of KG(s) at crossover, we see we have a phase margin of 8.Needabout27 more to meet spec. Note, addition of pole and zero from lead network will shift crossover frequency somewhat. To be safe, design for added phase of 37 instead of 27. α = sin(37 ) + sin(37 ) =.25. T =.25(3) =.667. So, D(s) = [ 2s/3 + 2s/2 + ]. In plots below, the blue line is the Bode plot of the compensated system KD(s)G(s). Also, uncompensated root locus is plotted top-right; compensated root locus is plotted bottom-right. We find that we just missed specifications: PM = 44.Iterateif desired to meet specs. Lecture notes prepared by and copyright 998 23, Gregory L. Plett and M. Scott Trimboli
ECE45/ECE55, FREQUENCY-RESPONSE DESIGN 9 7 Magnitude Phase 6 5 4 3 2 2 3 4 2 2 9 2 3 4 5 6 7 ω (rad/sec) 8 2 2 ω (rad/sec) Imag Axis Imag Axis.5.5.5.5 2.5.5.5 6 4 2 2 4 Real Axis 6 7 6 5 4 3 2 2 Real Axis Amplitude.2.8.6.4.2 Step Response Amplitude 3 2.5 2.5.5 Ramp Response.5.5 2 2.5 Time (sec.) Summary of design example..5.5 2 2.5 3 Time (sec.). Determine dc-gain so that steady-state errors meet spec. 2. Select α and T to achieve an acceptable PM at crossover. Lecture notes prepared by and copyright 998 23, Gregory L. Plett and M. Scott Trimboli
ECE45/ECE55, FREQUENCY-RESPONSE DESIGN 9 8 9.3: Design method #2 for lead controllers Design specifications Desired closed-loop bandwidth requirements (rather than e ss ). Desired PM requirements. Choose open-loop crossover frequency ωc to be half the desired closed-loop bandwidth. Evaluate KG = G( jω c ) and φ G = G( jω c ). Compute phase lead required φmax = PM φ G 8. Compute α = sin(φ max ) + sin(φ max ). Compute T = αωc. Compensation is [ ] Ts + D(s) = K αts + α D( jω c ) =K + α α + = K α + α α + = K. α Open-loop gain at ωc is designed to be : D( jω c ) G( jω c ) = K α G( jω c ) = Our design is now complete. K = α K G. Lecture notes prepared by and copyright 998 23, Gregory L. Plett and M. Scott Trimboli
ECE45/ECE55, FREQUENCY-RESPONSE DESIGN 9 9 EXAMPLE: Desired gain crossover frequency of radians per second. Desired PM of 6. G(s) = s(s + ). KG = j( j + ) =., φ G = 74.3. φmax = 6 + 74.3 8 = 54.3. sin(φ max ) α = + sin(φ max ) =.37. T = α =.35. K D = α K G = 32.36. Matlab code to automate this procedure: % [K,T,alpha]=bod_lead(np,dp,wc,PM) % Computes the lead compensation of the plant np/dp to have % phase margin PM (in degrees) at crossover frequency wc (in radians/sec). % e.g., [K,T,alpha]=bod_lead([],[ ],5,6); function [K,T,alpha]=bod_lead(np,dp,wc,PM) % first compute the plant response at wc. [magc,phc]=bode(np,dp,wc); % now, compute the needed phase lead at wc and convert to radians % for use with "sine" phir=(-8+pm-phc)*pi/8; if abs(phir)pi/2, fprintf('a simple phase lead/lag cannot change the phase by more\n'); fprintf('than +/- 9 degrees.\n'); error('aborting.'); end; % Compute alpha, T, and K for compensator alpha=(-sin(phir))/(+sin(phir)); T=/(wc*sqrt(alpha)); K=sqrt(alpha)/magc; Lecture notes prepared by and copyright 998 23, Gregory L. Plett and M. Scott Trimboli
ECE45/ECE55, FREQUENCY-RESPONSE DESIGN 9 % compute the new open-loop system by convolving the plant polynomials % with the compensator polynomials. nol=conv(np,k*[t ]); dol=conv(dp,[alpha*t ]); % check the solution by plotting the Bode plot for the new open-loop % polynomials. Include the frequency w= % to get the full resonance response to show the gain margin. Also, plot % the uncompensated Bode response. w=logspace(-2,)*wc; w(34)=wc; clf; [mag,ph]=bode(np,dp,w); [mag2,ph2]=bode(nol,dol,w); subplot(2); semilogx(w/wc,2*log(mag),'--'); hold on; semilogx(w/wc,2*log(mag2)); grid; plot(w/wc,*w+,'g-'); ylabel('magnitude (db)'); title('phase-lead design (uncompensated=dashed; compensated=solid)'); subplot(22); semilogx(w/wc,ph,'--'); hold on; semilogx(w/wc,ph2); grid; plot(w/wc,*w-8+pm,'g-'); ylabel('phase'); xlabel('frequency/wc (i.e., ""=wc)'); Matlab results: Magnitude (db) Phase Phase lead design (uncompensated=dashed; compensated=solid) 4 2 2 4 6.. 9 2 5 8.. Frequency/wc (i.e., ""=wc) Lecture notes prepared by and copyright 998 23, Gregory L. Plett and M. Scott Trimboli
ECE45/ECE55, FREQUENCY-RESPONSE DESIGN 9 9.4: PI and lag compensation PI compensation In many problems it is important to keep bandwidth low, and also reduce steady-state error. PI compensation used here. K D(s) = K [ + T I s ]..ωt I ωt I ωt I K 9 ωt I ωt I Infinite gain at zero frequency Reduces steady-state error to step, ramp, etc. But also has integrator anti-windup problems. Adds phase below breakpoint. We want to keep breakpoint frequency very low to keep from destabilizing system. Lag compensation T I ω c. Approximates PI, but without integrator overflow. [ ] Ts + D(s) = α α>. αts + Lecture notes prepared by and copyright 998 23, Gregory L. Plett and M. Scott Trimboli
ECE45/ECE55, FREQUENCY-RESPONSE DESIGN 9 2 Primary objective of lag is to add 2 log α db gain to low frequencies without changing PM. α αt T αt T 9 Steady-state response improves with little effect on transient response. Typical process Assumption is that we need to modify (increase) the dc-gain of the loop transfer function. If we apply only a gain, then ω c typically increases and the phase margin decreases. NOT GOOD. Instead, use lag compensation to lower high-frequency gain. Assume plant has gain K (adjustable), or that we insert a gain K into the system. Adjust the open-loop gain K to meet phase margin requirements (plus about 5 slop factor) at crossover without additional compensation. Draw Bode diagram of system using the gain K from above. Evaluate low-frequency gain. Determine α to meet low-frequency gain requirements. Lecture notes prepared by and copyright 998 23, Gregory L. Plett and M. Scott Trimboli
ECE45/ECE55, FREQUENCY-RESPONSE DESIGN 9 3 Choose one corner frequency ω = (the zero) to be about one T decade below crossover frequency. (This way, the phase added by the lag compensator will minimally affect PM. Thephaseaddedat crossover will be about 5,henceourpreviousslopfactor). The other corner frequency is at ω = αt. Iterate design to meet spec. EXAMPLE: K G(s) = (.5 s + ) (s + ) ( 2 s + ). Bode plot for plant is red line, below. Uncompensated root locus is top-right plot. We want to design compensator for PM 25, K p = 9.. Set K = 4.5 for PM = 3.Thisgivescrossoveratω c.2 rads/sec. (Green line on Bode plot.) 2. Low-frequency gain now about 3 db or (3/2) = 4.5. 3. Should be raised by a factor of 2 to get K p = 9. So,α = 2. 4. Choose corner frequency at ω =.2 rads/sec. =.2, ort = 5. T 5. We then know other corner frequency ω = αt =..4 Step Response From: U() Altogether, we now have the compensator [ ] 5s + D(s) = 2. s + Amplitude To: Y().2.8.6.4.2 5 5 2 25 Time (sec.) Lecture notes prepared by and copyright 998 23, Gregory L. Plett and M. Scott Trimboli
ECE45/ECE55, FREQUENCY-RESPONSE DESIGN 9 4 2 2 Magnitude Phase 2 3 4 2 2 3 6 9 2 5 8 2 24 ω (rad/sec) 27 2 2 ω (rad/sec) Imag Axis Imag Axis 2 3.5 3 2.5 2.5.5.5 2 Real Axis 2 3.5 3 2.5 2.5.5.5 Real Axis Please understand that the recipes in these notes are not meant to be exhaustive! And, we often require both lead and lag to meet specs. Many other approaches to control design using frequency-response methods exist. In fact, once you are comfortable with Bode plots, you can add poles and zeros like LEGOs to build whatever frequency response you might like (within the limitations of Bode s gain-phase theorem). Our next section gives some guidance on this. Lecture notes prepared by and copyright 998 23, Gregory L. Plett and M. Scott Trimboli
ECE45/ECE55, FREQUENCY-RESPONSE DESIGN 9 5 9.5: Design based on sensitivity Goal: Develop conditions on Bode plot of loop transfer function D(s)G(s) that will ensure good performance with respect to sensitivity, steady-state errors and sensor noise. Steady-state performance = lower bound on system low-freq. gain. Sensor noise = upper bound on high-frequency gain. Consider also the risk of an unmodeled system resonance: Magnitude may go over. Can cause instability. Must ensure that high-frequency gain is low so magnitude does not go over. Magnitude 2 4 6 8 2 Frequency Together, these help us design a desired loop frequency response: Magnitude must be high at low frequencies, and Low at high frequencies. Magnitude of D(s)G(s) Steady-state Error Boundary Sensor noise and plant sensitivity boundary Sensitivity functions The presence of noises also enters our design considerations. w(t) r(t) D(s) G(s) y(t) v(t) Lecture notes prepared by and copyright 998 23, Gregory L. Plett and M. Scott Trimboli
ECE45/ECE55, FREQUENCY-RESPONSE DESIGN 9 6 Y (s) = W (s) + G(s)D(s)[R(s) V (s) Y (s)] [ + G(s)D(s)] Y (s) = W (s) + G(s)D(s)[R(s) V (s)] or, Y (s) = G(s)D(s) W (s) + [R(s) V (s)]. + G(s)D(s) + G(s)D(s) Tracking error = R(s) Y (s) G(s)D(s) E(s) = R(s) W (s) [R(s) V (s)] + G(s)D(s) + G(s)D(s) = + G(s)D(s) [R(s) W (s)] + G(s)D(s)V (s) + G(s)D(s) Define the sensitivity function S(s) to be S(s) = + G(s)D(s) which is the transfer function from r(t) to e(t) and from w(t) to e(t). The complementary sensitivity function T (s) = S(s) S(s) = G(s)D(s) + G(s)D(s) = T (s) which is the transfer function from r(t) to y(t). If V =, then and Y (s) = S(s)W (s) + T (s)r(s) E(s) = S(s)[R(s) W (s)]. The sensitivity function here is related to the one we saw several weeks ago SG T = T G G T = = + D(s)G(s) D(s)G(s) [ + D(s)G(s)] 2 + D(s)G(s) = S(s). G(s)[ + D(s)G(s)] G(s) Lecture notes prepared by and copyright 998 23, Gregory L. Plett and M. Scott Trimboli
ECE45/ECE55, FREQUENCY-RESPONSE DESIGN 9 7 So S(s) is the sensitivity of the transfer function to plant perturbations. Recall that T (s) + S(s) =, regardlessofd(s) and G(s). We would like T (s) =. ThenS(s) = ; Disturbanceiscancelled, design is insensitive to plant perturbation, steady-state error. BUT, forphysicalplants,g(s) for high frequencies (which forces S(s) ). Furthermore, the transfer function between V (s) and E(s) is T (s). To reduce high frequency noise effects, T (s) as frequency increases, and S(s). Typical sensitivity and complementary sensitivity (closed-loop transfer) functions are: S( jω) Performance Spec. T ( jω) Stability Spec. Another view of sensitivity: So, + D( jω)g( jω) is the distance between the Nyquist + D( jω)g( jω) curve to the point, and S( jω) =. D( jω)g( jω) + D( jω)g( jω) I(s) R(s) Lecture notes prepared by and copyright 998 23, Gregory L. Plett and M. Scott Trimboli
ECE45/ECE55, FREQUENCY-RESPONSE DESIGN 9 8 Alargevalueof S( jω) indicates a nearly unstable Nyquist plot. The maximum value of S is a more accurate measure of stability than PM or GM. So,wewantmax S( jω) small. How small? Note: E( jω) = S( jω)r( jω) E( jω) = S( jω)r( jω) S( jω) R( jω) put a frequency-based error bound Let W (ω) = R( jω)/e b.then, E( jω) S( jω) R( jω) e b S( jω) W (ω). EXAMPLE: Aunity-feedbacksystemistohaveanerrorlessthan.5 for all unity-amplitude sinusoids below 5 rads/sec. Draw W ( jω) for this design. Spectrum of R( jω) is unity for ω 5. Since eb =.5, W (ω) =.5 = 2 5 for this range. 5 5 2 Magnitude 2 5 Frequency (rads/sec.) We can translate this requirement into a loop-gain requirement. When errors are small, loop gain is high, so S( jω) D( jω)g( jω) and D( jω)g( jω) W (ω) or, D( jω)g( jω) W (ω) Lecture notes prepared by and copyright 998 23, Gregory L. Plett and M. Scott Trimboli
ECE45/ECE55, FREQUENCY-RESPONSE DESIGN 9 9 9.6: Robustness Typically there is some uncertainty in the plant transfer function. We want our design to be robustly stable, and to robustly give good performance (often called H design). Uncertainty often expressed as multiplicative G( jω) = G n ( jω)[ + W 2 ( jω) ( jω)] W2 (ω) is a function of frequency expressing uncertainty, or size of possible error in transfer function as a function of frequency. W2 (ω) is almost always small at low frequencies. W2 (ω) increases at high frequencies as unmodeled structural flexibility is common. Typical W2 Magnitude 7 6 5 4 3 2 5 5 2 Frequency (rads/sec.) ( jω) expresses uncertainty in phase. The only restriction is Design ( jω). Assume design for nominal plant Gn (s) is stable. Thus, + D( jω)g n ( jω) = ω. Lecture notes prepared by and copyright 998 23, Gregory L. Plett and M. Scott Trimboli
ECE45/ECE55, FREQUENCY-RESPONSE DESIGN 9 2 For robust stability, + D( jω)g n ( jω) + D( jω)g n ( jω) }{{} = by assumption + D( jω)g( jω) = ω + D( jω)g n ( jω)[ + W 2 (ω) ( jω)] = + D( jω)g n( jω) + D( jω)g n ( jω) W 2(ω) ( jω) = recall, T ( jω) = D( jω)g n( jω) + D( jω)g n ( jω), [ + T ( jω)w 2 (ω) ( jω)] = so, T ( jω)w 2 (ω) ( jω) < or, T ( jω) W 2 (ω) <. For high freqencies D( jω)gn ( jω) is typically small, so T ( jω) D( jω)g n ( jω). Thus D( jω)g n ( jω) W 2 (ω) < D( jω)g n ( jω) < W 2 (ω). EXAMPLE: The uncertainty in a plant model is described by a function W 2 (ω) which is zero until ω = 3 rads/sec, and increases linearly from there to a value of at ω =, rads/sec. It remains constant at for higher frequencies. Plot constraint on D( jω)g n ( jω). Where W2 (ω) =, thereisnoconstraintonthemagnitudeoftheloop gain. Above ω = 3, /W 2 (ω) is a hyperbola from to. at,. Lecture notes prepared by and copyright 998 23, Gregory L. Plett and M. Scott Trimboli
ECE45/ECE55, FREQUENCY-RESPONSE DESIGN 9 2 Magnitude 8 7 6 5 4 3 2 2 4 6 8 Frequency (rads/sec.) Combining W (ω) and W 2 (ω) requirements, 8 Log Magnitude 6 4 2 2 4 6 8 2 4 6 8 Frequency (rads/sec.) Limitation: Crossover needs to be with slope. So,cannotmake constraints too strict, or design will be unstable. Lecture notes prepared by and copyright 998 23, Gregory L. Plett and M. Scott Trimboli