# How can we control the output temperature of a multi-input single-output pipe air-flow system?

I am trying to optimize the heat control of a test bench at our facility. The test bench is basically a pipe with an air flow that can be heated up to desired temperature. To heat the air flow up, three heat zones are available as shown in the sketch below. Measurements of the temperature are available for $$T_1, T_2, T_3$$ and $$T_4$$. The three zones are each equipped with there own PID controller, so it is possible to set target temperatures for each zone. However the single temperature states obviously affect the values of each other, especially in the direction of the flow, but also slightly in upstream direction via conduction in the pipe material.

The ultimate goal is to set a target temperature for $$T_4$$ and control the three heat zones accordingly.

Right now, basically, only the PID controller of the second heating zone is used for the temperature control. Ideally I would like to use all three heating zones. The PID controllers of the heating zones could either be used to do so or just set to a static gain and building a control on top of this.

What is the general strategy to get such a MISO control set up?

• You probably first need to get a dynamical model for the system. Preferably as a state space model. Then you have to ask yourself what are your design requirements, such as disturbance rejection, minimize power usage or temperature tracking error. Jul 25 '18 at 18:07
• Why not slave T1 and T3 to T2? Then all you have to do is calibrate T2 vs. T4 . Add a little hysteresis so the three controllers don't fight over milliKelvins. Jul 25 '18 at 18:32
• Hi @CarlWitthoft! How would this "enslavement" of T1 and T3 look like in practice? Would I not use the controllers for U1 and U3 but just use the output of the controller of U2 for all three voltages?
– Axel
Jul 25 '18 at 22:15
• Hi @fibonatic. Although I am sure that this would be much closer to an ideal solution, I must admit that we will probably not have the resources and the know-how to properly set up a dynamical model of the system. So I am more looking for practical advise how to cleverly adjust the PID controllers or connect them to a combined control.
– Axel
Jul 25 '18 at 22:21
• @Axel Yes, that was my thought. Very simple, but perhaps not terribly accurate. Arash's MPC answer looks good. Jul 27 '18 at 11:18

There might be so many methods to perform that. But, the premium method is to use a nonlinear Model Predictive Control (MPC).

This is a multi-input/multi-output control method which predicts the future based on the available model. Then it optimizes a series of control inputs to minimize a forecast cost function with respect to the constraints.

A nonlinear MPC is like this

\begin{cases} J(\Delta \boldsymbol U|t)=\sum_{k=1}^{N_p} ||T_4(t+kT_s|t)-T_4^{\text{ref}}||^2+\sum_{k=0}^{N_c-1}||\Delta\boldsymbol U||^2 \\ \Delta \boldsymbol U^{\star}(t) =\text{argmin}_{\Delta \boldsymbol U} ~~J(\Delta \boldsymbol U|t) \\ \text{Optional constraints} \end{cases}

where $x(t'|t)$ means $x$ predicted of time $t'$ at the current time of $t$.

The first term in the cost function is penalizing the error. The second term minimizes the control actions. The constraints could be maximum or minimum temperatures. $N_p$ is called the prediction horizon and $N_c$ is the control horizon and $T_s$ is the sample time.

$\boldsymbol U$ is the series of control actions such as

$$\boldsymbol U=\begin{bmatrix} T_1(t)\\ T_2(t)\\ T_3(t)\\ \dots\\ T_1(t+(N_c-1)T_s)\\ T_2(t+(N_c-1)T_s)\\ T_3(t+(N_c-1)T_s)\\ \end{bmatrix}$$

$\Delta \boldsymbol U$ is the difference of control input $$\Delta \boldsymbol U(t)=\boldsymbol U(t)-\boldsymbol U(t-T_s)$$

The control input is updated at each sample time.

If there is no constraint and if the problem is convex the problem becomes far easier to solve. You can use gradient descent method. If it is even linear, it will reduce to Linear Quadratic Regulator (LQR) problem.

For more information about MPC, have a look at my papers in Researchgate.

BTW, MATLAB has MPC toolbox as well as system identification. You can easily use them.

• Since the raison detre of MPC is process control (similar to the control problem posed by the OP) which requires control of nonlinear dynamics with state and output constraints, it is a good idea to apply here. However, it seems the answer did not state the model predictive dynamical equation $T_4(t′|t)=f(T_4(t))$ as a constraint in the optimization problem state, which is indeed critical to the MPC formulation. Mar 18 at 15:37

Let us take a lumped mass approach to model the thermal dynamics of the region across two zone, including the convection and conduction and approximate the state $$T_4 \approx \frac{T_2 + T_3}{2}$$. Further, assuming that the heat flow is dominated by convection, we can apply the Newton's law of cooling (or heating) to obtain the heat flow rates and therefore the lumped-mass zone temperature dynamics are $$\dot{T_{i}} = {k}_{i} (T_i - \frac{T_{iup}+ T_{idown}}{2})$$ where $$0 < {k}_{i} = const.$$ and the subscripts $$up$$, $$down$$ denote the upstream and downstream temperatures. Then, assuming that $$k := k_i = k_j$$ for all $$i, j$$ and denoting $$T_{12}:=T_{1down} =T_{2up}$$, we have $$\dot{T_{1}} = {k} (T_1 - \frac{T_{1up}+ T_{1down}}{2}) \approx {k} (T_1 - \frac{T_{1up}+ T_{12}}{2}),$$ and similarly $$\dot{T_{2}} \approx {k} (T_{2} - \frac{T_{12}+ T_{4}}{2}),$$ $$\dot{T_{3}} \approx {k} (T_3 - \frac{T_{4}+ T_{3down}}{2}),$$ so that the approximation $$T_4 \approx \frac{T_2 + T_3}{2}$$ implies that $$\dot{T_4} = k (\frac{T_4}{2} - \frac{T_{12} + 2 T_4 + T_{3down}}{4}) = - k \frac{T_{1} + T_{2} + 2 T_{3down}}{8} < 0.$$ This implies that $$\dot{T_4} \rightarrow 0$$ as $$t \rightarrow 0$$ if $$T_2$$ and $$T_3$$ are stable. Considering that temperature PID control of zones $$2$$ and $$3$$ is available, a good first approach is to apply individual PID controllers for zones $$1$$ and $$2$$ to stabilize their temperatures and set $$T_2^{ref}$$ and $$T_3^{ref}$$ such that $$T_4^{ref} = \frac{T_2^{ref} + T_3^{ref}}{2}$$.