In a typical design of a control system, we have these kinds of specifications and requirements. First, we may have variations in the load current which cause variations in the output voltage. And we would generally like to maintain regulation of the output voltage regardless of what the load current does. So there will be a limit on the maximum variations in the output voltage that result from load current variations. And essentially, this is the limit on the maximum allowable output impedance of our closed loop system. A similar problem is the effect of input voltage variations, or VG hat variations on the output voltage. And so again, we may have some maximum amount of input voltage variations that we are expected to, to see. And this requirement then limits the magnitude of the transfer function from the input voltage to the output voltage. So in previous lectures we've discussed already how to work out the closed loop transfer function, and we found that we can find the closed output impedence as the open loop output impedence divided by 1 plus loop gain. And likewise the closed loop transfer function from Vg to the output, we can construct as the open loop Gvg divided by 1 plus loop gain. These are the, then the closed loop disturbance transfer functions. And we want to design our feedback loop to make each of these quantities be sufficiently small so that the output voltage is regulated. The other kinds of requirements that we get relate to the last lecture. So we may have some transient response time requirement, which means that we want to respond to a disturbance in a certain amount of time. And so this requires a sufficiently high cross over frequency and bandwidth of the feedback. Also, this transient response might have overshoot in ringing. Generally, we want to limit that. And so we need an adequate phase margin in order to achieve that requirement. So, these two issues were discussed in the last lecture. The, the problem of designing a feedback control system then is one of shaping the loop gain so that we have the adequate phase margin, we have an adequate crossover frequency. And we have a large enough magnitude of the loop gain to make these disturbance transfer function be sufficiently small. So what we'll talk about in this lecture then is how to add polls and zeros, and gains to our loop gain to shape it and change it so that we meet all of these kinds of requirements. And this addition of polls and zeros is done through generally what's called a compensator network. It's another block that we to our feedback loop that often contains things like op-amp circuits, or in an analog feedback loop. And this is the place then where we can add these poles and zeros to shape the loop gain, and get what we need. So we're going to talk about several of the classic kinds of compensator networks. The first one is called a lead compensator traditionally, or a PD proportional plus derivative control compensator. And the object of this kind of compensator network is to improve the phase margin. So how can we improve the phase margin of the loop gain if we don't have enough? Well, we know that zeros add positive phase. So naturally, we can think of adding a zero to our loop gain. Here is then a plot of a loop gain that has a zero right here, and after that frequency, we have a gain that increases. So we get this compensator that has a, some dc gain, and then it has a zero. Now one immediate problem or practical problem with this, is that this transfer function by itself with the zero, implies that the gain gets larger and larger as the frequency increase. And in fact as you go to infinite frequency, this circuit has infinite gain. And this is not at all practical. All amplifier circuits must roll off at high frequency. If you go to a high enough frequency there's no more gain. So there's at least one pole to flatten out our gain, and in fact there's more than that. There's at least one more after that to make the gain roll off. We'll talk more about this when we do an example of designing an op amp circuit for a practical compensator. So what's shown here is a pole, then that makes our compensator gain flatten out at higher frequency. And we'll assume that any further poles are at a high enough frequency that they don't affect what happens here in the vicinity of our crossover frequency where we're going to design. The phase asymptotes of this transfer function are constructed below it. The zero will give us phase asymptotes that extend a decade on either side of the zero frequency. And likewise, the pole will give phase asymptotes that look like this. That go down to minus 90 and change over a decade on either side of the pole frequency. So here's fp over 10, and 10 fp. The phase asymptotes will have this as fz over 10, and 10fz up here. When you combine these asymptotes, the slopes over the range from this frequency to this frequency will cancel and will flatten out. And then above that frequency we'll eventually come back to a net zero degrees phase shift. So the composite asymptotes are sketched here. The maximum phase happens right at that frequency. So if we want to improve the phase at the cross over frequency, we should see the cross over frequency to be this frequency where phase is maximum. So we'll set that equal to the cross over frequency of sub c. This is a log scale frequency, and so halfway between these two phase break frequencies on the log scale is the geometric mean, which turns out to be at the square root of the zero frequency times the poll frequency. So that's what we should set equal to f sub c. Then this phase here we'll call the theta max, or perhaps just theta on the next slide. So that's phase lead that we get out of this network. We can work out the exact phase of this transfer function and calculate what theta is as a function of f z and f p. That's actually done on the next slide. So here is the answer. The frequency where the phase is maximum is at this geometric mean. Which we will set equal to the crossover frequency. And the value of that phase, if you work out the exact function, it turns out to be expressible like this. So here's a plot of the maximum phase lead that we get as the function of the ratio of the pole frequency to the 0 frequency, which is on this axis. So, for example, if we place the pole at 10 times the 0 frequency like this, then we'll get this much phase lead out of our network, which looks like it's, what, about 55 degrees. And so we can actually figure out what ratio of frequencies of the pole and zero we need to get a certain amount of phase lead. Here, here it is the relationship between the pole over zero frequency versus this maximum phase data. So to design a lead compensator then, or a PD compensator, we want to set our crossover frequency to be right there, and our pole and zero frequency will be spaced evenly about it. And we will choose that ratio of frequencies to make this maximum phase give us enough additional phase to, to get the proper phase margin in our loop. Here then is what we need to do. So fc is the crossover frequency, theta is the amount of additional phase that we need out of this compensator network. And here are the expressions then that we can solve for the zero and pole frequencies of our compensator. One last little point is that this compensator also has a gain that can move our overall loop gain up and down. If you don't want to change the crossover frequency of your loop, you need to make this gain right here the unity gain so that it doesn't change the gain at the crossover frequency. Well, that means that this gain at low frequency will be less than unity. Here is a fact and expression from the gain, which you can derive by writing the equation of the asymptote. If we want to change the gain of the loop at the cross over frequency, then we can set this quantity equal to whatever gain we need and solve for the value of Gc zero that it takes then to get, to achieve that gain. So this slide is the bottom line. This is, these design equations that we need to design the PD compensator. Here's a brief example, and we'll do some more involved examples in upcoming lectures. That what I've shown here is an uncompensated feedback loop that has two poles with a Q factor. And then it rolls off with a two pole slope after that. It passes through zero db right there. So this is our crossover frequency. And here are the phase asymptotes for the non compensated loop gain t. In the vicinity of the resonance, the phase changes very quickly from zero to minus 180 degrees. And by the time we get up here to this high frequency where we have a crossover, the phase of t is basically minus 180 degrees, and we basically have no phase margin. So what we need to do is add a PD compensator network to add a zero and a pole that will improve our phase margin. Here I've illustrated one where the zero is below fc and the poll is above fc, as on the previous slide so that our compensated loop then does this. If it, we maintain the same crossover frequency, but the zero and pole give us some additional phase so that we now have some positive phase margin here. Which is in fact equal to the amount of phase we're adding from our compensator for this example. One of the things it does is reduce the DC gain. And so with this type of compensator, we're not conce, concerned with the, the DC gain or the gain of T at other frequencies. All we are really trying to do is improve the phase margin. Here is a second classical type of compensator network called the Lag Compensator, or the proportional plus integral controller, or PI controller. The object of this type of compensator is to increase the loop gain at low frequency so that we can regulate better and have more loop gain. Here's a transfer function of the classic PI compensator. It's, I expressed it here as a, an inverted zero, so it has a gain that looks like this. This term here is the integrator In the Laplace domain, an integrator is, divides by s. And then, so that's the I part of the PI controller. And then this is the proportional part, or proportional gain, that's P. And so we have proportional gain, and we have an integrator at, at low frequency that increases the low frequency gain. This kind of compensator does not improve our phase margin at all. In fact, at low frequency it makes the phase more negative. So that's not good. Generally, what we do with a PI compensator is we try to not disrupt the high frequency phase. So the PI compensator has zero degrees of phase at high frequency, and generally we'll want to have our crossover frequency somewhere up here. Where the compen, the PI compensator doesn't mess up our phase margin. But what we do is we used the compensator to improve the low frequency gain and get better regulation, so that we reduce the disturbance transfer functions at low frequency. Here is a brief example of a lag compensator. In this case, our initial uncompensated loop gain is this one. It has a low value of gain at DC, in fact, it has next to no loop gain. And then it has a single pole, with a single pole slope and height frequency. The phase of the uncompensated gain then is zero degrees at low frequency. And then the pole gives us, minus 45 degree per decade slope, and we end up at minus 90 degrees at high frequency. Our phase margin is not a problem. Looks like here, if we cross over at this high frequency, we've had 90 degrees of phase margin. And that's not the problem at all. Instead, the problem is that we have next to no gain at low frequency and our loop doesn't do anything, so we need to boost the gain. Now, the first thing we could do is simply add more DC gain to our entire loop. So we could bring the whole loop up by maybe that much, and just scale the whole curve up, so that we have a, a gain like this. But then we can do even better if we add an inverted zero here, and get very large gain at DC. The inverted zero might be chosen to be a decade in frequency below the crossover so that it doesn't change the phase margin, but it simply gives us more low frequency gain. Here is a plot of the quantity 1 over 1 plus t for the compensated loop gain. So recall that this quantity 1 over 1 plus t reduces disturbance transfer functions in the converter, such as the output impedance or the line to alpha transfer function Gvg. As you recall, 1 over 1 plus T is found as being essentially equal to 1 or 0 dB at high frequency, and 1 over T at low frequency. So increasing T with this Pi compensator will reduce 1 over 1 plus T. And therefore reduce the disturbance transfer functions and give us very good rejection of disturbances, and very good regulation of the output voltage at low frequencies. Finally, here is a PID compensator. Or a combination of the previous lag and lead compensator networks. So what we have here is a PD compensator from those two terms, which gives us this zero and this pole. I've also shown us another pole, a second pole at very high frequency. As I mentioned, this was present in a practical amplifier. And then finally, we have the PI compensator, which gives us this inverted zero at low frequency. So this compensator network has all the terms. This is often what we will do if we have a second order system such as a continuous conduction mode but type convertor to compensate. The crossover frequency as in the PD compensator will be chosen, to be halfway between the zero and the pole, so that our crossover frequency will be here and will get some Improvement in phase margin from that. And then we'll have our pi compensator, inverted zero. We add some frequencies sufficiently less than the crossover frequency, and improve the low frequency gain. The way to design one of these is to do these quantities one at a time. So I would first design the PD compensator part to improve the phase margin. And after that, add on an inverted zero or PI compensator to improve the load frequency gain and get a composite transfer function like this. In upcoming lectures, we're going to discuss first design of some of, of this type of compensator. And I'll do a practical design example. And we'll also talk about how to realize opient compensator circuits to realize a transfer function such as this using the ideas that we've discussed in previous lectures.