6. Nyquist Diagram, Bode Diagram, Gain Margin, Phase Margin, Forward path R(s) K G p (s ) 1 G p (s) 3 s 4s 2 5s 10 C(s) H (s ) KG p (s ) 1 KG p (s ) Nyquist diyagram is obtanined by plotting the response of the forward path [KGp(s)] to harmonic inputs with different frequencies (ω), in the complex plane. The amlitude and phase information of KGp(s) can be seen from the Nyquist diagram It is a critical situation for the stability of the closed loop control system, if the denominator of the closed loop transfer function 1+KGp(s)=0, or in other words the transfer function of the forward path KGp(s)=-1. 1 KG p (s ) 0 KG p (s ) 1 Nyquist diagram is obtained by drawing the value of the KGp(s) for different ω (rad/s) values in the complex plane 1 G p (s) 3 s 4s 2 5s 10 for K=5 5 KG p (s) 3 s 4s 2 5s 10 5 KG p (s) 3 s 4s 2 5s 10 clc;clear w=2; s=i*w; K=5; KGp=K/(s^3+4*s^2+5*s+10) mag=abs(KGp) phas=angle(KGp)*180/pi Input amplitude is 1 The value of output of KGp(s) to a harmonic input having ω= 2 rad/s and amplitude of 1 can be calculated as shown below Im KGp = -0.7500 - 0.2500i mag = 0.7906 Re -0.75 phas = -161.5651 -0.25 Output amplitude is 0.7906 0.7906 KGp(s) plane Im -1 Nyquist diagram is drawn by connecting the tip of the vectors representing the KGp(s) for different ω frequencies. Re -0.78 -0.75 -0.5334 -0.5098 -0.0201i ω=2.2 -0.25i ω=2.0 Increasing ω ω=1.8 rad/s -0.8427i ω=1.7 rad/s Nyquist curve -1.1722i ω=2.2 ω=2.0 ω=1.8 ω=1.7 rad/s KGp(s)=-0.5334 rad/s KGp(s)=-0.7500 rad/s KGp(s)=-0.7873 rad/s KGp(s)=-0.5098 - 0.0201i - 0.2500i - 0.8427i - 1.1722i Nyquist Diagram 4 K=5; num=[K]; 3 K=15 den=[1 4 5 10]; K=10 nyquist(num,den) 2 K KG p (s) 3 s 4s 2 5s 10 1 KG p (s ) Denominator of the closed loop system 1 Imaginary Axis H (s ) KG p (s ) K=7 K=3 K=1 0 -1 D(s) s 3 4s 2 5s (10 K ) -2 From Routh-Hurwitz 10 K 10 K cr 10 -3 -4 -3 When KGp(s)=-1, the closed loop control system is marginally stable. -2.5 -2 -1.5 -1 -0.5 Real Axis 0 0.5 1 1.5 2 KG p (s) plane Im r ( t ) cos t M(dB) Bode diagram s i Vector length [KGp(s)]= a 1 log 0 GM (dB ) Re a M Nyquist diagram 180 Vector length [KGp(s)]= 1 When the vector length of [KGp(s)] is 1, its value in logarithmic scale is zero. 0 M 20 log 10 KG p (s ) M 20 log 10 1 M0 Φ is the phase of KGp(s). When the phase angle is -180º , KGp(s) is on the real axis and its amplitude is shown as a. When Nyquist curve intersects the real axis at -1, control system is marginaly stable. How many degrees there are when the vectıor length is 1? What is the value of vector length in decibel when the vector is in horizontal position.? log M The relation can be used to find the critical value of the proportinal controller K Kc Kc K Gain margin in logarithmic scale KGp(s)=-a KGp(s)=-1 1 a Gain Margin (gm) 1 GM 20 log 10 a Bode diagram is the representation of the magnitude and phase of the forward path of a closed loop system KGp(s) in decibel scale for different harmonic input frequencies. Magnitude is given in decibel and phase is given in degree. The frequencies for gain and phase margin are represented by ω2 and ω1, respectively and they are calculated using Matlab as described below. clc;clear or KGp(s) K=5; tf is a Matlab command to clc;clear form the transfer function. K=5; num=K*[1]; den=[1 4 5 10]; sys=tf(num,den); bode(sys) [gm,pm,w2,w1]=margin(sys) 1 K 3 s 4 s 2 5s 10 num=K*[1]; den=[1 4 5 10]; bode(num,den) [gm,pm,w2,w1]=margin(num,den) Matlab gives the gain margin in linear scale as gm. Critical gain value Kcr can be calculated by multiplying the actual gain value K by gm. Bode Diagram 20 0 2.0024 Gain margin in linear scale pm = Magnitude (dB) gm = GM -20 -40 -60 The closed loop system is stable if the gain curve is intersected below 0, otherwise control system is unstable. -80 Kcr=K*gm=5*2=10 -100 33.2155 Phase margin w2 = -45 Frequency for gain margin w1 = 1.8830 Frequency for phase margin Phase (deg) 2.2367 The gain margin is obtained in decibel scale from Bode diagram (GM). The relationship between GM and gm is -120 0 (degree) -90 -135 Damping ratio GM=20log10(gm) gm=10GM/20 -180 PM -225 -270 -1 10 0 10 ω1 ω2 Frequency (rad/sec) 1 10 2 10 PM ( o ) 100 Bode diagrams of first order systems Bode diagrams of second order systems n 1 0.05 a2 a1 a4 0.3 0.7 0.05 a1 G (s ) a sa a4 a2 g(t ) ae at Corner frequency=a (rad/s) 0.3 0.7 n2 G (s ) 2 s 2ns n2 g(t ) Ae t cos( t ) 1 Resonance n Design of different type controllers: z p 1 aT2 i s plane 1 T 2 m 1 aTs 1 Ts a1 sin m a1 o 1 aT V1 R1 C R2 V2 a φM=41.48 : a=4.92 a1 G c (s ) Phase-Lead Controller: ωM=9.05: T=0.0498 R1 R 2 R2 R1 3.92 R2 aT R 1C R 1C 0.245 a1 Phase-Lag Controller: V1 G c (s ) R1 R2 V 2 C a R2 R1 R 2 1 (1 aTs) a (1 Ts) aT R 2C Phase Lead-Lag Controller: Phase Lead: PM increases, damping increases, OV decreases, ess remains same. Phase Lag: PM decreases, damping decreases, OV increases, ess decreases