In this lecture, we'll do a, a design example where we're going to design a compensator. Of the feedback loop for a buck converter with output voltage regulation. So the object in this system is to produce an output voltage of 15 volts. So the first thing we should do is decide what the sensor or feedback gain, h of s should be. In this example, we have a reference voltage that is a well-regulated and accurate five volts. So as we've discussed previously, in a well designed feedback loop, the error signal will be zero, or at least very, very small, and so the fedback. Output voltage, h times v, should be equal to the reference when the, the circuit is working in steady state. So we have five volts here, and that means that h, therefore, should be 1 3rd. So we'll have gain of a 3rd and our 15 volts will turn into 5. So H equals 1 3rd. With this choice of values, we can work out the quiescent operating point of the converter, define, for example, the steady state duty cycle. We're not going to model losses, so the steady state duty cycle would be 15 volts divided by 28 volts for the buck converter. And we can work out the other quantities, such as the control voltage and, and other things from there. So, here is a list of the voltages and duty cycle at this quiescent operating point. Knowing that, we can now plug in the small signal model for our buck converter, and here is the buck converter AC model that we have previously derived. I also have shown a block diagram then for the rest of the feedback loop. We can solve this ac model for the buck converter then to find the important transfer functions. So the control-to-output transfer function Gvd of s for this buck converter, we've found previously for the buck is this expression. We'll plug in the numbers from the previous slides to these component values, and what we find is that we have a dc gain in gvd, of 28 volts, which corresponds to 29 db volts. And we have a resonant frequency, f0. That turns out to be 1 kilohertz, so we'll have a two pole slope beyond 1 kilohertz. The q factor works out to be 9 and a half, which corresponds to 19.5 db, so we can sketch in the resonance from that. And we can also sketch the phase asymptotes of gbd. By using our phase asymptote formulas, we find that the phase asymptotes have break frequencies at 900 hertz and 1.1 kilohertz, so the phase changes very sharply over that narrow frequency range. From 0 degrees down to minus 180 degrees. So, there's our control-to-output transfer function. We could also work out the line-to-output transfer function and the output impedance of the converter power stage as usual and here are the expressions for those. So given all of those things, then, we have this complete system block diagram with the converter power stage model, as we previously discussed, and with the, the transfer functions of the buck converter included. And we have our feedback loop. As well. From this block diagram, we can work out the loop gain. So the loop gain T will be the compensator gain G c times the modulator gain, 1 over V M, times the control to output transfer function G v d, and then times the H of s. So, that's, that's these quantities. And when we plug in our GVD of s with its two poles, then we get this. So, let's first plot the uncompensated loop gain. This is the loop gain t of s when the compensator gain is 1. So we haven't designed a compensator yet. Let's see what our starting point is. So the uncompensated loop gain then has the two poles from the control to output transfer function, and then it has a dc gain that is the product of these dc gains around the loop. This DC gain works out then to be 2.33 or 7.4 dB. So we have a fairly low DC gain in our uncompensated loop. And then we have our same two poles at 1 KHz with a Q of 9.5. So there's the complete loop gain. Without a compensator, you can see that the crossover frequency looks like it's right there, from the drawing. Which is 1.8 kilohertz, and the phase at that point. Is almost minus 180 degrees. There's actually a little deviation from the asymptote and if you work out the exact phase at that point, we find that it's minus 175 degrees. So, our uncompensated loop would have a phase margin of five degrees. Well, so this is our starting point. I would say, some defects in the uncompensated loop gain are, first of all, we don't have much phase margin. Second of all, we could probably push this crossover frequency up to a higher frequency and get some more bandwidth. And third, we don't have much low frequency loop gain, so our loop won't do much of a job of regulating. First thing we'll do then, is design a lead compensator to improve the phase margin. So we discussed already how to do that. What we're going to do is I'm going to try to design for a crossover frequency of five kilohertz Which is here. It's, it's 1 20th of the switching frequency. So we'll need to increase our loop gain by, this much, to push our, our gain up at 5 kilohertz so that our crossover frequency ends up being there. We'll also need to add some phase, so we'll need to improve our phase margin, and I'm going to design for a closed loop q of 1. If you recall our plot of q of the closed loop transfer function versus phase margin of t. If we want a Q, closed-loop Q of 1, this means we need a phase margin of 52 degrees. Looking at this plot for the uncompensated loop gain, at 5 kilohertz there really is basically no phase margin. So, we need to design a compensator, that will add 52 degrees at 5 KHz. And we'll add this much gain at 5 KHz. From working out the asymptote of T, the expression for the asymptote of the uncompensated T. One finds that the existing loop gain at 5 KHz is minus 20.6 dB. So, we need to add 20.6 dB more of gain at 5 kHz to, to get the crossover frequency to be there. Here were are the asymptotes of the lead compensator from the previous lecture. We'll then want this frequency here to be the crossover frequency, fc or 5 kHz. And we'll want this phase right at this point. We were calling theta to be plus 52 degrees. This slide is also from the previous lecture. These are the formulas for designing the lead compensator. So, again, f c is 5 KHz. And Theta is our 52 degrees. So we can simply plug the numbers in and see what zero and pole frequency we need. Then here are those computations. It turns out our zero needs to be at 1.7kHz and the poles need to, pole needs to be at 14.5kHz. And our compensator dc gain needs to be 11.3 db, or a gain of 3.7. Here is a Bode plot of that then, so this is our 5 kilohertz right there. Let's plot the compensated loop gain now with this compensator. Here's the original loop gain with the, the dc value of the uncompensated loop gain and its two poles. And then, these three terms are the added terms that come from our compensator with our zero pole and additional dc gain. When we add those in to our loop gain, we'll get the zero right here and the pole right there. The phase asymptotes then are increased, so we have our phase margin of 52 degrees at 5 kilohertz. And it turns out now that our DC loop gain is 8.6, or 18.7 db. Which is better than it was before. This loop gain is not bad. We do have a good phase margin, but we could further improve it by increasing the low frequency or dc value of the loop gain. The reason we would want to do that is to reduce the disturbance transfer functions. If you recall from previous lectures, the disturbance transfer functions such as the, gvg of transfer function, from vg hat to v hat. End up having a factor of 1 plus t in them, like this, in the closed loop case. So our, we can use our loop to reduce this transfer function in magnitude. A typical case for wanting to reduce this transfer function. Is in a dc voltage regulator that operates off the power line, where g, vg includes variations at the second harmonic of the ac line frequency. In other words, at 100 hertz or 120 hertz. So if we have voltage ripple from rectification That occurs down at frequencies down here. Then our feedback loop can reduce those variations if it has more loop gain at 100 or 120 Hz. So it would be nice if we could reduce 1 over 1 plus T or increase the loop gain. To better reject those harmonics. What we can do then, is to add a pi type compensator or lag compensator, which is this inverted zero form, like this. What this does then, is increase the loop gain of frequencies below the inverted zero frequency, so that we better reject. Variations or disturbances. Since the inverted zero term adds phase lag at frequencies below 10 times omega L, it is a good idea to choose this omega L to be. Perhaps no more than 1 10th of our crossover frequency, so that it doesn't reduce our phase margin. Therefore with a crossover frequency of 5 kilohertz, we might choose this f sub l to be 500 hertz. Now, the lower in frequency we put it, the less benefit there is, say, at 100 or 120 hertz. So we might want to put this in fact at a higher frequency, but if we do, then we're going to have to redesign our lead compensator to correct the phase margin. So here is a design then where we choose 500 hertz, and then we obtain this loop gain, with our additional term at 500 hertz. And. Loop gain being improved at frequencies below that. The 1 over 1 plus key factor then looks like. Then let's construct the closed loop transfer function from vg to the output. Here's our open loop gbg. And it has the same poles as in gbd, plus it has a dc gain equal to the duty cycle. So I'm going to just sketch them on this plot. We have a duty cycle that is slightly greater than a half. Or slightly larger than minus 6 db so, it's down here. Then we have the same two poles at f not. So this quantity gvg, then gets multiplied by 1 over 1 plus t, so we have multi, multiply this asymptote by that asymptote. Well, at high frequency above the crossover, 1 over 1 plus d is 1 and it doesn't change anything, so we get the close loop gvg is the same as the open loop. And that's the case all the way up to f, or frequencies of fc and higher. When we go below fc, the 1 over 1 plus T term adds a plus 20 dB per decade slope there. We had a minus 40 slope on Gvg, so we go to plus, or to minus 20. Then we have our compensator zero. Which adds a plus 40 dB per decade slope below that, which will make this whole function flatten out below the 0. So that is at f sub z. The next corner frequency we come to is f not. This resonance at f not. Is contained in both GVG, and in 1 over 1 plus t. 1 over 1 plus t has resonant zeros, and GVG has resonant pulls, and they come from exactly the same place. So, in fact, when you multiply these two quantities together, the resonance cancels out. So it doesn't appear in our closed loop gbg or closed loop transfer function from vg to output. Finally we have the compensator inverted 0 at f sub l. And below that. We get this 20 dB per decade slope in 1 over 1 plus T. So, our Gvg function, or Gvg over 1 plus T, will have a plus 20 dB per decade slope below that. So, this is Gvg over 1 plus T. Some things to note about this. First of all, we can work out what is the gain at 100 Hz, or 120 Hz which is this value. We can calculate how much it is, and if we know how big our input variation is nvg at. Then we can multiply by this gain to find the resulting output variation. Another thing that we can see from this is that the maximum value of this transfer function happens over this range of frequencies right here, between f sub l and f sub z. So this is where this transfer function from the disturbance in vg to the output would be maximum. And where most susceptible then to variations in vg over this range of frequencies, which is around a kilohertz. If we need to reduce variations more, we can also gain the insight from this kind of construction to see what we need to do. For example, if we want to reduce this transfer function more, perhaps we need to push up the crossover frequency more, which will push down all of these asymptotes at frequencies below the crossover. Here is a nice drawn plot. On, on this slide of the quantity that I just computed. So, I've done an example of how to design a PID compensator for a voltage regulator circuit. We came up with this compensator. This gv, gc of s that has this kind of transfer function. In the next lecture, we're going to design an op amp compensator circuit that realizes this gain.