We want to use the AC models of switching converters that we derived last week, to design the control systems of power converter systems. To do this, we need to, plot the frequency responses, that are predicted by the AC models. And in other words, we need to construct Bode plots of the, the circuit responses. Now, this is something that is traditionally covered in the undergraduate circuits curriculum for electrical engineers And many of you may already be good at that and in that case you can skip this and the next lecture or two. However I'm going to review Bode plots here so that everybody is up to speed on them. And also I will probably teach you some things that weren't covered in the circuits classes and it go beyond them. So I'm going to go through this material quickly, but I'm going to, I think, cover all the bases. So a Bode plot is a log-log frequency response plot of a transfer function. So if we have a transfer function, like, for example, we talked last week, about the control to alpha transfer function, Gvd of s, which was the transfer function from g hat of s to the output voltage, v hat of s. this is a transfer function that is frequency dependent. And to plot it, and find what is called the sinusoidal steady state, we let s equal j omega, where j is the square root of minus 1. And omega is angular frequency, so that we get a complex valued function Gvd of j omega. We can then find the magnitude of that complex function and its phase and plot those as a function of frequency omega. when we do that plot that is the frequency response plot when it's on a log-log scale it's called a Bode plot. so for a Bode plot, the frequency axis, or horizontal axis, is drawn on a logarithmic scale, usually versus the frequency in hertz. And the vertical axis is effectively logarithmic, but it is plotted in units of what are called decibels. Or actually a magnitude expressed in decibels is given by 20 times the base 10 log of the, the magnitude function. 'Kay? So if we have say a gain of 1, so G equals 1, the base 10 log of 1 is 0, and we get 0 decibels. We have, if the function is 10, the base 10 log of 10 is 1 and we get 20 decibels, and in fact, increasing the function by a factor of 10 adds 20 decibels to the function expressed in d of v. So we'll plot the function in decibels on the vertical axis. Here's some common numbers and their values in decibels. A factor of 2 turns out to be 6 decibels, the factor of 10 to some power is 20 times the power in decibels, so 1000, which is 10 to the third power would be three times 20 or 60 decibels. If we want to plot a function that has units, such as an impedance or a voltage or a current, we, formally, we should divide the quantity inside the log. to make it unit-less. And so one formal way to say that is that, say we want to apply the impedance, we need to divide by some constant impedance that we call the base impedance. to get a dimensionless number and then express that number in decibels. Of course, you have to tell everybody what number you decided to use as the base impedance. A very common choice is a base impedance of 1 ohm. So then we would take our impedance, divide it by 1 ohm, and then express that number in decibels. If we do that it's the tradition to call that z expressed to db ohms like this. So, 5 ohms, if we have we have we have it with a base impedance of 1 ohm. From five is 14dB, and on the right here on this plot, or chart. And, so 5 ohms would correspond with 14 dB ohms. you often see currents or electromagnetic interference specifications, you see currents expressed in dB micro amps. And what they are doing there is that, they are choosing one micro amp as the base current. So 60 dB micro amps is 60 dB or a factor of a thousand with respect to 1 micro amp, which means that a current of 1 milli amp. The, the usefulness of the log, log plot for Bode plots is that functions that go like frequency to some power are effectively straight lines when we use this log, log scale. So, for example, if we have a transfer function, g whose magnitude is frequency divided by some constant f nought to the nth power. Then, when we express that in decibels, we take 20 times the base 10 log, the power can be taken outside and we get 20 in times the log of f over f nought. So this turns out to be a straight line in log f. So here effectively, you can think of the horizontal axis as going like the log of frequency and we have a function here that varies as the log of frequency. And in fact, if you increase the log of the frequency by one then we'll increase the magnitude by 20 times n decibels. So we say that we have a slope of 20 n decibels per decade, where a decade is a factor of 10 in frequency that increases the log of f by 1. So here is a plot for several different values of n. So here for n is 2, our function is f over f nought squared. We have a straight line with a slope of n times 20 or 40 dB per decade. And the function actually goes through 0 dB right here. at f equals f nought. When f equals, if you plug in f equals f nought you get 1, and the base 10 log of 1 is 0. So we're at zero dB when f equals f nought. So what we can do then, is just take, take one point that is 0 dB at f equals f nought. And then draw a line with the correct slope through that point. The, the big use Bode plots is to approximate our magnitude function over different frequency ranges, by functions of this form. So we may have a function that goes by frequency squared over say, frequency range from here to here. And we'll follow this curve and then over the next frequency range, maybe it goes like frequency to the 1st power, and so, from there, we'll go with a lower slope and so on. And so we divide our frequency response plot into different regimes or different frequency ranges where we have different slopes. Okay, let's do an example. Here's a simple RC low pass filter circuit. So, our output voltage, v2 of s is equal to the input, v1 of s, multiplied by the, the circuit transfer function. And the transfer function of this circuit is a voltage divider. equal to the impedance of the capacitor, which is 1 over sc. [SOUND] divided by the sum of the impedance r plus 1 over sc. Okay, so that's what we have here. we're going to write our transfer functions from now on in a normalized form, as a rational fraction that's in normalized form. What I mean by a rational fraction is that it's a ratio of polynomials, so there's a numerator polynomial divided by a denominator polynomial. And what I mean by normalized form is that the coefficient of s to the 0 power is 1 in both the numerator and denominator. So here if you multiply top and bottom by sc, then what we get is 1 in the numerator and in the denominator we get 1 plus src. So this is a nice normalize form rational fraction. Okay, this term coincides with a standard form that we're going to use, for a first order polynomial and the denominator. This is called a pull, in which there's a root of the denominator. [COUGH] and the normalized formula we will use has again, the coefficient of s to the 0 power is 1. And here, we have a constant, omega nought, that tells us the coefficient of s to the first power. Okay? By equating our standard form to the original function, we can find that one over omega nought is equal to rc. And so this gives us an equation for the coefficient omega nought in our normalized, our standard form. and its relationship to the elements of the original circuit. Okay. So we have our G of s, then, is of, for the simple pole is of this form. To find the magnitude of this transfer function, we let s equal j omega. Which gives us this, and then we find the magnitude of the resulting complex function. So, the, the complex function G of j omega at any given value of omega is some complex number that has a magnitude, and it has a phase. So we can find the magnitude by what the magnitude would be the square root of the sum of the squares of the real part plus imaginary part, each squared. If you multiply top and bottom of our function by the complex conjugate, 1 minus j omega over omega not, you can express G like this and this part here is the real part, whereas this part here is the imaginary part. [INAUDIBLE]. So to, to find the magnitude then, we find the square root of the real part squared plus the imaginary part squared. If you plug those real and imaginary parts in and do some algebra, you can show that the magnitude works out to be this function. There's actually an easier way than that, if we have, say G is some numerator polynomial divided by a denominator polynomial. The magnitude of G turns out to be the magnitude of the numerator divided by the magnitude of the denominator. So the magnitude of the ratio of the polynomials is equal to the ratio of the magnitudes. So all you really have to do since the numerator is 1, it's magnitude is 1, all you really have to do is find the magnitude of the denominator, which has this real part and this imaginary part. So what we would get then would be 1 over the square root of the real part squared plus the imaginary part squared omega over omega not quantity squared. As the magnitude of G. I would also note that you don't include the j when you square the imaginary part. If you did, that would give you an extra minus sign which is not correct. Okay. So here is our magnitude function. We now express that in decibels. So, 20 times the base 10 log of this. [NOISE] is that. We can use the, the property that the log of 1 over x is equal to minus the log of x, so we can actually, flip over the quantity inside the log, and pull a minus sign out instead. So this is up to the minus 1 power, and we can get this expression for for the magnitude in dB. Here is our function that we found for the magnitude. What we're going to do next is draw the voting plot, by approximating it over different frequency ranges by functions that go like frequencies to some power. And in the case of this simple form in a single pull, we find the asymptotic behavior at low frequency and high frequency. So, at low frequency, which means in particular, for frequencies where omega is very small, what does this function tend to? Now if you look at the denominator we have 1 plus the function of omega, and when an omega is small this function of omega becomes small. And in particular when omega over omega not squared is a lot less than 1, you can just throw out this term. So another way to say that is for omega much less than omega nought, the function just goes, we just ignore this term, and we get one over root one. So magnitude of G goes to one, and that's the asymptotic behavior. So our low frequency asymptote, I'm going to draw is just a straight line, equal to one or zero BD. How about the other case? What happens at high frequency? So if we reverse the inequality where omega is much greater than omega not, in that case the omega term becomes large compared to 1 and we can throw out the 1. So then we get 1 over root omega over omega not squared, which goes to 1 over omega over omega not. Or this is a function that goes like omega over omega not to the minus 1 power. And when I express this in frequency f, what, omega is two pi f, so we could write this as 2 pi f over 2 pi f nought, all to the minus 1 power, which is just f over f nought to the minus 1. Okay, this is a term that we've already seen. If we go back a few slides, here is our plot for functions that go like f to some power. Here the power is n is minus 1. So we'll have this curve right here. The n is minus 1 curve. And this is actually a line that has a slope of minus 20 db per decade and it goes through 0 dB at f equals f nought. So here is that line for f much greater than f nought. We have the minus 20 dB per decade slope. Then it passes through 0 dB at f equals f nought. Which in fact intersects the other asymptote. So we have two different asymptotes. One for f much less than f nought, and one for f much greater than f nought. The only thing left is to, to say, well, okay, what does the exact curve do in the vicinity of f equals f nought? And to find that we can just plug in some values. So for example, if we let, when f equals f not, what do we get? Our magnitude of G then becomes what? 1 over root 1 plus f over f not, quantity squared. If f equals f nought, and the whole thing will go to what? 1 over root 2. Okay, 1 over root 2 expressed in decibels works out to be minus 3 db. Approximately. So, at the corner frequency of the function, we say is 3 dB below the 0 db asymptote. Or we say the function is three dB down at the corner frequency. You can do a similar calculation at f is one half f nought, or f is 2 f nought, so a factor of 2 on either side in frequency. And find that the exact curve is 1dB below the asymptotes there. So we can plug in then those values. You just draw the asymptotes and then plug in the values for these three points. And draw a smooth curve through them, and that is the plot of the single pole response. So anytime we get a term that is, can be written in this form, then this what it's, it's magnitude looks like. 'Kay, we should also talk about the phase. The phase is very important in design of the control system. So we need to similarly understand the phase. So here is, again, our G of j omega is this to find the phase. This phase angle. We know from geometry, the phase is the arc tangent of the In this case the imaginary part or this opposite side divided by the real part, which is this side. So from trigonometry, we get that the phase is the arc tangent of the imaginary over the real part. When we take this imaginary part and this real part and divide, including the minus sign, we get that the phase is the arctangent of omega over omega nought. Which is the same as minus the arctangent of f over f nought. Here's the plot of that with frequency again varying on a log scale. This is a computer generated plot. We can plug in some values. So as in the magnitude we might look at the asymptotic behavior. What happens to this function. For omega much less than omega-not. Well, we find that the function tends towards a 0 degree asymptote at low frequency. And likewise at high frequency with omega much greater than omega-not, the function tends towards a constant asymptote of minus 90 degrees. At the corner frequency, omega equals omega i, you get minus the arc tangent of 1 which is minus 45 degrees. So right here at the corner at minus 45. So we have asymptotes for low frequency and high frequency, but unlike the magnitude case, the asymptotes don't intersect. And we need some kind of other asymptote to draw for mid-frequencies that tells us how the phase changes between the high and low frequency asymptotes. Now there's more than one way to do this, and in fact, in different textbooks or different papers and things you'll see different choices for that asymptote. One way to do it is to find the slope of this function right at the corner. So right here at minus 45 degrees. We could differentiate the arctangent function and find its slope. It's actually a little tricky, because you have to vary frequency on this, in this logarithmic form and then take the derivative of that. But we can do it, and if you do that, it turns out that [NOISE] if we draw a function with that slope, and extend it up to the high and low frequency asymptotes. Then this break frequency where the asymptotes intersect, turns out to be equal to e to the pi over 2 times f nought. And this one here turns out to be e to the minus pi over 2 times f nought. Okay, get out your calculator, e to the pi over 2 is 4.81. [NOISE] So if we know f not we can multiply by 4.81 and find this break frequency where we, the asymptotes change. So you'll see in some books that's what people use. in some other books, most notably the Sean's Outline on Bode plots be around 4.81 up to 5. And so this is five times f nought, and this f nought divided by 5. yet another choice that is popular is instead of 5 to use 10. So here's that choice. there is in fact, no such thing as an exact approximation. 10 is easy to do in your head. And in fact, the choice of 10 is perhaps not quite as good in the vicinity of f nought. But it's maybe a better average approximation of the curve over the whole range. so again, it's a matter of taste but what we're going to use is in here is 10 and it does have the nice interpretation that the phase changes over 2 orders of magnitude. About the corner frequency, and so it'll change from 0 to minus 90 degrees over 2 orders of magnitude in frequency. And that's a good approximation of how the phase works. So the slope of this phase asymptote then, will, is minus 45 degrees per decade. Or a decade as factor of 10 in frequency, so in this factor of 10 in frequency from here to here, we change by minus 45 degrees. Okay. The actual function deviates from the asymptote by 1 10th of a radian or 5.7 degrees at these break frequencies. [COUGH] So here's a summary of the rules for constructing the magnitude and phase at Bode plot asymptotes, for the case of the simple real pole. So the magnitude asymptotes are 0 dB at low frequency, and a minus 20 dB per decade slope at high frequency. The deviation of minus 3dB at the corner frequency. The phase asymptotes have a minus 45 degree per decade app slope asymptote going from 1 10th of the corner to 10 times the corner frequency. The, low frequency asymptote is zero degrees, and the high frequency asymptote is minus 90.