Margins on Bode plots G(s) + -
Margins on Nyquist plot Suppose: Draw Nyquist plot G(jω) & unit circle They intersect at point A Nyquist plot cross neg. real axis at –k
Stability from Nyquist plot G(s) + The complete Nyquist plot: Plot G(jω) for ω = 0+ to +∞ Get complex conjugate of plot, that’s G(jω) for ω = 0– to –∞ If G(s) has pole on jω-axis, treat separately Mark direction of ω increasing Locate point: –1 -
Encirclement of the -1 point As you follow along the G(jω) curve for one complete cycle, you may “encircle” the –1 point Going around in c.w. once is +1 encirclement c.c.w. once is –1 encirclement
Nyquist Criterion Theorem # (unstable poles of closed-loop) Z = # (unstable poles of open-loop) P + # encirclement N or: Z = P + N To have closed-loop stable: need Z = 0, i.e. N = –P
That is: G(jω) needs to encircle the “–1” point c.c.w. P times. If open loop is stable to begin with, G(jω) cannot encircle the “–1” point for closed-loop stability In previous example: No encirclement, N = 0. Open-loop stable, P = 0 Z = P + N = 0, no unstable poles in closed-loop, stable
function mynyquist(n,d,w) %mynyquist-- plots a nonlinearly compressed nyquist plot. % Near the origin (distance less than 2), it preserves the % original Nyquist plot. Far away from the origin (distance % more than 2), the distance is compressed by taking the log. % %Syntax: mynyquist(n,d), or mynyquist(n,d,w) % where n and d are the numerator and denominator of the transfer % function, w is the desired frequency points. %The program does not handle jw-axis poles. if nargin <3 [m,p,w]=bode(n,d); d1=log10(min(w)); d2=log10(max(w)); w=logspace(d1, d2, 200); end;
G=polyval(n, j*w)./polyval(d,j*w); %or G=evalfr(tf(n,d),j*w); GA=abs(G); GP=angle(G); GAA=(GA<2).*GA+(GA>=2).*(2+2*log(GA/2)); %if GA<2, do nothing; if>=2, do log compression plot(GAA.*cos(GP),GAA.*sin(GP),'b'); hold; plot(GAA.*cos(GP),-GAA.*sin(GP),'r'); %this plots the negative freq part axis equal; %axis([-3 1 -2 2]); %this sets x, y limits for the graph window grid; a=0:2*pi/200:2*pi; plot(cos(a),sin(a),':'); %this plots the unit circle for phase margin %you can also use the rectangle command
Matlab nyquist plot for: 23(s+0.25)(s2+0.7s+1) G(s) = ------------------------------------------------------------------------- (0.15s+1)(s3+10s2)(s2+0.5s+0.25) nyquist(23*conv([1 .25],[1 0.7 1]),conv([0.15 1],conv([1 10 0 0],[1 0.5 0.25]))) Hard to see any useful information. Essentially useless.
Without the “axis” command line. mynyquist(23*conv([1 .25],[1 0.7 1]),conv([0.15 1],conv([1 10 0 0],[1 0.5 0.25]))) Without the “axis” command line.
With the “axis” command line. You can change the x, y limits.
Example:
As you move around from ω = –∞ to 0–, to 0+, to +∞, you go around “–1” c.c.w. once. # encirclement N = – 1. # unstable pole P = 1
Check: c.l. pole at s = –3, stable. i.e. # unstable poles of closed-loop = 0 closed-loop system is stable. Check: c.l. pole at s = –3, stable.
Example: Get G(jω) for ω = 0+ to +∞ Use conjugate to get G(jω) for ω = –∞ to 0– How to go from ω = 0– to ω = 0+? At ω ≈ 0 :
# encirclement N = _____ # open-loop unstable poles P = _____ Z = P + N = ________ = # closed-loop unstable poles. closed-loop stability: _______
Q: 1. Find stability margins Example: Given: G(s) is stable With K = 1, performed open-loop sinusoidal tests, and G(jω) is on next page Q: 1. Find stability margins 2. Use Nyquist criterion to determine closed-loop stability
Solution: Where does G(jω) cross the unit circle? ________ Phase margin ≈ ________ Where does G(jω) cross the negative real axis? ________ Gain margin ≈ ________ Is closed-loop system stable with K = 1? ________
Note that the open loop T.F. is KG(s). If K is not = 1, Nyquist plot of KG(s) is a radial scaling of G(jω). e.g. If K = 2, scale G(jω) by a factor of 2 in all directions. Q: How much can K increase before GM becomes lost? ________ How much can K decrease? ______
Some people say the gain margin is 0 to 5 in this example Q: As K is increased from 1 to 5, GM is lost, what happens to PM? What’s the max PM as K is reduced to 0 and GM becomes ∞?
To use Nyquist criterion, need complete Nyquist plot. Get complex conjugate Connect ω = 0– to ω = 0+ through an infinite circle Count # encirclement N Apply: Z = P + N o.l. stable, P = _______ Z = _______ c.l. stability: _______
Correct Incorrect
Example: G(s) stable, P = 0 G(jω) for ω > 0 as given. Get G(jω) for ω < 0 by conjugate Connect ω = 0– to ω = 0+. But how?
Incorrect Choice a) : Where’s “–1” ? # encirclement N = _______ Z = P + N = _______ Make sense? _______ Incorrect
Correct Choice b) : Where is “–1” ? # encir. N = _____ Z = P + N = _______ closed-loop stability _______ Correct
Note: If G(jω) is along –Re axis to ∞ as ω→0+, it means G(s) has in it. when s makes a half circle near s = 0 and sweeps in CCW direction 180o, G(s) makes a full circle near ∞ and sweeps in CW direction 360o. choice a) is impossible, but choice b) is possible.
Incorrect
Example: G(s) stable, P = 0 Get conjugate for ω < 0 Connect ω = 0– to ω = 0+. Needs to go one full circle with radius ∞. Two choices.
G(s) sweeps in CW direction! Choice a) : N = 0 Z = P + N = 0 closed-loop stable Incorrect! G(s) sweeps in CW direction!
Correct! Choice b) : N = 2 Z = P + N = 2 Closed loop has two unstable poles Correct!
Which way is correct?
Example: G(s) has one unstable pole P = 1, no unstable zeros Get conjugate Connect ω = 0– to ω = 0+. How? If connect in c.c.w., we get => This is wrong, 0- to 0+ should be in CW dir!
# encirclement N = ? If “–1” is to the left of A i.e. A > –1 then N = 0 Z = P + N = 1 + 0 = 1 but if gain is increased, “–1” could be inside, N = –2 Z = P + N = –1 c.c.w. is impossible
If connect c.w.: For A > –1 N = ______ Z = P + N = ______ For A < –1 N = ______ Z = ______ No contradiction. This is the correct way.
Example: G(s) stable, minimum phase G(jω) as given: get conjugate. Connect ω = 0– to ω = 0+,
If A < –1 < 0 :. N = ______. Z = P + N = ______. stability of c If A < –1 < 0 : N = ______ Z = P + N = ______ stability of c.l. : ______ If B < –1 < A : A=-0.2, B=-4, C=-20 N = ______ Z = P + N = ______ closed-loop stability: ______ Gain margin: gain can be varied between 1/0.2 and 1/4, or can be less than 1/20
If C < –1 < B :. N = ______. Z = P + N = ______ If C < –1 < B : N = ______ Z = P + N = ______ closed-loop stability: ______ If –1 < C : N = ______ Z = P + N = ______ closed-loop stability: ______