Frequency-domain design
So far, we have seen how to analyze the frequency response of a plant by examining its Bode plot. If we use feedback compensation to change the system’s transfer function, then we are designing a compensator and our resulting closed-loop system has transfer function
Where we define the loop transfer function .
What matters is closed-loop performance, i.e., the frequency response of . However, depends on in a complicated way, so our approach will be to:
Decide what we want the Bode plot of to look like.
Infer what the Bode plot of should look like to achieve the desired .
Design so that the Bode plot of has the desired shape.
The last step is easy because of the decomposition of bode plots property. We can make the Bode plot of by summing the Bode plots of and . So if we know what we want the Bode plot of to look like, we can design accordingly.
This means we can do our design by only looking at the Bode plot of our open-loop plant . This technique is called loop shaping and is a powerful tool for control design.
Closed-loop performance¶
We’ll start with a block diagram that includes some extra disturbance inputs:
Figure 1:Block diagram for control design, including reference input , disturbance input , and measurement noise . The loop transfer function is .
Reference : the desired value of the output, which we choose. Ideally, we would track the reference perfectly, meaning that at all times.
Sensor noise : most sensors have some noise, which we can model as an external input. Ideally, we want to reject sensor noise; we want the output to be unaffected by the noise.
Output disturbance : an external input that affects the output. For example, if the system is a thermostat, a disturbance could be anything that directly affects the temperature of the room, such as a breeze from an open window, or sunlight coming through the window. Ideally, we want to reject output disturbances as well.
Writing the equations for the block diagram, we have:
Eliminating and solving for in terms of , , and , we have:
The transfer function is called the sensitivity function and the transfer function is called the complementary sensitivity function. Note that is same closed-loop transfer function we defined in Eq. (1). Meanwhile, is the transfer function from to . It is also the transfer function from to , as we saw in the section on steady-state error.
In most systems, we want the following:
Reference tracking at low frequencies, so that we can track slowly changing references. This means that we want at low frequencies.
Noise rejection at high frequencies, so that we can reject high-frequency sensor noise. This means that we want at high frequencies.
Disturbance rejection at low frequencies, so that we can reject slowly changing disturbances. This means that we want , i.e., , at low frequencies.
Therefore, the ideal (closed-loop) magnitude Bode plot looks something like this:
Figure 2:Ideal closed-loop Bode magnitude plot.
At low frequencies: The closed-loop Bode plot has a magnitude of 0 dB (assuming a phase of 0°). This means , so the DC gain of our closed-loop system is 1 and we achieve perfect tracking of constant references. It also means that we can perfectly reject any constant disturbances.
At high frequencies: The closed-loop Bode plot has high-frequency roll-off. This means at high frequencies, and we reject noise at high frequencies.
What happens in the intermediate frequency range? This brings us to the concept of bandwidth, which we will now discuss.
Bandwidth¶
The frequency at which the closed-loop Bode plot starts to roll off is called the bandwidth of the system. The technical definition is the frequency at which drops to 3 dB below the low-frequency magnitude. We labeled it in Figure 2.
A nice property of bandwidth is that for a first-order system, the bandwidth is the same as the corner frequency. To see why, assume a first-order system . The corner frequency is . At this frequency, the magnitude is
So at , the magnitude has dropped by a factor of compared to its DC gain.
Bandwidth is an important concept because it gives us a single number that captures the trade-off between tracking and noise rejection.
A higher bandwidth means better tracking of high-frequency references, but worse noise rejection at high frequencies. The suspension in a Formula One race car should have a high bandwidth to precisely track the road surface and give the driver good handling, even if that means the driver feels more of the bumps in the road.
A lower bandwidth means worse tracking of high-frequency references, but better noise rejection at high frequencies. The suspension in a luxury sedan should have a low bandwidth to give the driver a smooth ride, even if that means the car doesn’t track the road surface as precisely.
Open-loop performance¶
Now that we know what we want the closed-loop Bode plot to look like, let’s think about how to achieve it. We start by looking at the relationship between the loop gain and the closed-loop transfer functions . We have:
The relationship between the magnitudes and is most clear when we separate the cases where or or . So let’s look at these three cases separately.
If , then . This is what we wanted at low frequencies, so we should strive for a large loop gain at low frequencies.
If , then . So if we want high-frequency roll-off in our closed-loop system, we should also have high-frequency roll-off in the open-loop transfer function as well. So we should strive for a small loop gain at high frequencies.
If , then (this isn’t obvious, read below for the derivation!). By definition, the first condition is satisfied at (gain crossover frequency), and the second condition is satisfied at (bandwidth), so we have the important fact: The open-loop gain crossover frequency is approximately equal to the bandwidth.
Derivation of
By definition of the gain crossover frequency, . But what is the phase of this complex number? For this, we can use the definition of phase margin:
So we can express the complex number in polar form as . The magnitude of the closed-loop transfer function at is:
If , then and . The smaller our phase margin, the worse the approximation gets, and if , ; the closed-loop system has a resonant peak.
If we ensure that is sufficiently large in our open-loop design, then the approximation will be good.
Finally, the slope at the gain crossover also matters.
We know from sketching Bode plots that each pole eventually contributes a slope of -20 dB/decade and -90° of phase. At , the phase tells us the phase margin. A shallower slope means less phase lag, so more phase margin!
However, a slope that’s too shallow means that a small change in proportional gain (shifting the magnitude plot up or down a little bit) will cause a large change in gain crossover frequency. This is bad if we are hoping to maintain a consistent bandwidth!
So the slope shouldn’t be too shallow or too steep. A good rule of thumb is to aim for a slope of -20 dB/decade at the gain crossover. This ensures a healthy of around 90° and that the bandwidth is robust to small changes in gain. We can summarize all of our design goals in the following open-loop Bode magnitude plot:
Figure 3:Ideal open-loop Bode magnitude plot.
We can easily tune the gain crossover frequency (and hence the bandwidth) by adjusting our proportional gain. A larger gain moves the magnitude plot up, which tends to increase the gain crossover frequency and hence the bandwidth. If the slope is -20 dB/decade at the gain crossover, then increasing by 20 dB will increase the bandwidth by one decade. In other words, increasing proportional gain by a factor will increase the bandwidth by a factor of .
Time domain performance¶
We can draw useful parallels (and equations!) between time-domain and frequency-domain performance. As an approximation, let’s assume that our closed-loop system has a DC gain of 1 (as in Figure 2) and is governed by a pair of dominant poles, so its response is approximately that of a first-order or second-order system.
Bandwidth and settling time¶
Settling time is related to the real part of the dominant poles. For a first-order system, we have , where is the corner frequency (and bandwidth!). For a second-order system, we have . We also know that is the corner frequency for the Bode plot of a second-order system, which isn’t exactly the bandwidth, but is a decent approximation for underdamped systems. So we can write:
So bandwidth governs speed of response. There is a more exact relationship between bandwidth and settling time for a second-order system, which we derive in Exercise 1.
This means that if we know a desired settling time for our system, this gives us an approximate target for our bandwidth.
Phase margin and damping¶
Both phase margin and damping ratio (or percent overshoot) are measures of how close a system is to instability. The instability threshold is when the closed-loop system has a purely imaginary pole. With root locus, we observed this as poles “crossing into the RHP”.
In the time domain, a pole approaching the imaginary axis means that the system becomes increasingly underdamped and .
In the frequency domain, a pole approaching the imaginary axis means that the characteristic equation satisfies , so .
It turns out there is an approximate relationship between phase margin and damping ratio. If the closed-loop system has a DC gain of 1 and a dominant pair of complex poles, then the damping ratio of these dominant poles is related to the phase margin (measured in degrees on the open-loop Bode plot) as:
So phase margin governs damping of response. If you’re curious about where this relationship comes from, expand the derivation below for more details.
Derivation of PM- rule of thumb
If the closed-loop system has DC gain 1 and is dominated by a pair of complex conjugate poles, then we can write it as:
Since , our open-loop transfer function must be:
To find the gain crossover frequency, we set :
Letting , we have: . Squaring both sides and simplifying:
Using the quadratic formula:
Since , we take the positive root, and substituting back in for , we obtain our gain crossover frequency:
To find the phase margin, we evaluate :
Now use the fact that (we proved it here) to simplify this expression and obtain:
This is an exact relationship between and . However, it is not very practical. When , we have
By the small-angle approximation and . Converting to degrees, we have . Using 100 instead of 114.6 gives us a nice round number and works over a larger range of values, as shown below:
Figure 4:Different approximations of the relationship between and .
This means that in many cases, phase margin can directly tell us about damping ratio and hence percent overshoot. For example, using the plot relating and , see that:
corresponds to and .
corresponds to and .
corresponds to and .
corresponds to and .
We can also combine the formulas (8) and (9) to obtain for example formulas for required bandwidth and phase margin as a function of desired settling time and percent overshoot.
Summary of design goals¶
Now that we know what the Bode plot of the loop gain should look like to achieve desirable closed-loop performance, the next step is to design so that has the desired Bode plot.
Frequency-domain PID¶
We already have a solid intuition for how PID control affects the time-domain response of a system. Now let’s revisit PID control in the context of frequency response and loop-shaping. Compensator design is a game of trade-offs, so for each case, we will indicate which properties are benefits (🟢), neutral (⚪), or drawbacks (🔴).
P control¶
Increasing the proportional gain simply shifts the magnitude plot of upwards. This typically has the following effects:
🟢 Improves steady-state error by shifting up low-frequency gain
⚪ Increases gain crossover frequency, and hence bandwidth
🔴 Increases sensitivity to high-frequency noise
🔴 Reduces gain margin, phase margin, and delay margin
The net result is typically a faster system with increased sensitivity to noise, delays, and unmodeled dynamics. This is a common trade-off in control design: increasing bandwidth typically reduces robustness. Reducing the proportional gain has the opposite effect: it reduces bandwidth and improves robustness.
PI control¶
A PI controller takes the form . Here is its Bode plot:
This Bode plot will get added to the Bode plot of to obtain . This can affect the loop gain in several ways:
🟢 The large gain at low frequency improves tracking, steady-state error, and disturbance rejection at low frequencies.
⚪ Behaves like a proportional controller at high frequencies, so the same trade-offs apply at high frequencies as with P control.
🔴 The low-frequency phase lag introduced by the integrator may reduce phase margin and compromise stability, depending on the gain crossover frequency.
PD control¶
A PD controller takes the form . We normalized by so that the DC gain would be . Here is what the Bode plot looks like:
This can affect the loop gain in several ways:
🟢 The high-frequency phase lead introduced by the zero can increase phase margin, depending on the gain crossover frequency.
⚪ Behaves like a proportional controller at low frequencies, so the same trade-offs apply at low frequencies as with P control.
🔴 The high-frequency gain reduces our high-frequency roll-off, which can amplify noise and unmodeled dynamics at high frequencies, reducing robustness.
PID control¶
A PID controller takes the form . This is just the product of the PI and PD controllers with a common value. It’s also possible to make a PID controller with complex zeros, but we’ll stick with this simpler form for now. Here is the Bode plot (assuming ):
The PID controller combines the effects of P, I, and D control, so it can have both benefits and drawbacks. The integrator can improve low-frequency tracking and disturbance rejection, but it can also reduce phase margin. The derivative term can increase phase margin, but it can also amplify noise at high frequencies.
In the next section, we look at lead and lag compensators, which are yet another design choice when it comes to shaping the Bode plot of .
Test your knowledge¶
Solution to Exercise 1 #
We calculated the magnitude of the frequency response for a second-order system in the section on second-order Bode plots. The bandwidth is where the magnitude drops to -3 dB compared to the DC gain. Since our DC gain is 1, this means a magnitude of . This leads us to the equation:
We can tackle the second part first; when is a good approximation for ? Substituting in , we have:
So is a good approximation for when , or . This is precisely the damping ratio at which the system loses its resonant peak! Let’s now solve for the exact formula for in general.
Let’s define . Then we can rearrange the equation to get:
Rearranging further, we have:
Using the quadratic formula, we have:
We should ignore the negative solution, since is positive based on how it was defined. Substituting back in, we have:
We can check that the big square root simplifies to 1 when , as we previously determined. In general, the approximation is decent for underdamped systems, but not great for overdamped systems. Here is a plot showing how the true bandwidth varies as a function of damping ratio:
Figure 8:Bandwidth of a second-order system as a function of damping ratio
Therefore, if we want a more accurate estimate of the relationship between bandwidth and settling time than the one from Eq. (8), we can write: