Robust Control Toolbox

Control of a Two-Tank System

This example shows how to use Robust Control Toolbox™ to design a robust controller (using D-K iteration) and to do robustness analysis on a process control problem. In our example, the plant is a simple two-tank system.

Additional experimental work relating to this system is described by Smith et al. in the following references:

The plant in our example consists of two water tanks in cascade as shown schematically in Figure 1. The upper tank (tank 1) is fed by hot and cold water via computer-controlled valves. The lower tank (tank 2) is fed by water from an exit at the bottom of tank 1. An overflow maintains a constant level in tank 2. A cold water bias stream also feeds tank 2 and enables the tanks to have different steady-state temperatures.

Our design objective is to control the temperatures of both tanks 1 and 2. The controller has access to the reference commands and the temperature measurements.

There are significant dynamics and saturations associated with the actuators, so we'll want to include actuator models. In the frequency range we're using, we can model the actuators as a first order system with rate and magnitude saturations. It is the rate limit, rather than the pole location, that limits the actuator performance for most signals. For a linear model, some of the effects of rate limiting can be included in a perturbation model.

We initially set up the actuator model with one input (the command signal) and two outputs (the actuated signal and its derivative). We'll use the derivative output in limiting the actuation rate when designing the control law.

Open-loop experiments reveal some variability in the system responses and suggest that the linear models are good at low frequency. If we fail to take this information into account during the design, our controller might perform poorly on the real system. For this reason, we will build an uncertainty model that matches our estimate of uncertainty in the physical system as closely as possible. Because the amount of model uncertainty or variability typically depends on frequency, our uncertainty model involves frequency-dependent weighting functions to normalize modeling errors across frequency.

For example, open-loop experiments indicate a significant amount of dynamic uncertainty in the t1 response. This is due primarily to mixing and heat loss. We can model it as a multiplicative (relative) model error Delta2 at the t1 output. Similarly, we can add multiplicative model errors Delta1 and Delta3 to the h1 and t2 outputs as shown in Figure 5.

To complete the uncertainty model, we quantify how big the modeling errors are as a function of frequency. While it's difficult to determine precisely the amount of uncertainty in a system, we can look for rough bounds based on the frequency ranges where the linear model is accurate or poor, as in these cases:

Next, we randomly sample the uncertainty to see how the modeling errors might affect the tank responses

step(tank1u,1000), title('Variability in responses due to modeling errors (Tank 1)')

Figure 7: Variability in responses due to modeling errors (Tank 1).

Setting up a Controller Design

Now let's look at the control design problem. We're interested in tracking setpoint commands for t1 and t2. To take advantage of H-infinity design algorithms, we must formulate the design as a closed-loop gain minimization problem. To do so, we select weighting functions that capture the disturbance characteristics and performance requirements to help normalize the corresponding frequency-dependent gain constraints.

Here is a suitable weighted open-loop transfer function for the two-tank problem:

The sensor dynamics are insignificant relative to the dynamics of the rest of the system. This is not true of the sensor noise. Potential sources of noise include electronic noise in thermocouple compensators, amplifiers, and filters, radiated noise from the stirrers, and poor grounding. We use smoothed FFT analysis to estimate the noise level, which suggests the following weights:

The error weights penalize setpoint tracking errors on t1 and t2. We'll pick first-order low-pass filters for these weights. We use a higher weight (better tracking) for t1 because physical considerations lead us to believe that t1 is easier to control than t2.

The reference (setpoint) weights reflect the frequency contents of such commands. Because the majority of the water flowing into tank 2 comes from tank 1, changes in t2 are dominated by changes in t1. Also t2 is normally commanded to a value close to t1. So it makes more sense to use setpoint weighting expressed in terms of t1 and t2-t1:

Finally, we would like to penalize both the amplitude and the rate of the actuator. We do this by weighting fhc (and fcc) with a function that rolls up at high frequencies. Alternatively, we can create an actuator model with fh and d|fh|/dt as outputs, and weight each output separately with constant weights. This approach has the advantage of reducing the number of states in the weighted open-loop model.

By constructing the weights and weighted open loop of Figure 8, we have recast the control problem as a closed-loop gain minimization. Now we can easily compute a gain-minimizing control law for the nominal tank models:

The smallest achievable closed-loop gain is about 0.9, which shows us that our frequency-domain tracking performance specifications are met by the controller k0. Simulating this design in the time domain is a reasonable way to check that we have correctly set the performance weights. First, we create a closed-loop model mapping the input signals [ t1ref; t2ref; t1noise; t2noise] to the output signals [ h1; t1; t2; fhc; fcc]:

The H-infinity controller k0 is designed for the nominal tank models. Let's look at how well its fares for perturbed model within the model uncertainty bounds. We can compare the nominal closed-loop performance gamma0 with the worst-case performance over the model uncertainty set. (see "Uncertainty on Model Dynamics" for more information.)

Note that wcgain also returns local sensitivities of the worst-case gain to the variability of each uncertain element. The sensitivities imply that the peak on the worst-case gain curve is most sensitive to changes in the range of delta2.