Department Of Industrial Engineering Faculty Of Engineering And Information Technology An-Najah National University Control Systems Dr. Mohammad Abuabiah m.abuabiah@najah.edu Office: 11-4-130 1 Chapter 11 Design Via Frequency Response 2 Chapter Outcome 3 Dr. Mohammad Abuabiah • Use frequency response techniques to adjust the gain to meet a transient response specification. • Use frequency response techniques to design compensators to improve the steady-state error. cascade • Use frequency response techniques to design compensators to improve the transient response. cascade An-Najah National University • Use frequency response techniques to design cascade compensators to improve both the steady-state error and the transient response. 11.1 Introduction Dr. Mohammad Abuabiah • When designing via frequency response methods, we use the concepts of stability, transient response, and steady-state error that we learned in Chapter 10. • The emphasis in this chapter is on the design of gain, lag, lead, and lag-lead compensation. An-Najah National University • In the next extra chapter we will extrapolate the concepts and designs problems involving PI, PD, and PID compensation. 4 11.1 Tuning Vs Exact/Definitive Answer Dr. Mohammad Abuabiah • An Exact or definitive answer is a final one. Definitive means authoritative, conclusive, final. A definitive answer is usually a strong yes or no. • Controller tuning is the process of determining the controller parameters which produce the desired output. An-Najah National University • Controller tuning allows for optimization of a process and minimizes the error between the variable of the process and its set point. 5 11.2 Transient Response via Gain Adjustment Dr. Mohammad Abuabiah • Let us begin our discussion of design via frequency response methods by discussing the link between phase margin, transient response, and gain. An-Najah National University • In Section 10.10, the relationship between damping ratio (equivalently percent overshoot) and phase margin is shown. Thus, if we can vary the phase margin, we can vary the percent overshoot. • Thus, a simple gain adjustment can be used to design phase margin and, hence, percent overshoot. 6 11.2 Transient Response via Gain Adjustment 7 โDesign Procedure: Dr. Mohammad Abuabiah 1. Draw the Bode magnitude and phase plots for a convenient value of gain. 2. Using Eqs. ๐ถ๐บ ๐ป = − ๐ฅ๐ง(% )/ ๐ ๐ + ๐ฅ๐ง๐ (%๐ถ๐บ/๐๐๐) ๐๐๐ And An-Najah National University ๐๐ด = (๐ญ๐๐ง−๐ ๐๐ป/ −๐๐ป๐ + ๐ + ๐๐ป๐ ) × ๐๐๐/๐ to, determine the required phase margin from the percent overshoot. 3. Find the frequency, ๐๐๐ด , on the Bode phase diagram that yields the desired phase margin, CD, as shown on Figure. 4. Change the gain by an amount AB to force the magnitude curve to go through 0 dB at ๐๐๐ด . The amount of gain adjustment is the additional gain needed to produce the required phase margin. 8 11.2 Transient Response via Gain Adjustment Dr. Mohammad Abuabiah An-Najah National University Example 11.1 Transient Response Design via Gain Adjustment 9 Dr. Mohammad Abuabiah • PROBLEM: For the position control system shown in Figure, find the value of preamplifier gain, K, to yield a ๐. ๐% overshoot in the transient response for a step input. Use only frequency response methods. An-Najah National University Example 11.1 Transient Response Design via Gain Adjustment 10 Dr. Mohammad Abuabiah • SOLUTION: We will now follow the previously described gain adjustment design procedure. • Write the simplified-subsystem transfer function: clc clear close all An-Najah National University %% Example 11.1 s = tf('s'); G1 = 100/(s+100); G2 = 1/(s+36); G3 = 1/s; Ge = G1*G2*G3; display(zpk(Ge)) 1. Choose ๐ฒ = ๐๐ (1/๐๐๐๐๐๐(๐ ∗ ๐บ๐ )) to start the magnitude plot at ๐ ๐ ๐ฉ. %% Step 1 K = 1/dcgain(s*Ge); Example 11.1 Transient Response Design via Gain Adjustment 11 2. Find the following: Dr. Mohammad Abuabiah a) ๐ป = − ๐๐ %๐ถ๐บ ๐๐๐ %๐ถ๐บ ๐ ๐ +๐๐๐ ๐๐๐ = ๐. ๐ ๐๐๐ b) ๐๐ด = ๐๐๐−๐ ๐๐ป/ −๐๐ป๐ + ๐ + ๐๐ป๐ × ๐๐ = ๐๐. ๐๐ An-Najah National University %% Step 2 pos = 9.5; z =(-log(pos/100))/(sqrt(pi^2+log(pos/100)^2)); Pm=atan(2*z/(sqrt(-2*z^2+sqrt(1+4*z^4))))*(180/pi); display(Pm) 3. Locate on the phase plot the frequency that yields a ๐๐. ๐๐ phase margin. This frequency is found where the phase angle is the difference between −๐๐๐๐ and ๐๐. ๐๐ , or −๐๐๐. ๐๐ . The value of the phase-margin frequency is ๐๐. ๐ ๐๐๐ /๐. %% Step 3 Pmreq = Pm-180; % Answer -120.8 display(Pmreq) figure, bode(K*Ge) grid on Example 11.1 Transient Response Design via Gain Adjustment 12 Dr. Mohammad Abuabiah An-Najah National University Example 11.1 Transient Response Design via Gain Adjustment 13 Dr. Mohammad Abuabiah 4. At a frequency of ๐๐. ๐ ๐๐๐ /๐ on the magnitude plot, the gain is found to be − ๐๐. ๐๐ ๐ฉ. This magnitude has to be raised to ๐ ๐ ๐ฉ to yield the required phase margin. Since the log-magnitude plot was drawn for ๐ฒ = ๐๐ , a ๐๐. ๐ ๐ ๐ฉ increase, or ๐ฒ = ๐๐ × ๐๐. ๐ = ๐๐๐. ๐ • Thus, the controller transfer function is An-Najah National University %% Step 4 M = 10^(24.2/20); display(M); %16.2 K = K*M; Gc = K; display(Gc) ๐ฎ๐ ๐ = ๐ฒ = ๐๐๐. ๐ 5. Finally, the results: %% Result T = feedback(Gc*Ge,1); figure,step(T); grid on L = Gc*Ge; [Gm,Pm,Wgm,Wpm] = margin(L); display(Pm) Example 11.1 Transient Response Design via Gain Adjustment 14 Dr. Mohammad Abuabiah An-Najah National University Example 11.1 Transient Response Design via Gain Adjustment 15 Dr. Mohammad Abuabiah • Final Result: An-Najah National University Parameter Phase Margin Proposed Specification ๐๐. ๐๐๐๐ Actual Value ๐๐. ๐๐๐๐ Percent Overshoot ๐. ๐% ๐. ๐๐% 11.2 Gain Compensation: Analog 16 • Active-Circuit Realization: Dr. Mohammad Abuabiah 1๐พ๐จ 1๐พ๐จ An-Najah National University ๐ ๐๐ ๐ฎ๐ ๐ = ๐ฒ = ๐๐๐. ๐ = − ๐ = ๐๐ ๐๐๐๐ ≅− ๐๐ ๐.๐๐ Example 11.1 Summary 17 Dr. Mohammad Abuabiah clc clear close all %% Step 3 figure, bode(K*Ge) grid on %% Example 11.1 s = tf('s'); G1 = 100/(s+100); G2 = 1/(s+36); G3 = 1/s; Ge = G1*G2*G3; display(zpk(Ge)) %% Step 4 M = 10^(24.2/20); display(M); K = K*M; Gc = K; dsiplay(Gc) An-Najah National University %% Step 1 K = 1/dcgain(s*Ge); display(K) %% Step 2 pos = 9.5; z =(-log(pos/100))/(sqrt(pi^2+log(pos/100)^2)); dsiplay(z) Pm=atan(2*z/(sqrt(-2*z^2+sqrt(1+4*z^4))))*(180/pi); Pmreq = Pm-180; display(Pmreq) %% Result T = feedback(Gc*Ge,1); figure,step(T); grid on L = Gc*Ge; [Gm,Pm,Wgm,Wpm] = margin(L); display(Pm) 11.3 Lag Compensation 18 Dr. Mohammad Abuabiah • In the next three sections, we will discuss the design of lag, lead, and lag-lead compensation via Bode diagrams. • The name lag compensator comes from the fact that the typical phase angle response for the compensator is always negative, or lagging in phase angle. An-Najah National University • The function of the lag compensator as seen on Bode diagrams is to improve the static error constant by increasing only the lowfrequency gain without any resulting instability. • The transfer function of the lag compensator is ๐ถ>๐ 19 11.3 Lag Compensation Dr. Mohammad Abuabiah An-Najah National University 20 11.3 Lag Compensation Dr. Mohammad Abuabiah An-Najah National University 11.3 Lag Compensation • Another form of The transfer function of the lag compensator is Dr. Mohammad Abuabiah ๐ฒ๐ ๐ + ๐๐ ๐ฎ๐ ๐ = (๐ + ๐๐ ) Where, An-Najah National University • ๐ฒ๐ = ๐๐ ๐๐ • ๐๐ = ๐๐ • ๐๐ = ๐๐ ๐ด ๐๐ • ๐๐ : At this frequency the magnitude plot must go through 0 dB. • ๐ด: magnitude at the ๐๐ requency. 21 11.3 Lag Compensation 22 โ Design Procedure: Dr. Mohammad Abuabiah 1. Set the gain, ๐ฒ, to the value that satisfies the steady-state error specification and plot the Bode magnitude and phase diagrams for this value of gain. 2. Find the frequency where the phase margin is ๐๐ to ๐๐๐ greater than the phase margin that yields the desired transient response (Ogata, 1990). This step compensates for the fact that the phase of the lag compensator may still contribute anywhere from −5๐ to −12๐ of phase at the phase-margin frequency. An-Najah National University 3. Select a lag compensator whose magnitude response yields a composite Bode magnitude diagram that goes through 0 dB at the frequency found in Step 2 as follows: Draw the compensator’s high-frequency asymptote to yield 0 dB for the compensated system at the frequency found in Step 2. 4. Reset the system gain, ๐ฒ, to compensate for any attenuation in the lag network in order to keep the static error constant the same as that found in Step 1. Example 11.2 Lag Compensation Design Dr. Mohammad Abuabiah • PROBLEM: Given the system of Figure, use Bode diagrams to design a lag compensator to yield a tenfold improvement in steady-state error over the gain compensated system while keeping the percent overshoot at 9.5%. 23 An-Najah National University Example 11.2 Lag Compensation Design Dr. Mohammad Abuabiah • SOLUTION: We will follow the compensation design procedure. previously described 1. From Example 11.1 a gain, K, of 583.9 yields a 9.5% overshoot. clc clear close all %% Example 11.2 An-Najah National University %% Step 1 s = tf('s'); G1 = 100/(s+100); G2 = 1/(s+36); G3 = 1/s; K = 583.9; Ge = G1*G2*G3*K; display(zpk(Ge)) 24 lag Example 11.2 Lag Compensation Design Dr. Mohammad Abuabiah • SOLUTION: We will follow the compensation design procedure. previously described 25 lag 58390 ๐พ๐ฃ = lim ๐ ๐บ(๐ ) = lim ๐ = 16.22 ๐ →0 ๐ →0 ๐ ๐ + 36 ๐ + 100 For a tenfold improvement in steady-state error, ๐ฒ๐ must increase by a factor of ๐๐, or ๐ฒ๐ = ๐๐๐. ๐. Therefore, An-Najah National University %% Step 1 Kv = dcgain(s*Ge); Kv = 10*Kv; K = dcgain(Kv/(s*Ge)); Ge = Ge*K; figure,bode(Ge) Example 11.2 Lag Compensation Design 26 2. Step 2: Dr. Mohammad Abuabiah – The phase-margin required for a ๐. ๐% overshoot (๐ = 0.6) is found to be ๐๐. ๐๐ . We increase this value of phase margin by ๐๐๐ to ๐๐. ๐๐ in order to compensate for the phase angle contribution of the lag compensator. – Now find the frequency where the phase margin is ๐๐. ๐๐ . This frequency occurs at a phase angle of −๐๐๐๐ + ๐๐. ๐๐จ = −๐๐๐. ๐ and is ๐. ๐ ๐๐๐ /๐. – At this frequency, the magnitude plot must go through 0 dB. The magnitude at 9.8 rad/s is now +๐๐ ๐ ๐ฉ (exact, that is, non-asymptotic). Thus, the lag compensator must provide −๐๐ ๐ ๐ฉ attenuation at 9.8 rad/s. An-Najah National University %% Step 2 pos = 9.5; z =(-log(pos/100))/(sqrt(pi^2+log(pos/100)^2)); Pm=atan(2*z/(sqrt(-2*z^2+sqrt(1+4*z^4))))*(180/pi); Pm = Pm+10; %tuning parameter Pmreq = Pm-180; display(Pmreq) wf = 9.8; %from Bode plot Example 11.2 Lag Compensation Design 3. Step 3: Dr. Mohammad Abuabiah – Find the following: o ๐๐๐๐๐๐ด = ๐๐ → ๐ด = ๐๐ ๐๐ ๐๐ = ๐๐. ๐๐๐๐ o ๐๐ = ๐. ๐ ๐๐๐ /๐ ๐๐ o ๐๐ = ๐๐ = ๐. ๐๐ ๐๐๐ /๐ o ๐๐ = ๐๐ ๐.๐๐ = = ๐. ๐๐๐๐ ๐๐๐ /๐ ๐ด ๐๐.๐๐๐๐ An-Najah National University ๐ o ๐ฒ๐ = ๐ ๐ = ๐ ๐.๐๐๐๐ = ๐. ๐๐๐๐ ๐.๐๐ %% Step 3 M = 10^(24/20); %The magnitude at 9.8 rad/s wh = wf/10; wl = wh/M; Kc = wl/wh; 27 Example 11.2 Lag Compensation Design • Hence, the lag compensator’s transfer function is Dr. Mohammad Abuabiah ๐ฎ๐ ๐ = • ๐ฒ๐ ๐ + ๐๐ ๐ + ๐. ๐๐ = ๐. ๐๐๐ (๐ + ๐๐ ) (๐ + ๐. ๐๐๐) The compensated system’s forward transfer function is thus ๐ฎ ๐ ๐ฎ๐ ๐ = An-Najah National University = ๐๐๐๐๐๐ ๐ ๐ + ๐๐ ๐ + ๐๐๐ ๐. ๐๐๐ ๐ + ๐. ๐๐ (๐ + ๐. ๐๐๐) ๐๐๐๐๐ ๐ + ๐. ๐๐ ๐ ๐ + ๐๐ ๐ + ๐๐๐ ๐ + ๐. ๐๐๐ %% Step 4 Gc = Kc*(s+wh)/(s+wl); display(zpk(Gc)) %% Result T = feedback(Gc*Ge,1); figure,step(T); [Gm,Pm,Wg,Wp]=margin(Gc*Ge) Kv = dcgain(s*Gc*Ge); 28 29 Example 11.2 Lag Compensation Design Dr. Mohammad Abuabiah An-Najah National University 30 Example 11.2 Lag Compensation Design Dr. Mohammad Abuabiah An-Najah National University Example 11.2 Lag Compensation Design Dr. Mohammad Abuabiah • Final Result: An-Najah National University Parameter ๐ฒ๐ Proposed Specification ๐๐๐. ๐ Actual Value ๐๐๐. ๐๐๐ Phase Margin Percent Overshoot ๐๐. ๐๐ ๐. ๐% ๐๐. ๐๐๐ ๐. ๐๐% 31 11.3 Lag Compensation: Analog • Active-Circuit Realization: Dr. Mohammad Abuabiah An-Najah National University ๐ + ๐. ๐๐ ๐ฎ๐ ๐ = ๐. ๐๐๐ (๐ + ๐. ๐๐๐) ๐๐ ๐๐ 32 Example 11.2 Summary Dr. Mohammad Abuabiah clc clear close all %% Example 11.2 s = tf('s'); G1 = 100/(s+100); G2 = 1/(s+36); G3 = 1/s; K = 583.9; Ge = G1*G2*G3*K; display(zpk(Ge)) An-Najah National University %% Step 1 Kv = dcgain(s*Ge); Kv = 10*Kv; K = dcgain(Kv/(s*Ge)); Ge = Ge*K; figure,bode(Ge) %% Step 2 pos = 9.5; z =(-log(pos/100))/(sqrt(pi^2+log(pos/100)^2)); Pm=atan(2*z/(sqrt(-2*z^2+sqrt(1+4*z^4))))*(180/pi); Pm = Pm+10; Pmreq = 180-Pm; display(Pmreq) wf = 9.8; %from Bode plot 33 %% Step 3 M = 10^(24/20); wh = wf/10; wl = wh/M; Kc = wl/wh; %% Step 4 Gc = Kc*(s+wh)/(s+wl); display(zpk(Gc)) %% Result T = feedback(Gc*Ge,1); figure,step(T); stepinfo(T) grid on [Gm,Pm,Wg,Wp]=margin(Gc*Ge); Kv = dcgain(s*Gc*Ge); display(Kv) 11.4 Lead Compensation 34 Dr. Mohammad Abuabiah • For second-order systems, we derived the relationship between phase margin and percent overshoot as well as the relationship between closed-loop bandwidth and other time-domain specifications, such as settling time, peak time, and rise time. • When we designed the lag network to improve the steady-state error, we wanted a minimal effect on the phase diagram in order to yield an imperceptible change in the transient response. An-Najah National University • However, in designing lead compensators via Bode plots, we want to change the phase diagram, increasing the phase margin to reduce the percent overshoot, and increasing the gain crossover to realize a faster transient response (Improving Transient -Response). • The transfer function of the lead compensator is ๐ท<๐ 11.4 Lead Compensation • Dr. Mohammad Abuabiah In order to design a lead compensator and change both the phase margin and phasemargin frequency, it is helpful to have an analytical expression for the maximum value of phase and the frequency at which the maximum value of phase occurs, – The frequency, ๐๐๐๐ , at which the maximum phase angle, ๐๐๐๐ , occurs is – the maximum phase shift of the compensator, ๐๐๐๐ , is An-Najah National University ๐ − ๐ฌ๐ข๐ง ๐๐๐๐ ๐ท= ๐ + ๐ฌ๐ข๐ง ๐๐๐๐ – the compensator’s magnitude at ๐๐๐๐ is 35 36 11.4 Lead Compensation Dr. Mohammad Abuabiah An-Najah National University 11.4 Lead Compensation • Another form of The transfer function of the lead compensator is Dr. Mohammad Abuabiah ๐ฒ๐ ๐ + ๐๐ ๐ฎ๐ ๐ = (๐ + ๐๐ ) Where, An-Najah National University • ๐ฒ๐ = ๐ ๐ท • ๐๐ = ๐๐๐๐ ๐ท • ๐๐ ๐๐ = ๐ท • ๐๐๐๐ : the frequency at which the maximum phase angle, ๐๐๐๐ . 37 11.4 Lead Compensation 38 โ Design Procedure: Dr. Mohammad Abuabiah An-Najah National University 1. Find the closed-loop bandwidth required to meet the settling time, peak time, or rise time requirement (using Equations discussed in Chapter 10). 2. Since the lead compensator has negligible effect at low frequencies, set the gain, K, of the uncompensated system to the value that satisfies the steady-state error requirement. 3. Plot the Bode magnitude and phase diagrams for this value of gain and determine the uncompensated system’s phase margin. 4. Find the phase margin to meet the damping ratio or percent overshoot requirement. Then evaluate the additional phase contribution required from the compensator. 5. Determine the value of ๐ท from the lead compensator’s required phase contribution. 6. Determine the compensator’s magnitude at the peak of the phase curve. 7. Determine the new phase-margin frequency by finding where the uncompensated system’s magnitude curve is the negative of the lead compensator’s magnitude at the peak of the compensator’s phase curve. 8. Design the lead compensator’s break frequencies to find T and the break frequencies. 9. Reset the system gain to compensate for the lead compensator’s gain. 10. Check the bandwidth to be sure the speed requirement in Step 1 has been met. 11. Simulate to be sure all requirements are met. 12. Redesign if necessary to meet requirements. Example 11.3 Lead Compensation Design Dr. Mohammad Abuabiah • PROBLEM: Given the system of Figure, design a lead compensator to yield ๐ถ๐บ% ≤ ๐๐% overshoot and ๐ฒ๐ = ๐๐, with a peak time of ≤ 0.1 second. 39 An-Najah National University Example 11.3 Lead Compensation Design Dr. Mohammad Abuabiah • SOLUTION: We will follow the previously described lead compensation design procedure with the help of MATLAB. • Step 1: write your system ๐ฎ๐ (๐): clc clear close all %% Example 11.3 %% Step 1 An-Najah National University s = tf('s'); G1 = 100/(s+100); G2 = 1/(s+36); G3 = 1/s; Ge1 = G1*G2*G3; display(zpk(Ge1)) • Step 2: find the value of ๐ฒ: %% Step 2 Kv = 40; K = dcgain(Kv/(s*Ge1)); display(K) Ge2 = Ge1*K; 40 Example 11.3 Lead Compensation Design • Step 3: Find the bandwidth frequency: Dr. Mohammad Abuabiah %% Step 3 pos = 20; Tp = 0.1; z=(-log(pos/100))/(sqrt(pi^2+log(pos/100)^2)); % Calculate required damping ration wn=pi/ (Tp*sqrt(l-z^2)); %Calculate required natural frequency wBW=wn*sqrt((1-2*z^2)+sqrt(4*z^4-4*z^2+2)); %determine the bandwidth display(wBW) • Step 4: Find compensator beta: %% Step 4 An-Najah National University [Gm,Pm,Wcg,Wcp]=margin(Ge2); %find the current phase margin Pmreq =atan(2*z/(sqrt(-2*z^2+sqrt(l+4*z^4))))*(180/pi); % Calculate required phase margin. Pmreq= Pmreq+15 %Add a correction factor (try & error) Pmc = Pmreq-Pm % phase contribution required from lead compensator beta=(1-sin(Pmc*pi/180))/(1+sin(Pmc*pi/180)); display(beta) • Step 5: Find the maximum frequency ๐๐๐๐ : %% Step 5 magpc = 1/sqrt(beta); %Find compensator peak magnitude. Mreq = 20*log10(1/magpc) % Mreq = -4.6127 figure, bode(Ge2); wmax = 41.5; %This is the frequency at the peak magnitude (from bode plot). 41 Example 11.3 Lead Compensation Design Dr. Mohammad Abuabiah • Step 6: Find the lead compensator controller: %% Step 6 zc = wmax*sqrt(beta); pc=zc/beta; Kc=1/beta; Gc = Kc*(s+zc)/(s+pc); display(zpk(Gc)); • Step 7: Validate your result: An-Najah National University %% Step 7 T = feedback(Gc*Ge2,1); figure,step(T) grid on Kv = dcgain(s*Gc*Ge2); display(Kv) wBW = bandwidth(T); display(wBW) 42 43 Example 11.3 Lead Compensation Design Dr. Mohammad Abuabiah An-Najah National University Example 11.3 Lead Compensation Design Dr. Mohammad Abuabiah • Final Result: An-Najah National University Parameter ๐ฒ๐ ๐ป๐ Proposed Specification ๐๐ ๐. ๐ Actual Value ๐๐ ๐. ๐๐๐๐ Percent Overshoot ๐๐% ๐๐. ๐% Bandwidth ๐๐. ๐๐๐๐ ๐๐. ๐๐๐๐ ๐. ๐๐๐๐ ๐ + ๐๐. ๐ ๐ฎ๐ = ๐ + ๐๐. ๐๐ 44 11.4 Lead Compensation: Analog • Active-Circuit Realization: Dr. Mohammad Abuabiah An-Najah National University ๐๐ ๐๐ 45 11.5 Lag-Lead Compensation Dr. Mohammad Abuabiah • In this section, we improve both transient response and the steady-state error by using a lead compensator and a lag compensator. Our compensator is called a lag-lead compensator. An-Najah National University • We first design the lag compensation to lower the high-frequency gain, stabilize the system, and improve the steady-state error and then design a lead compensator to meet the phase-margin requirements. • At the end of this section, we emphasize lag-lead design, using a single, passive lag-lead network. 46 11.5 Lag-Lead Compensation 47 Dr. Mohammad Abuabiah • The transfer function of a single, passive lag-lead network is ๐ฎ๐ ๐ = ๐ฎ๐ณ๐๐๐ ๐ ๐ฎ๐ณ๐๐ ๐ = ๐ ๐+๐ป ๐ ๐+๐ป ๐ธ ๐+ ๐ป๐ ๐+ ๐ ๐ ๐ ๐ธ๐ป๐ An-Najah National University • where ๐ธ > ๐ . The first term in parentheses produces the lead compensation, and the second term in parentheses produces the lag compensation. 48 11.5 Lag-Lead Compensation Dr. Mohammad Abuabiah An-Najah National University 11.5 Lag-Lead Compensation 49 โ Design Procedure: Dr. Mohammad Abuabiah An-Najah National University 1. Using a second-order approximation, find the closed-loop bandwidth required to meet the settling time, peak time, or rise time requirement. 2. Set the gain, K, to the value required by the steady-state error specification. 3. Plot the Bode magnitude and phase diagrams for this value of gain. 4. Using a second-order approximation, calculate the phase margin to meet the damping ratio or percent overshoot requirement. 5. Select a new phase-margin frequency near ๐๐ฉ๐พ . 6. At the new phase-margin frequency, determine the additional amount of phase lead required to meet the phase-margin requirement. Add a small contribution that will be required after the addition of the lag compensator. 7. Design the lag compensator by selecting the higher break frequency one decade below the new phase-margin frequency. Find the value of ๐ธ from the lead compensator’s requirements (๐ธ = ๐/๐ท). 8. Design the lead compensator. Using the value of ๐ธ from the lag compensator design and the value assumed for the new phase-margin frequency, find the lower and upper break frequency for the lead compensator. 9. Check the bandwidth to be sure the speed requirement in Step 1 has been met. 10. Redesign if phase-margin or transient specifications are not met, as shown by analysis or simulation. Example 11.4 lag-lead Compensation Design Dr. Mohammad Abuabiah • PROBLEM: Given a unity feedback system where ๐ฒ ๐ฎ ๐ = ๐ ๐+๐ ๐+๐ design a active lag-lead compensator using Bode diagrams to yield a 13.25% overshoot, a peak time of 2 seconds, and ๐ฒ๐ = ๐๐. An-Najah National University • SOLUTION: We will follow the steps previously mentioned in this section for lag-lead design with the help of MATLAB. 50 Example 11.4 lag-lead Compensation Design Dr. Mohammad Abuabiah • Step 1: write your system ๐ฎ(๐): clc clear close all %% Example 11.4 %% Step 1 s = tf('s’); G = 1/(s*(s+1)*(s+4)); An-Najah National University • Step 2: Find the value of K: %% Step 2 Kv = 12; K = Kv*dcgain(1/(s*G)); Ge = K*G; display(zpk(Ge)); display(K) 51 Example 11.4 lag-lead Compensation Design Dr. Mohammad Abuabiah • Step 3: find the value of the Bandwidth ๐๐ฉ๐พ : %% Step 3 pos = 13.25; Tp = 2; z =(-log(pos/100))/(sqrt(pi^2+log(pos/100)^2)); Pmreq=atan(2*z/(sqrt(-2*z^2+sqrt(1+4*z^4))))*(180/pi); wn = pi/(Tp*sqrt(1-z^2)); wBW = wn*sqrt((1-2*z^2)+sqrt(4*z^4-4*z^2+2)); display(wBW) • Step 4: Find the value of ๐ท: An-Najah National University %% Step 4 wpm = 0.8*wBW; %Choose new phase-margin frequency. [M,P]=bode(Ge,wpm); % Get Bode data. Pmreqc=Pmreq-(180+P)+5; % Find phase contribution required from lead compensator with additional 5 degrees. beta=(1-sin(Pmreqc*pi/180))/(1+sin(Pmreqc*pi/180)); display(beta) 52 Example 11.4 lag-lead Compensation Design Dr. Mohammad Abuabiah • Step 5: Compute the Lag-Compensator : %% Step 5 zclag=wpm/10; % Calculate zero of lag compensator. pclag=zclag*beta; % Calculate pole of lag compensator. Kclag=beta; % Calculate gain of lag compensator. Glag = Kclag*(s+zclag)/(s+pclag); display(zpk(Glag)); An-Najah National University • Step 6: Compute the Lead-Compensator : %% Step 6 zclead=wpm*sqrt(beta); % Calculate zero of lead compensator. pclead=zclead/beta; %Calculate pole of lead compensator. Kclead=1/beta; % Calculate gain of lead compensator. Glead = Kclead*(s+zclead)/(s+pclead); display(zpk(Glead)); 53 Example 11.4 lag-lead Compensation Design Dr. Mohammad Abuabiah • Step 7: Validate your result: %% Step 7 Gc = Glag*Glead; display(zpk(Gc)) Kv = dcgain(s*Gc*Ge); display(Kv) T = feedback(Gc*Ge,1); figure,step(T) grid on 54 An-Najah National University 55 Example 11.4 lag-lead Compensation Design Dr. Mohammad Abuabiah An-Najah National University 11.5 Active-Circuit Realization Dr. Mohammad Abuabiah • Lag-lead compensator can be formed by cascading the lag compensator with the lead compensator, as shown in Figure An-Najah National University ๐ฎ๐ = ๐ช ๐ช๐ ๐ ๐น ๐ ๐ช๐ ๐ ๐+๐น ๐ช ๐ ๐ − ๐ ๐+ × ๐ช ๐ช๐ ๐ ๐น ๐ ๐ช๐ ๐ ๐+๐น ๐ช ๐ ๐ − ๐ ๐+ 56