[BLANK_AUDIO] In this lecture, we'll discuss stability. In the previous lectures, we found how to construct the loop gain and the important quantities, T over 1 plus T and 1 over 1 plus T. These important quantities govern the closed-loop transfer functions of the control system. For example, to construct T over 1 plus T, we found that this was, had an asymptote of 1 or 0 dB, where the loop gain T is large in magnitude. And where it's small in magnitude, it follows T. So for this example we get asymptotes that look like this. Now let's take a look at these asymptotes. They don't include the poles right here at fp1 that were present in T nor they, do they seem to include this zero. And instead we have a new corner frequency at the crossover frequency of sub c. So it would appear that these corners have moved up to f sub c. In fact, what happens is that the poles do a deep move. One of the poles may cancel this zero, and the other one will move up here to have sub c. So what is apparent is that the act of closing a feedback loop can move the poles around. Now that's both good news and bad news. The good news is, you can move the poles to other places, and in this example we end up increasing the, the bandwidth of our system so that these low frequency poles down at about 30 Hertz get moved up to the crossover frequency of greater than a kilohertz. But the fact that the poles can move is also bad news because the feedback loop can move the poles anywhere. And sometimes, they get moved to bad places, such as in the right half of the complex plane, where we get unstable responses. Or where we may have undamped or lightly damped type resonant responses, such as this. Here's an example of a, a response where, for example, the input, or the reference, perhaps, took a step change. So maybe we can think of our reference as doing this. And then here is the response of the output voltage, v-hat, which is trying to follow the reference. And it eventually does follow the reference, but there's a transient response that may include things like overshoot and ringing. Often times in a power system, we don't like this kind of overshoot and ringing, or, and it's not allowed. For example, if this was a computer power supply, where we were trying to, to feed 3.3 Volts, say, to a processor, and maybe this is a turn-on transient. We don't want to overshoot to twice that or 6.6 Volts will blowup all of the, the chips, and the processor chips. Another example where this might be undesirable is if we have say a robot arm and we're trying to control the position of the robot. And we are commanding the robort position to change from say, this value to that value. But, instead first it swings pass the value and comes back and maybe going past that value. Put makes it, your robot arm go through the wall or something. So, we very often can't allow this kind of response. So, we get new poles at the crossover frequency. And those poles can be resonant, they can be associated with a Q factor, right here, so we may have a closed loop response, that includes some Q factor. And that resonant response leads to overshoot than ringing like this. So this is something that we generally have to control, and the control of exactly where tho-, these close loop holes are? What their Q factor is, whether they're stable or unstable is the stability problem. Here's another way to look at it, just the algebraic approach. Suppose that our loop gain T has some numerator polynomial, I'll call N of S, and a denominator polynomial, we'll call D of S. We can simply plug that in for T, and see what we get. So T over 1 plus T, if we plug this in, expression in, we can do the algebra and we find that the denominator polynomial becomes N of S plus D of S. So it's a different polynomial than the original D of S To find the poles of this denominator we have to do quite a bit of work. We'll have to add the two polynomials together and refactor them. It actually turns out to be not so simple to do in a general case. And that algebra and refactorization often is not very eliminative. So one of the key topics of the classical control field is finding simpler ways to understand the nature of these new poles at the crossover frequency without having to do this re-factorization. Here's an example of how the poles can move. So, let's say we have some original open loop system with a transfer function G of s. We close a feedback loop around it with some feedback gain H of s so that we get a loop gain then that's G times H. And we'll do an example where G is this fairly simple looking expression. It has a DC gain of 100 and then it has three poles. So there's three roots of the denominator each at s equals minus 1, and in the complex s plane then, we have three poles here at minus 1. Okay, we'll, we'll add a simple feedback loop now. So, this is our G of s and we are going to add a feedback loop having a gain of 1, our H of s equals 1, and lets calculate what the closed loop poles are from vn to vl. So the, we have already that v out over vn is 1 over H times T over 1 plus T. H is 1 and T is G. So, we get this. We can plug in our transfer function for G. We can do the algebra and multiply out the transfer function to find the denominator. We find that there is a cubic polynomial on the denominator which we have to re-factor. Well, it's not easy to [INAUDIBLE] re-factor this by hand. this is done here numerically with a root finding program. And, we find that this is the denominator. So this, this cubic polynomial has three roots. One of them is at s equals minus 5.64, which is right there. So one of the roots at s was minus 1, gets moved out to there. The other two roots are complex. And they in fact have positive real parts. So, these roots are at s equals plus 1.32 plus or minus j4.07. So, the other two roots moved to here and to here. Now, these two roots are in the right half of the complex plain, and they have positive real parts. They indicate us an unstable response. The reason for this is that if you take the inverse Laplace Transform of this transfer function for some given input, you find that the output contains terms that go like e to the pole times t. So with, with the inverse Laplace Transform we we'll get a term that is some constant time e to the minus 5.64t, which is okay, that's a decaying exponential that decays to zero, and, and indicates a stable response. But the other two, have, are e to the plus 1.32t and times e to the minus j4.07t, so these indicate a growing oscillation. They're a response whose amplitude grows, or the envelope here grows, like e to the 1.32t. And the complex part is the oscillatory part [COUGH]. So, by having poles in the right half of the complex plane, we get solutions that have positive real exponents, and are growing exponential, or growing oscillations. And therefore, we get an unstable response. So this is a maybe fairly innocent looking at first. We don't have any minus signs in the denominator or anything, but nonetheless it turns out that this has poles on the right-half plane, and constitutes an unstable feedback loop. Okay, the re-factorization of the denominator again is not so easy to do in practice. And so in the classical control business, there are quite a few different techniques to get around the problem of having to re-factor the denominator. What we would really like to do is to see how we should shape the Bodie plot of T, to make the close loop response, including these new polls, be well-behaved and do what we want. So we have these tests on the loop gain T that determine what the close-loop poles do. One of the general tests from classical control theory is called the Nyquist stability theorem. Now, we don't have time to explain this. If you want to learn this, it's worth learning. And, you should take a control class. but what we talking to use is, is a special case of this, that is called the phase margin test which is a test that we can apply to the Bodie plot of T and to deduce what these closed loop holes do. This is a nice design tool, because it let's us change or work with the Bodie plot of T and change our loop gain shape it to, to give the kind of response that we need. So it's a nice design oriented tool. I'll state, though, that this phase margin test is not the most general. There are some cases where it doesn't work, and we'll discuss those as well. So here is a statement of the phase margin test. So again, this is a test on T, the loop gain. And this test determines whether 1 over 1 plus T and T over 1 plus T, have right half plane poles. So, what we do, is we first find the crossover frequency. We've already talked about the crossover frequency. But, to, to state it correctly, the crossover frequency is the frequency where the magnitude of T is 1, or 0 dB. Once we find that frequency, then we find the phase of T at the crossover. So this is phase of T at the crossover frequency. What you do is you add that phase to 180 degrees, the result is called the phase margin. And if the phase margin is positive, then we have a stable feedback system. Okay. Now there are special cases. You can build loop gains that have more than one cross-over frequency. And some of those might have positive phase margins, and some might have negative. And, in that case really we need to revert to the marginal Nyquist criterion that I'll say that in those cases the, usually the loop is unstable. This test also applies really only if the original loop gain or T has no right half plane poles to begin with. So we have to have a system that is open loop stable. Generally in power electronics we have that, but if it's unstable to start with, we, it's possible to apply feedback to stabilize the system. But we can't apply the phase margin test, we need to use some more complex classical control theory to do this. So having said all of that the bottom line is that we find the phase of the loop gain at the crossover frequency and 180 degrees, that's our phase margin, we want to pause it at phase margin for stability. Here's an example. So here is some given loop gain. It has a DC gain here, let's say a 40 dB or a gain of 100. It has two poles with some Q factor at some low frequency. So after that we roll off with minus 40 dB per decade, and those two poles cause the phase to change from zero down to close to minus 180 degrees. We also have a higher frequency zero which changes the slope so that we go to minus 20 dB per decade slope after that. And that, the, this zero gives some positive phase, so that at high frequency, the phase of T is minus 90 degrees. Okay, just from looking at the plot, you can see the crossover frequency is right there. Here's the phase of T at the crossover frequency. This says the phase of T, if you worked out what that value is, it says it's minus 112 degrees for this example. So if we add 180 to minus 112, we get plus 68, and that is the phase margin. It turns out to be this distance, is the phase margin. The phase margin is positive and so this is stable. Here's a few more details on exactly how we calculate that in practice. A good way first to find the crossover frequency is to write the equation of this asymptote You have to estimate over which range of frequencies the crossover frequency occurs, and then write the equation of that asymptote. So what, here's our expression for T that has a DC gain, the zero and the two poles. The equation of the, this asymptote at high frequency, you recall, is found by taking the largest term everywhere we have a sum. So in the numerator we-, we're at frequency above omega z. S over omega z will dominate over the 1 and we throw out the 1. We are also at frequency well above omega p1 or fp1. So this term will dominate the other two denominator terms and we throw them out. When we do that, we get this expression. And you can simplify it, and write it this way. And finally, that's the equation of the asymptote. What we do is we equate that to 1 to find the frequency where the asymptote is equal to 1. And we get this equation for the crossover frequency. Of course, there maybe some small deviation from the deviation from the asymptotes. It looks like that deviation will not be very large. But this is an approximate solution. It's a lot easier to find, to use this approximate solution though than it is to work with the exact equation with the radicals for the magnitude. Once we know this crossover frequency, now we can evaluate the phase, right here. So, we need the phase of T. There is really two ways to do that. One way is to work with the exact equations for the phase of each of these terms, so that's shown here. This is the expression that we had for the phase of a zero and this is the expression we had for the phase of complex poles. And so what we can do is, is add the two expressions, and get the total phase. The expressions are somewhat complex, but, you can, if you have a calculator or a spreadsheet or MATLAB or something, it's not hard to evaluate. The other way to do this is to use the phase asymptotes. So we could write the equation of this asymptote over this frequency range, which appears to be the correct frequency range, that includes the crossover frequency of c. So for this, to write the equation for this asymptote, what we do is we add the input equations for each of the asymptotes of each of these corners. So we're at frequency much greater than the resonant pole corner frequency. And the poles will give a phase asymptote of minus 180 degrees, which is this term. Then the zero right, right here is near the crossover, and we're on the part of it, asymptote that has a plus 45 degrees per decade slope. So we need to write the equation of that, and this is the equation for a phase asymptote. It has the slope plus 45 degrees per decade. And then we're on a log scale, so that, this is this asymptote is a function of the log of frequency, and what you have to do is take the base 10 log of frequency divided by the brake frequency of, for that asymptote. So the break frequency for this asymptote would be at 110th of the corner frequency or fz over 10. And we have a plus 45 degree per decade slope starting there. So the correct expression then is the base 10 log of frequency divided by the corner frequency over 10. So here is an equation of the phase asymptote. You can decide which one of these is easier to use. The asymptote is, is quite a bit of an approximation. This one is, of course, the, the more accurate one. neither one is easy to do in your head. So we use or the other, other of these to evaluate the phase of T at the cross-over. Plug that in here. Add that to a 180 to get the phase margin. Here is a second example. This is a case where the zero is turned into a pole. So we have our same DC gain of 40 dB, or a 100. We have our same two poles with a Q factor. But then, this next corner is also a pole, so that we have a total of three poles. The high frequency phase asymptotes then go to minus 270 degrees. And, if you work out what the phase is at the crossover frequency, it turns out, it says here that it turns out to be minus 230 degrees. So the phase margin then is minus 230 plus 180, which gives us minus 50 degrees. This is less than 0 and therefore this is an unstable system. You might go back to the previous example that had three polls at s equals 1, and work out the phase margin if you want an exercise. Okay, so we have the phase margin test that tells us stability. One of, the next question we'll ask in the next lecture is how big do, does the phase margin need to be?