Feedback and P-control
In this section, we make our first foray into feedback control. We have looked at first and second order systems and developed qualitative and quantitative measures of performance (settling time, overshoot, etc.). Now we will see how feedback control can be used to improve performance.
Standard feedback configuration¶
A general feedback configuration is shown in the block diagram below. The system we want to control has transfer function .
Figure 1:General feedback configuration. The closed-loop system is the system that maps the reference input to the output .
The blocks of the diagram are as follows:
is the plant: the system we want to control. Historically, the name “plant” comes from the fact that control theory was originally developed to control physical processes such as chemical plants, nuclear reactors, etc. However, the term “plant” is now used more generally to refer to any system we want to control, including mechanical systems, electrical systems, etc.
is the sensor: the system that measures the output of the plant and feeds it back to the controller. In many cases, we will assume , which means we have a perfect sensor that measures the output without any distortion or delay. However, in some cases, we may need to consider more realistic sensors that have their own dynamics and limitations.
is the controller or compensator: the system we design to manipulate the input to the plant in order to achieve desired performance. In general, it can also have its own dynamics and complexity, so we write it as a transfer function. Some textbooks use the symbol for the controller.
is the feedforward compensator or pre-filter: an optional block that allows us to directly manipulate the reference signal before it enters the feedback loop. This can be useful for certain control strategies, but we will typically assume for simplicity.
The transfer function from to is called the closed-loop transfer function and is denoted by . We can derive an expression for by manipulating the block diagram as we saw in our earlier section on block diagrams. We just need to remember that block diagrams are nothing more than a visual representation of algebraic equations. We will drop the “” for brevity in the equations below.
Substituting the first equation into the second and the second into the third, we get:
Now rearrange to find the closed-loop transfer function:
Unity feedback¶
The most common feedback configuration is the one where and , which is called unity feedback. In this case, the block diagram is
Figure 2:The standard unity feedback architecture. The closed-loop system is the system that maps the reference input to the output .
and the closed-loop transfer function simplifies to:
Example: closed-loop system¶
Let’s find the closed-loop transfer function of the plant in unity feedback with compensator .
Solution: The closed-loop transfer function is given by:
P-control of a first-order system¶
Let’s suppose we have a first-order plant in canonical form and that the DC gain is . This assumption just simplifies the analysis and does not affect the generality of our conclusions. The plant is given by:
The simplest type of controller is a proportional (P) controller, which has the form:
where is a constant called the proportional gain. The intuition behind P-control is that our compensator measures the error and applies an input that is proportional to the error. If we use standard unity feedback as in Figure 2, the closed-loop transfer function for a P-controller applied to a first-order system is given by:
This is still a first-order system, but, its DC gain and time constant have changed. To see this, rewrite the closed-loop transfer function in canonical form:
The time constant is now , which is smaller than the original time constant for any . This means that the closed-loop system will have a faster transient response (smaller settling time) than the open-loop system.
However, the DC gain is now , which is less than 1 for any finite . This means that the closed-loop system will have a steady-state error to a step input: It will not track the reference input perfectly. Here are plots of the step response of the closed-loop system for different values of .
Figure 3:Step response of a first-order system with proportional control for different values of the proportional gain . The dashed curve is the step response of the open-loop system. As increases, the transient response gets faster (smaller settling time), but there is always a steady-state error (the final value is less than 1).
Pole-zero plot for first-order system¶
We can also look at how the pole location changes as we increase . The closed-loop system (12) has a single pole at . Therefore:
When , the pole is at , which is the same as the open-loop system. However, the DC gain is 0 for this case, so the system does not respond to the step input at all.
As increases, the pole moves to the left in the complex plane, which corresponds to a faster transient response.
We can show this visually on the pole-zero plot by plotting the set of all possible locations of the closed-loop pole as we vary . This is called a root locus and will be covered in more detail in a later section. Here it is:
Figure 4:Root locus of a first-order system with proportional control. The blue shows the open-loop pole. The blue arrow shows how the closed-loop pole moves as increases from 0 to .
Eliminating steady-state error¶
We saw that proportional feedback control helps improve the transient response of the system, but it comes at the price of steady-state error. There are two simple ways to eliminate steady-state error, but both have serious drawbacks. The first way is to add a feedforward compensator as in Figure 1 that cancels the DC gain of the closed-loop system. The second is to simply make the gain very large so the error goes to zero. This is known as a high-gain controller. We will see that both of these methods have serious drawbacks.
Feedforward compensation¶
One simple way to apparently eliminate steady-state error is to add a feedforward compensator as in Figure 1 that cancels the DC gain of the closed-loop system. For example, if we choose , then the closed-loop transfer function becomes:
Now the DC gain is 1, so there is no steady-state error to a step input! However, this feedforward compensator is not very practical for two reasons:
Perfect knowledge: The plant model must be known perfectly, which is often not the case in practice. For example, suppose our DC gain is not exactly 1, but rather . Then the DC gain of the closed-loop system becomes . This requires using , which depends on the unknown parameter . We can measure experimentally, but this is not ideal because may drift over time or depend on environmental parameters. Our closed-loop steady-state error would also drift over time, and would require frequent re-tuning.
No disturbances: If there are disturbances in the system, such as a constant disturbance affecting our input, this would also cause steady-state error. However, feedforward compensation can only cancel the steady-state error caused by the reference input, but not the steady-state error caused by disturbances.
We will see a more practical way to eliminate steady-state error in a later section when we introduce integral control. Integral control does not require perfect knowledge of the plant model and can also eliminate steady-state error caused by constant disturbances.
High-gain control¶
Based on our previous analysis, we can eliminate steady-state error by making very large. This also has the benefit of making our transient response arbitrarily fast (settling time goes to zero). Alas, this is one of those “seems too good to be true” situations that is indeed too good to be true.
Returning to our shower control example from the start of the course, a high-gain controller would allow the shower to respond instantly to changes in the desired temperature! We know from experience and from physics that this can’t be possible.
High-gain controllers have several practical drawbacks:
Large input: When is large, the input is typically large, because . This may not be desirable for several reasons, such as energy consumption, wear and tear on actuators, or saturation of the input (e.g. you can’t turn the shower handle beyond a certain point). Using a large input may also invalidate the linear model of the system, which may be based on the assumption of relatively small inputs.
Delay in the loop: In practice, there is always some delay in the feedback loop, such as sensor delay, actuator delay, or computational delay. We will see later in the class that any delay in the feedback loop (and every real system has some delay) will destabilize a system when paired with a sufficiently large proportional gain.
Sensitivity to noise: In practice, there is always some noise in the system, such as sensor noise, actuator noise, or process noise. Since the measurement (and hence the noise) is being amplified by and fed back into the system, we will eventually see a deterioration in performance or even instability if is too large.
For these reasons, high-gain control is not a practical way to eliminate steady-state error. In practice, we typically make as large as it needs to be to achieve acceptable performance, but no larger. The more practical integral control mentioned earlier can achieve zero steady-state error without using excessively large inputs. We will cover this topic soon!
P-control of a second-order system¶
Now let’s see what happens when we apply proportional control to a second-order system. Consider a second-order plant in canonical form, again with DC gain for simplicity:
The closed-loop transfer function with proportional control is given by:
Once again, proportional control preserves the order of the system; the closed-loop system is still second-order. However, all the parameters have changed. In particular, the new parameters satisfy:
Which implies that
So as with the first-order case, there is a steady-state error to a step input that diminishes as we increase . The other parameters change in a more complicated way. The natural frequency increases with , and the damping ratio decreases with . It is easier to see what happens if compute the poles of the closed-loop system explicitly. If we assume the system is underdamped to begin with (), then the poles are given by
Therefore, as we vary , we observe the following:
When , the poles are at , which is the same as the open-loop system. However, the DC gain is 0 for this case, so the system does not respond to the step input at all. We observed the same thing for first-order systems.
As increases, the real part of the poles remains constant at , but the imaginary part increases. This means that:
Settling time remains constant because the real part of the poles is constant.
Peak time decreases because the imaginary part increases.
Overshoot increases because the pole angle increases.
We already saw what increasing the imaginary part of the poles does to the step response; see the second panel of Figure 6. However now, the DC gain is also changing. Here are plots of root locus and the closed-loop step response for different values of to illustrate these effects. We assumed for the open-loop system.
Figure 5:Left: Root locus of a second-order system with proportional control. The blue shows the open-loop poles. The blue arrows show how the closed-loop poles move as increases from 0 to . Right: The closed-loop step response for different values of . Peak time decreases, overshoot increases, steady-state error decreases, and settling time remains constant as increases.
Interpretation of P-control error¶
We saw that first and second-order systems with proportional control have a steady-state error to a step input. What is the physical interpretation of this phenomenon? Here are two examples:
Shower control: The error is the difference between the desired temperature and the actual temperature . The controller applies an input to the shower valve. Assuming a positive angle corresponds to more hot water, this will behave as intended; increasing temperature when it’s too cold and reducing temperature when it’s too hot. However, if we ever reach our desired temperature, the error goes to zero, so the controller chooses a knob angle of zero. If this angle happens to correspond to the temperature we want, then we are in luck. But if zero angle corresponds to a medium temperature and our reference is hot, then we will have a steady-state error and our shower will always run a bit cold.
Drone altitude control: The error is the difference between the desired altitude and the actual altitude . The controller applies an input to the drone’s motors. Assuming a positive input corresponds to more thrust, this will behave as intended; increasing altitude when it’s too low and reducing altitude when it’s too high. However, if we ever reach our desired altitude, the error goes to zero, so the controller chooses an input of zero and the drone drops due to gravity. Again, we can never reach our desired altitude.
Test your knowledge¶
Solution to Exercise 1 #
We can find the closed-loop transfer function in steps. First, consider the inner loop. Its transfer function is given by:
Now we can treat the inner loop as a single block with transfer function . The resulting block diagram is:
Figure 7:Simplification of Figure 6 found by collapsing the inner loop.
The closed-loop transfer function of the system is given by:
To place the closed-loop poles at , the characteristic polynomial must be . Therefore, we need to match coefficients:
which implies that and . The resulting closed-loop transfer function is:
The DC gain is therefore .