# Model Predictive Control of Temperature and Humidity in Heating, Ventilating and Air Conditioning Systems

Jakob Rehrl, Daniel Schwingshackl, Martin Horn

► To cite this version:

Jakob Rehrl, Daniel Schwingshackl, Martin Horn. Model Predictive Control of Temperature and Humidity in Heating, Ventilating and Air Conditioning Systems. 26th Conference on System Modeling and Optimization (CSMO), Sep 2013, Klagenfurt, Austria. pp.285-295, 10.1007/978-3-662-45504-3_28. hal-01286437

HAL Id: hal-01286437

https://inria.hal.science/hal-01286437

Submitted on 10 Mar 2016

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Model predictive control of temperature and
humidity in heating, ventilating and air
conditioning systems*

Jakob Rehrl¹, Daniel Schwingshackl², and Martin Horn¹

¹ Graz University of Technology, Institute of Automation and Control
8010 Graz, Austria

² Alpen-Adria-Universität Klagenfurt, Control and Mechatronic Systems
9020 Klagenfurt, Austria

**Abstract.** The major application of heating, ventilating and air-conditioning (HVAC) systems is the simultaneous control of air temperature and air humidity. Therefore, in a typical industrial HVAC plant the following actuators are available: A cooling coil is used to decrease the air temperature and relative humidity by cooling below the dew point temperature. A steam humidifier is installed to increase the air humidity whereas the air temperature is influenced via a heating coil. Additionally, air temperature and humidity are affected by disturbances acting on the system. These disturbances include outer air temperature and humidity as well as the temperatures of hot water and cool water supply. Consequently, in the setup at hand, a plant with three manipulated inputs, four measurable disturbances and two controlled outputs has to be considered. A predictive control scheme based on a discrete time plant model is presented. The proposed controller computes the manipulated variables by solving an optimization problem at each time step. Simulation and measurement results obtained from an industrial HVAC system are shown.

**Keywords:** model predictive control, heating ventilating and air conditioning systems

# 1 Introduction

Heating, ventilating and air conditioning (HVAC) systems are used in comfort applications like office space air conditioning. Furthermore, they are also required in industrial applications like inlet air conditioning of engine test benches or for the air conditioning of climate test chambers, e.g. used for automotive tests, see Fig. 1. The two latter fields of application impose stringent specifications on control accuracy.

In order to efficiently operate e.g. a climate chamber, the time required to switch from one temperature/humidity setpoint to another one should be as

<footnote>* The authors would like to thank the company Fischer & Co. Luft- und Klimatechnik in Graz, Austria for their support and for providing the test plant.</footnote>
<figure><img src="image_2.png" /><figcaption>Fig. 1. Sketch of a climate chamber for automotive tests.</figcaption></figure>

short as possible. In Fig. 2, two exemplary setpoint changes are shown: the
left one shows poor performance, whereas the right one reveals a much better
dynamic behaviour and consequently a shorter time to track new setpoints. In
this figure, a given tolerance band for temperature and humidity is indicated.
The grey shaded area illustrates the time it takes to meet the tolerance band
after a setpoint change.

In the present paper, a concept to control air temperature and air humidity
is presented. A systematic approach for controller design is given. The concept is
experimentally verified on an industrial test plant and the results are compared
to standard control techniques. The paper is structured as follows: Section 2
introduces an industrial test plant used to experimentally validate the results.
A mathematical model of the plant required for the proposed control concept is
given. Section 3 describes the suggested control strategy and its application to
the test plant. Section 4 discusses the obtained results and Section 5 concludes
the paper.

## 2 Test plant

In order to verify the proposed concept on an industrial system, the test plant shown in Fig. 3 is available<fnref n="3" />. The plant is capable of increasing and decreasing air temperature as well as air humidity. The core components are heating coils (to increase the air temperature), cooling coils (to decrease the air temperature and to decrease the air humidity) and a steam humidifier (to increase the air humidity). Via a fan, the conditioned air can be transported to a neighboring factory

<footnote n="3">³ The test plant was built and is maintained by Company Fischer&Co. Luft- und Klimatechnik in Graz, Austria (http://www.fischer-co.at/).</footnote>
<figure><img src="image_3.png" /><figcaption>Fig. 2. A setpoint change for temperature and humidity. Poor reference tracking (left hand side) vs. desired reference tracking (right hand side).</figcaption></figure>

building. In the considered plant setup, three actuating signals ($u_1...$ cooling coil 1, $u_2...$ heating coil 1, $u_3...$ steam humidifier) are used. The controlled variables are air temperature $y_1$ and air humidity $y_2$ in the supply air duct to the factory building. The air temperature and humidity after the fan, denoted by $d_1$ and $d_2$ respectively, are regarded as measurable disturbances. Furthermore, the hot water supply temperature for the heating coil and the cold water supply temperature for the cooling coil are considered as measureable disturbances $d_3$ and $d_4$.

## 2.1 Mathematical plant model

Mathematical plant models were derived for the components of the test plant. For the relevant items, the modeling will be described in the following subsections.

**Temperature and humidity sensor.** Temperature and humidity sensors were modeled as first order systems with transfer functions

$$G(s) = \frac{1}{1 + sT}, \qquad (1)$$

where the individual time constants $T$ were identified from measurements.

**Heating and cooling coil.** Since the structure of heating and cooling coil is in principle the same, only one model is required for both. A hot/cold fluid passes through pipes and air circulates around the pipes which leads to - in case of a temperature difference between water and air - a heat transfer. The mathematical model is derived from mass and energy balances. The gained partial differential equations describing temperature of water, pipe and air are converted
<figure><img src="image_4.png" /><figcaption>Fig. 3. Picture and schematic representation of the industrial test plant. Outside air enters the plant from the right, is conditioned and then transported to the neighboring factory building.</figcaption></figure>

to ordinary differential equations by segmenting the pipe [1, 2]. For one segment, see Fig. 4, the following set of differential equations is obtained$^4$.

$$ \frac{d\vartheta_{p,j}}{dt} = \frac{\alpha_i A_i}{m_p c_p} \left[ \frac{\vartheta_{w,j}^I + \vartheta_{w,j}^{II}}{2} - \vartheta_{p,j} \right] + \frac{\alpha_o A_o \Psi_a}{m_p c_p \kappa_a} (\vartheta_{a,j}^{in} - \vartheta_{p,j}) + \frac{\beta A_o r_v \Psi_v}{m_p c_p \kappa_v} (x_{a,j}^{in} - x_{p,j}) \quad (2) $$

$$ \frac{d\vartheta_{w,j}^I}{dt} = \frac{2}{T_{dw} \Delta \bar{x}} \left[ \vartheta_{w,j}^{in} - \frac{\vartheta_{w,j}^I + \vartheta_{w,j}^{II}}{2} \right] + \frac{\alpha_i A_i}{m_w c_w} (\vartheta_{p,j} - \vartheta_{w,j}^I) \quad (3) $$

$$ \frac{d\vartheta_{w,j}^{II}}{dt} = \frac{2}{T_{dw} \Delta \bar{x}} (\vartheta_{w,j}^{I} - \vartheta_{w,j}^{II}) + \frac{\alpha_i A_i}{m_w c_w} (\vartheta_{p,j} - \vartheta_{w,j}^{II}) \quad (4) $$

$$ \vartheta_{w,j}^{\text{out}} = 1.5\vartheta_{w,j}^{\text{II}} - 0.5\vartheta_{w,j}^{I} \quad (5) $$

$$ \vartheta_{a,j}^{\text{out}} = e^{-\kappa_a} \vartheta_{a,j}^{\text{in}} + (1 - e^{-\kappa_a}) \vartheta_{p,j} \quad (6) $$

$$ x_{a,j}^{\text{out}} = e^{-\kappa_v} x_{a,j}^{\text{in}} + (1 - e^{-\kappa_v}) x_{p,j} \quad (7) $$

The temperature $\vartheta_p$ of the pipe is influenced by the heat transfer from water to pipe, by the air inlet temperature and the inlet humidity, see (2). The water temperatures $\vartheta_{w,j}^I$ and $\vartheta_{w,j}^{II}$ depend on the inlet water temperature $\vartheta_{w,j}^{in}$ and the pipe temperature $\vartheta_p$. The coefficients in (2)-(4) are given by heat transfer

<footnote>$^4$ A description of the used variables can be found in the nomenclature at the end of the paper.</footnote>
properties. The outlet air temperature $\vartheta_{a,j}^{\text{out}}$ as well as the outlet air humidity $x_{a,j}^{\text{out}}$ are computed from the respective values at the segments inlet and at the pipe, see (6) and (7). The computation of the weighting factors is given in the nomenclature and can be found in [1].

<figure><img src="image_5.png" /><figcaption>Fig. 4. Structure of a heating/cooling coil and sketch of one pipe segment.</figcaption></figure>

**Hydraulics.** The structure of the hydraulics for heating coil and cooling coil differ. The heating coil is operated with (almost) constant water mass flow, its heating power is varied by adjusting the mixing ratio of (hot) supply water with (cold) return water. In contrast to this operating mode, the water mass flow of the cooling coil is varied in order to set the cooling power. For the hydraulic system of the heating coil, a static curve which relates a valve position to a mixing ratio is used for modeling. In case of the cooling coil, a curve that relates the valve position to a water mass flow is used. Both relationships were obtained from measurements and valve data. From the valve data and pipe resistance values, the shape of the respective static curve was obtained. Via measurements, the scaling of the static curve was adopted to the plant hydraulics.

## 3 Control concept

Model predictive control (MPC) [3, 4] has been increasingly applied to HVAC systems in recent years, see e.g. [5–8]. The sampling times of HVAC systems, which are typically in the range of several seconds, make the online solution of the optimization problem possible, even with limited computing power. Furthermore, multi-input-multi-output systems with constraints on the actuating signals are handled naturally with MPC. The block diagram of the proposed concept is depicted in Fig. 5. The model predictive controller utilizes a linear plant model which is updated each sampling instant. The linear model is obtained from a model constructed via the local linear model tree (LoLiMoT) algorithm [9–11]. This model will be referred to as LoLiMoT-model in the following and its generation will be illustrated in the next section. The computation of the linear state space model is addressed in Section 3.2.
<figure><img src="image_6.png" /><figcaption>Fig. 5. Block diagram of the proposed control concept.</figcaption></figure>

## 3.1 LoLiMoT-model of the plant

The idea of the LoLiMoT algorithm is to approximate a nonlinear system via several locally affine models. Input and output data of the system to be modeled, in the following referred to as identification data, is required by the algorithm to compute the local models parameters $w$ and the validity range of the local models. The output of one local model is computed from the $n$ previous plant inputs $u$ and outputs $y$ via its individual difference equation. The order of the local models is given by $n$. The output $y_k$ of the LoLiMoT-model at time instant $k$ is computed via the weighted sum of the locally affine models outputs, i.e.

$$y_k = \sum_{l=1}^{M} \left( w_{l0} + \sum_{i=1}^{n} \left[ w_{li}^{y} y_{k-i} + \sum_{j=1}^{m} w_{li}^{u_j} u_{j,k-i} \right] \right) \Phi_l(\mathbf{u}^*_k), \quad (8)$$

$$\text{where} \quad \mathbf{u}^*_k = [u_{1,k-1} \ u_{1,k-2} \ \dots \ u_{1,k-n} \ u_{2,k-1} \ \dots \ u_{2,k-n} \ \dots \ u_{m,k-1} \ \dots \ u_{m,k-n} \ y_{k-1} \ y_{k-2} \ \dots \ y_{k-n}]^T . \quad (9)$$

The number of local models is denoted by $M$. The number of model inputs is $m$. In the present paper, $M = 20$, $n = 1$ and $m = 7$ holds. The weighting functions $\Phi(\mathbf{u}^*_k)$ corresponding to the local models are normalized Gaussian functions. They depend on the previous inputs and outputs of the LoLiMoT-model which are collected in the vector $\mathbf{u}^*$.

In a first attempt, the identification data is directly derived from measurements at the test plant. This approach shows a severe problem: the disturbances $d_1$ to $d_4$ cannot be excited arbitrarily. Consequently, the data available for identification is inappropriate. To tackle the mentioned obstacle, the identification data was generated via the mathematical plant model given in Section 2.1. Via this method, sufficiently long and sufficiently excited identification signals can be generated. In Fig. 6, a comparison of test plant measurements versus the mathematical model output is shown. The dynamic behaviour is captured very well. The temperature offset will be compensated by the controller. The LoLiMoT-model output compared to the test plant measurements is depicted in Fig. 6 on
the right hand side. A good accordance of the model output with the test plant measurements is given.

<figure><img src="image_7.png" /><figcaption>Fig. 6. Comparison: test plant measurements vs. mathematical model output (left) and test plant measurement vs. LoLiMoT-model output (right).</figcaption></figure>

## 3.2 Computation of the linear state space model

For the proposed control concept, the plant parameters **A**, **B**, **H** and **C** of a linear state space model are required. These parameters are updated at each sampling instant and are obtained from the LoLiMoT-model. The observability canonical form is chosen, the parameters are computed from the coefficients given in (8). A detailed description is omitted due to space limitations, it can be found in [12].

## 3.3 Model predictive controller

The proposed control concept relies on a linear model predictive controller of the form<fnref n="5" />

$$ \min_{\mathbf{u}_{k+i|k}} \sum_{i=0}^{n_p-1} (\mathbf{r}_{k+i|k} - \hat{\mathbf{y}}_{k+i|k})^T \mathbf{Q} (\mathbf{r}_{k+i|k} - \hat{\mathbf{y}}_{k+i|k}) + \Delta \mathbf{u}_{k+i|k}^T \mathbf{R}_1 \Delta \mathbf{u}_{k+i|k} + \mathbf{u}_{k+i|k}^T \mathbf{R}_2 \mathbf{u}_{k+i|k} \quad (10) $$

s.t.

<footnote n="5">⁵ The nomenclature $k+i|k$ denotes the prediction of a variable at time instant $k+i$, provided measurement data is available up to time instant $k$.</footnote>
$$ \mathbf{u}_{min} \leq \mathbf{u}_{k+i|k} \leq \mathbf{u}_{max} \qquad (11) $$

$$ \Delta \mathbf{u}_{min} \leq \Delta \mathbf{u}_{k+i|k} \leq \Delta \mathbf{u}_{max} \qquad (12) $$

$$ \Delta \mathbf{u}_{k+i|k} = \mathbf{u}_{k+i|k} - \mathbf{u}_{k+i-1|k} \qquad (13) $$

$$ \Delta \mathbf{u}_{k+i|k} = 0 \quad \forall i > n_c \qquad (14) $$

$$ \mathbf{x}_{k+i+1|k} = \mathbf{A}_k \mathbf{x}_{k+i|k} + \mathbf{B}_k \mathbf{u}_{k+i|k} + \mathbf{H}_k \mathbf{d}_{k+i|k} \qquad (15) $$

$$ \hat{\mathbf{y}}_{k+i|k} = \mathbf{C}_k \mathbf{x}_{k+i|k} \qquad (16) $$

Deviations of the predicted plant output $\hat{\mathbf{y}}$ from the reference $\mathbf{r}$ are penalized by the matrix $\mathbf{Q}$ along the prediction horizon $n_p$. The choice of the prediction horizon was motivated by the system dynamics. From step experiments, the dominant time constant was determined and the horizon was chosen to cover approximately 5 time constants. With this setting, extensive experimental validation was performed on the industrial system with the proposed MPC-LoLiMoT-scheme. These experiments showed that the controlled variables converged to their respective reference values. The predicted output $\hat{\mathbf{y}}_{k+i|k}$ is corrected by the difference between measurement and model output at time $k$, i.e. $\hat{\mathbf{y}}_k - \mathbf{y}_k$. Constraints on the actuating signal $\mathbf{u}$ are given by (11). The rate of change of the actuating signal $\Delta \mathbf{u}$ is limited by $\Delta \mathbf{u}_{min}$ and $\Delta \mathbf{u}_{max}$, see (12)-(13). Furthermore, the actuating signal is supposed to remain constant for $i > n_c$, where $n_c$ is the control horizon, see (14). Constraints due to the plant model are represented by (15) and (16). The actuating signal as well as the actuating signals rate of change are penalized via $\mathbf{R}_2$ and $\mathbf{R}_1$ respectively.

# 4 Discussion

In Fig. 7, measurements obtained at the test plant are presented. The diagram on the left hand side outlines the capability of the proposed controller to track reference step signals. The short settling time demonstrates the performance of the MPC/LoLiMoT combination. Actuating signal limits concerning amplitude (limited to the range 0 - 100%) and rate (limited to 28.57% per 10 seconds) are accounted for by (11) and (12). The heater is at the lower limit until 1000 seconds, i.e. constraint (11) is active for the heater during this period. At time equal to 1000 s, the rate limitations (12) are active for the heater and for the humidifier. During the experiment, at least one of the actuators is at its lower limit most of the time. In the diagram on the right hand side, a comparison to a classical PI approach is shown. For this measurement, the steam humidifier was deactivated, and instead of cooling coil 1 and heating coil 1, cooling coil 2 and heating coil 2 were selected as actuators. In the PI-strategy, the cooler was used to control the temperature, the heater was used to control the humidity. Two separate PI-controllers were tuned by a company specialized to HVAC control. In the comparison diagram, the proposed strategy clearly outperforms the PI strategy. Especially, the temperature can be kept at the setpoint very accurately (notice the small deviation of less than 0.5°C from the reference) with the
proposed strategy, whereas the PI-strategy shows control errors above 1.5°C. The tracking performance regarding the humidity is similar for both approaches with slight advantages for the proposed concept. The humidity remains in a ±5% tolerance band from approximately 100 s after the step signal.

<figure><img src="image_8.png" /><figcaption>Fig. 7. Measurement results. Left: tracking of several reference steps. Right: Comparison to a conventional PI-controller.</figcaption></figure>

## 5 Conclusion

In the present paper, a control technique is presented which relies on a linear MPC formulation. To deal with nonlinearities of the plant, the parameters of the linear model are updated each sampling instant. A plant model obtained via the LoLiMoT algorithm forms the basis for the creation of the linear state space model. For the presented application consisting of 3 actuators and 2 controlled variables, the presented concept naturally handles the choice of the actuators. Limitations of the actuators (e.g. limited valve travel in the range of 0 to 100% and limited slew rate) are handled by the model predictive controller. With conventional schemes, e.g. separate PI-controllers, an additional logic to switch between the distinct controllers has to be implemented. This is not necessary with the proposed concept, it offers a straight forward, systematic approach to design controllers for HVAC systems.
## Nomenclature

<table><tr><td>A<sub>i</sub> ... inner pipe surface</td><td>x ... air humidity in kg water per kg air</td></tr><tr><td>A<sub>o</sub> ... outer pipe surface</td><td>Δx̃ ... normalized length of</td></tr><tr><td>c<sub>a</sub> ... specific heat capacity of air</td><td>one pipe segment</td></tr><tr><td>c<sub>p</sub> ... specific heat capacity of the pipe</td><td>α<sub>i</sub> ... inner heat transfer coefficient</td></tr><tr><td>c<sub>w</sub> ... specific heat capacity of water</td><td>water-pipe</td></tr><tr><td>ṁ<sub>a</sub> ... air mass flow</td><td>α<sub>o</sub> ... outer heat transfer coefficient</td></tr><tr><td>m<sub>p</sub> ... pipe mass</td><td>pipe-air</td></tr><tr><td>m<sub>w</sub> ... water mass</td><td>β ... mass transfer coefficient</td></tr><tr><td>n<sub>c</sub> ... control horizon</td><td>ϑ ... temperature, index a: air,</td></tr><tr><td>n<sub>p</sub> ... prediction horizon</td><td>index p: pipe, index w: water</td></tr><tr><td>r<sub>v</sub> ... evaporation heat of water</td><td>κ<sub>a</sub> ... α<sub>o</sub>A<sub>o</sub>/ṁ<sub>a</sub>c<sub>a</sub></td></tr><tr><td>T<sub>dw</sub> ... time it takes the water to<br>pass the coil</td><td>κ<sub>v</sub> ... βA<sub>o</sub>/ṁ<sub>a</sub></td></tr><tr><td>T ... time constant</td><td>Ψ<sub>a</sub> ... 1 - e<sup>κ<sub>a</sub></sup><br>Ψ<sub>v</sub> ... 1 - e<sup>κ<sub>v</sub></sup></td></tr></table>

## References

1. Wiening, W.: Zur Modellbildung, Regelung und Steuerung von Wärmeübertragern zum Heizen und Kühlen von Luft. Fortschritt-Berichte VDI Reihe 8 Nr. 128. VDI-Verlag, Düsseldorf (1987)

2. Rehrl, J.: Modeling, Simulation and Control of complex Heating, Ventilating and Air Conditioning (HVAC) Systems. PhD thesis, Alpen-Adria-Universität Klagenfurt (2011)

3. Maciejowski, J.M.: Predictive Control with Constraints. Pearson (2002)

4. Camacho, E.F., Bordons, C.: Model Predictive Control. 2nd edn. Springer (2007)

5. Aswani, A., Master, N., Taneja, J., Culler, D., Tomlin, C.: Reducing transient and steady state electricity consumption in hvac using learning-based model-predictive control. Proceedings of the IEEE 100(1) (2012) 240–253

6. Aswani, A., Master, N., Taneja, J., Krioukov, A., Culler, D., Tomlin, C.: Energy-efficient building hvac control using hybrid system lbmpc. In: 4th IFAC Nonlinear Model Predictive Control Conference. (2012) 496–501

7. Ma, Y., Kelman, A., Daly, A., Borrelli, F.: Predictive Control for Energy Efficient Buildings with Thermal Storage: Modeling, Simulation, and Experiments. IEEE Control Systems 32(1) (2012) 44–64

8. Oldewurtel, F., Ulbig, A., Parisio, A., Andersson, G., Morari, M.: Reducing peak electricity demand in building climate control using real-time pricing and model predictive control. In: 49th IEEE Conference on Decision and Control (CDC). (2010) 1927–1932

9. Nelles, O.: Nonlinear System Identification. Springer (2010)

10. Nelles, O.: LOLIMOT - Lokale, lineare Modelle zur Identifikation nichtlinearer, dynamischer Systeme. at - Automatisierungstechnik 45 (4 1997) 163–174

11. Hecker, O., Nelles, O., Moseler, O.: Nonlinear system identification and predictive control of a heat exchanger based on local linear fuzzy models. In: Proceedings of the American Control Conference. Volume 5. (June 1997) 3294–3298

12. Schwingshackl, D., Rehrl, J., Horn, M.: Model predictive control of a HVAC system based on the LoLiMoT algorithm. In: European Control Conference (ECC). (2013) 4328–4333