Thermal Example
Please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.
As you have discovered, it can be very difficult to design a controller by first selecting candidate poles, and then using a program like place to determine the associated gains. The problem is that the poles can have a complicated impact on trade-offs we care about, such as minimizing response time without exceeding equipment limits. What proved to be more effective is picking the state and input weights in a linear-quadratic regulation (LQR) scheme. In a previous postlab, we considered using LQR on a scalar discrete-time problem, mostly to gain insight into LQR. In this problem, we will try using LQR on a discrete-time system associated with temperature regulation.
A Temperature Control Example
Suppose you are designing the controller for a five-compartment heating system, as shown in the figure below. The pink compartment in the figure is the
Having encapsulated the physical details in g, the equations for the temperature change in one sample period, \Delta T, are not complicated. The change is equal to the product of the period length and the difference between the "flow" in from the left, and the "flow" out to the right. That is,
Controller Design and Equipment Constraints.
For this heating system, the control problem is to adjust the heater's temperature so that all four compartments achieve a desired temperature as quickly as possible, and then adjust the heater to maintain that temperature. But, this physical system has constraints. Allowing the heater to get too hot, even briefly, is dangerous. Very high heater temperatures could start a fire, or increase the frequency and severity of accidental burns. In addition, allowing compartment temperatures to exceed the target by more than a few degrees, even temporarily, may be problematic (particularly if the compartments are occupied).
The heating system constraints should not be dismissed as a problem-specific nuisance. Every real system has physical constraints, and addressing them is a central part of control system design. If fact, we started this section with a very specific physical example, rather than equations and derivations (but those are coming too), because the constraints are easily lost in the mathematics, as is the motivation for finding a design approach other than placing poles.
Determining the Gains.
We can formulate the temperature control problem as a single-input, single-output A_d,B_d,C_d,D_d state-space system,
where \textbf{x} = [x_1,x_2,x_3,x_4]^T , u is the heater temperature, and the A,B,C,D matrices can be derived from the difference equations above. Write a python script that can simulate the above system, and use pole placement to to determine the feedback gains,
prop26SS.py from lab6, simplify it and modify it to use the thermal system's A,B,C,D state-space description.
The use the place command to determine the feedback gains that place the poles of the closed-loop system at 0.501,0.502,0.503,0.504.
If you plot the step response of the closed-loop system, you should see something like the behaviors shown in the 25-minute simulation of the state shown belo. And if you examine the simulated compartment temperatures, you should notice several important characteristics. First, the controller is fast, the compartments settle to room temperature in less than 15 minutes. But, you should also be alarmed by how that speed was achieved. The maximum temperatures are thousands of degrees.
Clearly setting all the poles to 0.5 was too aggressive, but what should we do? Should we set all the poles to the same value, or should we chose several different values? And what values? In the next question, we will ask you to find poles values so that place produces gains that give you controller performance that matches ours. The question is not graded, try it three times by editing your python script, then look at our results and verify them in your code.
And before you start the next problem, please keep in mind our key point. It is very difficult to find the poles that gave a good result, Learn about LQR, another tool for determining controller gains.
You will be trying to pick poles that lead to a controller that minimizes the time for the compartments to settle to their final temperatures, while satisfying constraints associated with the physical system. The two constraints your solutions should always meet are:
- The maximum temperature of the heater must be less than 60.
- The maximum temperature in any compartment should not exceed 20.1 degrees (one tenth of a degree above the target).
Modify the poles to approximately 0.99 (offset them slightly for the place command to work, e.g. 0.99, 0.991, 0.992, 0.994).
Can you find a set of poles that performs better than the results shown below (satisfies the constraints and settles to within one degree in less than 165 minutes)?
We found the following four:
[0.63,0.73,0.87,0.98]
Using OUR answer for the poles in the previous problem, and then use your script to determine the associated gains for our set of poles. What were the related set of gains, to 2 digits of precision? Please note, this question is intended to help you verify that you understand your script.