Video length is 14:24

Understanding Disk Margin | Robust Control, Part 2

From the series: Robust Control

Brian Douglas

As we discussed in the part 1 video, mathematical models aren’t a perfect representation of real systems. Therefore, we want to make sure that any system that is designed with those models is robust to the expected variations of the real system. Margin is a way to specify how much uncertainty your system can handle before it no longer meets the requirement.

This video explains what disk margin is, why it might be a better representation of how much margin your system has over something like classical gain and phase margins, and how to interpret the results.

Published: 13 Feb 2020

In this video, we’re going to explain what disk margin is, why it might be a better representation of how much margin your system has over something like classical gain and phase margins, and how to interpret the results. For example, given this system, L, the classical gain and phase margins are 4.5 and almost 37 degrees. But if I check the disk margins they are, well, there are a bunch of numbers here, but they’re definitely different, and that’s what we’re going to talk about. But don’t worry, we’re not going to get too bogged down in mathematics; we’re going to try to interpret disk margin, and these numbers visually, so I hope you stick around for it. I’m Brian, and welcome to a MATLAB Tech Talk.

Let’s say that we have a system model which we’ll call L. L represents the open loop response of the real plant and any controllers and filters that are in line with it. So, it’s the open loop response of the ideal system that you want to implement. As we discussed in the last video, this model won’t perfectly match the real system. Therefore, we want to make sure there is margin in the design. Margin is a way to specify how much uncertainty your system can handle before it no longer meets the requirement. Specifying margin in terms of gain and phase—like gain margin must be greater than 3, and phase margin must be greater than 30 degrees—means that your real system will still be stable even if its gain is 3 times higher than the model at the critical frequency, or if its phase differs from the model by 30 degrees at the critical frequency. Our system, L, meets those requirements since we saw that it has a gain margin of 4.5 and a phase margin of 37 degrees. So, this seems good. If it didn’t meet the requirement, then we’d need to change L—either the controller part, or the filters, or maybe even the plant itself.

And the more margin that you have in the design, then the more robust the system is to uncertainty and variations, and, therefore, the more confidence you’ll have that the real system will be stable.

We can assess how much margin our closed loop system has by adding some variation in line with L. The amount of variation that it takes for the closed loop system to go unstable is how much margin we have in that direction. For this discussion, we’re going to vary a combination of both gain and phase, and we’re going to do that by multiplying the plant by a value, f.

The multiplier, f, is just a single complex number, so it has a real and imaginary component. And the value of this two-dimensional number dictates how much gain and phase we’re adding to the plant. We can see this more easily if we plot the value of f on a complex plane.

Gain is the magnitude of the complex number, or the distance from the origin. And phase is the angle between the real line and the line connecting the origin to the number.

So, if f equals 4 – 3i, this has a magnitude, or a multiplier of 5 and it adds an angle of about –37 degrees, so it would cause every frequency in the system to lag by 37 degrees and have a magnitude 5 times larger.

And we can check this out in MATLAB. I have the transfer function, L, and I’ve created a multiplier: f = 4 – 3i. And now I’ll plot the Bode plot for both L, and f*L. And check this out—L is the blue line, the modified f*L has been raised by 14 dB, which is 5 times larger, and the phase is lower by about 37 degrees. So, by multiplying our open loop model by a complex number, we have a way to conveniently add gain and phase.

We have to note that just multiplying a transfer function by a single complex number typically results in something that isn’t a realizable system, since it has an imaginary term in it. But that’s ok, this is just a tool for us to use to figure out the limits within our system.

Now, Bode plots are nice because gain and phase are separated out and it’s pretty easy to see the added gain or added phase directly. However, disk margins have a nice intuitive interpretation in the complex plane, so from now on we’re going to look at our system response on a Nyquist plot rather than a Bode plot.

All right, on the screen there are two graphs. The one on the left is the plotting just the multiplier, f, in the complex plane, and you can see that it’s currently at f = 1. The plot on the right shows the Nyquist plot for f*L. But since f = 1, this is the response for the unmodified system.

I’m not going to go through the Nyquist stability criterion in this video, but if you’re interested, I’ve linked below to one of my videos that describes it in detail. If you’re not familiar with it, then it’s enough to know that for this particular open loop system, L, the closed loop system will be unstable if the Nyquist curve encircles the point –1. The plot is green if the closed loop system is stable, and will turn red when it is unstable. So, when we add gain and phase to the system by changing the value of f, as long as this curve doesn’t cross over the –1 point, or as long as it doesn’t turn red, then the closed loop system is stable with those variations. In general, that statement’s not exactly true, but for this system it is. Again, check out the linked video if you want to learn more.

So, we can see that our closed loop system is stable without any variation in gain or phase since the curve doesn’t encircle –1.

Watch what happens to this Nyquist curve when I add gain. You can see that the curve grows as gain increases and shrinks when gain decreases. The thing to note here is that there is this one point at f = 4.5 where the curve crosses the –1 point, which means the closed loop system is not stable for this variation. This is the value of the classical gain margin that we calculated at the beginning of this video. So, gain can vary up to 4.5 times larger in our real system without causing instability.

Phase is similar. We can add pure phase by varying f along the unit circle. So, the magnitude stays 1 but the angle is changing. Adding phase into the system has this folding effect on the Nyquist plot where the top and bottom halves circle toward each other to the left. And the angle of the rotation is equal to the angle of added phase. Again, there is one point at about –37 degrees where the curve crosses the –1 point. This is again what we calculated for the classical phase margin.

What we’ve done is vary gain or phase individually. But if we look at the possible values of the multiplier, f, you can see that we’ve only looked at a very small region of the entire complex plane. Specifically, this line where only gain is adjusted, and this line where only phase is adjusted. The question is, is our system robust to other variations—all of these other combinations of phase and gain?

Well, let’s try a few. We can check f = 1.13 – 0.65i, which is equivalent to a gain of 1.3 and a rotation of –30 degrees. And this combination is not stable. And we could try another point, f = 1.36 – 0.34i, and see that this is closed loop stable, or point f = 2.95 – 0.52i, and see that it’s not stable.

Now, rather than check points one at a time, we can use a computer to try hundreds of variations and color the points red that cause instability and green that don’t, and we get something like this.

Remember, margin is how much variation a system can tolerate in any direction. So, starting from the nominal system, f=1, we can say this system can vary up to 4.5 in gain and 37 degrees in phase. But as we can see from this plot, the story of how robust our system is to variation is a lot more nuanced than just looking at classical gain and phase margins.

This is where the idea of disk margin comes in. As the name suggests, disk margin defines margin as a disk in the complex plane rather than just two points. We can define a disk that is able to fit entirely within the stable region and includes the nominal point, f = 1.

Within this disk, every single combination of gain and phase produces a stable closed loop system. So, now we can say that the margin in our design is the distance between the nominal system and the edge of the disk. So, as long as the real system variation falls within this disk, then you have confidence that it will be stable. This is nice because it takes into account a combination of gain and phase variation rather than just one or the other like we had with classical margins.

The size and location of the disk is defined as a function of two parameters e and alpha; e is the skew of the disk and you can think that as how far off the center of the disk is relative to the point f = 1. And you think of alpha as a measure of the size of the disk. So, if we choose a value for skew, then alpha is just the maximum disk size that only includes stable variations. So, it’s the largest circle that only has green inside of it.

The value of e you choose is based on your expectation of how gain in the real system is going to vary. If you think the gain of the real system is more likely to be higher than what your model claims, you may want to choose a more positive e. If you think the gain will be lower than what your model claims, you may want to choose a more negative e. And if you think the gain is equally likely to be higher or lower, or if you have no idea, then you may want to choose e = 0. This balances the gain equally on either side of f = 1.

And we can now describe the boundary of this maximum disk as having a lower and upper gain margin and a lower and upper phase margin. Or we could say that given a specific skew, e, the maximum disk margin is alpha.

And remember, changing the skew, say by making it larger, moves the disk in a way that increases both the upper and lower gain margins since it moves the disk to the right. And for this system, L, it also lowers the phase margins. And again, you’d choose a more positive skew if you thought the real system was more likely to have higher gain than what your model has.

Now if we go back to all of the numbers we got from the disk margin command in MATLAB, you can see that each of these disk parameters are there. The upper and lower gain margin, upper and lower phase margin, and the disk margin, alpha. These are the values for e = 0 since that’s the default in the command, but we can run it again with e = 5, and see that they are all slightly different. Both the upper and lower gain margins are higher, and the phase margins are lower, just as we expected.

All right, looking at this graph makes it seem like disk margin is very conservative since it’s excluding all of these stable variations that are outside of the disk. For example, we know a magnitude increase of 3 is a stable variation, but looking at the disk margin we would claim that that is outside of what our system can handle. But it’s not as conservative as you might think, because even though a gain of 3 is stable, in that condition it doesn’t take very much phase shift to cause an instability. So, the system may be stable with this much uncertainty in gain, but there isn’t much wiggle room for uncertainty in phase. Therefore, it’s not terribly conservative to just claim that a gain increase of 3 is not a variation you’re comfortable with.

But it might be worthwhile to check both the disk margin and the gain and phase margins of your system because they tell you slightly different things, and it’s interesting to see if they’re very different from each other. We can tell that this system is pretty robust to phase variations even when combined with some gain variation, since the two techniques produce similar phase margins.

But if we look at a different system, this one where L is this 4th order transfer function that I created, you can see that the stability map for this system produces this concave shape. And this results in a huge difference between classical margins, which are infinite in gain and about 70 degrees in phase, and the disk margins, which are much, much smaller. This tells us that our system is very robust to pure phase or gain variations but not very robust to combinations of gain and phase variation.

Now, overall, margin is just a design tool. It’s a way to ensure that your design is robust to the variations and uncertainty that you’re expecting in the real system. You can set those requirements as gain and phase margins, or disk margin, or both of them. The important thing is that you understand what those margins are telling you and what their limitations are. And if your system doesn’t meet your margin requirements, then you have to find a way to change your design.

Now, you might be thinking that this transfer function is a bit contrived, and real systems don’t typically have this type of extreme difference between gain and phase and disk margin, so what’s the big deal? Well, even if that statement is true, one of the huge benefits of looking at disk margin, and why it’s important to understand, is that it’s a much better indication of robustness when we apply it to multivariable systems. And that’s what we’ll cover in the next video.

If you don’t want to miss that or any future Tech Talk videos, don’t forget to subscribe to this channel. And you want to check out my channel, control system lectures, I cover more control theory topics there as well. Thanks for watching, and I’ll see you next time.