# Frequency Response: From Poles and Zeros to Stability and Compensation

> A frequency response lecture for controls students who already know what feedback does. We drive a plant with sine waves and read off the amplitude ratio and the phase shift, then build the magnitude and phase curves factor by factor out of a constant gain, an integrator, a pole and a zero, so the straight line approximations become arithmetic rather than folklore. We assemble a full third order loop segment by segment, locate its gain and phase crossover frequencies, close the loop, and show why the frequency at which the phase reaches minus one hundred and eighty degrees decides stability. Gain margin and phase margin are defined on those curves, and the loop is then driven into sustained and then growing oscillation by raising the gain past its margin. The lecture closes with a lag and then a lead compensator, comparing what each one does to both curves.

- Canonical watch page: [Frequency Response: From Poles and Zeros to Stability and Compensation](https://academa.ai/lectures/frequency-response-bode-closed-loop)
- Publisher: [Academa, Inc.](https://academa.ai)
- Subject: Engineering
- Published: 2026-08-28T19:16:09.089Z
- Updated: 2026-08-28T19:16:09.089Z
- Duration: PT1660S (27 minutes 40 seconds)
- Chapters: 5
- Views: 2
- Language: en-US
- Access: Free
- Video stream: [HLS content](https://academa.ai/media/l/01M14TY867AYWPKBBRWT86KP3M/0/dark/master.m3u8)
- Audiovisual record: [Semantic JSON](https://academa.ai/media/l/01M14TY867AYWPKBBRWT86KP3M/0/semantic.json)
- Thumbnail: [Image](https://academa.ai/media/l/01M14TY867AYWPKBBRWT86KP3M/0/dark/poster.jpg)

## Description

Build Bode magnitude and phase curves from poles and zeros, define gain and phase margin, then see what lag and lead compensators change.

## Chapters

- [00:00–05:1.164 · Sine In, Sine Out](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=0)
- [05:1.164–10:14.026 · The Four Building Blocks](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=301.1635000000001)
- [10:14.026–15:14.95 · Stacking the Factors](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=614.0257708333334)
- [15:14.95–21:10.022 · Closing the Loop](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=914.9500833333334)
- [21:10.022–27:40 · Lag and Lead](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1270.0216666666668)

## Transcript

### [00:00 · Sine In, Sine Out](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=0)

You already know what a feedback controller does. This lecture is about a different question, and it is the question most of classical control is actually built on. Not what a plant does to a step, but what it does to a sine wave, one frequency at a time. Answer that for every frequency and you have said everything there is to say about a linear system. So here is the setup. Take a plant that is linear and time invariant, and drive it with a pure sine wave. Because it is linear, whatever comes out is also a sine wave, at exactly the same frequency. Nothing else is possible, so only two things can differ between what goes in and what comes out: the size, and the timing. Let me make that concrete with the simplest plant there is, a single lag, one over s plus one. Drive it slowly, at a fifth of a radian per second. The grey curve is what we push in, the blue curve is what comes back out, and time runs along the bottom in seconds. Honestly, the two waves are almost the same wave. The output stands ninety eight percent as tall as the input, and it trails behind it by about eleven degrees. At this frequency the plant is barely doing anything at all. Ask it to move slowly, and it simply follows. One thing I am quietly assuming here. These are steady state pictures. Switch the drive on and there is a transient while the plant settles. Frequency response is what is left after that transient has died away. Now speed the drive up to one radian per second. Same plant, same amplitude going in. The output has dropped to seventy one percent of it, and it is now a full forty five degrees behind. That is an eighth of a cycle of lag. And at five radians per second the plant has more or less given up. The output is only two tenths of the input amplitude now, and it lags by seventy nine degrees, closing in on ninety. Notice the pattern that is forming. As the frequency climbs, the output shrinks, and it falls further and further behind. Both of those numbers come out of one piece of algebra, and you have seen it before. Put s equal to j omega in the transfer function. What comes back, for each frequency, is a single complex number. Its magnitude is the amplitude ratio: how much taller or shorter the output is than the input. Its argument is the phase shift, in degrees, and it is negative when the output lags. Two real numbers per frequency, and that pair is the whole of the frequency response. One convention before we plot any of it. We do not plot the magnitude directly. We plot twenty times its logarithm, in decibels. The reason is pure arithmetic. A transfer function is a product of factors, and taking logarithms turns that product into a sum of curves you can add up by eye. And the frequency axis is logarithmic as well. Every unit along it is one decade, a factor of ten in frequency. So the axis we are about to use runs from a tenth of a radian per second on the left to a hundred on the right, in three even steps. So here is the magnitude of that single lag, in decibels, against the logarithm of frequency. And here are the three experiments we just ran, sitting on it as three green dots: a fifth, one, and five. Flat and unbothered on the left, where the plant follows whatever it is given. Falling away steadily on the right, where it cannot keep up. The table beside it is those same three readings written out. Underneath goes the phase, in degrees, on the same frequency axis. Zero at low frequency, minus ninety at high frequency, and passing through minus forty five right at one radian per second, which is exactly where the pole is. Now look hard at what those two curves nearly are. The magnitude is nearly two straight lines: flat, then falling at twenty decibels per decade, and they meet at the pole. The phase is nearly three straight lines, hinged a decade either side of it. That is not a coincidence and it is not a drawing trick. It falls out of the algebra, and in the next part we work out exactly where it comes from, factor by factor, until sketching one of these is arithmetic. Then we close the loop. And I will show you why one particular frequency, the one where the phase reaches minus one hundred and eighty degrees, decides whether the closed loop is stable at all. Gain margin and phase margin are the two numbers that live at that frequency, and by the end you will read both of them straight off these curves.

### [05:1.164 · The Four Building Blocks](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=301.1635000000001)

So why decibels, and why a logarithmic frequency axis. Here is the answer, and it is the only reason those two conventions exist. A transfer function is a product: a constant out front, some factors upstairs, some factors downstairs. Take twenty times the logarithm of the magnitude, and that product becomes a sum. Every factor on top adds its own decibel curve. Every factor on the bottom subtracts one. Nothing else happens. And the angle of a product is the sum of the angles anyway, so the phase adds in exactly the same pattern, with no logarithm needed. Two sums, one for each curve. So if I can draw four simple curves, I can draw any Bode plot by stacking them up. Let me take those four one at a time. The first one is trivial. A constant gain K. Its magnitude does not depend on frequency at all, so in decibels it is a horizontal line at twenty log K. With K equal to two, that sits at six decibels. And a positive real number has no angle, so it contributes nothing whatsoever to the phase. The second one is an integrator, one over j omega. Its magnitude is one over omega, so in decibels it is minus twenty times the logarithm of omega. That is a straight line, exactly, at every frequency. And you can read the slope off it by arithmetic. At one radian per second it is zero decibels. At ten, it is minus twenty. At a hundred, minus forty. Every decade costs twenty decibels, forever. Its phase is easier still. One over j is minus j, which points straight down. Minus ninety degrees, at every frequency, with no bend in it anywhere. The third block is the one that actually earns its keep: a real pole, written so that it equals one at zero frequency. One over one plus j omega over omega p. Take it to its two limits and everything falls out. Well below the corner, omega over omega p is tiny, so the denominator is essentially one. The factor is one. Zero decibels, and no phase. That is the flat piece. Well above the corner, the one is negligible and the factor is omega p over j omega. That is an integrator again, scaled. So it falls at twenty decibels per decade, and its phase is minus ninety. So we have a flat line at zero on the left, a falling line at minus twenty on the right, and they cross where omega equals omega p, which here is two radians per second. That crossing is what everybody calls the corner, or the break frequency. Now, how wrong is that sketch. Right at the corner the denominator is one plus j, whose magnitude is root two, and twenty log of root two is minus three decibels. Three decibels below the corner of the sketch, and that is the worst it ever gets. Half a decade either side of the corner the error is down to one decibel, and a decade out it is under a quarter of one. So the straight lines are not a cartoon. They are the truth to within three decibels, everywhere. The phase needs one more rule, and it is a convention rather than a theorem. Zero below a decade under the corner, minus ninety above a decade over it, and a straight ramp of minus forty five degrees per decade joining them. At the corner itself the ramp is halfway down, at minus forty five degrees, and that one is exact: one over one plus j has an angle of minus forty five, precisely. The worst error in the ramp is about six degrees, out near its two hinges. And the fourth block is the same numbers with every sign flipped, because a zero is a pole moved upstairs. Flat, then rising at twenty decibels per decade. Zero degrees, then a ramp up to plus ninety. That is the whole vocabulary. Four shapes, and a Bode plot is what you get when you add up however many of them your plant happens to have. Written out as a table, that is it. A gain moves the whole magnitude curve up or down and touches nothing else. An integrator tilts it by twenty decibels per decade and drops the phase by ninety, at every frequency. A zero puts a bend upward in the magnitude at its own frequency, and hands you ninety degrees of phase lead spread across two decades. A pole does the mirror image: a bend downward, and ninety degrees of lag. And the two error facts are worth memorising, because they are the whole difference between the sketch and the truth. Three decibels at each corner, and a decade either side for the phase. Nothing else is approximate. So the straight lines are not magic. They are two limits and a hinge. Now let me stack them, on a plant with a pole, another pole, and an integrator in it.

### [10:14.026 · Stacking the Factors](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=614.0257708333334)

Here is the plant we will carry for the rest of the lecture. Forty, over s times s plus two times s plus ten. Third order, one integrator, two real poles, and nothing exotic anywhere in it. Before we can stack anything we have to rewrite it, because our four building blocks all equal one at low frequency and these brackets do not. So pull a two out of the first bracket, and a ten out of the second. Forty over twenty leaves two, and now every factor is in the right shape. Read them off. A gain of two, worth six decibels. One integrator. A pole at two radians per second, and a pole at ten. Those four items are the entire plant, and they are the entire Bode plot. So let us draw it. I will lay the magnitude down first, one segment at a time, and check a number at every break. Start at the far left of the magnitude plot, at a tenth of a radian per second. Down there both poles are still asleep, because we are well below both corners. So only the gain and the integrator are doing anything at all. Six decibels from the gain. And the integrator is worth plus twenty down there, because it costs twenty per decade and we are one decade below one radian per second. Six plus twenty is twenty six, and from there the line comes down at twenty decibels per decade. That segment runs until the first pole wakes up, at omega equal to two. Where has the line got to by then? Six from the gain, minus twenty log of two, which is another six. It arrives at exactly zero decibels. And past that corner the pole adds its own twenty per decade on top of the integrator's. So the slope steepens to minus forty, and the second segment falls twice as fast as the first. It runs from two up to ten, which is log ten of five, about seven tenths of a decade. At forty decibels a decade, that is twenty eight decibels lost, so we reach the second corner at minus twenty eight. Beyond ten the second pole joins in as well, so the slope steepens again, to minus sixty decibels per decade, and it never comes back up. Three segments, three slopes, and every number in them was arithmetic. Now here is the exact curve, drawn over the top. It hugs the skeleton everywhere, except that it rounds each corner off and sits about three decibels below it, exactly as we worked out. The phase is built the same way, and it starts lower down. The integrator hands us minus ninety degrees at every frequency, so the phase begins at minus ninety on the left and does not move until the first ramp starts. The pole at two begins bending a decade below itself, at nought point two, and finishes a decade above, at twenty. So this second piece falls at forty five degrees per decade. But at one radian per second the pole at ten begins its own ramp, and now both are running together. Two ramps at forty five each make ninety degrees per decade, so this middle piece is the steepest part of the whole curve. The first ramp finishes at twenty, and after that only the second is left, so we go back to forty five per decade and settle at minus two hundred and seventy. Ninety from the integrator, and ninety from each pole. And there is the exact phase over the top of that, never more than a few degrees from the hinges. Two curves, built out of nothing but four factors and a ruler. Two frequencies on these curves matter more than all the others, and the rest of the lecture is about them. The first is where the phase passes through minus one hundred and eighty degrees. You can find it exactly. Set the phase equal to minus one eighty. The integrator has already spent the ninety, so the two arctangents have to add up to ninety degrees between them. Two angles summing to ninety means their tangents multiply to one, and running that through the addition formula leaves one minus omega squared over twenty equal to zero. So the phase crosses minus one eighty at the square root of twenty, about four point four seven radians per second. Call it the phase crossover frequency. There it is on the curve. The second frequency is where the magnitude passes through zero decibels, where the loop neither amplifies nor attenuates. The skeleton puts that at two radians per second, where its two segments straddle the axis. The exact curve crosses lower, at about one point five six, and the gap is the three decibel corner error we already know about. Call that one the gain crossover frequency, and take the exact value, because we are about to measure a stability margin with it. Two frequencies, both read off curves we built by hand. Now let us close the loop and find out what they are worth.

### [15:14.95 · Closing the Loop](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=914.9500833333334)

Close the loop around that plant with unity negative feedback, and the closed loop transfer function is L over one plus L. Everything about stability is hiding in that denominator. The loop is on the edge of trouble when the denominator vanishes at some real frequency. That is one plus L of j omega equal to zero, which is L of j omega equal to minus one. Now read minus one in polar form, because that is what a Bode plot shows you. Its magnitude is one, and its angle is minus one hundred and eighty degrees. Two conditions, and they have to hold at the same frequency. Let me show you what that actually means physically, because the algebra hides it. Break the loop, and inject a sine wave at the phase crossover frequency, four point four seven radians per second. That is the grey wave. Send it round the plant. What comes back is the blue wave. It is one sixth the size, because we measured that magnitude, and it is upside down, because the phase there is minus one eighty. Half a cycle of delay is exactly an inversion. And now the summing junction does its job. Negative feedback subtracts, which flips that wave over one more time. So what actually gets added back in is the green wave, and look where it sits. It is in phase with what we injected. Perfectly, exactly in phase. That is the whole danger of this frequency. Everywhere else the returning signal partly cancels what is already there. Here it reinforces it. The only thing saving us is the size. It comes back one sixth as tall, so each trip round the loop it shrinks, and the ringing dies away. But suppose we multiplied the gain by six. Then it would come back exactly the same size it went in. And there it is, landing precisely on top of the wave we injected. At that point the loop no longer needs us. It can sustain that oscillation with no input at all, forever. So the factor six is a real quantity, and it has a name. It is the gain margin: how much you may multiply the loop gain by before the returning wave comes back full size. You read it off the plots in two steps. Find the frequency where the phase curve crosses minus one eighty. Drop straight up to the magnitude curve. Whatever gap you find between there and zero decibels is the gain margin. Here that gap measures fifteen point six decibels. And fifteen point six decibels is a factor of six, which is exactly the number we found by hand a moment ago. The other margin runs the same procedure the other way round. Start on the magnitude curve, at the frequency where it crosses zero decibels, one point five six. Drop down to the phase curve there. The phase reads minus one hundred and thirty seven degrees. So we are forty three degrees short of minus one eighty, and that is the phase margin: how much extra lag you could pour into this loop before it sang. And that second one is usually the number engineers care about more, because extra lag arrives whether you asked for it or not. A transport delay, a filter you forgot, an actuator that is slower than the model says. All of it eats phase margin, and none of it touches gain margin. Forty three degrees and a factor of six. Now let me spend them. First, what a gain change does to these two curves, because it is the simplest thing in the subject. Multiplying by a constant adds a constant number of decibels at every frequency, so the magnitude curve moves bodily upward. Its shape does not change at all. And a positive constant has no angle, so the phase curve does not move by one degree. Watch it. It will sit perfectly still through everything that follows, which is why the phase crossover frequency never moves either. Now lift the gain by our whole margin, a factor of six, fifteen point six decibels. Up goes the magnitude curve, and it keeps its shape exactly. And look what has happened at the phase crossover. The point that was fifteen point six decibels down is now sitting exactly on zero. The gain crossover and the phase crossover have arrived at the same frequency. Both conditions for minus one now hold together, and here is what that does in the time domain. This is the closed loop answering a step, at the original gain of forty. Some overshoot, a couple of swings, settled inside five seconds. And this is the same loop with the gain multiplied by six, at two hundred and forty. It never settles. It never diverges either. It just rings, with the same amplitude, indefinitely. Measure the period of that ringing. It is one point four seconds, and two pi over four point four seven is one point four. The loop is oscillating at precisely the frequency we identified on the phase plot, using nothing but arctangents. Push a little further, to two hundred and eighty, which is past the margin, and the oscillation grows instead of holding. The closed loop poles have crossed into the right half plane, and the frequency response of the open loop told us the exact moment it would happen. So the margins are not bookkeeping. They are the distance, measured in decibels and in degrees, between the loop you have and a loop that sings on its own. What is left is to buy some of that distance back.

### [21:10.022 · Lag and Lead](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1270.0216666666668)

Everything so far has been diagnosis. We took a plant apart, drew its two curves, and read two margins off them. Now let us change those curves on purpose, with the two simplest tools there are. Both of them are one zero and one pole. That is all. And the only thing that distinguishes them is which of the two sits at the lower frequency. Put the pole first, below the zero, and you have a lag compensator. At zero frequency the two brackets are both one, so it does nothing. Above the zero, the denominator has grown more than the numerator, so it attenuates. Put the zero first instead, below the pole, and you have a lead compensator. Again it is worth one at zero frequency, but now above the pole the numerator has won, so it amplifies. And in between it hands you phase lead, which is the thing you actually wanted. So one of them cuts the high end and one of them lifts it. Let us watch what each does to a loop we already know. Here is our plant again, in blue, on both plots. I have widened the frequency axis down to a hundredth of a radian per second, two decades lower than before, because that is where a lag compensator lives. Now the lag section on its own, in yellow. Its pole is at a hundred and twenty five ten thousandths, its zero at five hundredths. So it starts flat at zero decibels, falls at twenty per decade between the two, and then goes flat again. How far does it fall? The ratio of the pole to the zero, a quarter, which is twelve decibels. That is the whole of what this section is for: a twelve decibel cut, delivered at every frequency above five hundredths. And here is its phase. It dips down about thirty degrees in the middle, and comes back to zero afterwards. That dip is the price you pay, and look where it is: two decades below anything we care about. By the time we reach the interesting frequencies the section has given all of it back. Add the yellow to the blue, and the green curves are the compensated loop. Identical to the plant at low frequency, twelve decibels below it everywhere else. So the magnitude curve has dropped, and the point where it crosses zero decibels has slid a long way to the left. From one point five six down to about nought point four nine. And that is the whole trick. Down at nought point four nine, the plant had barely started lagging. The phase there is about minus one hundred and eleven degrees, so the phase margin is sixty nine, up from forty three. The gain margin improves too, from six to twenty four, because the whole magnitude curve dropped and the phase crossover frequency hardly moved. But notice what it cost. The crossover frequency is the loop's bandwidth, and we just divided it by three. This loop is safer and it is slower. Now clear those away and try the other one. The lead has its zero at one point two and its pole at seven point two, so both of them sit right in the middle of the action, near the old crossover. In yellow again, its magnitude is flat, then rises at twenty decibels per decade between the zero and the pole, then flat again. The ratio of zero to pole is one sixth, so it lifts the high end by about sixteen decibels. And here is the part we actually came for. Its phase rises to a maximum partway up, and for a ratio of one sixth that maximum is forty six degrees. It happens at the geometric mean of the zero and the pole, which is two point nine four. So you place the compensator so that its phase peak lands where the loop is going to cross zero decibels. Add the two together, and here are the compensated curves. The magnitude has been lifted at the top end, so crossover moves the other way this time, up from one point five six to two point six five. And on an uncompensated plant that would be bad news, because the phase up there is worse. But the lead has bumped the phase up by forty five degrees at exactly that frequency. So instead of the minus one hundred and fifty eight the plant would have given us, we read minus one hundred and twelve, and the phase margin is sixty eight. The gain margin is essentially unchanged, about sixteen decibels, because the lead pushed the phase crossover frequency out and lifted the magnitude there by about the same amount. Both effects roughly cancel. So look at what we bought. The same phase margin the lag gave us, near enough, but with the crossover frequency up rather than down. This loop is safer and it is faster. Side by side, then. The lag cuts the high end of the magnitude curve. The lead lifts it, and that single difference drives everything else about the two of them. The lag's own phase contribution is a nuisance to be parked out of the way, two decades below the action. The lead's phase contribution is the entire point, and you place it deliberately on top of the crossover frequency. So the lag moves the crossover down and the lead moves it up. Both of them end up buying you phase margin, and they buy it in opposite currencies: one pays with speed, the other pays with amplified high frequency, which means amplified noise. And both are one zero and one pole, the same two curves we drew by hand earlier. Which one you put first is the whole difference between them. That is the arc. A sine wave in gives a sine wave out, and two numbers record it. Those two numbers, plotted against a logarithmic frequency axis, are sums of straight lines you can draw from the poles and zeros alone. Close the loop, and one frequency on those plots decides everything: the one where the phase reaches minus one hundred and eighty degrees, where the returning signal comes back in step with itself. How far the magnitude sits below unity there is your gain margin, and how far the phase sits above minus one eighty at unity gain is your phase margin.

## About Academa, Inc.

Academa makes technical knowledge easier to understand through visual lectures and lets learners request new lecture videos on the topics they need.

## Complete audiovisual record

Immutable source: [semantic.json](https://academa.ai/media/l/01M14TY867AYWPKBBRWT86KP3M/0/semantic.json)

Record version: 1. Render attempt: 0.

### How to read this timeline

Each scene owns its object identifiers. A beat's board is the complete board when listed, empty when marked empty, and unchanged from the nearest earlier listed board in the same scene when marked unchanged. Action times are absolute positions in the published video.

### Scene 1: [Sine In, Sine Out](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=0)

Span: 00:00–05:1.164 (0s–301.1635000000001s).

#### Objects

- angle\_high: a PlotPoint \[green\] drawn in phase\_axes (target='phase\_curve', x=0.6989700043360189)
- angle\_low: a PlotPoint \[green\] drawn in phase\_axes (target='phase\_curve', x=-0.6989700043360187)
- angle\_mid: a PlotPoint \[green\] drawn in phase\_axes (target='phase\_curve')
- cap\_high\_bottom: a Math \[text\] that says "$\|G\| = 0.20, thin -79 degree$"
- cap\_high\_top: a Math \[text\] that says "$omega = 5$"
- cap\_low\_bottom: a Math \[text\] that says "$\|G\| = 0.98, thin -11 degree$"
- cap\_low\_top: a Math \[text\] that says "$omega = 0.2$"
- cap\_mid\_bottom: a Math \[text\] that says "$\|G\| = 0.71, thin -45 degree$"
- cap\_mid\_top: a Math \[text\] that says "$omega = 1$"
- card: a Title that says "Feedback Control — Frequency Response: From Poles and Zeros to Stability and Compensation"
- corner\_fact: a Math \[text\] that says "$upright("at the pole:") thin -3 thin upright("dB"), thin -45 degree$"
- db\_def: a Math \[text\] that says "$\|G\|\_(upright("dB")) = 20 log\_10 \|G(j omega)\|$"
- decade\_note: a Panel that says "One unit along the frequency axis is one decade, a factor of ten in frequency. The axis below runs from $0.1$ to $100$ radians per second."
- dot\_high: a PlotPoint \[green\] labelled "5" drawn in mag\_axes (target='mag\_curve', x=0.6989700043360189)
- dot\_low: a PlotPoint \[green\] labelled "0.2" drawn in mag\_axes (target='mag\_curve', x=-0.6989700043360187)
- dot\_mid: a PlotPoint \[green\] labelled "1" drawn in mag\_axes (target='mag\_curve')
- drive: a FunctionPlot \[gray\] drawn in frame (function=\<function\>)
- drive\_2: a FunctionPlot \[gray\] drawn in frame\_2 (function=\<function\>)
- drive\_3: a FunctionPlot \[gray\] drawn in frame\_3 (function=\<function\>)
- frame: an Axes (x\_range=(0.0, 63.0), y\_range=(-1.35, 1.35), aspect=(4.0, 3.0))
- frame\_2: an Axes (x\_range=(0.0, 12.6), y\_range=(-1.35, 1.35), aspect=(4.0, 3.0))
- frame\_3: an Axes (x\_range=(0.0, 2.5), y\_range=(-1.35, 1.35), aspect=(4.0, 3.0))
- head\_cases: a Heading that says "The Same Plant, Three Frequencies"
- head\_curves: a Heading that says "The Two Curves"
- head\_defs: a Heading that says "Two Numbers per Frequency"
- mag\_axes: an Axes (x\_range=(-1.0, 2.0), y\_range=(-50.0, 20.0), aspect=(8.0, 3.0))
- mag\_curve: a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>)
- mag\_def: a Math \[text\] that says "$upright("amplitude ratio") = \|G(j omega)\|$"
- mag\_skeleton: a FunctionPlot \[yellow\] drawn in mag\_axes (function=\<function\>)
- phase\_axes: an Axes (x\_range=(-1.0, 2.0), y\_range=(-100.0, 10.0), aspect=(8.0, 3.0))
- phase\_curve: a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>)
- phase\_def: a Math \[text\] that says "$upright("phase shift") = angle G(j omega)$"
- phase\_skeleton: a FunctionPlot \[yellow\] drawn in phase\_axes (function=\<function\>)
- question: a Panel that says "Drive a linear plant with a pure sine wave. What comes out, and how does the answer depend on the driving frequency?"
- readings: a Table \[text\] that says "$omega$ $\|G\|$ $angle G$ 0.2 0.98 $-11 degree$ 1 0.71 $-45 degree$ 5 0.20 $-79 degree$" (rows=(('$omega$', '$\|G\|$', '$angle G$'), ('0.2', '0.98', '$-11 degre…, header=True)
- reply: a FunctionPlot \[blue\] drawn in frame (function=\<function\>)
- reply\_2: a FunctionPlot \[blue\] drawn in frame\_2 (function=\<function\>)
- reply\_3: a FunctionPlot \[blue\] drawn in frame\_3 (function=\<function\>)
- slope\_fact: a Math \[text\] that says "$upright("far above the pole:") thin -20 thin upright("dB/decade")$"
- substitution: a Math \[text\] that says "$G(s) = frac(1, s + 1) quad -\> quad G(j omega) = frac(1, 1 + j omega)$"

#### Beats

##### [00:00](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=0)

Narration: You already know what a feedback controller does. This lecture is about a different question, and it is the question most of classical control is actually built on. Not what a plant does to a step, but what it does to a sine wave, one frequency at a time. Answer that for every frequency and you have said everything there is to say about a linear system.

Board: Empty.

Actions:
- [00:00](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=0): card is shown on the screen, written out.
- [00:1.5](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1.5): card: enter:write-left-to-right.
- [00:20.956](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=20.956): card is hidden from the screen — left the board.

##### [00:22.156](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=22.156)

Narration: So here is the setup. Take a plant that is linear and time invariant, and drive it with a pure sine wave. Because it is linear, whatever comes out is also a sine wave, at exactly the same frequency. Nothing else is possible, so only two things can differ between what goes in and what comes out: the size, and the timing.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [00:22.156](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=22.156): question is shown on the screen, written out.
- [00:34.811](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=34.81099999999999): question (the "frequency" part) is emphasized.
- [00:43.425](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=43.4255): question is hidden from the screen — left the board.
- [00:43.425](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=43.4255): question (the "frequency" part) is no longer emphasized.

##### [00:44.026](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=44.0255)

Narration: Let me make that concrete with the simplest plant there is, a single lag, one over s plus one. Drive it slowly, at a fifth of a radian per second. The grey curve is what we push in, the blue curve is what comes back out, and time runs along the bottom in seconds.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [00:44.026](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=44.0255): head\_cases is shown on the screen, written out.
- [00:50.713](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=50.713): frame is shown on the screen, written out.
- [00:52.176](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=52.176): cap\_low\_top is shown on the screen, written out.
- [00:54.579](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=54.579): drive is shown on the screen, written out.
- [00:56.599](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=56.599): reply is shown on the screen, written out.

##### [01:1.297](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=61.297000000000004)

Narration: Honestly, the two waves are almost the same wave. The output stands ninety eight percent as tall as the input, and it trails behind it by about eleven degrees. At this frequency the plant is barely doing anything at all. Ask it to move slowly, and it simply follows.

Board: frame — an Axes (x\_range=(0.0, 63.0), y\_range=(-1.35, 1.35), aspect=(4.0, 3.0)); cap\_low\_top — a Math \[text\] that says "$omega = 0.2$"; head\_cases — a Heading that says "The Same Plant, Three Frequencies"; drive — a FunctionPlot \[gray\] drawn in frame (function=\<function\>); reply — a FunctionPlot \[blue\] drawn in frame (function=\<function\>)

Actions:
- [01:1.297](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=61.297000000000004): cap\_low\_bottom is shown on the screen, written out.
- [01:7.218](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=67.218): cap\_low\_bottom (the "0.98" part) is emphasized.
- [01:10.214](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=70.214): cap\_low\_bottom (the "-11 degree" part) is emphasized.
- [01:10.214](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=70.214): cap\_low\_bottom (the "0.98" part) is no longer emphasized.
- [01:18.028](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=78.028): cap\_low\_bottom (the "-11 degree" part) is no longer emphasized.

##### [01:19.591](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=79.59100000000001)

Narration: One thing I am quietly assuming here. These are steady state pictures. Switch the drive on and there is a transient while the plant settles. Frequency response is what is left after that transient has died away.

Board: frame — an Axes (x\_range=(0.0, 63.0), y\_range=(-1.35, 1.35), aspect=(4.0, 3.0)); cap\_low\_top — a Math \[text\] that says "$omega = 0.2$"; cap\_low\_bottom — a Math \[text\] that says "$\|G\| = 0.98, thin -11 degree$"; head\_cases — a Heading that says "The Same Plant, Three Frequencies"; drive — a FunctionPlot \[gray\] drawn in frame (function=\<function\>); reply — a FunctionPlot \[blue\] drawn in frame (function=\<function\>)

Actions:
- [01:26.766](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=86.766): reply is indicated — a transient flash.

##### [01:34.646](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=94.64550000000001)

Narration: Now speed the drive up to one radian per second. Same plant, same amplitude going in. The output has dropped to seventy one percent of it, and it is now a full forty five degrees behind. That is an eighth of a cycle of lag.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [01:35.319](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=95.319): frame\_2 is shown on the screen, written out.
- [01:36.375](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=96.37500000000001): cap\_mid\_top is shown on the screen, written out.
- [01:38.245](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=98.245): drive\_2 is shown on the screen, written out.
- [01:41.983](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=101.983): reply\_2 is shown on the screen, written out.
- [01:42.401](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=102.40100000000001): cap\_mid\_bottom is shown on the screen, written out.

##### [01:50.304](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=110.30350000000001)

Narration: And at five radians per second the plant has more or less given up. The output is only two tenths of the input amplitude now, and it lags by seventy nine degrees, closing in on ninety. Notice the pattern that is forming. As the frequency climbs, the output shrinks, and it falls further and further behind.

Board: frame — an Axes (x\_range=(0.0, 63.0), y\_range=(-1.35, 1.35), aspect=(4.0, 3.0)); cap\_low\_top — a Math \[text\] that says "$omega = 0.2$"; cap\_low\_bottom — a Math \[text\] that says "$\|G\| = 0.98, thin -11 degree$"; frame\_2 — an Axes (x\_range=(0.0, 12.6), y\_range=(-1.35, 1.35), aspect=(4.0, 3.0)); cap\_mid\_top — a Math \[text\] that says "$omega = 1$"; cap\_mid\_bottom — a Math \[text\] that says "$\|G\| = 0.71, thin -45 degree$"; head\_cases — a Heading that says "The Same Plant, Three Frequencies"; drive — a FunctionPlot \[gray\] drawn in frame (function=\<function\>); reply — a FunctionPlot \[blue\] drawn in frame (function=\<function\>); drive\_2 — a FunctionPlot \[gray\] drawn in frame\_2 (function=\<function\>); reply\_2 — a FunctionPlot \[blue\] drawn in frame\_2 (function=\<function\>)

Actions:
- [01:50.965](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=110.96500000000002): frame\_3 is shown on the screen, written out.
- [01:50.965](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=110.96500000000002): cap\_high\_top is shown on the screen, written out.
- [01:53.496](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=113.49600000000002): drive\_3 is shown on the screen, written out.
- [01:53.496](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=113.49600000000002): reply\_3 is shown on the screen, written out.
- [01:54.924](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=114.92400000000002): cap\_high\_bottom is shown on the screen, written out.
- [01:56.898](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=116.89800000000002): cap\_high\_bottom (the "0.20" part) is emphasized.
- [01:58.814](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=118.81400000000002): cap\_high\_bottom (the "-79 degree" part) is emphasized.
- [01:58.814](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=118.81400000000002): cap\_high\_bottom (the "0.20" part) is no longer emphasized.
- [02:10.285](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=130.28500000000003): cap\_high\_bottom is hidden from the screen — left the board.
- [02:10.285](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=130.28500000000003): cap\_high\_top is hidden from the screen — left the board.
- [02:10.285](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=130.28500000000003): cap\_low\_bottom is hidden from the screen — left the board.
- [02:10.285](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=130.28500000000003): cap\_low\_top is hidden from the screen — left the board.
- [02:10.285](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=130.28500000000003): cap\_mid\_bottom is hidden from the screen — left the board.
- [02:10.285](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=130.28500000000003): cap\_mid\_top is hidden from the screen — left the board.
- [02:10.285](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=130.28500000000003): frame is hidden from the screen — left the board.
- [02:10.285](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=130.28500000000003): drive is hidden from the screen — frame left the board.
- [02:10.285](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=130.28500000000003): reply is hidden from the screen — frame left the board.
- [02:10.285](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=130.28500000000003): frame\_2 is hidden from the screen — left the board.
- [02:10.285](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=130.28500000000003): drive\_2 is hidden from the screen — frame\_2 left the board.
- [02:10.285](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=130.28500000000003): reply\_2 is hidden from the screen — frame\_2 left the board.
- [02:10.285](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=130.28500000000003): frame\_3 is hidden from the screen — left the board.
- [02:10.285](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=130.28500000000003): drive\_3 is hidden from the screen — frame\_3 left the board.
- [02:10.285](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=130.28500000000003): reply\_3 is hidden from the screen — frame\_3 left the board.
- [02:10.285](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=130.28500000000003): head\_cases is hidden from the screen — left the board.
- [02:10.285](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=130.28500000000003): cap\_high\_bottom (the "-79 degree" part) is no longer emphasized.

##### [02:10.885](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=130.88500000000002)

Narration: Both of those numbers come out of one piece of algebra, and you have seen it before. Put s equal to j omega in the transfer function. What comes back, for each frequency, is a single complex number.

Board: Empty.

Actions:
- [02:10.885](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=130.88500000000002): head\_defs is shown on the screen, written out.
- [02:16.387](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=136.387): substitution is shown on the screen, written out.

##### [02:26.067](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=146.06650000000002)

Narration: Its magnitude is the amplitude ratio: how much taller or shorter the output is than the input. Its argument is the phase shift, in degrees, and it is negative when the output lags. Two real numbers per frequency, and that pair is the whole of the frequency response.

Board: substitution — a Math \[text\] that says "$G(s) = frac(1, s + 1) quad -\> quad G(j omega) = frac(1, 1 + j omega)$"; head\_defs — a Heading that says "Two Numbers per Frequency"

Actions:
- [02:26.682](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=146.68200000000002): mag\_def is shown on the screen, written out.
- [02:33.206](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=153.20600000000002): phase\_def is shown on the screen, written out.

##### [02:45.022](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=165.02150000000003)

Narration: One convention before we plot any of it. We do not plot the magnitude directly. We plot twenty times its logarithm, in decibels. The reason is pure arithmetic. A transfer function is a product of factors, and taking logarithms turns that product into a sum of curves you can add up by eye.

Board: substitution — a Math \[text\] that says "$G(s) = frac(1, s + 1) quad -\> quad G(j omega) = frac(1, 1 + j omega)$"; mag\_def — a Math \[text\] that says "$upright("amplitude ratio") = \|G(j omega)\|$"; phase\_def — a Math \[text\] that says "$upright("phase shift") = angle G(j omega)$"; head\_defs — a Heading that says "Two Numbers per Frequency"

Actions:
- [02:51.825](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=171.82500000000002): db\_def is shown on the screen, written out.
- [02:58.71](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=178.71): db\_def (the "20 log\_10" part) is emphasized.
- [03:4.876](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=184.87550000000005): db\_def (the "20 log\_10" part) is no longer emphasized.

##### [03:5.476](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=185.47550000000004)

Narration: And the frequency axis is logarithmic as well. Every unit along it is one decade, a factor of ten in frequency. So the axis we are about to use runs from a tenth of a radian per second on the left to a hundred on the right, in three even steps.

Board: substitution — a Math \[text\] that says "$G(s) = frac(1, s + 1) quad -\> quad G(j omega) = frac(1, 1 + j omega)$"; mag\_def — a Math \[text\] that says "$upright("amplitude ratio") = \|G(j omega)\|$"; phase\_def — a Math \[text\] that says "$upright("phase shift") = angle G(j omega)$"; db\_def — a Math \[text\] that says "$\|G\|\_(upright("dB")) = 20 log\_10 \|G(j omega)\|$"; head\_defs — a Heading that says "Two Numbers per Frequency"

Actions:
- [03:11.245](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=191.24500000000003): decade\_note is shown on the screen, written out.
- [03:22.205](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=202.20500000000004): db\_def is hidden from the screen — left the board.
- [03:22.205](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=202.20500000000004): decade\_note is hidden from the screen — left the board.
- [03:22.205](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=202.20500000000004): head\_defs is hidden from the screen — left the board.
- [03:22.205](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=202.20500000000004): mag\_def is hidden from the screen — left the board.
- [03:22.205](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=202.20500000000004): phase\_def is hidden from the screen — left the board.
- [03:22.205](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=202.20500000000004): substitution is hidden from the screen — left the board.

##### [03:22.805](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=202.80500000000004)

Narration: So here is the magnitude of that single lag, in decibels, against the logarithm of frequency. And here are the three experiments we just ran, sitting on it as three green dots: a fifth, one, and five.

Board: Empty.

Actions:
- [03:22.805](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=202.80500000000004): head\_curves is shown on the screen, written out.
- [03:23.873](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=203.87300000000005): mag\_axes is shown on the screen, written out.
- [03:26.149](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=206.14900000000003): mag\_curve is shown on the screen, drawn.
- [03:34.856](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=214.85600000000005): dot\_low is shown on the screen, written out.
- [03:35.704](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=215.70400000000004): dot\_mid is shown on the screen, written out.
- [03:36.459](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=216.45900000000003): dot\_high is shown on the screen, written out.

##### [03:37.953](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=217.95250000000004)

Narration: Flat and unbothered on the left, where the plant follows whatever it is given. Falling away steadily on the right, where it cannot keep up. The table beside it is those same three readings written out.

Board: mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-50.0, 20.0), aspect=(8.0, 3.0)); head\_curves — a Heading that says "The Two Curves"; mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); dot\_low — a PlotPoint \[green\] labelled "0.2" drawn in mag\_axes (target='mag\_curve', x=-0.6989700043360187); dot\_mid — a PlotPoint \[green\] labelled "1" drawn in mag\_axes (target='mag\_curve'); dot\_high — a PlotPoint \[green\] labelled "5" drawn in mag\_axes (target='mag\_curve', x=0.6989700043360189)

Actions:
- [03:48.309](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=228.30900000000003): mag\_axes moves to a new place on the board.
- [03:48.309](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=228.30900000000003): readings is shown on the screen, written out.
- [03:49.609](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=229.60900000000004): readings is shown on the screen, written out.
- [03:49.809](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=229.80900000000003): readings is shown on the screen, written out.
- [03:50.209](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=230.20900000000003): readings is shown on the screen, written out.

##### [03:52.462](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=232.46150000000006)

Narration: Underneath goes the phase, in degrees, on the same frequency axis. Zero at low frequency, minus ninety at high frequency, and passing through minus forty five right at one radian per second, which is exactly where the pole is.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [03:52.462](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=232.46150000000006): phase\_axes is shown on the screen, written out.
- [03:54.981](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=234.98100000000005): phase\_curve is shown on the screen, drawn.
- [03:58.267](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=238.26700000000002): angle\_low is shown on the screen, written out.
- [04:0.856](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=240.85600000000002): angle\_mid is shown on the screen, written out.
- [04:4.002](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=244.00200000000004): angle\_high is shown on the screen, written out.

##### [04:9.571](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=249.57100000000005)

Narration: Now look hard at what those two curves nearly are. The magnitude is nearly two straight lines: flat, then falling at twenty decibels per decade, and they meet at the pole. The phase is nearly three straight lines, hinged a decade either side of it.

Board: mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-50.0, 20.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-100.0, 10.0), aspect=(8.0, 3.0)); head\_curves — a Heading that says "The Two Curves"; mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); dot\_low — a PlotPoint \[green\] labelled "0.2" drawn in mag\_axes (target='mag\_curve', x=-0.6989700043360187); dot\_mid — a PlotPoint \[green\] labelled "1" drawn in mag\_axes (target='mag\_curve'); dot\_high — a PlotPoint \[green\] labelled "5" drawn in mag\_axes (target='mag\_curve', x=0.6989700043360189); phase\_curve — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); angle\_low — a PlotPoint \[green\] drawn in phase\_axes (target='phase\_curve', x=-0.6989700043360187); angle\_mid — a PlotPoint \[green\] drawn in phase\_axes (target='phase\_curve'); angle\_high — a PlotPoint \[green\] drawn in phase\_axes (target='phase\_curve', x=0.6989700043360189)

Actions:
- [04:14.494](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=254.49400000000003): mag\_skeleton is shown on the screen, drawn.
- [04:17.176](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=257.17600000000004): slope\_fact is shown on the screen, written out.
- [04:21.762](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=261.76200000000006): phase\_skeleton is shown on the screen, drawn.
- [04:23.004](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=263.004): corner\_fact is shown on the screen, written out.

##### [04:25.961](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=265.9605000000001)

Narration: That is not a coincidence and it is not a drawing trick. It falls out of the algebra, and in the next part we work out exactly where it comes from, factor by factor, until sketching one of these is arithmetic.

Board: slope\_fact — a Math \[text\] that says "$upright("far above the pole:") thin -20 thin upright("dB/decade")$"; corner\_fact — a Math \[text\] that says "$upright("at the pole:") thin -3 thin upright("dB"), thin -45 degree$"; mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-50.0, 20.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-100.0, 10.0), aspect=(8.0, 3.0)); head\_curves — a Heading that says "The Two Curves"; mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); dot\_low — a PlotPoint \[green\] labelled "0.2" drawn in mag\_axes (target='mag\_curve', x=-0.6989700043360187); dot\_mid — a PlotPoint \[green\] labelled "1" drawn in mag\_axes (target='mag\_curve'); dot\_high — a PlotPoint \[green\] labelled "5" drawn in mag\_axes (target='mag\_curve', x=0.6989700043360189); phase\_curve — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); angle\_low — a PlotPoint \[green\] drawn in phase\_axes (target='phase\_curve', x=-0.6989700043360187); angle\_mid — a PlotPoint \[green\] drawn in phase\_axes (target='phase\_curve'); angle\_high — a PlotPoint \[green\] drawn in phase\_axes (target='phase\_curve', x=0.6989700043360189); mag\_skeleton — a FunctionPlot \[yellow\] drawn in mag\_axes (function=\<function\>); phase\_skeleton — a FunctionPlot \[yellow\] drawn in phase\_axes (function=\<function\>)

Actions:
- [04:30.547](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=270.547): mag\_skeleton is indicated — a transient flash.
- [04:30.547](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=270.547): phase\_skeleton is indicated — a transient flash.

##### [04:39.228](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=279.2275000000001)

Narration: Then we close the loop. And I will show you why one particular frequency, the one where the phase reaches minus one hundred and eighty degrees, decides whether the closed loop is stable at all. Gain margin and phase margin are the two numbers that live at that frequency, and by the end you will read both of them straight off these curves.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [04:59.174](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=299.1740000000001): mag\_curve is indicated — a transient flash.
- [04:59.174](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=299.1740000000001): phase\_curve is indicated — a transient flash.
- [05:0.122](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=300.1218333333334): corner\_fact is hidden from the screen — left the board.
- [05:0.122](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=300.1218333333334): head\_curves is hidden from the screen — left the board.
- [05:0.122](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=300.1218333333334): mag\_axes is hidden from the screen — left the board.
- [05:0.122](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=300.1218333333334): mag\_curve is hidden from the screen — mag\_axes left the board.
- [05:0.122](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=300.1218333333334): dot\_low is hidden from the screen — mag\_axes left the board.
- [05:0.122](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=300.1218333333334): dot\_mid is hidden from the screen — mag\_axes left the board.
- [05:0.122](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=300.1218333333334): dot\_high is hidden from the screen — mag\_axes left the board.
- [05:0.122](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=300.1218333333334): mag\_skeleton is hidden from the screen — mag\_axes left the board.
- [05:0.122](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=300.1218333333334): phase\_axes is hidden from the screen — left the board.
- [05:0.122](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=300.1218333333334): phase\_curve is hidden from the screen — phase\_axes left the board.
- [05:0.122](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=300.1218333333334): angle\_low is hidden from the screen — phase\_axes left the board.
- [05:0.122](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=300.1218333333334): angle\_mid is hidden from the screen — phase\_axes left the board.
- [05:0.122](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=300.1218333333334): angle\_high is hidden from the screen — phase\_axes left the board.
- [05:0.122](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=300.1218333333334): phase\_skeleton is hidden from the screen — phase\_axes left the board.
- [05:0.122](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=300.1218333333334): readings is hidden from the screen — left the board.
- [05:0.122](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=300.1218333333334): slope\_fact is hidden from the screen — left the board.

### Scene 2: [The Four Building Blocks](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=301.1635000000001)

Span: 05:1.164–10:14.026 (301.1635000000001s–614.0257708333334s).

#### Objects

- angle\_add: a Math \[text\] that says "$angle G = angle N\_1 + angle N\_2 - angle D\_1 - angle D\_2$"
- db\_add: a Math \[text\] that says "$\|G\|\_(upright("dB")) = \|K\|\_(upright("dB")) + \|N\_1\|\_(upright("dB")) + \|N\_2\|\_(upright("dB")) - \|D\_1\|\_(upright("dB")) - \|D\_2\|\_(upright("dB"))$"
- error\_note: a Math \[text\] that says "$\|1 + j\| = sqrt(2) quad -\> quad -3.01 thin upright("dB")$"
- gain\_plot: a FunctionPlot \[green\] labelled "20 log\_10 K" drawn in mag\_axes (function=\<function\>)
- half\_decade: a Math \[text\] that says "$upright("half a decade out:") thin -1 thin upright("dB")$"
- head\_blocks: a Heading that says "One Factor at a Time"
- head\_law: a Heading that says "Multiplication Becomes Addition"
- head\_rules: a Heading that says "The Whole Vocabulary"
- integrator\_angle: a FunctionPlot \[magenta\] drawn in phase\_axes (function=\<function\>)
- integrator\_plot: a FunctionPlot \[magenta\] drawn in mag\_axes (function=\<function\>)
- law\_note: a Panel that says "Every curve in this lecture is a sum of a handful of simple curves, and there are only four kinds of them."
- limits: a Derivation \[text\] that says "$G(j omega) &= frac(1, 1 + j omega / omega\_p) \\ omega -\> 0: quad &approx 1 \\ omega -\> infinity: quad &approx frac(omega\_p, j omega) \\ omega = omega\_p: quad &= frac(1, 1 + j)$"
- mag\_axes: an Axes (x\_range=(-1.0, 2.0), y\_range=(-50.0, 40.0), aspect=(8.0, 3.0))
- phase\_axes: an Axes (x\_range=(-1.0, 2.0), y\_range=(-100.0, 100.0), aspect=(8.0, 3.0))
- point: a Point \[yellow\] drawn in mag\_axes (location=(0.5, 6.02))
- point\_2: a Point \[yellow\] drawn in mag\_axes
- point\_3: a Point \[yellow\] drawn in mag\_axes (location=(1.0, -20.0))
- point\_4: a Point \[yellow\] drawn in mag\_axes (location=(2.0, -40.0))
- point\_5: a Point \[yellow\] drawn in mag\_axes (location=(0.3010299956639812, 0.0))
- point\_6: a Point \[yellow\] drawn in phase\_axes (location=(0.3010299956639812, -45.0))
- pole\_angle: a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>)
- pole\_angle\_lines: a FunctionPlot \[yellow\] drawn in phase\_axes (function=\<function\>)
- pole\_lines: a FunctionPlot \[yellow\] drawn in mag\_axes (function=\<function\>)
- pole\_plot: a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>)
- product: a Math \[text\] that says "$G(j omega) = K dot.op frac(N\_1 N\_2, D\_1 D\_2)$"
- rules: a Table \[text\] that says "Factor Slope, dB per decade Phase gain $K$ $0$ $0 degree$ integrator $-20$ everywhere $-90 degree$ everywhere zero at $omega\_z$ $0$, then $+20$ $0 degree$, then $+90 degree$ pole at $omega\_p$ $0$, then $-20$ $0 degree$, then $-90 degree$" (rows=(('Factor', 'Slope, dB per decade', 'Phase'), ('gain $K$', '$0$…, header=True)
- rules\_note: a Panel that says "A break costs a decade either side in phase, and the magnitude misses its corner by $3$ decibels. Those two facts are the entire error budget of a straight line sketch."
- zero\_angle: a FunctionPlot \[red\] drawn in phase\_axes (function=\<function\>)
- zero\_angle\_lines: a FunctionPlot \[yellow\] drawn in phase\_axes (function=\<function\>)
- zero\_lines: a FunctionPlot \[yellow\] drawn in mag\_axes (function=\<function\>)
- zero\_plot: a FunctionPlot \[red\] drawn in mag\_axes (function=\<function\>)

#### Beats

##### [05:1.164](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=301.1635000000001)

Narration: So why decibels, and why a logarithmic frequency axis. Here is the answer, and it is the only reason those two conventions exist. A transfer function is a product: a constant out front, some factors upstairs, some factors downstairs.

Board: Empty.

Actions:
- [05:1.164](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=301.1635000000001): head\_law is shown on the screen, written out.
- [05:12.368](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=312.3675000000001): product is shown on the screen, written out.

##### [05:18.517](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=318.5165000000001)

Narration: Take twenty times the logarithm of the magnitude, and that product becomes a sum. Every factor on top adds its own decibel curve. Every factor on the bottom subtracts one. Nothing else happens.

Board: product — a Math \[text\] that says "$G(j omega) = K dot.op frac(N\_1 N\_2, D\_1 D\_2)$"; head\_law — a Heading that says "Multiplication Becomes Addition"

Actions:
- [05:18.517](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=318.5165000000001): db\_add is shown on the screen, written out.
- [05:25.146](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=325.14550000000014): db\_add (the "\|N\_1\|\_(upright("dB"))" part) is emphasized.
- [05:28.722](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=328.7215000000001): db\_add (the "\|D\_1\|\_(upright("dB"))" part) is emphasized.
- [05:28.722](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=328.7215000000001): db\_add (the "\|N\_1\|\_(upright("dB"))" part) is no longer emphasized.
- [05:31.624](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=331.62400000000014): db\_add (the "\|D\_1\|\_(upright("dB"))" part) is no longer emphasized.

##### [05:32.224](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=332.2240000000001)

Narration: And the angle of a product is the sum of the angles anyway, so the phase adds in exactly the same pattern, with no logarithm needed. Two sums, one for each curve.

Board: product — a Math \[text\] that says "$G(j omega) = K dot.op frac(N\_1 N\_2, D\_1 D\_2)$"; db\_add — a Math \[text\] that says "$\|G\|\_(upright("dB")) = \|K\|\_(upright("dB")) + \|N\_1\|\_(upright("dB")) + \|N\_2\|\_(upright("dB")) - \|D\_1\|\_(upright("dB")) - \|D\_2\|\_(upright("dB"))$"; head\_law — a Heading that says "Multiplication Becomes Addition"

Actions:
- [05:32.979](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=332.9785000000001): angle\_add is shown on the screen, written out.
- [05:40.352](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=340.3515000000001): law\_note is shown on the screen, written out.

##### [05:43.343](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=343.34300000000013)

Narration: So if I can draw four simple curves, I can draw any Bode plot by stacking them up. Let me take those four one at a time.

Board: product — a Math \[text\] that says "$G(j omega) = K dot.op frac(N\_1 N\_2, D\_1 D\_2)$"; db\_add — a Math \[text\] that says "$\|G\|\_(upright("dB")) = \|K\|\_(upright("dB")) + \|N\_1\|\_(upright("dB")) + \|N\_2\|\_(upright("dB")) - \|D\_1\|\_(upright("dB")) - \|D\_2\|\_(upright("dB"))$"; angle\_add — a Math \[text\] that says "$angle G = angle N\_1 + angle N\_2 - angle D\_1 - angle D\_2$"; law\_note — a Panel that says "Every curve in this lecture is a sum of a handful of simple curves, and there are only four kinds of them."; head\_law — a Heading that says "Multiplication Becomes Addition"

Actions:
- [05:50.611](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=350.6110000000001): angle\_add is hidden from the screen — left the board.
- [05:50.611](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=350.6110000000001): db\_add is hidden from the screen — left the board.
- [05:50.611](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=350.6110000000001): head\_law is hidden from the screen — left the board.
- [05:50.611](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=350.6110000000001): law\_note is hidden from the screen — left the board.
- [05:50.611](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=350.6110000000001): product is hidden from the screen — left the board.

##### [05:51.211](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=351.2110000000001)

Narration: The first one is trivial. A constant gain K. Its magnitude does not depend on frequency at all, so in decibels it is a horizontal line at twenty log K. With K equal to two, that sits at six decibels. And a positive real number has no angle, so it contributes nothing whatsoever to the phase.

Board: Empty.

Actions:
- [05:51.211](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=351.2110000000001): head\_blocks is shown on the screen, written out.
- [05:55.344](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=355.3435000000001): mag\_axes is shown on the screen, written out.
- [05:59.222](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=359.2215000000001): gain\_plot is shown on the screen, written out.
- [06:3.994](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=363.99350000000015): point is shown on the screen, grown.
- [06:5.994](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=365.99350000000015): point is hidden from the screen.
- [06:10.02](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=370.0195000000001): mag\_axes moves to a new place on the board.
- [06:10.02](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=370.0195000000001): phase\_axes is shown on the screen, written out.

##### [06:11.502](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=371.50150000000014)

Narration: The second one is an integrator, one over j omega. Its magnitude is one over omega, so in decibels it is minus twenty times the logarithm of omega. That is a straight line, exactly, at every frequency.

Board: mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-50.0, 40.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-100.0, 100.0), aspect=(8.0, 3.0)); head\_blocks — a Heading that says "One Factor at a Time"; gain\_plot — a FunctionPlot \[green\] labelled "20 log\_10 K" drawn in mag\_axes (function=\<function\>)

Actions:
- [06:22.972](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=382.9715000000001): integrator\_plot is shown on the screen, drawn.

##### [06:26.695](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=386.6945000000001)

Narration: And you can read the slope off it by arithmetic. At one radian per second it is zero decibels. At ten, it is minus twenty. At a hundred, minus forty. Every decade costs twenty decibels, forever.

Board: mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-50.0, 40.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-100.0, 100.0), aspect=(8.0, 3.0)); head\_blocks — a Heading that says "One Factor at a Time"; gain\_plot — a FunctionPlot \[green\] labelled "20 log\_10 K" drawn in mag\_axes (function=\<function\>); integrator\_plot — a FunctionPlot \[magenta\] drawn in mag\_axes (function=\<function\>)

Actions:
- [06:31.78](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=391.7795000000001): point\_2 is shown on the screen, grown.
- [06:33.777](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=393.7765000000001): point\_3 is shown on the screen, grown.
- [06:33.78](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=393.7795000000001): point\_2 is hidden from the screen.
- [06:35.777](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=395.7765000000001): point\_3 is hidden from the screen.
- [06:36.541](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=396.5405000000001): point\_4 is shown on the screen, grown.
- [06:38.541](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=398.5405000000001): point\_4 is hidden from the screen.

##### [06:42.469](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=402.4690000000001)

Narration: Its phase is easier still. One over j is minus j, which points straight down. Minus ninety degrees, at every frequency, with no bend in it anywhere.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [06:49.284](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=409.2835000000001): integrator\_angle is shown on the screen, written out.

##### [06:53.669](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=413.6685000000001)

Narration: The third block is the one that actually earns its keep: a real pole, written so that it equals one at zero frequency. One over one plus j omega over omega p. Take it to its two limits and everything falls out.

Board: mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-50.0, 40.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-100.0, 100.0), aspect=(8.0, 3.0)); head\_blocks — a Heading that says "One Factor at a Time"; gain\_plot — a FunctionPlot \[green\] labelled "20 log\_10 K" drawn in mag\_axes (function=\<function\>); integrator\_plot — a FunctionPlot \[magenta\] drawn in mag\_axes (function=\<function\>); integrator\_angle — a FunctionPlot \[magenta\] drawn in phase\_axes (function=\<function\>)

Actions:
- [06:58.476](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=418.4755000000001): limits is shown on the screen, written out.

##### [07:9.861](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=429.8610000000001)

Narration: Well below the corner, omega over omega p is tiny, so the denominator is essentially one. The factor is one. Zero decibels, and no phase. That is the flat piece.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [07:14.39](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=434.3895000000001): limits is shown on the screen, written out.
- [07:21.681](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=441.68050000000017): integrator\_plot is hidden from the screen.
- [07:21.681](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=441.68050000000017): integrator\_angle is hidden from the screen.
- [07:21.681](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=441.68050000000017): pole\_plot is shown on the screen, drawn.

##### [07:23.407](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=443.40650000000016)

Narration: Well above the corner, the one is negligible and the factor is omega p over j omega. That is an integrator again, scaled. So it falls at twenty decibels per decade, and its phase is minus ninety.

Board: mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-50.0, 40.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-100.0, 100.0), aspect=(8.0, 3.0)); head\_blocks — a Heading that says "One Factor at a Time"; gain\_plot — a FunctionPlot \[green\] labelled "20 log\_10 K" drawn in mag\_axes (function=\<function\>); pole\_plot — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>)

Actions:
- [07:25.636](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=445.63550000000015): limits is shown on the screen, written out.

##### [07:37.683](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=457.6830000000001)

Narration: So we have a flat line at zero on the left, a falling line at minus twenty on the right, and they cross where omega equals omega p, which here is two radians per second. That crossing is what everybody calls the corner, or the break frequency.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [07:49.27](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=469.26950000000016): pole\_lines is shown on the screen, drawn.
- [07:51.105](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=471.10450000000014): point\_5 is shown on the screen, grown.
- [07:53.105](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=473.10450000000014): point\_5 is hidden from the screen.

##### [07:54.189](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=474.18900000000014)

Narration: Now, how wrong is that sketch. Right at the corner the denominator is one plus j, whose magnitude is root two, and twenty log of root two is minus three decibels. Three decibels below the corner of the sketch, and that is the worst it ever gets.

Board: mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-50.0, 40.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-100.0, 100.0), aspect=(8.0, 3.0)); head\_blocks — a Heading that says "One Factor at a Time"; gain\_plot — a FunctionPlot \[green\] labelled "20 log\_10 K" drawn in mag\_axes (function=\<function\>); pole\_plot — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); pole\_lines — a FunctionPlot \[yellow\] drawn in mag\_axes (function=\<function\>)

Actions:
- [07:58.172](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=478.17150000000015): limits is shown on the screen, written out.
- [08:4.325](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=484.32450000000017): error\_note is shown on the screen, written out.

##### [08:11.229](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=491.22900000000016)

Narration: Half a decade either side of the corner the error is down to one decibel, and a decade out it is under a quarter of one. So the straight lines are not a cartoon. They are the truth to within three decibels, everywhere.

Board: error\_note — a Math \[text\] that says "$\|1 + j\| = sqrt(2) quad -\> quad -3.01 thin upright("dB")$"; mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-50.0, 40.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-100.0, 100.0), aspect=(8.0, 3.0)); head\_blocks — a Heading that says "One Factor at a Time"; gain\_plot — a FunctionPlot \[green\] labelled "20 log\_10 K" drawn in mag\_axes (function=\<function\>); pole\_plot — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); pole\_lines — a FunctionPlot \[yellow\] drawn in mag\_axes (function=\<function\>)

Actions:
- [08:11.578](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=491.57750000000016): half\_decade is shown on the screen, written out.

##### [08:25.145](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=505.1450000000001)

Narration: The phase needs one more rule, and it is a convention rather than a theorem. Zero below a decade under the corner, minus ninety above a decade over it, and a straight ramp of minus forty five degrees per decade joining them.

Board: error\_note — a Math \[text\] that says "$\|1 + j\| = sqrt(2) quad -\> quad -3.01 thin upright("dB")$"; half\_decade — a Math \[text\] that says "$upright("half a decade out:") thin -1 thin upright("dB")$"; mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-50.0, 40.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-100.0, 100.0), aspect=(8.0, 3.0)); head\_blocks — a Heading that says "One Factor at a Time"; gain\_plot — a FunctionPlot \[green\] labelled "20 log\_10 K" drawn in mag\_axes (function=\<function\>); pole\_plot — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); pole\_lines — a FunctionPlot \[yellow\] drawn in mag\_axes (function=\<function\>)

Actions:
- [08:30.626](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=510.62550000000016): pole\_angle is shown on the screen, drawn.
- [08:36.524](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=516.5235000000001): pole\_angle\_lines is shown on the screen, drawn.

##### [08:40.444](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=520.4435000000001)

Narration: At the corner itself the ramp is halfway down, at minus forty five degrees, and that one is exact: one over one plus j has an angle of minus forty five, precisely. The worst error in the ramp is about six degrees, out near its two hinges.

Board: error\_note — a Math \[text\] that says "$\|1 + j\| = sqrt(2) quad -\> quad -3.01 thin upright("dB")$"; half\_decade — a Math \[text\] that says "$upright("half a decade out:") thin -1 thin upright("dB")$"; mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-50.0, 40.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-100.0, 100.0), aspect=(8.0, 3.0)); head\_blocks — a Heading that says "One Factor at a Time"; gain\_plot — a FunctionPlot \[green\] labelled "20 log\_10 K" drawn in mag\_axes (function=\<function\>); pole\_plot — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); pole\_lines — a FunctionPlot \[yellow\] drawn in mag\_axes (function=\<function\>); pole\_angle — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); pole\_angle\_lines — a FunctionPlot \[yellow\] drawn in phase\_axes (function=\<function\>)

Actions:
- [08:42.522](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=522.5215000000002): point\_6 is shown on the screen, grown.
- [08:44.522](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=524.5215000000002): point\_6 is hidden from the screen.

##### [08:56.044](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=536.0440000000001)

Narration: And the fourth block is the same numbers with every sign flipped, because a zero is a pole moved upstairs. Flat, then rising at twenty decibels per decade. Zero degrees, then a ramp up to plus ninety.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [08:56.044](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=536.0440000000001): pole\_plot is hidden from the screen.
- [08:56.044](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=536.0440000000001): pole\_lines is hidden from the screen.
- [08:56.044](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=536.0440000000001): pole\_angle is hidden from the screen.
- [08:56.044](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=536.0440000000001): pole\_angle\_lines is hidden from the screen.
- [09:2.511](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=542.5105000000001): zero\_plot is shown on the screen, drawn.
- [09:3.37](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=543.3695000000001): zero\_lines is shown on the screen, written out.
- [09:6.528](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=546.5275000000001): zero\_angle is shown on the screen, drawn.
- [09:7.491](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=547.4905000000001): zero\_angle\_lines is shown on the screen, written out.

##### [09:9.937](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=549.9365000000001)

Narration: That is the whole vocabulary. Four shapes, and a Bode plot is what you get when you add up however many of them your plant happens to have.

Board: error\_note — a Math \[text\] that says "$\|1 + j\| = sqrt(2) quad -\> quad -3.01 thin upright("dB")$"; half\_decade — a Math \[text\] that says "$upright("half a decade out:") thin -1 thin upright("dB")$"; mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-50.0, 40.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-100.0, 100.0), aspect=(8.0, 3.0)); head\_blocks — a Heading that says "One Factor at a Time"; gain\_plot — a FunctionPlot \[green\] labelled "20 log\_10 K" drawn in mag\_axes (function=\<function\>); zero\_plot — a FunctionPlot \[red\] drawn in mag\_axes (function=\<function\>); zero\_lines — a FunctionPlot \[yellow\] drawn in mag\_axes (function=\<function\>); zero\_angle — a FunctionPlot \[red\] drawn in phase\_axes (function=\<function\>); zero\_angle\_lines — a FunctionPlot \[yellow\] drawn in phase\_axes (function=\<function\>)

Actions:
- [09:12.968](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=552.9675000000002): zero\_plot is indicated — a transient flash.
- [09:12.968](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=552.9675000000002): zero\_angle is indicated — a transient flash.
- [09:18.981](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=558.9810000000001): error\_note is hidden from the screen — left the board.
- [09:18.981](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=558.9810000000001): half\_decade is hidden from the screen — left the board.
- [09:18.981](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=558.9810000000001): head\_blocks is hidden from the screen — left the board.
- [09:18.981](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=558.9810000000001): limits is hidden from the screen — left the board.
- [09:18.981](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=558.9810000000001): mag\_axes is hidden from the screen — left the board.
- [09:18.981](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=558.9810000000001): gain\_plot is hidden from the screen — mag\_axes left the board.
- [09:18.981](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=558.9810000000001): zero\_plot is hidden from the screen — mag\_axes left the board.
- [09:18.981](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=558.9810000000001): zero\_lines is hidden from the screen — mag\_axes left the board.
- [09:18.981](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=558.9810000000001): phase\_axes is hidden from the screen — left the board.
- [09:18.981](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=558.9810000000001): zero\_angle is hidden from the screen — phase\_axes left the board.
- [09:18.981](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=558.9810000000001): zero\_angle\_lines is hidden from the screen — phase\_axes left the board.

##### [09:20.181](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=560.1810000000002)

Narration: Written out as a table, that is it. A gain moves the whole magnitude curve up or down and touches nothing else. An integrator tilts it by twenty decibels per decade and drops the phase by ninety, at every frequency.

Board: Empty.

Actions:
- [09:20.181](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=560.1810000000002): head\_rules is shown on the screen, written out.
- [09:21.192](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=561.1915000000001): rules is shown on the screen, written out.
- [09:23.641](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=563.6405000000002): rules is shown on the screen, written out.
- [09:26.323](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=566.3225000000002): rules (the "row=2" part) is emphasized.
- [09:28.436](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=568.4355000000002): rules is shown on the screen, written out.
- [09:28.436](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=568.4355000000002): rules (the "row=2" part) is no longer emphasized.
- [09:31.466](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=571.4655000000002): rules (the "row=3" part) is emphasized.
- [09:34.462](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=574.4615000000001): rules (the "row=3" part) is no longer emphasized.

##### [09:35.062](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=575.0615000000001)

Narration: A zero puts a bend upward in the magnitude at its own frequency, and hands you ninety degrees of phase lead spread across two decades. A pole does the mirror image: a bend downward, and ninety degrees of lag.

Board: head\_rules — a Heading that says "The Whole Vocabulary"

Actions:
- [09:35.549](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=575.5485000000001): rules is shown on the screen, written out.
- [09:41.424](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=581.4235000000001): rules (the "row=4" part) is emphasized.
- [09:44.095](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=584.0945000000002): rules is shown on the screen, written out.
- [09:44.733](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=584.7325000000002): rules (the "row=4" part) is no longer emphasized.
- [09:46.243](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=586.2425000000002): rules (the "row=5" part) is emphasized.
- [09:48.727](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=588.7270000000001): rules (the "row=5" part) is no longer emphasized.

##### [09:49.327](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=589.3270000000001)

Narration: And the two error facts are worth memorising, because they are the whole difference between the sketch and the truth. Three decibels at each corner, and a decade either side for the phase. Nothing else is approximate.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [09:50.151](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=590.1505000000002): rules\_note is shown on the screen, written out.

##### [10:2.97](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=602.97)

Narration: So the straight lines are not magic. They are two limits and a hinge. Now let me stack them, on a plant with a pole, another pole, and an integrator in it.

Board: rules\_note — a Panel that says "A break costs a decade either side in phase, and the magnitude misses its corner by $3$ decibels. Those two facts are the entire error budget of a straight line sketch."; head\_rules — a Heading that says "The Whole Vocabulary"

Actions:
- [10:12.984](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=612.9841041666667): head\_rules is hidden from the screen — left the board.
- [10:12.984](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=612.9841041666667): rules is hidden from the screen — left the board.
- [10:12.984](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=612.9841041666667): rules\_note is hidden from the screen — left the board.

### Scene 3: [Stacking the Factors](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=614.0257708333334)

Span: 10:14.026–15:14.95 (614.0257708333334s–914.9500833333334s).

#### Objects

- bode\_work: a Derivation \[text\] that says "$L(s) &= frac(40, s (s + 2)(s + 10)) \\ &= frac(2, s) dot.op frac(1, 1 + s / 2) dot.op frac(1, 1 + s / 10)$"
- cross\_work: a Derivation \[text\] that says "$-90 degree - arctan frac(omega, 2) - arctan frac(omega, 10) &= -180 degree \\ arctan frac(omega, 2) + arctan frac(omega, 10) &= 90 degree \\ 1 - frac(omega^2, 20) &= 0 \\ omega\_(upright("pc")) &= sqrt(20) approx 4.47$"
- factors: a Block \[text\] that says "a gain of $2$, worth $6$ decibels one integrator a pole at $omega = 2$ a pole at $omega = 10$"
- gc\_dot: a PlotPoint \[green\] drawn in mag\_axes (target='mag\_curve', x=0.19284611518884168)
- gc\_guide: a Line \[green\] drawn in mag\_axes (start=(0.19284611518884168, -85.0), end=(0.19284611518884168, 45.0), dashed=True)
- gc\_line: a Math \[text\] that says "$omega\_(upright("gc")) approx 1.56 quad (\|L\| = 1)$"
- head\_build: a Heading that says "Laying Down the Skeleton"
- head\_cross: a Heading that says "The Two Crossover Frequencies"
- head\_form: a Heading that says "Putting a Plant into Bode Form"
- mag\_axes: an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0))
- mag\_curve: a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>)
- mag\_work: a Derivation \[text\] that says "$omega = 0.1: quad &6 + 20 = 26 \\ omega = 2: quad &6 - 6 = 0 \\ omega = 10: quad &0 - 40 log\_10 5 = -28$"
- minus\_180: a Line \[gray\] drawn in phase\_axes (start=(-1.0, -180.0), end=(2.0, -180.0), dashed=True)
- pc\_dot: a PlotPoint \[red\] drawn in phase\_axes (target='phase\_curve', x=0.6505149978319906)
- pc\_guide: a Line \[red\] drawn in phase\_axes (start=(0.6505149978319906, -280.0), end=(0.6505149978319906, -70.0), dashed=True)
- phase\_axes: an Axes (x\_range=(-1.0, 2.0), y\_range=(-285.0, -60.0), aspect=(8.0, 3.0))
- phase\_curve: a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>)
- phase\_four: a Line \[yellow\] drawn in phase\_axes (start=(1.3010299956639813, -238.54634980487916), end=(2.0, -270.0))
- phase\_one: a Line \[yellow\] drawn in phase\_axes (start=(-1.0, -90.0), end=(-0.6989700043360187, -90.0))
- phase\_three: a Line \[yellow\] drawn in phase\_axes (start=(0.0, -121.45365019512084), end=(1.3010299956639813, -238.54634980487916))
- phase\_two: a Line \[yellow\] drawn in phase\_axes (start=(-0.6989700043360187, -90.0), end=(0.0, -121.45365019512084))
- point: a Point \[yellow\] drawn in mag\_axes (location=(0.3010299956639812, 0.0))
- point\_2: a Point \[yellow\] drawn in mag\_axes (location=(1.0, -13.979400086720375))
- point\_3: a Point \[yellow\] drawn in mag\_axes (location=(0.3010299956639812, -3.0))
- point\_4: a Point \[yellow\] drawn in mag\_axes (location=(0.3010299956639812, 0.0))
- seg\_one: a Line \[yellow\] labelled "-20" drawn in mag\_axes (start=(-1.0, 26.020599913279625), end=(0.3010299956639812, 0.0))
- seg\_three: a Line \[yellow\] labelled "-60" drawn in mag\_axes (start=(1.0, -13.979400086720375), end=(2.0, -53.979400086720375))
- seg\_two: a Line \[yellow\] labelled "-40" drawn in mag\_axes (start=(0.3010299956639812, 0.0), end=(1.0, -13.979400086720375))
- sketch\_gap: a Math \[text\] that says "$upright("skeleton says") thin 2.0, quad upright("exact") thin 1.56$"
- zero\_db\_line: a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True)

#### Beats

##### [10:14.026](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=614.0257708333334)

Narration: Here is the plant we will carry for the rest of the lecture. Forty, over s times s plus two times s plus ten. Third order, one integrator, two real poles, and nothing exotic anywhere in it.

Board: Empty.

Actions:
- [10:14.026](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=614.0257708333334): head\_form is shown on the screen, written out.
- [10:17.161](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=617.1607708333333): bode\_work is shown on the screen, written out.

##### [10:28.546](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=628.5462708333333)

Narration: Before we can stack anything we have to rewrite it, because our four building blocks all equal one at low frequency and these brackets do not. So pull a two out of the first bracket, and a ten out of the second.

Board: head\_form — a Heading that says "Putting a Plant into Bode Form"

Actions:
- [10:37.311](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=637.3107708333333): bode\_work is shown on the screen, written out.

##### [10:41.557](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=641.5567708333333)

Narration: Forty over twenty leaves two, and now every factor is in the right shape. Read them off. A gain of two, worth six decibels. One integrator. A pole at two radians per second, and a pole at ten. Those four items are the entire plant, and they are the entire Bode plot.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [10:41.557](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=641.5567708333333): factors is shown on the screen, written out.
- [10:47.722](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=647.7217708333334): factors (the "a gain of $2$, worth $6$ decibels" part) is emphasized.
- [10:50.578](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=650.5777708333334): factors (the "a gain of $2$, worth $6$ decibels" part) is no longer emphasized.
- [10:50.578](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=650.5777708333334): factors (the "one integrator" part) is emphasized.
- [10:52.168](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=652.1677708333334): factors (the "a pole at $omega = 2$" part) is emphasized.
- [10:52.168](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=652.1677708333334): factors (the "one integrator" part) is no longer emphasized.
- [10:54.328](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=654.3277708333334): factors (the "a pole at $omega = 10$" part) is emphasized.
- [10:54.328](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=654.3277708333334): factors (the "a pole at $omega = 2$" part) is no longer emphasized.
- [10:56.534](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=656.5337708333334): factors (the "a pole at $omega = 10$" part) is no longer emphasized.

##### [11:0.686](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=660.6857708333333)

Narration: So let us draw it. I will lay the magnitude down first, one segment at a time, and check a number at every break.

Board: factors — a Block \[text\] that says "a gain of $2$, worth $6$ decibels one integrator a pole at $omega = 2$ a pole at $omega = 10$"; head\_form — a Heading that says "Putting a Plant into Bode Form"

Actions:
- [11:8.337](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=668.3367708333334): factors moves to a new place on the board.
- [11:8.337](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=668.3367708333334): bode\_work is hidden from the screen — left the board.
- [11:8.337](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=668.3367708333334): head\_form is hidden from the screen — left the board.

##### [11:8.937](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=668.9367708333333)

Narration: Start at the far left of the magnitude plot, at a tenth of a radian per second. Down there both poles are still asleep, because we are well below both corners. So only the gain and the integrator are doing anything at all.

Board: factors — a Block \[text\] that says "a gain of $2$, worth $6$ decibels one integrator a pole at $omega = 2$ a pole at $omega = 10$"

Actions:
- [11:8.937](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=668.9367708333333): head\_build is shown on the screen, written out.
- [11:8.937](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=668.9367708333333): mag\_axes is shown on the screen, written out.
- [11:18.399](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=678.3987708333334): zero\_db\_line is shown on the screen, written out.

##### [11:23.527](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=683.5267708333333)

Narration: Six decibels from the gain. And the integrator is worth plus twenty down there, because it costs twenty per decade and we are one decade below one radian per second. Six plus twenty is twenty six, and from there the line comes down at twenty decibels per decade.

Board: factors — a Block \[text\] that says "a gain of $2$, worth $6$ decibels one integrator a pole at $omega = 2$ a pole at $omega = 10$"; mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); head\_build — a Heading that says "Laying Down the Skeleton"; zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True)

Actions:
- [11:34.766](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=694.7657708333334): mag\_work is shown on the screen, written out.
- [11:36.832](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=696.8317708333334): seg\_one is shown on the screen, drawn.

##### [11:39.824](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=699.8237708333334)

Narration: That segment runs until the first pole wakes up, at omega equal to two. Where has the line got to by then? Six from the gain, minus twenty log of two, which is another six. It arrives at exactly zero decibels.

Board: factors — a Block \[text\] that says "a gain of $2$, worth $6$ decibels one integrator a pole at $omega = 2$ a pole at $omega = 10$"; mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); head\_build — a Heading that says "Laying Down the Skeleton"; zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); seg\_one — a Line \[yellow\] labelled "-20" drawn in mag\_axes (start=(-1.0, 26.020599913279625), end=(0.3010299956639812, 0.0))

Actions:
- [11:52.119](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=712.1187708333333): mag\_work is shown on the screen, written out.
- [11:53.315](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=713.3147708333333): point is shown on the screen, grown.
- [11:55.315](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=715.3147708333333): point is hidden from the screen.

##### [11:55.366](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=715.3657708333334)

Narration: And past that corner the pole adds its own twenty per decade on top of the integrator's. So the slope steepens to minus forty, and the second segment falls twice as fast as the first.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [12:1.868](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=721.8677708333333): seg\_two is shown on the screen, drawn.

##### [12:7.46](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=727.4597708333333)

Narration: It runs from two up to ten, which is log ten of five, about seven tenths of a decade. At forty decibels a decade, that is twenty eight decibels lost, so we reach the second corner at minus twenty eight.

Board: factors — a Block \[text\] that says "a gain of $2$, worth $6$ decibels one integrator a pole at $omega = 2$ a pole at $omega = 10$"; mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); head\_build — a Heading that says "Laying Down the Skeleton"; zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); seg\_one — a Line \[yellow\] labelled "-20" drawn in mag\_axes (start=(-1.0, 26.020599913279625), end=(0.3010299956639812, 0.0)); seg\_two — a Line \[yellow\] labelled "-40" drawn in mag\_axes (start=(0.3010299956639812, 0.0), end=(1.0, -13.979400086720375))

Actions:
- [12:16.342](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=736.3417708333334): mag\_work is shown on the screen, written out.
- [12:19.151](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=739.1507708333334): point\_2 is shown on the screen, grown.
- [12:21.151](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=741.1507708333334): point\_2 is hidden from the screen.

##### [12:21.446](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=741.4462708333333)

Narration: Beyond ten the second pole joins in as well, so the slope steepens again, to minus sixty decibels per decade, and it never comes back up. Three segments, three slopes, and every number in them was arithmetic.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [12:24.976](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=744.9757708333334): seg\_three is shown on the screen, drawn.

##### [12:34.776](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=754.7762708333333)

Narration: Now here is the exact curve, drawn over the top. It hugs the skeleton everywhere, except that it rounds each corner off and sits about three decibels below it, exactly as we worked out.

Board: factors — a Block \[text\] that says "a gain of $2$, worth $6$ decibels one integrator a pole at $omega = 2$ a pole at $omega = 10$"; mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); head\_build — a Heading that says "Laying Down the Skeleton"; zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); seg\_one — a Line \[yellow\] labelled "-20" drawn in mag\_axes (start=(-1.0, 26.020599913279625), end=(0.3010299956639812, 0.0)); seg\_two — a Line \[yellow\] labelled "-40" drawn in mag\_axes (start=(0.3010299956639812, 0.0), end=(1.0, -13.979400086720375)); seg\_three — a Line \[yellow\] labelled "-60" drawn in mag\_axes (start=(1.0, -13.979400086720375), end=(2.0, -53.979400086720375))

Actions:
- [12:35.769](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=755.7687708333333): mag\_curve is shown on the screen, drawn.
- [12:41.11](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=761.1097708333334): point\_3 is shown on the screen, grown.
- [12:43.11](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=763.1097708333334): point\_3 is hidden from the screen.

##### [12:46.818](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=766.8182708333334)

Narration: The phase is built the same way, and it starts lower down. The integrator hands us minus ninety degrees at every frequency, so the phase begins at minus ninety on the left and does not move until the first ramp starts.

Board: factors — a Block \[text\] that says "a gain of $2$, worth $6$ decibels one integrator a pole at $omega = 2$ a pole at $omega = 10$"; mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); head\_build — a Heading that says "Laying Down the Skeleton"; zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); seg\_one — a Line \[yellow\] labelled "-20" drawn in mag\_axes (start=(-1.0, 26.020599913279625), end=(0.3010299956639812, 0.0)); seg\_two — a Line \[yellow\] labelled "-40" drawn in mag\_axes (start=(0.3010299956639812, 0.0), end=(1.0, -13.979400086720375)); seg\_three — a Line \[yellow\] labelled "-60" drawn in mag\_axes (start=(1.0, -13.979400086720375), end=(2.0, -53.979400086720375)); mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>)

Actions:
- [12:46.818](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=766.8182708333334): phase\_axes is shown on the screen, written out.
- [12:52.17](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=772.1697708333334): phase\_one is shown on the screen, drawn.

##### [13:0.154](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=780.1537708333333)

Narration: The pole at two begins bending a decade below itself, at nought point two, and finishes a decade above, at twenty. So this second piece falls at forty five degrees per decade.

Board: factors — a Block \[text\] that says "a gain of $2$, worth $6$ decibels one integrator a pole at $omega = 2$ a pole at $omega = 10$"; mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-285.0, -60.0), aspect=(8.0, 3.0)); head\_build — a Heading that says "Laying Down the Skeleton"; zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); seg\_one — a Line \[yellow\] labelled "-20" drawn in mag\_axes (start=(-1.0, 26.020599913279625), end=(0.3010299956639812, 0.0)); seg\_two — a Line \[yellow\] labelled "-40" drawn in mag\_axes (start=(0.3010299956639812, 0.0), end=(1.0, -13.979400086720375)); seg\_three — a Line \[yellow\] labelled "-60" drawn in mag\_axes (start=(1.0, -13.979400086720375), end=(2.0, -53.979400086720375)); mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); phase\_one — a Line \[yellow\] drawn in phase\_axes (start=(-1.0, -90.0), end=(-0.6989700043360187, -90.0))

Actions:
- [13:9.152](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=789.1517708333333): phase\_two is shown on the screen, drawn.

##### [13:12.015](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=792.0152708333334)

Narration: But at one radian per second the pole at ten begins its own ramp, and now both are running together. Two ramps at forty five each make ninety degrees per decade, so this middle piece is the steepest part of the whole curve.

Board: factors — a Block \[text\] that says "a gain of $2$, worth $6$ decibels one integrator a pole at $omega = 2$ a pole at $omega = 10$"; mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-285.0, -60.0), aspect=(8.0, 3.0)); head\_build — a Heading that says "Laying Down the Skeleton"; zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); seg\_one — a Line \[yellow\] labelled "-20" drawn in mag\_axes (start=(-1.0, 26.020599913279625), end=(0.3010299956639812, 0.0)); seg\_two — a Line \[yellow\] labelled "-40" drawn in mag\_axes (start=(0.3010299956639812, 0.0), end=(1.0, -13.979400086720375)); seg\_three — a Line \[yellow\] labelled "-60" drawn in mag\_axes (start=(1.0, -13.979400086720375), end=(2.0, -53.979400086720375)); mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); phase\_one — a Line \[yellow\] drawn in phase\_axes (start=(-1.0, -90.0), end=(-0.6989700043360187, -90.0)); phase\_two — a Line \[yellow\] drawn in phase\_axes (start=(-0.6989700043360187, -90.0), end=(0.0, -121.45365019512084))

Actions:
- [13:23.301](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=803.3007708333333): phase\_three is shown on the screen, drawn.

##### [13:25.572](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=805.5722708333333)

Narration: The first ramp finishes at twenty, and after that only the second is left, so we go back to forty five per decade and settle at minus two hundred and seventy. Ninety from the integrator, and ninety from each pole.

Board: factors — a Block \[text\] that says "a gain of $2$, worth $6$ decibels one integrator a pole at $omega = 2$ a pole at $omega = 10$"; mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-285.0, -60.0), aspect=(8.0, 3.0)); head\_build — a Heading that says "Laying Down the Skeleton"; zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); seg\_one — a Line \[yellow\] labelled "-20" drawn in mag\_axes (start=(-1.0, 26.020599913279625), end=(0.3010299956639812, 0.0)); seg\_two — a Line \[yellow\] labelled "-40" drawn in mag\_axes (start=(0.3010299956639812, 0.0), end=(1.0, -13.979400086720375)); seg\_three — a Line \[yellow\] labelled "-60" drawn in mag\_axes (start=(1.0, -13.979400086720375), end=(2.0, -53.979400086720375)); mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); phase\_one — a Line \[yellow\] drawn in phase\_axes (start=(-1.0, -90.0), end=(-0.6989700043360187, -90.0)); phase\_two — a Line \[yellow\] drawn in phase\_axes (start=(-0.6989700043360187, -90.0), end=(0.0, -121.45365019512084)); phase\_three — a Line \[yellow\] drawn in phase\_axes (start=(0.0, -121.45365019512084), end=(1.3010299956639813, -238.54634980487916))

Actions:
- [13:32.179](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=812.1787708333334): phase\_four is shown on the screen, drawn.
- [13:35.279](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=815.2787708333333): phase\_curve is shown on the screen, drawn.

##### [13:39.014](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=819.0137708333333)

Narration: And there is the exact phase over the top of that, never more than a few degrees from the hinges. Two curves, built out of nothing but four factors and a ruler.

Board: factors — a Block \[text\] that says "a gain of $2$, worth $6$ decibels one integrator a pole at $omega = 2$ a pole at $omega = 10$"; mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-285.0, -60.0), aspect=(8.0, 3.0)); head\_build — a Heading that says "Laying Down the Skeleton"; zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); seg\_one — a Line \[yellow\] labelled "-20" drawn in mag\_axes (start=(-1.0, 26.020599913279625), end=(0.3010299956639812, 0.0)); seg\_two — a Line \[yellow\] labelled "-40" drawn in mag\_axes (start=(0.3010299956639812, 0.0), end=(1.0, -13.979400086720375)); seg\_three — a Line \[yellow\] labelled "-60" drawn in mag\_axes (start=(1.0, -13.979400086720375), end=(2.0, -53.979400086720375)); mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); phase\_one — a Line \[yellow\] drawn in phase\_axes (start=(-1.0, -90.0), end=(-0.6989700043360187, -90.0)); phase\_two — a Line \[yellow\] drawn in phase\_axes (start=(-0.6989700043360187, -90.0), end=(0.0, -121.45365019512084)); phase\_three — a Line \[yellow\] drawn in phase\_axes (start=(0.0, -121.45365019512084), end=(1.3010299956639813, -238.54634980487916)); phase\_four — a Line \[yellow\] drawn in phase\_axes (start=(1.3010299956639813, -238.54634980487916), end=(2.0, -270.0)); phase\_curve — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>)

Actions:
- [13:48.464](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=828.4642708333333): factors is hidden from the screen — left the board.
- [13:48.464](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=828.4642708333333): head\_build is hidden from the screen — left the board.
- [13:48.464](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=828.4642708333333): mag\_work is hidden from the screen — left the board.

##### [13:49.064](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=829.0642708333334)

Narration: Two frequencies on these curves matter more than all the others, and the rest of the lecture is about them. The first is where the phase passes through minus one hundred and eighty degrees.

Board: mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-285.0, -60.0), aspect=(8.0, 3.0)); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); seg\_one — a Line \[yellow\] labelled "-20" drawn in mag\_axes (start=(-1.0, 26.020599913279625), end=(0.3010299956639812, 0.0)); seg\_two — a Line \[yellow\] labelled "-40" drawn in mag\_axes (start=(0.3010299956639812, 0.0), end=(1.0, -13.979400086720375)); seg\_three — a Line \[yellow\] labelled "-60" drawn in mag\_axes (start=(1.0, -13.979400086720375), end=(2.0, -53.979400086720375)); mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); phase\_one — a Line \[yellow\] drawn in phase\_axes (start=(-1.0, -90.0), end=(-0.6989700043360187, -90.0)); phase\_two — a Line \[yellow\] drawn in phase\_axes (start=(-0.6989700043360187, -90.0), end=(0.0, -121.45365019512084)); phase\_three — a Line \[yellow\] drawn in phase\_axes (start=(0.0, -121.45365019512084), end=(1.3010299956639813, -238.54634980487916)); phase\_four — a Line \[yellow\] drawn in phase\_axes (start=(1.3010299956639813, -238.54634980487916), end=(2.0, -270.0)); phase\_curve — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>)

Actions:
- [13:49.064](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=829.0642708333334): head\_cross is shown on the screen, written out.
- [13:56.948](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=836.9477708333333): minus\_180 is shown on the screen, written out.

##### [14:0.276](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=840.2762708333333)

Narration: You can find it exactly. Set the phase equal to minus one eighty. The integrator has already spent the ninety, so the two arctangents have to add up to ninety degrees between them.

Board: mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-285.0, -60.0), aspect=(8.0, 3.0)); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); seg\_one — a Line \[yellow\] labelled "-20" drawn in mag\_axes (start=(-1.0, 26.020599913279625), end=(0.3010299956639812, 0.0)); seg\_two — a Line \[yellow\] labelled "-40" drawn in mag\_axes (start=(0.3010299956639812, 0.0), end=(1.0, -13.979400086720375)); seg\_three — a Line \[yellow\] labelled "-60" drawn in mag\_axes (start=(1.0, -13.979400086720375), end=(2.0, -53.979400086720375)); mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); phase\_one — a Line \[yellow\] drawn in phase\_axes (start=(-1.0, -90.0), end=(-0.6989700043360187, -90.0)); phase\_two — a Line \[yellow\] drawn in phase\_axes (start=(-0.6989700043360187, -90.0), end=(0.0, -121.45365019512084)); phase\_three — a Line \[yellow\] drawn in phase\_axes (start=(0.0, -121.45365019512084), end=(1.3010299956639813, -238.54634980487916)); phase\_four — a Line \[yellow\] drawn in phase\_axes (start=(1.3010299956639813, -238.54634980487916), end=(2.0, -270.0)); phase\_curve — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); head\_cross — a Heading that says "The Two Crossover Frequencies"; minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-1.0, -180.0), end=(2.0, -180.0), dashed=True)

Actions:
- [14:2.575](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=842.5747708333333): cross\_work is shown on the screen, written out.
- [14:8.485](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=848.4847708333333): cross\_work is shown on the screen, written out.

##### [14:12.649](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=852.6487708333333)

Narration: Two angles summing to ninety means their tangents multiply to one, and running that through the addition formula leaves one minus omega squared over twenty equal to zero.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [14:18.036](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=858.0357708333333): cross\_work is shown on the screen, written out.

##### [14:23.582](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=863.5817708333333)

Narration: So the phase crosses minus one eighty at the square root of twenty, about four point four seven radians per second. Call it the phase crossover frequency. There it is on the curve.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [14:26.496](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=866.4957708333334): cross\_work is shown on the screen, written out.
- [14:28.284](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=868.2837708333333): pc\_guide is shown on the screen, written out.
- [14:34.031](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=874.0307708333332): pc\_dot is shown on the screen, written out.

##### [14:36.152](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=876.1517708333333)

Narration: The second frequency is where the magnitude passes through zero decibels, where the loop neither amplifies nor attenuates. The skeleton puts that at two radians per second, where its two segments straddle the axis.

Board: mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-285.0, -60.0), aspect=(8.0, 3.0)); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); seg\_one — a Line \[yellow\] labelled "-20" drawn in mag\_axes (start=(-1.0, 26.020599913279625), end=(0.3010299956639812, 0.0)); seg\_two — a Line \[yellow\] labelled "-40" drawn in mag\_axes (start=(0.3010299956639812, 0.0), end=(1.0, -13.979400086720375)); seg\_three — a Line \[yellow\] labelled "-60" drawn in mag\_axes (start=(1.0, -13.979400086720375), end=(2.0, -53.979400086720375)); mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); phase\_one — a Line \[yellow\] drawn in phase\_axes (start=(-1.0, -90.0), end=(-0.6989700043360187, -90.0)); phase\_two — a Line \[yellow\] drawn in phase\_axes (start=(-0.6989700043360187, -90.0), end=(0.0, -121.45365019512084)); phase\_three — a Line \[yellow\] drawn in phase\_axes (start=(0.0, -121.45365019512084), end=(1.3010299956639813, -238.54634980487916)); phase\_four — a Line \[yellow\] drawn in phase\_axes (start=(1.3010299956639813, -238.54634980487916), end=(2.0, -270.0)); phase\_curve — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); head\_cross — a Heading that says "The Two Crossover Frequencies"; minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-1.0, -180.0), end=(2.0, -180.0), dashed=True); pc\_guide — a Line \[red\] drawn in phase\_axes (start=(0.6505149978319906, -280.0), end=(0.6505149978319906, -70.0), dashed=True); pc\_dot — a PlotPoint \[red\] drawn in phase\_axes (target='phase\_curve', x=0.6505149978319906)

Actions:
- [14:43.978](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=883.9777708333334): point\_4 is shown on the screen, grown.
- [14:45.978](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=885.9777708333334): point\_4 is hidden from the screen.

##### [14:49.813](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=889.8132708333333)

Narration: The exact curve crosses lower, at about one point five six, and the gap is the three decibel corner error we already know about. Call that one the gain crossover frequency, and take the exact value, because we are about to measure a stability margin with it.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [14:52.623](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=892.6227708333333): gc\_line is shown on the screen, written out.
- [14:54.504](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=894.5037708333333): sketch\_gap is shown on the screen, written out.
- [14:59.148](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=899.1477708333333): gc\_guide is shown on the screen, written out.
- [15:1.516](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=901.5157708333334): gc\_dot is shown on the screen, written out.

##### [15:6.482](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=906.4817708333333)

Narration: Two frequencies, both read off curves we built by hand. Now let us close the loop and find out what they are worth.

Board: mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-285.0, -60.0), aspect=(8.0, 3.0)); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); seg\_one — a Line \[yellow\] labelled "-20" drawn in mag\_axes (start=(-1.0, 26.020599913279625), end=(0.3010299956639812, 0.0)); seg\_two — a Line \[yellow\] labelled "-40" drawn in mag\_axes (start=(0.3010299956639812, 0.0), end=(1.0, -13.979400086720375)); seg\_three — a Line \[yellow\] labelled "-60" drawn in mag\_axes (start=(1.0, -13.979400086720375), end=(2.0, -53.979400086720375)); mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); phase\_one — a Line \[yellow\] drawn in phase\_axes (start=(-1.0, -90.0), end=(-0.6989700043360187, -90.0)); phase\_two — a Line \[yellow\] drawn in phase\_axes (start=(-0.6989700043360187, -90.0), end=(0.0, -121.45365019512084)); phase\_three — a Line \[yellow\] drawn in phase\_axes (start=(0.0, -121.45365019512084), end=(1.3010299956639813, -238.54634980487916)); phase\_four — a Line \[yellow\] drawn in phase\_axes (start=(1.3010299956639813, -238.54634980487916), end=(2.0, -270.0)); phase\_curve — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); gc\_line — a Math \[text\] that says "$omega\_(upright("gc")) approx 1.56 quad (\|L\| = 1)$"; sketch\_gap — a Math \[text\] that says "$upright("skeleton says") thin 2.0, quad upright("exact") thin 1.56$"; head\_cross — a Heading that says "The Two Crossover Frequencies"; minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-1.0, -180.0), end=(2.0, -180.0), dashed=True); pc\_guide — a Line \[red\] drawn in phase\_axes (start=(0.6505149978319906, -280.0), end=(0.6505149978319906, -70.0), dashed=True); pc\_dot — a PlotPoint \[red\] drawn in phase\_axes (target='phase\_curve', x=0.6505149978319906); gc\_guide — a Line \[green\] drawn in mag\_axes (start=(0.19284611518884168, -85.0), end=(0.19284611518884168, 45.0), dashed=True); gc\_dot — a PlotPoint \[green\] drawn in mag\_axes (target='mag\_curve', x=0.19284611518884168)

Actions:
- [15:9.767](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=909.7667708333333): pc\_dot is indicated — a transient flash.
- [15:9.767](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=909.7667708333333): gc\_dot is indicated — a transient flash.
- [15:13.908](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=913.9084166666667): cross\_work is hidden from the screen — left the board.
- [15:13.908](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=913.9084166666667): gc\_line is hidden from the screen — left the board.
- [15:13.908](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=913.9084166666667): head\_cross is hidden from the screen — left the board.
- [15:13.908](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=913.9084166666667): mag\_axes is hidden from the screen — left the board.
- [15:13.908](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=913.9084166666667): zero\_db\_line is hidden from the screen — mag\_axes left the board.
- [15:13.908](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=913.9084166666667): seg\_one is hidden from the screen — mag\_axes left the board.
- [15:13.908](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=913.9084166666667): seg\_two is hidden from the screen — mag\_axes left the board.
- [15:13.908](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=913.9084166666667): seg\_three is hidden from the screen — mag\_axes left the board.
- [15:13.908](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=913.9084166666667): mag\_curve is hidden from the screen — mag\_axes left the board.
- [15:13.908](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=913.9084166666667): gc\_guide is hidden from the screen — mag\_axes left the board.
- [15:13.908](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=913.9084166666667): gc\_dot is hidden from the screen — mag\_axes left the board.
- [15:13.908](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=913.9084166666667): phase\_axes is hidden from the screen — left the board.
- [15:13.908](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=913.9084166666667): phase\_one is hidden from the screen — phase\_axes left the board.
- [15:13.908](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=913.9084166666667): phase\_two is hidden from the screen — phase\_axes left the board.
- [15:13.908](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=913.9084166666667): phase\_three is hidden from the screen — phase\_axes left the board.
- [15:13.908](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=913.9084166666667): phase\_four is hidden from the screen — phase\_axes left the board.
- [15:13.908](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=913.9084166666667): phase\_curve is hidden from the screen — phase\_axes left the board.
- [15:13.908](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=913.9084166666667): minus\_180 is hidden from the screen — phase\_axes left the board.
- [15:13.908](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=913.9084166666667): pc\_guide is hidden from the screen — phase\_axes left the board.
- [15:13.908](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=913.9084166666667): pc\_dot is hidden from the screen — phase\_axes left the board.
- [15:13.908](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=913.9084166666667): sketch\_gap is hidden from the screen — left the board.

### Scene 4: [Closing the Loop](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=914.9500833333334)

Span: 15:14.95–21:10.022 (914.9500833333334s–1270.0216666666668s).

#### Objects

- damped\_curve: a FunctionPlot \[blue\] labelled "K = 40" drawn in time\_axes (function=\<function\>)
- fed\_back: a FunctionPlot \[green\] drawn in loop\_axes (function=\<function\>)
- fed\_back\_big: a FunctionPlot \[green\] drawn in loop\_axes (function=\<function\>)
- gain\_note: a Math \[text\] that says "$K: quad 40 -\> 240 -\> 280$"
- gc\_guide\_mag: a Line \[green\] drawn in mag\_axes (start=(0.19284611518884168, -85.0), end=(0.19284611518884168, 45.0), dashed=True)
- gc\_guide\_phase: a Line \[green\] drawn in phase\_axes (start=(0.19284611518884168, -280.0), end=(0.19284611518884168, -70.0), dashed=True)
- gm\_bar: a Line \[green\] labelled "upright("GM")" drawn in mag\_axes (start=(0.6505149978319906, -15.563025007672874), end=(0.6505149978319906, 0.0))
- gm\_def: a Math \[text\] that says "$upright("GM") = frac(1, \|L(j omega\_(upright("pc"))))\|)$"
- gm\_val: a Math \[text\] that says "$upright("GM") = 6 approx 15.6 thin upright("dB")$"
- growing\_curve: a FunctionPlot \[red\] labelled "K = 280" drawn in time\_axes (function=\<function\>)
- head\_condition: a Heading that says "What Makes a Loop Sing"
- head\_margins: a Heading that says "The Two Margins"
- head\_push: a Heading that says "Pushing Past the Margin"
- inject: a FunctionPlot \[gray\] drawn in loop\_axes (function=\<function\>)
- lift: a VariableNumber
- loop\_axes: an Axes (x\_range=(0.0, 4.3), y\_range=(-1.35, 1.35), aspect=(6.0, 3.0))
- loop\_work: a Derivation \[text\] that says "$Y(s) &= frac(L(s), 1 + L(s)) R(s) \\ 1 + L(j omega) &= 0 \\ L(j omega) &= -1 \\ \|L\| = 1 quad & upright("and") quad angle L = -180 degree$"
- mag\_axes: an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0))
- mag\_curve: a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>)
- minus\_180: a Line \[gray\] drawn in phase\_axes (start=(-1.0, -180.0), end=(2.0, -180.0), dashed=True)
- pc\_dot: a PlotPoint \[red\] labelled "-15.6 thin upright("dB")" drawn in mag\_axes (target='mag\_curve', x=0.6505149978319906)
- pc\_guide\_mag: a Line \[red\] drawn in mag\_axes (start=(0.6505149978319906, -85.0), end=(0.6505149978319906, 45.0), dashed=True)
- pc\_guide\_phase: a Line \[red\] drawn in phase\_axes (start=(0.6505149978319906, -280.0), end=(0.6505149978319906, -70.0), dashed=True)
- period\_brace: a Brace \[yellow\] labelled "T = 1.4 thin upright("s")" drawn in time\_axes (x\_start=6.0, x\_end=7.404962946208145, y=-1.0)
- phase\_axes: an Axes (x\_range=(-1.0, 2.0), y\_range=(-285.0, -60.0), aspect=(8.0, 3.0))
- phase\_curve: a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>)
- pm\_bar: a Line \[green\] labelled "upright("PM")" drawn in phase\_axes (start=(0.19284611518884168, -180.0), end=(0.19284611518884168, -136.8))
- pm\_def: a Math \[text\] that says "$upright("PM") = 180 degree + angle L(j omega\_(upright("gc")))$"
- pm\_val: a Math \[text\] that says "$upright("PM") = 180 degree - 137 degree = 43 degree$"
- point: a Point \[yellow\] drawn in mag\_axes (location=(0.6505149978319906, 0.0))
- returned: a FunctionPlot \[blue\] drawn in loop\_axes (function=\<function\>)
- sustained\_curve: a FunctionPlot \[yellow\] labelled "K = 240" drawn in time\_axes (function=\<function\>)
- target: a Line \[gray\] drawn in time\_axes (start=(0.0, 1.0), end=(10.0, 1.0), dashed=True)
- time\_axes: an Axes (x\_range=(0.0, 10.0), y\_range=(-4.0, 6.0), aspect=(6.0, 4.0))
- zero\_db\_line: a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True)

#### Beats

##### [15:14.95](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=914.9500833333334)

Narration: Close the loop around that plant with unity negative feedback, and the closed loop transfer function is L over one plus L. Everything about stability is hiding in that denominator.

Board: Empty.

Actions:
- [15:14.95](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=914.9500833333334): head\_condition is shown on the screen, written out.
- [15:18.746](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=918.7460833333334): loop\_work is shown on the screen, written out.

##### [15:27.242](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=927.2415833333334)

Narration: The loop is on the edge of trouble when the denominator vanishes at some real frequency. That is one plus L of j omega equal to zero, which is L of j omega equal to minus one.

Board: head\_condition — a Heading that says "What Makes a Loop Sing"

Actions:
- [15:30.005](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=930.0050833333333): loop\_work is shown on the screen, written out.
- [15:38.573](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=938.5730833333334): loop\_work is shown on the screen, written out.

##### [15:40.381](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=940.3805833333334)

Narration: Now read minus one in polar form, because that is what a Bode plot shows you. Its magnitude is one, and its angle is minus one hundred and eighty degrees. Two conditions, and they have to hold at the same frequency.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [15:46.139](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=946.1390833333334): loop\_work is shown on the screen, written out.
- [15:47.799](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=947.7990833333334): loop\_work (the "\|L\| = 1" part) is emphasized.
- [15:51.828](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=951.8280833333334): loop\_work (the "angle L = -180 degree" part) is emphasized.
- [15:51.828](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=951.8280833333334): loop\_work (the "\|L\| = 1" part) is no longer emphasized.
- [15:55.288](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=955.2875833333334): loop\_work (the "angle L = -180 degree" part) is no longer emphasized.

##### [15:55.888](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=955.8875833333334)

Narration: Let me show you what that actually means physically, because the algebra hides it. Break the loop, and inject a sine wave at the phase crossover frequency, four point four seven radians per second. That is the grey wave.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [16:1.448](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=961.4480833333334): loop\_axes is shown on the screen, written out.
- [16:10.028](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=970.0280833333334): inject is shown on the screen, written out.

##### [16:11.708](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=971.7075833333334)

Narration: Send it round the plant. What comes back is the blue wave. It is one sixth the size, because we measured that magnitude, and it is upside down, because the phase there is minus one eighty. Half a cycle of delay is exactly an inversion.

Board: loop\_axes — an Axes (x\_range=(0.0, 4.3), y\_range=(-1.35, 1.35), aspect=(6.0, 3.0)); head\_condition — a Heading that says "What Makes a Loop Sing"; inject — a FunctionPlot \[gray\] drawn in loop\_axes (function=\<function\>)

Actions:
- [16:15.086](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=975.0860833333334): returned is shown on the screen, written out.
- [16:20.891](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=980.8910833333334): returned is indicated — a transient flash.

##### [16:29.084](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=989.0840833333334)

Narration: And now the summing junction does its job. Negative feedback subtracts, which flips that wave over one more time. So what actually gets added back in is the green wave, and look where it sits. It is in phase with what we injected. Perfectly, exactly in phase.

Board: loop\_axes — an Axes (x\_range=(0.0, 4.3), y\_range=(-1.35, 1.35), aspect=(6.0, 3.0)); head\_condition — a Heading that says "What Makes a Loop Sing"; inject — a FunctionPlot \[gray\] drawn in loop\_axes (function=\<function\>); returned — a FunctionPlot \[blue\] drawn in loop\_axes (function=\<function\>)

Actions:
- [16:39.626](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=999.6260833333334): fed\_back is shown on the screen, written out.
- [16:43.121](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1003.1210833333334): fed\_back is indicated — a transient flash.

##### [16:48.597](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1008.5970833333334)

Narration: That is the whole danger of this frequency. Everywhere else the returning signal partly cancels what is already there. Here it reinforces it. The only thing saving us is the size.

Board: loop\_axes — an Axes (x\_range=(0.0, 4.3), y\_range=(-1.35, 1.35), aspect=(6.0, 3.0)); head\_condition — a Heading that says "What Makes a Loop Sing"; inject — a FunctionPlot \[gray\] drawn in loop\_axes (function=\<function\>); returned — a FunctionPlot \[blue\] drawn in loop\_axes (function=\<function\>); fed\_back — a FunctionPlot \[green\] drawn in loop\_axes (function=\<function\>)

Actions:
- [16:56.48](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1016.4800833333334): inject is indicated — a transient flash.

##### [17:1.028](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1021.0275833333334)

Narration: It comes back one sixth as tall, so each trip round the loop it shrinks, and the ringing dies away. But suppose we multiplied the gain by six. Then it would come back exactly the same size it went in.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [17:9.804](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1029.8040833333334): fed\_back\_big is shown on the screen, drawn.

##### [17:14.886](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1034.8855833333334)

Narration: And there it is, landing precisely on top of the wave we injected. At that point the loop no longer needs us. It can sustain that oscillation with no input at all, forever.

Board: loop\_axes — an Axes (x\_range=(0.0, 4.3), y\_range=(-1.35, 1.35), aspect=(6.0, 3.0)); head\_condition — a Heading that says "What Makes a Loop Sing"; inject — a FunctionPlot \[gray\] drawn in loop\_axes (function=\<function\>); returned — a FunctionPlot \[blue\] drawn in loop\_axes (function=\<function\>); fed\_back — a FunctionPlot \[green\] drawn in loop\_axes (function=\<function\>); fed\_back\_big — a FunctionPlot \[green\] drawn in loop\_axes (function=\<function\>)

Actions:
- [17:16.325](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1036.3250833333334): inject is indicated — a transient flash.
- [17:26.868](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1046.8675833333334): head\_condition is hidden from the screen — left the board.
- [17:26.868](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1046.8675833333334): loop\_axes is hidden from the screen — left the board.
- [17:26.868](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1046.8675833333334): inject is hidden from the screen — loop\_axes left the board.
- [17:26.868](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1046.8675833333334): returned is hidden from the screen — loop\_axes left the board.
- [17:26.868](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1046.8675833333334): fed\_back is hidden from the screen — loop\_axes left the board.
- [17:26.868](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1046.8675833333334): fed\_back\_big is hidden from the screen — loop\_axes left the board.
- [17:26.868](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1046.8675833333334): loop\_work is hidden from the screen — left the board.

##### [17:27.468](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1047.4675833333333)

Narration: So the factor six is a real quantity, and it has a name. It is the gain margin: how much you may multiply the loop gain by before the returning wave comes back full size.

Board: Empty.

Actions:
- [17:27.468](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1047.4675833333333): head\_margins is shown on the screen, written out.
- [17:28.153](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1048.1530833333334): mag\_axes is shown on the screen, written out.
- [17:28.153](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1048.1530833333334): phase\_axes is shown on the screen, written out.
- [17:29.604](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1049.6040833333334): mag\_curve is shown on the screen, drawn.
- [17:29.604](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1049.6040833333334): phase\_curve is shown on the screen, drawn.
- [17:32.239](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1052.2390833333334): zero\_db\_line is shown on the screen, written out.
- [17:32.239](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1052.2390833333334): minus\_180 is shown on the screen, written out.

##### [17:38.877](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1058.8765833333334)

Narration: You read it off the plots in two steps. Find the frequency where the phase curve crosses minus one eighty. Drop straight up to the magnitude curve. Whatever gap you find between there and zero decibels is the gain margin.

Board: mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-285.0, -60.0), aspect=(8.0, 3.0)); head\_margins — a Heading that says "The Two Margins"; mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); phase\_curve — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-1.0, -180.0), end=(2.0, -180.0), dashed=True)

Actions:
- [17:43.776](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1063.7760833333334): pc\_guide\_phase is shown on the screen, written out.
- [17:46.109](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1066.1090833333333): pc\_guide\_mag is shown on the screen, written out.
- [17:47.166](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1067.1660833333333): pc\_dot is shown on the screen, written out.
- [17:49.186](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1069.1860833333335): gm\_bar is shown on the screen, written out.

##### [17:53.594](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1073.5940833333334)

Narration: Here that gap measures fifteen point six decibels. And fifteen point six decibels is a factor of six, which is exactly the number we found by hand a moment ago.

Board: mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-285.0, -60.0), aspect=(8.0, 3.0)); head\_margins — a Heading that says "The Two Margins"; mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); phase\_curve — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-1.0, -180.0), end=(2.0, -180.0), dashed=True); pc\_guide\_phase — a Line \[red\] drawn in phase\_axes (start=(0.6505149978319906, -280.0), end=(0.6505149978319906, -70.0), dashed=True); pc\_guide\_mag — a Line \[red\] drawn in mag\_axes (start=(0.6505149978319906, -85.0), end=(0.6505149978319906, 45.0), dashed=True); pc\_dot — a PlotPoint \[red\] labelled "-15.6 thin upright("dB")" drawn in mag\_axes (target='mag\_curve', x=0.6505149978319906); gm\_bar — a Line \[green\] labelled "upright("GM")" drawn in mag\_axes (start=(0.6505149978319906, -15.563025007672874), end=(0.6505149978319906, 0.0))

Actions:
- [17:54.453](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1074.4530833333333): gm\_def is shown on the screen, written out.
- [17:59.677](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1079.6770833333335): gm\_val is shown on the screen, written out.
- [18:1.918](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1081.9180833333335): gm\_val (the "6" part) is emphasized.
- [18:4.426](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1084.4260833333333): gm\_val (the "6" part) is no longer emphasized.

##### [18:5.026](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1085.0260833333334)

Narration: The other margin runs the same procedure the other way round. Start on the magnitude curve, at the frequency where it crosses zero decibels, one point five six. Drop down to the phase curve there.

Board: gm\_def — a Math \[text\] that says "$upright("GM") = frac(1, \|L(j omega\_(upright("pc"))))\|)$"; gm\_val — a Math \[text\] that says "$upright("GM") = 6 approx 15.6 thin upright("dB")$"; mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-285.0, -60.0), aspect=(8.0, 3.0)); head\_margins — a Heading that says "The Two Margins"; mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); phase\_curve — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-1.0, -180.0), end=(2.0, -180.0), dashed=True); pc\_guide\_phase — a Line \[red\] drawn in phase\_axes (start=(0.6505149978319906, -280.0), end=(0.6505149978319906, -70.0), dashed=True); pc\_guide\_mag — a Line \[red\] drawn in mag\_axes (start=(0.6505149978319906, -85.0), end=(0.6505149978319906, 45.0), dashed=True); pc\_dot — a PlotPoint \[red\] labelled "-15.6 thin upright("dB")" drawn in mag\_axes (target='mag\_curve', x=0.6505149978319906); gm\_bar — a Line \[green\] labelled "upright("GM")" drawn in mag\_axes (start=(0.6505149978319906, -15.563025007672874), end=(0.6505149978319906, 0.0))

Actions:
- [18:12.12](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1092.1200833333335): gc\_guide\_mag is shown on the screen, written out.
- [18:15.742](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1095.7420833333333): gc\_guide\_phase is shown on the screen, written out.

##### [18:18.49](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1098.4900833333334)

Narration: The phase reads minus one hundred and thirty seven degrees. So we are forty three degrees short of minus one eighty, and that is the phase margin: how much extra lag you could pour into this loop before it sang.

Board: gm\_def — a Math \[text\] that says "$upright("GM") = frac(1, \|L(j omega\_(upright("pc"))))\|)$"; gm\_val — a Math \[text\] that says "$upright("GM") = 6 approx 15.6 thin upright("dB")$"; mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-285.0, -60.0), aspect=(8.0, 3.0)); head\_margins — a Heading that says "The Two Margins"; mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); phase\_curve — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-1.0, -180.0), end=(2.0, -180.0), dashed=True); pc\_guide\_phase — a Line \[red\] drawn in phase\_axes (start=(0.6505149978319906, -280.0), end=(0.6505149978319906, -70.0), dashed=True); pc\_guide\_mag — a Line \[red\] drawn in mag\_axes (start=(0.6505149978319906, -85.0), end=(0.6505149978319906, 45.0), dashed=True); pc\_dot — a PlotPoint \[red\] labelled "-15.6 thin upright("dB")" drawn in mag\_axes (target='mag\_curve', x=0.6505149978319906); gm\_bar — a Line \[green\] labelled "upright("GM")" drawn in mag\_axes (start=(0.6505149978319906, -15.563025007672874), end=(0.6505149978319906, 0.0)); gc\_guide\_mag — a Line \[green\] drawn in mag\_axes (start=(0.19284611518884168, -85.0), end=(0.19284611518884168, 45.0), dashed=True); gc\_guide\_phase — a Line \[green\] drawn in phase\_axes (start=(0.19284611518884168, -280.0), end=(0.19284611518884168, -70.0), dashed=True)

Actions:
- [18:23.215](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1103.2150833333333): pm\_bar is shown on the screen, written out.
- [18:26.908](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1106.9080833333333): pm\_def is shown on the screen, written out.
- [18:28.986](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1108.9860833333335): pm\_val is shown on the screen, written out.

##### [18:33.127](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1113.1270833333333)

Narration: And that second one is usually the number engineers care about more, because extra lag arrives whether you asked for it or not. A transport delay, a filter you forgot, an actuator that is slower than the model says. All of it eats phase margin, and none of it touches gain margin.

Board: gm\_def — a Math \[text\] that says "$upright("GM") = frac(1, \|L(j omega\_(upright("pc"))))\|)$"; gm\_val — a Math \[text\] that says "$upright("GM") = 6 approx 15.6 thin upright("dB")$"; pm\_def — a Math \[text\] that says "$upright("PM") = 180 degree + angle L(j omega\_(upright("gc")))$"; pm\_val — a Math \[text\] that says "$upright("PM") = 180 degree - 137 degree = 43 degree$"; mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-285.0, -60.0), aspect=(8.0, 3.0)); head\_margins — a Heading that says "The Two Margins"; mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); phase\_curve — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-1.0, -180.0), end=(2.0, -180.0), dashed=True); pc\_guide\_phase — a Line \[red\] drawn in phase\_axes (start=(0.6505149978319906, -280.0), end=(0.6505149978319906, -70.0), dashed=True); pc\_guide\_mag — a Line \[red\] drawn in mag\_axes (start=(0.6505149978319906, -85.0), end=(0.6505149978319906, 45.0), dashed=True); pc\_dot — a PlotPoint \[red\] labelled "-15.6 thin upright("dB")" drawn in mag\_axes (target='mag\_curve', x=0.6505149978319906); gm\_bar — a Line \[green\] labelled "upright("GM")" drawn in mag\_axes (start=(0.6505149978319906, -15.563025007672874), end=(0.6505149978319906, 0.0)); gc\_guide\_mag — a Line \[green\] drawn in mag\_axes (start=(0.19284611518884168, -85.0), end=(0.19284611518884168, 45.0), dashed=True); gc\_guide\_phase — a Line \[green\] drawn in phase\_axes (start=(0.19284611518884168, -280.0), end=(0.19284611518884168, -70.0), dashed=True); pm\_bar — a Line \[green\] labelled "upright("PM")" drawn in phase\_axes (start=(0.19284611518884168, -180.0), end=(0.19284611518884168, -136.8))

Actions:
- [18:48.301](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1128.3010833333333): pm\_bar is indicated — a transient flash.

##### [18:52.372](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1132.3720833333334)

Narration: Forty three degrees and a factor of six. Now let me spend them.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [18:56.192](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1136.1920833333334): gc\_guide\_mag is hidden from the screen.
- [18:56.192](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1136.1920833333334): gc\_guide\_phase is hidden from the screen.
- [18:56.192](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1136.1920833333334): gm\_bar is hidden from the screen.
- [18:56.192](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1136.1920833333334): pm\_bar is hidden from the screen.
- [18:57.132](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1137.1320833333334): gm\_def is hidden from the screen — left the board.
- [18:57.132](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1137.1320833333334): gm\_val is hidden from the screen — left the board.
- [18:57.132](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1137.1320833333334): head\_margins is hidden from the screen — left the board.
- [18:57.132](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1137.1320833333334): pm\_def is hidden from the screen — left the board.
- [18:57.132](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1137.1320833333334): pm\_val is hidden from the screen — left the board.

##### [18:57.732](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1137.7320833333333)

Narration: First, what a gain change does to these two curves, because it is the simplest thing in the subject. Multiplying by a constant adds a constant number of decibels at every frequency, so the magnitude curve moves bodily upward. Its shape does not change at all.

Board: mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-285.0, -60.0), aspect=(8.0, 3.0)); mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); phase\_curve — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-1.0, -180.0), end=(2.0, -180.0), dashed=True); pc\_guide\_phase — a Line \[red\] drawn in phase\_axes (start=(0.6505149978319906, -280.0), end=(0.6505149978319906, -70.0), dashed=True); pc\_guide\_mag — a Line \[red\] drawn in mag\_axes (start=(0.6505149978319906, -85.0), end=(0.6505149978319906, 45.0), dashed=True); pc\_dot — a PlotPoint \[red\] labelled "-15.6 thin upright("dB")" drawn in mag\_axes (target='mag\_curve', x=0.6505149978319906)

Actions:
- [18:57.732](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1137.7320833333333): head\_push is shown on the screen, written out.
- [19:4.233](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1144.2330833333333): gain\_note is shown on the screen, written out.

##### [19:15.016](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1155.0155833333333)

Narration: And a positive constant has no angle, so the phase curve does not move by one degree. Watch it. It will sit perfectly still through everything that follows, which is why the phase crossover frequency never moves either.

Board: mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-285.0, -60.0), aspect=(8.0, 3.0)); mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); phase\_curve — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-1.0, -180.0), end=(2.0, -180.0), dashed=True); pc\_guide\_phase — a Line \[red\] drawn in phase\_axes (start=(0.6505149978319906, -280.0), end=(0.6505149978319906, -70.0), dashed=True); pc\_guide\_mag — a Line \[red\] drawn in mag\_axes (start=(0.6505149978319906, -85.0), end=(0.6505149978319906, 45.0), dashed=True); pc\_dot — a PlotPoint \[red\] labelled "-15.6 thin upright("dB")" drawn in mag\_axes (target='mag\_curve', x=0.6505149978319906); gain\_note — a Math \[text\] that says "$K: quad 40 -\> 240 -\> 280$"; head\_push — a Heading that says "Pushing Past the Margin"

Actions:
- [19:22.956](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1162.9560833333335): phase\_curve is indicated — a transient flash.

##### [19:28.688](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1168.6880833333335)

Narration: Now lift the gain by our whole margin, a factor of six, fifteen point six decibels. Up goes the magnitude curve, and it keeps its shape exactly.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [19:29.454](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1169.4540833333333): mag\_curve is redrawn as the numbers it depends on change.
- [19:29.454](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1169.4540833333333): lift ticks to 15.563025007672874.

##### [19:39.435](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1179.4350833333333)

Narration: And look what has happened at the phase crossover. The point that was fifteen point six decibels down is now sitting exactly on zero. The gain crossover and the phase crossover have arrived at the same frequency.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [19:45.832](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1185.8320833333332): pc\_dot: one name gives way to another over the same drawing (label\_becomes).
- [19:51.184](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1191.1840833333333): point is shown on the screen, grown.

##### [19:53.154](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1193.1540833333333)

Narration: Both conditions for minus one now hold together, and here is what that does in the time domain. This is the closed loop answering a step, at the original gain of forty. Some overshoot, a couple of swings, settled inside five seconds.

Board: mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-285.0, -60.0), aspect=(8.0, 3.0)); mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); phase\_curve — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-1.0, -180.0), end=(2.0, -180.0), dashed=True); pc\_guide\_phase — a Line \[red\] drawn in phase\_axes (start=(0.6505149978319906, -280.0), end=(0.6505149978319906, -70.0), dashed=True); pc\_guide\_mag — a Line \[red\] drawn in mag\_axes (start=(0.6505149978319906, -85.0), end=(0.6505149978319906, 45.0), dashed=True); pc\_dot — a PlotPoint \[red\] labelled "-15.6 thin upright("dB")" drawn in mag\_axes (target='mag\_curve', x=0.6505149978319906); gain\_note — a Math \[text\] that says "$K: quad 40 -\> 240 -\> 280$"; head\_push — a Heading that says "Pushing Past the Margin"; point — a Point \[yellow\] drawn in mag\_axes (location=(0.6505149978319906, 0.0))

Actions:
- [19:53.184](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1193.1840833333333): point is hidden from the screen.
- [19:58.088](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1198.0880833333333): time\_axes is shown on the screen, written out.
- [20:1.374](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1201.3740833333334): target is shown on the screen, written out.
- [20:3.162](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1203.1620833333334): damped\_curve is shown on the screen, drawn.

##### [20:9.335](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1209.3350833333334)

Narration: And this is the same loop with the gain multiplied by six, at two hundred and forty. It never settles. It never diverges either. It just rings, with the same amplitude, indefinitely.

Board: mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-285.0, -60.0), aspect=(8.0, 3.0)); mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); phase\_curve — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-1.0, -180.0), end=(2.0, -180.0), dashed=True); pc\_guide\_phase — a Line \[red\] drawn in phase\_axes (start=(0.6505149978319906, -280.0), end=(0.6505149978319906, -70.0), dashed=True); pc\_guide\_mag — a Line \[red\] drawn in mag\_axes (start=(0.6505149978319906, -85.0), end=(0.6505149978319906, 45.0), dashed=True); pc\_dot — a PlotPoint \[red\] labelled "-15.6 thin upright("dB")" drawn in mag\_axes (target='mag\_curve', x=0.6505149978319906); gain\_note — a Math \[text\] that says "$K: quad 40 -\> 240 -\> 280$"; time\_axes — an Axes (x\_range=(0.0, 10.0), y\_range=(-4.0, 6.0), aspect=(6.0, 4.0)); head\_push — a Heading that says "Pushing Past the Margin"; target — a Line \[gray\] drawn in time\_axes (start=(0.0, 1.0), end=(10.0, 1.0), dashed=True); damped\_curve — a FunctionPlot \[blue\] labelled "K = 40" drawn in time\_axes (function=\<function\>)

Actions:
- [20:19.331](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1219.3310833333335): sustained\_curve is shown on the screen, drawn.

##### [20:23.611](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1223.6110833333335)

Narration: Measure the period of that ringing. It is one point four seconds, and two pi over four point four seven is one point four. The loop is oscillating at precisely the frequency we identified on the phase plot, using nothing but arctangents.

Board: mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-285.0, -60.0), aspect=(8.0, 3.0)); mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); phase\_curve — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-1.0, -180.0), end=(2.0, -180.0), dashed=True); pc\_guide\_phase — a Line \[red\] drawn in phase\_axes (start=(0.6505149978319906, -280.0), end=(0.6505149978319906, -70.0), dashed=True); pc\_guide\_mag — a Line \[red\] drawn in mag\_axes (start=(0.6505149978319906, -85.0), end=(0.6505149978319906, 45.0), dashed=True); pc\_dot — a PlotPoint \[red\] labelled "-15.6 thin upright("dB")" drawn in mag\_axes (target='mag\_curve', x=0.6505149978319906); gain\_note — a Math \[text\] that says "$K: quad 40 -\> 240 -\> 280$"; time\_axes — an Axes (x\_range=(0.0, 10.0), y\_range=(-4.0, 6.0), aspect=(6.0, 4.0)); head\_push — a Heading that says "Pushing Past the Margin"; target — a Line \[gray\] drawn in time\_axes (start=(0.0, 1.0), end=(10.0, 1.0), dashed=True); damped\_curve — a FunctionPlot \[blue\] labelled "K = 40" drawn in time\_axes (function=\<function\>); sustained\_curve — a FunctionPlot \[yellow\] labelled "K = 240" drawn in time\_axes (function=\<function\>)

Actions:
- [20:24.725](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1224.7250833333333): period\_brace is shown on the screen, written out.
- [20:35.929](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1235.9290833333334): pc\_guide\_phase is indicated — a transient flash.

##### [20:39.757](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1239.7570833333334)

Narration: Push a little further, to two hundred and eighty, which is past the margin, and the oscillation grows instead of holding. The closed loop poles have crossed into the right half plane, and the frequency response of the open loop told us the exact moment it would happen.

Board: mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-285.0, -60.0), aspect=(8.0, 3.0)); mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); phase\_curve — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-1.0, -180.0), end=(2.0, -180.0), dashed=True); pc\_guide\_phase — a Line \[red\] drawn in phase\_axes (start=(0.6505149978319906, -280.0), end=(0.6505149978319906, -70.0), dashed=True); pc\_guide\_mag — a Line \[red\] drawn in mag\_axes (start=(0.6505149978319906, -85.0), end=(0.6505149978319906, 45.0), dashed=True); pc\_dot — a PlotPoint \[red\] labelled "-15.6 thin upright("dB")" drawn in mag\_axes (target='mag\_curve', x=0.6505149978319906); gain\_note — a Math \[text\] that says "$K: quad 40 -\> 240 -\> 280$"; time\_axes — an Axes (x\_range=(0.0, 10.0), y\_range=(-4.0, 6.0), aspect=(6.0, 4.0)); head\_push — a Heading that says "Pushing Past the Margin"; target — a Line \[gray\] drawn in time\_axes (start=(0.0, 1.0), end=(10.0, 1.0), dashed=True); damped\_curve — a FunctionPlot \[blue\] labelled "K = 40" drawn in time\_axes (function=\<function\>); sustained\_curve — a FunctionPlot \[yellow\] labelled "K = 240" drawn in time\_axes (function=\<function\>); period\_brace — a Brace \[yellow\] labelled "T = 1.4 thin upright("s")" drawn in time\_axes (x\_start=6.0, x\_end=7.404962946208145, y=-1.0)

Actions:
- [20:44.935](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1244.9350833333333): growing\_curve is shown on the screen, drawn.

##### [20:55.578](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1255.5780833333333)

Narration: So the margins are not bookkeeping. They are the distance, measured in decibels and in degrees, between the loop you have and a loop that sings on its own. What is left is to buy some of that distance back.

Board: mag\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-90.0, 50.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-1.0, 2.0), y\_range=(-285.0, -60.0), aspect=(8.0, 3.0)); mag\_curve — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); phase\_curve — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-1.0, 0.0), end=(2.0, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-1.0, -180.0), end=(2.0, -180.0), dashed=True); pc\_guide\_phase — a Line \[red\] drawn in phase\_axes (start=(0.6505149978319906, -280.0), end=(0.6505149978319906, -70.0), dashed=True); pc\_guide\_mag — a Line \[red\] drawn in mag\_axes (start=(0.6505149978319906, -85.0), end=(0.6505149978319906, 45.0), dashed=True); pc\_dot — a PlotPoint \[red\] labelled "-15.6 thin upright("dB")" drawn in mag\_axes (target='mag\_curve', x=0.6505149978319906); gain\_note — a Math \[text\] that says "$K: quad 40 -\> 240 -\> 280$"; time\_axes — an Axes (x\_range=(0.0, 10.0), y\_range=(-4.0, 6.0), aspect=(6.0, 4.0)); head\_push — a Heading that says "Pushing Past the Margin"; target — a Line \[gray\] drawn in time\_axes (start=(0.0, 1.0), end=(10.0, 1.0), dashed=True); damped\_curve — a FunctionPlot \[blue\] labelled "K = 40" drawn in time\_axes (function=\<function\>); sustained\_curve — a FunctionPlot \[yellow\] labelled "K = 240" drawn in time\_axes (function=\<function\>); period\_brace — a Brace \[yellow\] labelled "T = 1.4 thin upright("s")" drawn in time\_axes (x\_start=6.0, x\_end=7.404962946208145, y=-1.0); growing\_curve — a FunctionPlot \[red\] labelled "K = 280" drawn in time\_axes (function=\<function\>)

Actions:
- [20:58.585](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1258.5850833333334): mag\_curve is redrawn as the numbers it depends on change.
- [20:58.585](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1258.5850833333334): lift ticks to 0.0.
- [21:8.98](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1268.98): gain\_note is hidden from the screen — left the board.
- [21:8.98](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1268.98): head\_push is hidden from the screen — left the board.
- [21:8.98](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1268.98): mag\_axes is hidden from the screen — left the board.
- [21:8.98](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1268.98): mag\_curve is hidden from the screen — mag\_axes left the board.
- [21:8.98](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1268.98): zero\_db\_line is hidden from the screen — mag\_axes left the board.
- [21:8.98](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1268.98): pc\_guide\_mag is hidden from the screen — mag\_axes left the board.
- [21:8.98](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1268.98): pc\_dot is hidden from the screen — mag\_axes left the board.
- [21:8.98](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1268.98): phase\_axes is hidden from the screen — left the board.
- [21:8.98](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1268.98): phase\_curve is hidden from the screen — phase\_axes left the board.
- [21:8.98](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1268.98): minus\_180 is hidden from the screen — phase\_axes left the board.
- [21:8.98](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1268.98): pc\_guide\_phase is hidden from the screen — phase\_axes left the board.
- [21:8.98](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1268.98): time\_axes is hidden from the screen — left the board.
- [21:8.98](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1268.98): target is hidden from the screen — time\_axes left the board.
- [21:8.98](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1268.98): damped\_curve is hidden from the screen — time\_axes left the board.
- [21:8.98](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1268.98): sustained\_curve is hidden from the screen — time\_axes left the board.
- [21:8.98](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1268.98): period\_brace is hidden from the screen — time\_axes left the board.
- [21:8.98](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1268.98): growing\_curve is hidden from the screen — time\_axes left the board.

### Scene 5: [Lag and Lead](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1270.0216666666668)

Span: 21:10.022–27:40.046 (1270.0216666666668s–1660.0463958333335s).

#### Objects

- closing: a Panel that says "Both sections are the same two factors we met earlier: one zero and one pole. Which of them comes first is the whole difference."
- gc\_lag\_ang: a Line \[green\] drawn in phase\_axes (start=(-0.3142582613977364, -280.0), end=(-0.3142582613977364, 55.0), dashed=True)
- gc\_lag\_mag: a Line \[green\] drawn in mag\_axes (start=(-0.3142582613977364, -75.0), end=(-0.3142582613977364, 55.0), dashed=True)
- gc\_lead\_ang: a Line \[green\] drawn in phase\_axes (start=(0.42324587393680785, -280.0), end=(0.42324587393680785, 55.0), dashed=True)
- gc\_lead\_mag: a Line \[green\] drawn in mag\_axes (start=(0.42324587393680785, -75.0), end=(0.42324587393680785, 55.0), dashed=True)
- gc\_now\_mag: a Line \[gray\] drawn in mag\_axes (start=(0.19284611518884168, -75.0), end=(0.19284611518884168, 55.0), dashed=True)
- head\_forms: a Heading that says "Two Ways to Bend the Curves"
- head\_lag: a Heading that says "The Lag: Cut the Gain, Keep the Phase"
- head\_lead: a Heading that says "The Lead: Buy Phase Where It Counts"
- head\_summary: a Heading that says "The Two Trades"
- lag\_ang: a FunctionPlot \[yellow\] drawn in phase\_axes (function=\<function\>)
- lag\_form: a Math \[text\] that says "$C(s) = frac(1 + s / 0.05, 1 + s / 0.0125)$"
- lag\_mag: a FunctionPlot \[yellow\] drawn in mag\_axes (function=\<function\>)
- lag\_where: a Text \[text\] that says "The pole comes first, so the section is worth $1$ at low frequency and less than $1$ above the zero."
- lag\_work: a Derivation \[text\] that says "$upright("high frequency gain") &= frac(0.0125, 0.05) = frac(1, 4) \\ &= -12 thin upright("dB") \\ omega\_(upright("gc")): quad 1.56 &-\> 0.49 \\ upright("PM"): quad 43 degree &-\> 69 degree \\ upright("GM"): quad 15.6 &-\> 27.6 thin upright("dB")$"
- lagged\_ang: a FunctionPlot \[green\] drawn in phase\_axes (function=\<function\>)
- lagged\_mag: a FunctionPlot \[green\] drawn in mag\_axes (function=\<function\>)
- lead\_ang: a FunctionPlot \[yellow\] drawn in phase\_axes (function=\<function\>)
- lead\_form: a Math \[text\] that says "$C(s) = frac(1 + s / 1.2, 1 + s / 7.2)$"
- lead\_mag: a FunctionPlot \[yellow\] drawn in mag\_axes (function=\<function\>)
- lead\_where: a Text \[text\] that says "The zero comes first, so the section is worth $1$ at low frequency and more than $1$ above the pole."
- lead\_work: a Derivation \[text\] that says "$alpha = frac(1.2, 7.2) = frac(1, 6) quad &-\> quad phi\_m = 46 degree \\ omega\_m = sqrt(1.2 dot.op 7.2) &= 2.94 \\ omega\_(upright("gc")): quad 1.56 &-\> 2.65 \\ upright("PM"): quad 43 degree &-\> 68 degree \\ upright("GM"): quad 15.6 &-\> 15.9 thin…$"
- led\_ang: a FunctionPlot \[green\] drawn in phase\_axes (function=\<function\>)
- led\_mag: a FunctionPlot \[green\] drawn in mag\_axes (function=\<function\>)
- left\_label: a Tex \[text\] that says "Lag compensator" (underline=True)
- mag\_axes: an Axes (x\_range=(-2.0, 1.5), y\_range=(-80.0, 60.0), aspect=(8.0, 3.0))
- minus\_180: a Line \[gray\] drawn in phase\_axes (start=(-2.0, -180.0), end=(1.5, -180.0), dashed=True)
- phase\_axes: an Axes (x\_range=(-2.0, 1.5), y\_range=(-285.0, 60.0), aspect=(8.0, 3.0))
- plant\_ang: a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>)
- plant\_mag: a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>)
- point: a Point \[yellow\] drawn in mag\_axes (location=(0.0, -12.04))
- point\_2: a Point \[yellow\] drawn in phase\_axes (location=(-1.6020599913279623, -30.0))
- point\_3: a Point \[yellow\] drawn in phase\_axes (location=(-0.3142582613977364, -110.8))
- point\_4: a Point \[yellow\] drawn in phase\_axes (location=(0.6505149978319906, -180.0))
- point\_5: a Point \[yellow\] drawn in phase\_axes (location=(0.46834733041215726, 45.6))
- point\_6: a Point \[yellow\] drawn in phase\_axes (location=(0.42324587393680785, -112.4))
- right\_label: a Tex \[text\] that says "Lead compensator" (underline=True)
- summary: a Table \[text\] that says "Lag Lead Magnitude cuts the high end lifts the high end Phase a small dip, parked low a bump of up to $+90 degree$ Crossover moves down moves up Buys margin by slowing the loop adding phase at crossover" (rows=(('', 'Lag', 'Lead'), ('Magnitude', 'cuts the high end', 'lifts…, header=True)
- zero\_db\_line: a Line \[gray\] drawn in mag\_axes (start=(-2.0, 0.0), end=(1.5, 0.0), dashed=True)

#### Beats

##### [21:10.022](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1270.0216666666668)

Narration: Everything so far has been diagnosis. We took a plant apart, drew its two curves, and read two margins off them. Now let us change those curves on purpose, with the two simplest tools there are.

Board: Empty.

Actions:
- [21:10.022](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1270.0216666666668): head\_forms is shown on the screen, written out.

##### [21:22.731](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1282.7306666666668)

Narration: Both of them are one zero and one pole. That is all. And the only thing that distinguishes them is which of the two sits at the lower frequency.

Board: head\_forms — a Heading that says "Two Ways to Bend the Curves"

Actions:
- [21:23.033](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1283.0326666666667): left\_label is shown on the screen, written out.
- [21:23.033](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1283.0326666666667): right\_label is shown on the screen, written out.

##### [21:32.329](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1292.3291666666667)

Narration: Put the pole first, below the zero, and you have a lag compensator. At zero frequency the two brackets are both one, so it does nothing. Above the zero, the denominator has grown more than the numerator, so it attenuates.

Board: left\_label — a Tex \[text\] that says "Lag compensator" (underline=True); right\_label — a Tex \[text\] that says "Lead compensator" (underline=True); head\_forms — a Heading that says "Two Ways to Bend the Curves"

Actions:
- [21:35.325](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1295.3246666666669): lag\_form is shown on the screen, written out.
- [21:45.529](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1305.5286666666668): lag\_where is shown on the screen, written out.

##### [21:47.221](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1307.2206666666668)

Narration: Put the zero first instead, below the pole, and you have a lead compensator. Again it is worth one at zero frequency, but now above the pole the numerator has won, so it amplifies. And in between it hands you phase lead, which is the thing you actually wanted.

Board: left\_label — a Tex \[text\] that says "Lag compensator" (underline=True); lag\_form — a Math \[text\] that says "$C(s) = frac(1 + s / 0.05, 1 + s / 0.0125)$"; lag\_where — a Text \[text\] that says "The pole comes first, so the section is worth $1$ at low frequency and less than $1$ above the zero."; right\_label — a Tex \[text\] that says "Lead compensator" (underline=True); head\_forms — a Heading that says "Two Ways to Bend the Curves"

Actions:
- [21:51.075](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1311.0746666666669): lead\_form is shown on the screen, written out.
- [21:58.877](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1318.8766666666668): lead\_where is shown on the screen, written out.

##### [22:5.282](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1325.2816666666668)

Narration: So one of them cuts the high end and one of them lifts it. Let us watch what each does to a loop we already know.

Board: left\_label — a Tex \[text\] that says "Lag compensator" (underline=True); lag\_form — a Math \[text\] that says "$C(s) = frac(1 + s / 0.05, 1 + s / 0.0125)$"; lag\_where — a Text \[text\] that says "The pole comes first, so the section is worth $1$ at low frequency and less than $1$ above the zero."; right\_label — a Tex \[text\] that says "Lead compensator" (underline=True); lead\_form — a Math \[text\] that says "$C(s) = frac(1 + s / 1.2, 1 + s / 7.2)$"; lead\_where — a Text \[text\] that says "The zero comes first, so the section is worth $1$ at low frequency and more than $1$ above the pole."; head\_forms — a Heading that says "Two Ways to Bend the Curves"

Actions:
- [22:12.364](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1332.3641666666667): head\_forms is hidden from the screen — left the board.
- [22:12.364](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1332.3641666666667): lag\_form is hidden from the screen — left the board.
- [22:12.364](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1332.3641666666667): lag\_where is hidden from the screen — left the board.
- [22:12.364](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1332.3641666666667): lead\_form is hidden from the screen — left the board.
- [22:12.364](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1332.3641666666667): lead\_where is hidden from the screen — left the board.
- [22:12.364](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1332.3641666666667): left\_label is hidden from the screen — left the board.
- [22:12.364](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1332.3641666666667): right\_label is hidden from the screen — left the board.

##### [22:12.964](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1332.9641666666666)

Narration: Here is our plant again, in blue, on both plots. I have widened the frequency axis down to a hundredth of a radian per second, two decades lower than before, because that is where a lag compensator lives.

Board: Empty.

Actions:
- [22:12.964](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1332.9641666666666): head\_lag is shown on the screen, written out.
- [22:13.777](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1333.7766666666666): mag\_axes is shown on the screen, written out.
- [22:13.777](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1333.7766666666666): phase\_axes is shown on the screen, written out.
- [22:14.718](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1334.7176666666667): plant\_mag is shown on the screen, drawn.
- [22:14.718](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1334.7176666666667): plant\_ang is shown on the screen, drawn.
- [22:17.423](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1337.4226666666668): zero\_db\_line is shown on the screen, written out.
- [22:17.423](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1337.4226666666668): minus\_180 is shown on the screen, written out.
- [22:17.423](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1337.4226666666668): gc\_now\_mag is shown on the screen, written out.

##### [22:26.997](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1346.9971666666668)

Narration: Now the lag section on its own, in yellow. Its pole is at a hundred and twenty five ten thousandths, its zero at five hundredths. So it starts flat at zero decibels, falls at twenty per decade between the two, and then goes flat again.

Board: mag\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-80.0, 60.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-285.0, 60.0), aspect=(8.0, 3.0)); head\_lag — a Heading that says "The Lag: Cut the Gain, Keep the Phase"; plant\_mag — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); plant\_ang — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-2.0, 0.0), end=(1.5, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-2.0, -180.0), end=(1.5, -180.0), dashed=True); gc\_now\_mag — a Line \[gray\] drawn in mag\_axes (start=(0.19284611518884168, -75.0), end=(0.19284611518884168, 55.0), dashed=True)

Actions:
- [22:29.877](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1349.8766666666668): lag\_mag is shown on the screen, drawn.

##### [22:43.781](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1363.7811666666666)

Narration: How far does it fall? The ratio of the pole to the zero, a quarter, which is twelve decibels. That is the whole of what this section is for: a twelve decibel cut, delivered at every frequency above five hundredths.

Board: mag\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-80.0, 60.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-285.0, 60.0), aspect=(8.0, 3.0)); head\_lag — a Heading that says "The Lag: Cut the Gain, Keep the Phase"; plant\_mag — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); plant\_ang — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-2.0, 0.0), end=(1.5, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-2.0, -180.0), end=(1.5, -180.0), dashed=True); gc\_now\_mag — a Line \[gray\] drawn in mag\_axes (start=(0.19284611518884168, -75.0), end=(0.19284611518884168, 55.0), dashed=True); lag\_mag — a FunctionPlot \[yellow\] drawn in mag\_axes (function=\<function\>)

Actions:
- [22:46.289](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1366.2886666666668): lag\_work is shown on the screen, written out.
- [22:49.343](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1369.3426666666667): lag\_work is shown on the screen, written out.
- [22:54.741](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1374.7406666666668): point is shown on the screen, grown.
- [22:56.741](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1376.7406666666668): point is hidden from the screen.

##### [22:59.242](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1379.2416666666668)

Narration: And here is its phase. It dips down about thirty degrees in the middle, and comes back to zero afterwards. That dip is the price you pay, and look where it is: two decades below anything we care about. By the time we reach the interesting frequencies the section has given all of it back.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [23:0.461](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1380.4606666666668): lag\_ang is shown on the screen, drawn.
- [23:1.947](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1381.9466666666667): point\_2 is shown on the screen, grown.
- [23:3.947](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1383.9466666666667): point\_2 is hidden from the screen.

##### [23:18.58](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1398.5796666666668)

Narration: Add the yellow to the blue, and the green curves are the compensated loop. Identical to the plant at low frequency, twelve decibels below it everywhere else.

Board: mag\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-80.0, 60.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-285.0, 60.0), aspect=(8.0, 3.0)); head\_lag — a Heading that says "The Lag: Cut the Gain, Keep the Phase"; plant\_mag — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); plant\_ang — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-2.0, 0.0), end=(1.5, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-2.0, -180.0), end=(1.5, -180.0), dashed=True); gc\_now\_mag — a Line \[gray\] drawn in mag\_axes (start=(0.19284611518884168, -75.0), end=(0.19284611518884168, 55.0), dashed=True); lag\_mag — a FunctionPlot \[yellow\] drawn in mag\_axes (function=\<function\>); lag\_ang — a FunctionPlot \[yellow\] drawn in phase\_axes (function=\<function\>)

Actions:
- [23:20.867](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1400.8666666666668): lagged\_mag is shown on the screen, drawn.
- [23:20.867](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1400.8666666666668): lagged\_ang is shown on the screen, drawn.

##### [23:30.14](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1410.1396666666667)

Narration: So the magnitude curve has dropped, and the point where it crosses zero decibels has slid a long way to the left. From one point five six down to about nought point four nine.

Board: mag\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-80.0, 60.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-285.0, 60.0), aspect=(8.0, 3.0)); head\_lag — a Heading that says "The Lag: Cut the Gain, Keep the Phase"; plant\_mag — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); plant\_ang — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-2.0, 0.0), end=(1.5, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-2.0, -180.0), end=(1.5, -180.0), dashed=True); gc\_now\_mag — a Line \[gray\] drawn in mag\_axes (start=(0.19284611518884168, -75.0), end=(0.19284611518884168, 55.0), dashed=True); lag\_mag — a FunctionPlot \[yellow\] drawn in mag\_axes (function=\<function\>); lag\_ang — a FunctionPlot \[yellow\] drawn in phase\_axes (function=\<function\>); lagged\_mag — a FunctionPlot \[green\] drawn in mag\_axes (function=\<function\>); lagged\_ang — a FunctionPlot \[green\] drawn in phase\_axes (function=\<function\>)

Actions:
- [23:34.145](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1414.1446666666668): gc\_lag\_mag is shown on the screen, written out.
- [23:40.879](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1420.8786666666667): lag\_work is shown on the screen, written out.

##### [23:43.116](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1423.1156666666668)

Narration: And that is the whole trick. Down at nought point four nine, the plant had barely started lagging. The phase there is about minus one hundred and eleven degrees, so the phase margin is sixty nine, up from forty three.

Board: mag\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-80.0, 60.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-285.0, 60.0), aspect=(8.0, 3.0)); head\_lag — a Heading that says "The Lag: Cut the Gain, Keep the Phase"; plant\_mag — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); plant\_ang — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-2.0, 0.0), end=(1.5, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-2.0, -180.0), end=(1.5, -180.0), dashed=True); gc\_now\_mag — a Line \[gray\] drawn in mag\_axes (start=(0.19284611518884168, -75.0), end=(0.19284611518884168, 55.0), dashed=True); lag\_mag — a FunctionPlot \[yellow\] drawn in mag\_axes (function=\<function\>); lag\_ang — a FunctionPlot \[yellow\] drawn in phase\_axes (function=\<function\>); lagged\_mag — a FunctionPlot \[green\] drawn in mag\_axes (function=\<function\>); lagged\_ang — a FunctionPlot \[green\] drawn in phase\_axes (function=\<function\>); gc\_lag\_mag — a Line \[green\] drawn in mag\_axes (start=(-0.3142582613977364, -75.0), end=(-0.3142582613977364, 55.0), dashed=True)

Actions:
- [23:50.476](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1430.4756666666667): gc\_lag\_ang is shown on the screen, written out.
- [23:52.427](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1432.4266666666667): point\_3 is shown on the screen, grown.
- [23:54.427](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1434.4266666666667): point\_3 is hidden from the screen.
- [23:54.76](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1434.7596666666668): lag\_work is shown on the screen, written out.

##### [23:57.868](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1437.8676666666668)

Narration: The gain margin improves too, from six to twenty four, because the whole magnitude curve dropped and the phase crossover frequency hardly moved. But notice what it cost. The crossover frequency is the loop's bandwidth, and we just divided it by three. This loop is safer and it is slower.

Board: mag\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-80.0, 60.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-285.0, 60.0), aspect=(8.0, 3.0)); head\_lag — a Heading that says "The Lag: Cut the Gain, Keep the Phase"; plant\_mag — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); plant\_ang — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-2.0, 0.0), end=(1.5, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-2.0, -180.0), end=(1.5, -180.0), dashed=True); gc\_now\_mag — a Line \[gray\] drawn in mag\_axes (start=(0.19284611518884168, -75.0), end=(0.19284611518884168, 55.0), dashed=True); lag\_mag — a FunctionPlot \[yellow\] drawn in mag\_axes (function=\<function\>); lag\_ang — a FunctionPlot \[yellow\] drawn in phase\_axes (function=\<function\>); lagged\_mag — a FunctionPlot \[green\] drawn in mag\_axes (function=\<function\>); lagged\_ang — a FunctionPlot \[green\] drawn in phase\_axes (function=\<function\>); gc\_lag\_mag — a Line \[green\] drawn in mag\_axes (start=(-0.3142582613977364, -75.0), end=(-0.3142582613977364, 55.0), dashed=True); gc\_lag\_ang — a Line \[green\] drawn in phase\_axes (start=(-0.3142582613977364, -280.0), end=(-0.3142582613977364, 55.0), dashed=True)

Actions:
- [24:0.457](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1440.4566666666667): lag\_work is shown on the screen, written out.
- [24:4.485](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1444.4846666666667): point\_4 is shown on the screen, grown.
- [24:6.485](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1446.4846666666667): point\_4 is hidden from the screen.
- [24:16.652](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1456.6521666666667): head\_lag is hidden from the screen — left the board.
- [24:16.652](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1456.6521666666667): lag\_work is hidden from the screen — left the board.

##### [24:17.252](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1457.2521666666667)

Narration: Now clear those away and try the other one. The lead has its zero at one point two and its pole at seven point two, so both of them sit right in the middle of the action, near the old crossover.

Board: mag\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-80.0, 60.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-285.0, 60.0), aspect=(8.0, 3.0)); plant\_mag — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); plant\_ang — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-2.0, 0.0), end=(1.5, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-2.0, -180.0), end=(1.5, -180.0), dashed=True); gc\_now\_mag — a Line \[gray\] drawn in mag\_axes (start=(0.19284611518884168, -75.0), end=(0.19284611518884168, 55.0), dashed=True); lag\_mag — a FunctionPlot \[yellow\] drawn in mag\_axes (function=\<function\>); lag\_ang — a FunctionPlot \[yellow\] drawn in phase\_axes (function=\<function\>); lagged\_mag — a FunctionPlot \[green\] drawn in mag\_axes (function=\<function\>); lagged\_ang — a FunctionPlot \[green\] drawn in phase\_axes (function=\<function\>); gc\_lag\_mag — a Line \[green\] drawn in mag\_axes (start=(-0.3142582613977364, -75.0), end=(-0.3142582613977364, 55.0), dashed=True); gc\_lag\_ang — a Line \[green\] drawn in phase\_axes (start=(-0.3142582613977364, -280.0), end=(-0.3142582613977364, 55.0), dashed=True)

Actions:
- [24:17.252](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1457.2521666666667): head\_lead is shown on the screen, written out.
- [24:17.252](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1457.2521666666667): lag\_mag is hidden from the screen.
- [24:17.252](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1457.2521666666667): lag\_ang is hidden from the screen.
- [24:17.252](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1457.2521666666667): lagged\_mag is hidden from the screen.
- [24:17.252](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1457.2521666666667): lagged\_ang is hidden from the screen.
- [24:17.252](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1457.2521666666667): gc\_lag\_mag is hidden from the screen.
- [24:17.252](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1457.2521666666667): gc\_lag\_ang is hidden from the screen.
- [24:21.536](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1461.5356666666667): lead\_mag is shown on the screen, drawn.

##### [24:30.089](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1470.0886666666668)

Narration: In yellow again, its magnitude is flat, then rises at twenty decibels per decade between the zero and the pole, then flat again. The ratio of zero to pole is one sixth, so it lifts the high end by about sixteen decibels.

Board: mag\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-80.0, 60.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-285.0, 60.0), aspect=(8.0, 3.0)); plant\_mag — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); plant\_ang — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-2.0, 0.0), end=(1.5, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-2.0, -180.0), end=(1.5, -180.0), dashed=True); gc\_now\_mag — a Line \[gray\] drawn in mag\_axes (start=(0.19284611518884168, -75.0), end=(0.19284611518884168, 55.0), dashed=True); head\_lead — a Heading that says "The Lead: Buy Phase Where It Counts"; lead\_mag — a FunctionPlot \[yellow\] drawn in mag\_axes (function=\<function\>)

Actions:
- [24:39.087](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1479.0866666666668): lead\_work is shown on the screen, written out.

##### [24:45.364](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1485.3636666666669)

Narration: And here is the part we actually came for. Its phase rises to a maximum partway up, and for a ratio of one sixth that maximum is forty six degrees. It happens at the geometric mean of the zero and the pole, which is two point nine four.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [24:49.102](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1489.1016666666667): lead\_ang is shown on the screen, drawn.
- [24:54.629](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1494.6286666666667): point\_5 is shown on the screen, grown.
- [24:56.629](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1496.6286666666667): point\_5 is hidden from the screen.
- [24:57.438](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1497.4376666666667): lead\_work is shown on the screen, written out.

##### [25:2.577](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1502.5771666666667)

Narration: So you place the compensator so that its phase peak lands where the loop is going to cross zero decibels. Add the two together, and here are the compensated curves.

Board: mag\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-80.0, 60.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-285.0, 60.0), aspect=(8.0, 3.0)); plant\_mag — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); plant\_ang — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-2.0, 0.0), end=(1.5, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-2.0, -180.0), end=(1.5, -180.0), dashed=True); gc\_now\_mag — a Line \[gray\] drawn in mag\_axes (start=(0.19284611518884168, -75.0), end=(0.19284611518884168, 55.0), dashed=True); head\_lead — a Heading that says "The Lead: Buy Phase Where It Counts"; lead\_mag — a FunctionPlot \[yellow\] drawn in mag\_axes (function=\<function\>); lead\_ang — a FunctionPlot \[yellow\] drawn in phase\_axes (function=\<function\>)

Actions:
- [25:9.45](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1509.4496666666669): led\_mag is shown on the screen, drawn.
- [25:9.45](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1509.4496666666669): led\_ang is shown on the screen, drawn.

##### [25:13.765](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1513.7651666666668)

Narration: The magnitude has been lifted at the top end, so crossover moves the other way this time, up from one point five six to two point six five. And on an uncompensated plant that would be bad news, because the phase up there is worse.

Board: mag\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-80.0, 60.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-285.0, 60.0), aspect=(8.0, 3.0)); plant\_mag — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); plant\_ang — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-2.0, 0.0), end=(1.5, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-2.0, -180.0), end=(1.5, -180.0), dashed=True); gc\_now\_mag — a Line \[gray\] drawn in mag\_axes (start=(0.19284611518884168, -75.0), end=(0.19284611518884168, 55.0), dashed=True); head\_lead — a Heading that says "The Lead: Buy Phase Where It Counts"; lead\_mag — a FunctionPlot \[yellow\] drawn in mag\_axes (function=\<function\>); lead\_ang — a FunctionPlot \[yellow\] drawn in phase\_axes (function=\<function\>); led\_mag — a FunctionPlot \[green\] drawn in mag\_axes (function=\<function\>); led\_ang — a FunctionPlot \[green\] drawn in phase\_axes (function=\<function\>)

Actions:
- [25:16.912](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1516.9116666666669): gc\_lead\_mag is shown on the screen, written out.
- [25:21.011](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1521.0106666666668): lead\_work is shown on the screen, written out.

##### [25:28.542](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1528.5416666666667)

Narration: But the lead has bumped the phase up by forty five degrees at exactly that frequency. So instead of the minus one hundred and fifty eight the plant would have given us, we read minus one hundred and twelve, and the phase margin is sixty eight.

Board: mag\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-80.0, 60.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-285.0, 60.0), aspect=(8.0, 3.0)); plant\_mag — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); plant\_ang — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-2.0, 0.0), end=(1.5, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-2.0, -180.0), end=(1.5, -180.0), dashed=True); gc\_now\_mag — a Line \[gray\] drawn in mag\_axes (start=(0.19284611518884168, -75.0), end=(0.19284611518884168, 55.0), dashed=True); head\_lead — a Heading that says "The Lead: Buy Phase Where It Counts"; lead\_mag — a FunctionPlot \[yellow\] drawn in mag\_axes (function=\<function\>); lead\_ang — a FunctionPlot \[yellow\] drawn in phase\_axes (function=\<function\>); led\_mag — a FunctionPlot \[green\] drawn in mag\_axes (function=\<function\>); led\_ang — a FunctionPlot \[green\] drawn in phase\_axes (function=\<function\>); gc\_lead\_mag — a Line \[green\] drawn in mag\_axes (start=(0.42324587393680785, -75.0), end=(0.42324587393680785, 55.0), dashed=True)

Actions:
- [25:29.598](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1529.5976666666668): gc\_lead\_ang is shown on the screen, written out.
- [25:39.641](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1539.6406666666667): point\_6 is shown on the screen, grown.
- [25:41.545](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1541.5446666666667): lead\_work is shown on the screen, written out.
- [25:41.641](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1541.6406666666667): point\_6 is hidden from the screen.

##### [25:43.19](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1543.1896666666669)

Narration: The gain margin is essentially unchanged, about sixteen decibels, because the lead pushed the phase crossover frequency out and lifted the magnitude there by about the same amount. Both effects roughly cancel.

Board: mag\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-80.0, 60.0), aspect=(8.0, 3.0)); phase\_axes — an Axes (x\_range=(-2.0, 1.5), y\_range=(-285.0, 60.0), aspect=(8.0, 3.0)); plant\_mag — a FunctionPlot \[blue\] drawn in mag\_axes (function=\<function\>); plant\_ang — a FunctionPlot \[blue\] drawn in phase\_axes (function=\<function\>); zero\_db\_line — a Line \[gray\] drawn in mag\_axes (start=(-2.0, 0.0), end=(1.5, 0.0), dashed=True); minus\_180 — a Line \[gray\] drawn in phase\_axes (start=(-2.0, -180.0), end=(1.5, -180.0), dashed=True); gc\_now\_mag — a Line \[gray\] drawn in mag\_axes (start=(0.19284611518884168, -75.0), end=(0.19284611518884168, 55.0), dashed=True); head\_lead — a Heading that says "The Lead: Buy Phase Where It Counts"; lead\_mag — a FunctionPlot \[yellow\] drawn in mag\_axes (function=\<function\>); lead\_ang — a FunctionPlot \[yellow\] drawn in phase\_axes (function=\<function\>); led\_mag — a FunctionPlot \[green\] drawn in mag\_axes (function=\<function\>); led\_ang — a FunctionPlot \[green\] drawn in phase\_axes (function=\<function\>); gc\_lead\_mag — a Line \[green\] drawn in mag\_axes (start=(0.42324587393680785, -75.0), end=(0.42324587393680785, 55.0), dashed=True); gc\_lead\_ang — a Line \[green\] drawn in phase\_axes (start=(0.42324587393680785, -280.0), end=(0.42324587393680785, 55.0), dashed=True)

Actions:
- [25:46.58](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1546.5796666666668): lead\_work is shown on the screen, written out.

##### [25:57.246](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1557.2456666666667)

Narration: So look at what we bought. The same phase margin the lag gave us, near enough, but with the crossover frequency up rather than down. This loop is safer and it is faster.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [26:7.358](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1567.3576666666668): led\_mag is indicated — a transient flash.
- [26:7.658](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1567.657666666667): led\_ang is indicated — a transient flash.
- [26:9.32](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1569.3196666666668): head\_lead is hidden from the screen — left the board.
- [26:9.32](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1569.3196666666668): lead\_work is hidden from the screen — left the board.
- [26:9.32](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1569.3196666666668): mag\_axes is hidden from the screen — left the board.
- [26:9.32](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1569.3196666666668): plant\_mag is hidden from the screen — mag\_axes left the board.
- [26:9.32](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1569.3196666666668): zero\_db\_line is hidden from the screen — mag\_axes left the board.
- [26:9.32](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1569.3196666666668): gc\_now\_mag is hidden from the screen — mag\_axes left the board.
- [26:9.32](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1569.3196666666668): lead\_mag is hidden from the screen — mag\_axes left the board.
- [26:9.32](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1569.3196666666668): led\_mag is hidden from the screen — mag\_axes left the board.
- [26:9.32](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1569.3196666666668): gc\_lead\_mag is hidden from the screen — mag\_axes left the board.
- [26:9.32](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1569.3196666666668): phase\_axes is hidden from the screen — left the board.
- [26:9.32](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1569.3196666666668): plant\_ang is hidden from the screen — phase\_axes left the board.
- [26:9.32](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1569.3196666666668): minus\_180 is hidden from the screen — phase\_axes left the board.
- [26:9.32](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1569.3196666666668): lead\_ang is hidden from the screen — phase\_axes left the board.
- [26:9.32](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1569.3196666666668): led\_ang is hidden from the screen — phase\_axes left the board.
- [26:9.32](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1569.3196666666668): gc\_lead\_ang is hidden from the screen — phase\_axes left the board.

##### [26:9.92](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1569.9196666666667)

Narration: Side by side, then. The lag cuts the high end of the magnitude curve. The lead lifts it, and that single difference drives everything else about the two of them.

Board: Empty.

Actions:
- [26:9.92](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1569.9196666666667): head\_summary is shown on the screen, written out.
- [26:10.268](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1570.2676666666669): summary is shown on the screen, written out.
- [26:12.73](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1572.7296666666668): summary is shown on the screen, written out.
- [26:17.687](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1577.6866666666667): summary (the "row=2" part) is emphasized.
- [26:20.624](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1580.6241666666667): summary (the "row=2" part) is no longer emphasized.

##### [26:21.224](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1581.2241666666669)

Narration: The lag's own phase contribution is a nuisance to be parked out of the way, two decades below the action. The lead's phase contribution is the entire point, and you place it deliberately on top of the crossover frequency.

Board: head\_summary — a Heading that says "The Two Trades"

Actions:
- [26:23.744](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1583.7436666666667): summary is shown on the screen, written out.
- [26:29.572](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1589.5716666666667): summary (the "row=3" part) is emphasized.
- [26:34.175](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1594.1746666666668): summary (the "row=3" part) is no longer emphasized.

##### [26:34.775](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1594.7746666666667)

Narration: So the lag moves the crossover down and the lead moves it up. Both of them end up buying you phase margin, and they buy it in opposite currencies: one pays with speed, the other pays with amplified high frequency, which means amplified noise.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [26:36.046](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1596.0456666666669): summary is shown on the screen, written out.
- [26:38.821](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1598.820666666667): summary is shown on the screen, written out.
- [26:42.107](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1602.1066666666668): summary (the "row=5" part) is emphasized.
- [26:50.303](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1610.3031666666668): summary (the "row=5" part) is no longer emphasized.

##### [26:50.903](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1610.9031666666667)

Narration: And both are one zero and one pole, the same two curves we drew by hand earlier. Which one you put first is the whole difference between them.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [26:51.565](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1611.5646666666669): closing is shown on the screen, written out.

##### [27:0.501](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1620.501166666667)

Narration: That is the arc. A sine wave in gives a sine wave out, and two numbers record it. Those two numbers, plotted against a logarithmic frequency axis, are sums of straight lines you can draw from the poles and zeros alone.

Board: closing — a Panel that says "Both sections are the same two factors we met earlier: one zero and one pole. Which of them comes first is the whole difference."; head\_summary — a Heading that says "The Two Trades"

Actions:
- None.

##### [27:16.449](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1636.4491666666668)

Narration: Close the loop, and one frequency on those plots decides everything: the one where the phase reaches minus one hundred and eighty degrees, where the returning signal comes back in step with itself. How far the magnitude sits below unity there is your gain margin, and how far the phase sits above minus one eighty at unity gain is your phase margin.

Board: Unchanged from the preceding beat in this scene.

Actions:
- [27:39.005](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1659.0047291666667): closing is hidden from the screen — left the board.
- [27:39.005](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1659.0047291666667): head\_summary is hidden from the screen — left the board.
- [27:39.005](https://academa.ai/lectures/frequency-response-bode-closed-loop?t=1659.0047291666667): summary is hidden from the screen — left the board.
