Postive PM and GM but unstable closed loop response

Hi,
I have the following plant (Gp) and controller (Gc) transfer functions
Gp =
0.9524 s^2 - 5.079 s + 5.079
---------------------------------------------
s^4 + 6.127 s^3 + 13.49 s^2 + 25.14 s + 20.91
Gc =
3858 s + 5107
-------------------
1.324 s^2 + 62.57 s
If we look at the open-loop transfer function, we see that both GM and PM are positive.
margin(Gp*Gc)
But the closep loop system response is unstable.
Gcl = feedback(Gol*Gc, 1);
figure; step(Gcl)
Do you have any idea what is wrong with this?
*****************************************************************************
Explanation (Solution)
This system had originally two very large delays on the loop transfer function (one was the actuator delay and the other was the sensor delay). These two delays introduced significant phase shifts making the phase response start somewhere around 260 degrees and decreasing all the way down to -265 (as seen in first figure above). So, the phase response crosses the critical phase of 180 degrees twice, one at +180 and the other at -180. Matlab computes the PM and GM based on the -180 crossing. That's why we see a postive PM and GM but unstable response. The magnitude at +180 degrees is very high (around 30dB) causing a negative GM and unstable response. Therefore, we need to pay attention to both crossings to make sure that the system has sufficint margin not to become unstable.

3 Comments

The fact alone that the open loop transfer function appears to have a "negative gain margin" is insufficient to determine closed loop stability. Many systems are closed-loop stable but can have one or more phase crossovers where the gain is positive, which in those cases truly is a negative gain margin that tells how much the loop gain can be decreased before inducing instability.
Maybe you were accounting for additional factors that were not included in your explanation when you made your conclusion. I'm not saying that your conclusion about closed loop stablity is wrong for this particular problem, just that it appears you got to that conlusion going down the wrong path, which could lead to you an incorrect conclusion for a different problem.
Instead of using margin(), consider using the function allmargin(), which tells you whether or not the closed loop system is stable and also returns all of the margins, not just a minimum margin, for a closed-loop stable system.
Here is an example of system that has a negative gain margin but is closed loop stable.
G=tf(5,[1 0])*tf(1,[1/1000 2*.7/sqrt(1000) 1]);
G1=G*tf(100*conv([1/2 1],[1/2 1]),conv([1/.1 1],[1/.1 1]));
margin(G1) % negative gain margin
%H1=minreal(G1/(1+G1));
H1 = feedback(G1,1);
pole(H1) % all closed loop poles in left half plane
ans =
-21.5886 +21.9511i -21.5886 -21.9511i -0.1008 + 2.1942i -0.1008 - 2.1942i -1.0933 + 0.0000i
Hi. Yes, you're absolutely right. I also run into this kind of situations several times where the GM is negative but the system is closed-loop stable. As you said, this is spesific to the problem and the system itself. I just put my trust so much on the controller system design with frequency response, but it seems that these two metrics could also be misleading in some cases (at least GM is so). Thank you for you explanations. I was just surprised and disappointed when such a well-known method failed in my case. I guess they do not just cover these special cases well in books and tutorials. Maybe I look for more generic methods for controller design, like state-spate pole placement.

Sign in to comment.

Answers (1)

Paul
Paul on 20 Apr 2021
Edited: Paul on 20 Apr 2021
Closed loop stability needs to be determined before caculating GM and PM. In other words, GM and PM cannot be used to determine or verify closed loop stability. Instead, closed loop stability needs to be determined by other means. For systems that are closed loop stable the GM and PM tell how much the gain or phase can vary before changing the number of encircelments of the -1 point, thereby inducing closed loop instability.
For systems that are closed loop unstable, it's possible to use the open loop Bode plot to determine how much to change the open loop gain or phase to make the system stable, but care must be taken to understand whether or not the change in gain or phase needs to increase or decrease the number of encirclements and by how many.

Products

Release

R2020a

Asked:

on 20 Apr 2021

Edited:

on 1 Aug 2025

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!