In the last lecture we found that the phase margin test, is a way to determine the stability of the closed-loop transfer functions, based on the loop gain T and its phase, at the crossover frequency. In this lecture, we're going to ask how much phase margin is enough. Is 1 degree of phase margin, sufficient? Certainly, what we found in the last lecture is that, if we had a phase margin of plus 1 degree, then our phase margin test would say that the, the closed loop system is stable. Now, of course, perhaps we want more margin than that in, in a good robust design. And, so we need some amount of additional phase margin, to make sure we have a, a sufficient cushion for reliability and accounting, for variations in components. But, there's actually more to, it than that. The phase margin also determines, the closed loop response. At least, it's, it's a measure of the closed loop transient response, in some sense. And so, in this lecture, we're going to discuss the relationship between the phase margin and the q factor, of the closed loop poles, of t over 1 plus t, that occur at the, the crossover frequency. And what we're going to find is that, the larger the phase margin, then the better the response is, as far as having less overshoot and ringing and having a lower q factor for these poles, that are near the crossover frequency. We're going to actually make a dominant pole approximation and characterize the closed-loop response of t over 1 plus t, and 1 over 1 plus t, as having two poles near the crossover frequency, that have some Q-factor. And we'll find a relationship between that Q factor, and the phase margin of t. So, this is a nice design tool that really tells us, how much phase margin we need, and then provides a, a design criterion, for how to shape the loop gain to give us a good closed-loop response. I'm going to explain this relationship, using a simple second-order system in which, in which we assume, that the loop gain T, has this form. So, there is a low frequency pole that we're going to approximate for simplicity, as a pole at the origin. So this 1 over s over Omega knot term, is a term that goes to infinity magnitude at DC, and then, it rolls off with a minus 20 db per decade slope, and it has a magnitude of 1 or zero db, at omega equals omega knot. So it has this characteristic, or this asymptote, and it goes through 0 dB at f equals f naught, or omega equals omega naught. And then, we'll have a second pole at high frequency, at frequency omega equals omega 2, or f equals f 2, that will cause the slope to change to minus 40 dB per decade, after that. Now, the real loop gain may be more complex, but if we can approximate the loop gain T in the vicinity of a cross-over frequency like this, then this should be a good approximation, of what happens in t over 1 plus t, in the vicinity of the crossover frequency. So perhaps, the real t actually has multiple poles and zeros, that are happening at very low frequency, with all kinds of things going on. But, when we get near, say, within a decade or so of the crossover frequency, we can approximate t like this. So this in fact, is a good approximation for many of the systems, that we want to design. And in fact, the results will apply to even more cases, simply, than this. How does this behave, as far as phase is concerned? Well, this, this s over omega naught term in the denominator, gives us a phase of minus 90 degrees. And then the second pole at omega 2, gives us a phase asymptote, that decreases towards minus 180 degrees, at high frequency. And so, the phase margin then, will lie somewhere between 0 and 90 degrees, depending on exactly, where the crossover frequency is, relative to f 2. Let's use this approximation for t, and calculate the closed loop response. So, we can work out, what t over 1 plus t is, when we plug this in for t. And in fact, the easy way to do that, is to first divide the numerator and denominator by t, and what we get is, 1 over 1 plus 1 over t, and 1 over t is really easy to calculate, we, we plug this in. So, what we find is that, t over 1 plus t becomes this expression, that has two poles. Alright, we can write these two poles, or this denominator in our standard form, to identify a corner frequency, omega c, and a q factor. What we find, when we do that is that, omega 0 omega 2, this coefficient of s squared, is equal to this co-efficient, omega c squared. So we get that, omega c is root omega, not omega 2. We'll find that, when we plot omega, our frequency on a log scale, that this square root of the product, is this geometric mean, which on the log scale, lies half way between. So omega c is halfway between omega 0 and omega 2. So, if we go back to this plot, here is f 0 and f 2, and f c is halfway in between. Okay, we can also work out, what q is. So, by equating q omega c to omega 0 here, we can find that oq is omega 0, divided by omega c. Or alternatively, we can write this, as square root of omega 0 over omega 2. So then, here is the t over 1 plus t transfer function. What we have, is two poles, at this f c that, is halfway that between f 0 and f two, and it has a q, that was omega 0 over omega c or, or f 0 over f c. And if you work out what that is, that turns out to, to follow the low frequency asymptote here. If you have, want the equation the low frequency asymptote, is f 0 over f, and if you plug in f as fc, you get this value q, which is right there. So, the actual value of the function, as I've drawn here, lies below the 0 db asymptote, and in fact, we have the low q case. You can approximate, what the two poles are then, using the low-q approximation, that we've already talked about, where we'll have one pole at q times omega c, which turns out to be omega 0 or right here, at f 0. And the other pole is at omega c over q, which turns out to be omega 2 or f 2, right there. And the low Q approximation, then gives us what we would get, by easing the approximate construction of the asymptotes, as we've previously discussed. So, this is the low q case. Let's consider the high Q case. Suppose, you move f 2 down, to a lower frequency. And here, we're going to choose f 2, to be below f c. So, f 0 is again, the frequency where the low frequency asymptote passes through 0 db. We have to extend the low frequency asymptot in this case, to find f 0, and f 2 is the second pole frequency. Fc is again, have way between. In this case, the previous argument still apply. q is omega 0 omega c or f 0 over f c, which now, is a big number than one. We have a q larger than one, and the exact function goes up and touches this slow frequency asymptote and then, comes down. So, this is the high q case and we have this q, that grows. It's larger and larger, as f2 goes to a lower and lower frequency. Well, what is happening, as far as phase margin goes? If we move f2 to a lower frequency, you can see that, that will move this phase asymptote, to a lower frequency, and our phase of t at the crossover, gets lower. And as f 2 goes to dc, our phase margin goes to zero, and, and as we, as this happens, we find that the closed loop q, grows. We can work out an expression for the exact phase margin, of our original t, and we can plug that into our expression for, the q of the closed loop poles. And with some algebra, we can find this expression, for the relationship between the q of the closed loop poles and the phase margin from t, there's what it turns out to be. Takes some algebra to do that. Or alternatively, you can solve for the phase margin, in terms of q. And here's an expression for, what phase margin it takes, in order to get a certain closed loop q, for this example. Here's a plot of that result. So, this is phase margin of t, on the horizontal axis, and q of the closed loops poles of t over 1 plus t, on the vertical axis, with q expressed in decibels. So, that's the answer. You can see that, if you want a q of 1, which is 0 db, right here. It takes this phase margin, which works out to be 52 degrees. Or, if you like Q of a half for your closed loop poles, which means we have real poles, that takes a phase margin of 76 degrees. And the smaller the phase margin, the higher the q factor is. So, this phase margin of 1 degree, would give us a very high Q, and a very large resonance in our closed-loop transfer functions, and that's a very good reason to require more phase margin. So, we need phase margin, not just for a yes, no stability test, but we need phase margin, to keep the resonance in our close loop transfer functions, at a controlled and low value, 'kay? The next question is, how much q can we allow? That really depends on your application, but let's see, what the impact of having a higher q is. Well, this is really, an exercise in constructing inverse laplace transforms. Let's suppose that, we have this closed loop transfer function, with these complex poles, and what we want to do is, work out, say the step response. So, we'll have some input to our transfer function, that will take a step, and it's laplace transform. Then we can express, let's say, a unit step function can be written into laplace transform, domain as, 1 over s. You can multiply that by this second order response, and then, take the inverse laplace transform, to work out the exact time domain response, in the output that we get. So, this is also an exercise in algebra and inverse laplace transforms, but, the re, the result, in the case where q is greater than a half, so that we have complex poles, is this. So, if our input is, is a unit step function, then our output is this time domain response. In the case of real poles, we get decaying exponential time, type responses and here's what, what that is. Okay, and that's a pretty big expression, here is a plot though. So again, our input is a unit step, that's doing this. We would like the output to follow that, and it eventually does settle down and follow that, but there is some trangent that happens, following the, the step. So, for low q, we have these decaying exponential type responses, but very monotonically and eventually, settle down to follow the, the input. And for high Q, we have these ringing or sinusoidal type of responses, that have overshoot and ringing, but the ringing decays in amplitude and eventually, it settles down. So, one has to decide, whether overshoot is allowed. One also has to decide, how fast we want the response to be. Q of a half is, the case where we have two real and repeated roots, this is actually, [COUGH] the fastest response that has no over-shoot in ringing, and it's this response, right here. This is called the critically damped case. Cube greater than a half, gives us complex poles, this is called the under damped case. These responses are faster, but they have over-shoot and ringing, and take some time to settle down, to the final value. Whereas q less than a half gives us, what's called the over-damped case, where we have two real roots that are at different values. And we get decaying exponential type responses that are slower, but don't overshoot. So often, we think that the critically damped case for q of a half is the best, because it's the fastest response with no overshoot. On the other hand, we might allow a little bit of overshoot, so a q of 1, say, has maybe, 15 or 20% overshoot, which we have to decide, if that's acceptable or not, but it is a faster response, and requires less phase margin. Generally, in power applications, we can't allow overshoots heading towards twice the final value, like we get in the lightly damped case, with very little phase margin. This type of overshoot and ringing, usually will cause higher stresses on, on our components, where the voltage will go to twice the, the final value, and usually, we can't allow that. Here's a nice little function, that is the peak. We can solve this function to find the peak value, and this is what it becomes, as a function of q. So, this peak for the under-damped case, is the value of the first peak, right up here. Let's say right here, as a function of q. So, if we decide, how high we can allow the peak to be, then we can solve this to see, how much q that requires, and then we can go back to the previous plot here to see, how much bayes margin is required. One other thing about this plot is that, the horizontal axis here, is labeled in units of radions, of omega c, times time. So, if you have a requirement that you want the settling time or the rise time to be so many, say microseconds or milliseconds, then we can plug that time in here, for t, and actually work out, what the cross over frequency, omega C needs to be. For example, if we have q of a half, and we want a settling time of some number of seconds, we may define settling time, as the time that it takes the wave form, to get within some amount. Like say, within 10% of the final value, and stay there. So, we can draw some boundary, that's 1 plus or minus 0.1, or 10%. And then see that okay, if we have q of a half, then right there, is where we get to, within 10% of the final value, and that's maybe, four radiants. So, you can plug in omega c equals four, and then solve for, what omega c is required, to get the given t, or, or time, that is the specification. You can also see that q of 1 would, will over, no, it will rise faster to this value, but then, it will overshoot and go out of the box, and it doesn't get back in the box, until right there. So, it actually has a longer settling time, but a faster rise time. So, one can decide exactly, what one needs from the application and then use a plot like this, to choose, how big the cross over frequency needs to be, and ultimately, what is the bandwidth of the feedback loop. So, from this kind of plot then, we can get a requirement on both, what omega c should be, and what q should be. And then that in turn tells us, what the phase margin should be, and what the feedback loop crossover frequency should be. One last thing I need to point out is that, I explained this with respect to a, an, simply an example. I, I chose this somewhat arbitrary loop gain, although I did argue that this loop gain, is one that can approximate a great many actual loop gains, in the vicinity of the crossover frequency. It's possible to choose other loop gains, if their closed loop response in well approximated, by a second order system in the vicinity of the crossover frequency, then in fact, you get the same answer, which is this. And there's a, actually a good fundamental reason for that, but as long as you correctly work out the magnitude and phase of t, and relate it to q, you will get the same answer. If, if the system can be approximated by this dominant pole or two poles, second order system, in the vicinity of the crossover frequency. Now, of course, you can design more complex feedback loops, whose closed loops response has more than two poles, near the crossover frequency. And in that case, you can't characterize the response, simply by this parameter q, and, and omega c, it takes more parameters. So, in that case, you have to do more work and use more advanced, control techniques, to work out what happens. But in fact, the vast majority of our systems or feedback with systems, that we design in para electronics, do end up being second order systems, and we can use these simple arguments then, to design them.