Control Engineering Frequency Response and Stability Analysis Hans-Petter Halvorsen
Dataverktøy Spesialtilfelle MathScript LabVIEW Differensial -likninger Tidsplanet Laplace 2.orden 1.orden Realisering/ Implementering Reguleringsteknikk Serie, Parallel, Feedback Det komplekse plan S-planet K = Forsterkning T=Tidskonstant Transferfunksjoner Blokkdiagrammer Tilstandsrommodeller Analyse/Design Stabilitetsanalyse Det komplekse plan 2. Frekvensrespons 1. Systemets poler Bodediagram Sprangrespons 1.orden med tidsforsinkelse Diskretisering Reguleringssystem Asymptotisk stabilt system Air Heater Tidsplanet Ustabilt system Marginalt stabilt system Asymptotisk stabilt system Marginalt stabilt system Ustabilt system
Stabilitetssanalyse vha. Frekvensrespons Temaer: Frekvensrespons Hva er det? Frekvensrespons vha MathScript Sjekke om systemet er stabilt vha Bodediagram Sjekke systemets stabilitetsmarginer, dvs. hvor mye vi kan øke forsterkningen i systemet (reguleringssløyfa) før systemet blir ustabilt Reguleringssystemets båndbredde og følgeegenskaper
Frequency Response Simple Example Outside Temperature frequency 1 (year) T = 1 year frequency 2 (24 hours) -> Only the gain and phase are different T = 24 hours Assume the outdoor temperature is varying like a sine function during a year (frequency 1) or during 24 hours (frequency 2). Then the indoor temperature will be a sine as well, but with different gain. In addition it will have a phase lag. Inside Temperature frequency 1 (year) frequency 2 (24 hours) Figures: F. Haugen, Advanced Dynamics and Control: TechTeach, 2010
Frequency Response MathScript functions
Bode Diagram The x-scale is logarithmic Gain ( Forsterkningen ) The y-scale is in [db] Phase lag ( Faseforkyvningen ) The y-scale is in [degrees] Vanligvis er enheten for frekvens Hertz [Hz], men i frekvensrespons/bodediagram brukes radianer ω [rad/s]. Sammenhengen
Stability Analysis Loop Transfer Function (Sløyfetransferfunksjonen): Hr =... Hp =... Hm =... L = series(series(hr, Hp), Hm) Used in Frequency Response Stability Analysis (Bode Diagram) The Tracking Function (Følgeforholdet): L =... T = feedback(l, 1) The Sensivity Function (Sensitivitetsfunksjonen): T =... S = 1-T
Frequency Response and Stability Analysis Bode Diagram ωc and ω180 are called the crossoverfrequencies ( kryssfrekvens ) ΔK is the gain margin (GM) of the system ( Forsterkningsmargin ). How much the loop gain can increase before the system becomes unstable ϕ is the phase margin (PM) of the system ( Fasemargin ). Hvor mye fasedreining systemet tåler før det blir ustabilt. We have the following: Asymptotisk stabilt system Marginalt stabilt system Ustabilt system
Stability Analysis - Example Students: Find ωc, ω180, ΔK, φ from the plot (Bruk utdelt papir)
Stability Analysis Example - Solutions
Gain Margin ΔK (GM) - Example Assume: Loop gain Loop gain ( Sløyfeforsterkningen ) When becomes the system unstable? System becomes unstable when: Cont. next page ->
Example cont. Asymptotisk stabilt system: Marginalt stabilt system: Ustabilt system: Figures: F. Haugen, Advanced Dynamics and Control: TechTeach, 2010
Stability Analysis - Summary Tidsplanet Asymptotisk stabilt system Frekvensrespons/Bodediagram Marginalt stabilt system Ustabilt system Det komplekse plan Asymptotisk stabilt system Marginalt stabilt system Ustabilt system
Stability Analysis using Frequency Response within MathScript Hr =... Hp =... Hm =... L = series(series(hr, Hp), Hm) bode(l) margin(l) [gm, pm, w180, wc] = margin(h); gmdb = 20*log10(gm) bode margin
Stability Analysis MathScript Example Students: Set Kp=0.5 (in this example Kp will be the loop gain). Plot the Bode diagram. Find ωc, ω180, ΔK, φ both manually from the plot and compare with the results from MathScript (margin function).
Stability Analysis MathScript Example - Solutions MathScript: clear, clc, clf % Define Transfer functions % The Process Transfer function Hp(s) num_p=[1]; den1=[1, 0]; den2=[1, 1]; den_p = conv(den1,den2); Hp = tf(num_p, den_p) % The Measurement Transfer function Hm(s) num_m=[1]; den_m=[3, 1]; Hm = tf(num_m, den_m) % The Controller Transfer function Hr(s) Kp = 0.5; Hr = tf(kp) % The Loop Transfer function L = series(series(hr, Hp), Hm) % Bode Diagram figure(1) bode(l) subplot(2,1,1) grid on subplot(2,1,2) grid on figure(2) margin(l) [gm, pm, w180, wc] = margin(l); wc w180 gmdb = 20*log10(gm) pm Cont. on next page ->
Stability Analysis Example - Solutions Bode Diagram and Results: Tip: Adjust the scale on the axes to make it easier to read the different values GM 0.0 1 0.1 wc PM 0.0 0.1 w180
Stability Analysis Example cont. Results from previous page: Kp=0.5 ΔK Students: How much can we increase Kp before the system becomes unstable? Plot the Step Response and find the Poles for different Kp (asymtotically stable, marginally stable, unstable)
Stability Analysis Example cont. - Solutions Kp=0.5 -> ΔK=2.67 (from previous page) Kp (marginalt stabilt) = Kp x ΔK = 0.5 x 2.67 = 1.34 Dette gir følgende: Kp = 0.5 -> Asymptotisk Stabilt System Kp = 1.34 -> Marginal Stabilt System MathScript Kode Kp = 2 (f.eks.) -> Ustabilt System Kp =... Kp > 2... t = 0:0.1:50; figure(4) step(t, t) p = poles(t) figure(5) pzmap(t) See plots on next page ->
Kp = 0.5 Kp = 1.34 Kp = 2
Golden rules of Stability Margins for a Control System Gain Margin: ( Forsterkningsmargin ) Phase Margin: ( Fasemargin ) Merk! Siden (alt)for dårlig stabilitet må unngås, mens (alt)for god stabilitet kan aksepteres, er de nedre grensene for GM og PM kritiske, mens de øvre grensene er anbefalte, men ikke kritiske.
Bandwidth 3 different Bandwidth definitions: Et reguleringssystems følgeegenskaper er gode for frekvenser under båndbreddefrekvensen, mens de er dårlige for frekvenser over båndbreddefrekvensen. Gode følgeegenskaper når: Følgende sees fra kurven
Bandwidth - Example Students: Find ωc, ωs, ωt from the plot (Bruk utdelt papir)
Bandwidth Example - Solutions From the plot: ωc = 0.17 rad/s ωs = 0.053 rad/s ωt = 0.3 rad/s
Bandwidth - MathScript Hr =... Hp =... Hm =... L = series(series(hr, Hp), Hm) T = feedback(l, 1) S = 1-T bodemag(l,t,s)
Bandwidth MathScript Example Students: Set Kp=0.5. Plot L(jω), T(jω) og S(jω). Find ωc, ωs og ωt.
Bandwidth Example MathScript - Solutions clear, clc, clf % Define Transfer functions % The Process Transfer function Hp(s) num_p=[1]; den1=[1, 0]; den2=[1, 1]; den_p = conv(den1,den2); Hp = tf(num_p, den_p) % The Measurment Transfer function Hm(s) num_m=[1]; den_m=[3, 1]; Hm = tf(num_m, den_m) % The Controller Transfer function Hr(s) Kp = 0.5; Hr = tf(kp) % The Loop Transfer function L = series(series(hr, Hp), Hm) T = feedback (L, 1); S = 1-T; figure(3) bodemag(l, T, S) grid Use bodemag instead of bode if you just want to plot the gain function Same as previous example Cont. on next page ->
Bandwidth Example - Solutions Tip: Adjust the scale on the axes to make it easier to read the different values From the plot:
Frequency Response MathScript functions
Hans-Petter Halvorsen, M.Sc. University College of Southeast Norway www.usn.no E-mail: hans.p.halvorsen@hit.no Blog: http://home.hit.no/~hansha/