Atomate HVAC
Atomate HVAC
DI INGEGNERIA
DELL'INFORMAZIONE
Laureando
Giorgio Pattarello
Relatore
Prof. Ruggero Carli
Correlatore
Prof. Karl H. Johansson
Dipartimento di
Ingegneria
dell’Informazione
Anno 2013
Abstract
Recently, one of the most debated subjects regards energy savings. Since the
percentage of the energy consumptions accounted for buildings is surprisingly
higher than the one for the industries and transportations, the society is
becoming more and more aware of the importance of the quality of building
management. This gives an impulse to the automatic control community to
design intelligent controllers for energy savings, a fact that appears evident also
in the scientific literature. Many efforts have been spent in order to propose
different control technique for the HVAC systems. However, only few papers
deal with the implementation and test of the proposed controllers on a real
case study. There is thus still the need of understanding what is critical in
the implementation of such schemes, what affects the most the energy saving
possibilities, and what is the critical and valuable information.
The final aim of this work is thus to design, implement and test a controller
on a real testbed kindly provided by KTH Royal Institute of Technology. The
control paradigm presented in this thesis is a model predictive controller that
aims at saving energy as well as keeping the temperature and the carbon
dioxide (CO2 ) concentration in a comfort range that guarantees the wellness
of room occupants. To improve the knowledge of the plant, we also study the
problem of modeling both the dynamics of the system to be controlled and
of the dedicated actuation system. Our experiments show that the obtained
controller is able to satisfy the requests on energy savings and comfort, and
hence can be used as a starting point for the design of efficient model based
controllers of HVAC systems.
ii
Acknowledgements
The path I walked on to get to where I am now has been very long and twisting
but all the people I found along made my travel easier and enjoyable. From
all of them I have learnt something that I will always carry with me. In this
occasion I can write on paper how grateful I am to them.
First of all I would like to thank Prof. Ruggero Carli and Prof. Karl Henrik
Johansson for having given me the opportunity to spend six beautiful months in
Stockholm, learning, growing and enjoying. Without this experience probably
I would not have been aware of some aspect of the life that sometimes after a
while you may forget.
Thanks to Damiano, Alessandra, Marco an also Giulio for having been so
patient, willing and kind with me in all the period I spent both inside and
outside the department; in particular Damiano has been for me more than a
supervisor and he helped me every time I had any kind of problem.
I want to thank also my parents and my sister. They always supported,
trusted and believed in me in all the choices I have done in my life.
Thanks to Coba, Zano, Gamba, Guido and Michele for having been always
real and honest friends. Especially I want to thank Coba and Marta for the
big role they gave me in a very remarkable day of their life. I am very proud
of this, and I am very proud of you all. I wish you all the best in your future
because you deserve it.
Thanks to Valerio, Giulio, Demia and Alberto for making me feel in a family
all the time. The time I spent with you was really great.
Thanks to all the HVAC group, especially Lin, Mani, Daniel, Ferran, Alireza,
Afrooz and all the people who helped me and shared with me the technical
problems of a real testbed; thanks also to Akademiska Hus for the support for
the measurements.
Thanks to Andrea, Gianluca, Giacomo, Lorenza, Giulia M., Giulia V.,
iv
Laura, Elena, all my past teammates and all the people with whom I shared
also a little part of my life, because I will always have a little piece of you in
me.
Thanks to Volpe and Lanza for having shared with me most of the troubles
I have had to become an engineer.
I leave at the end a very special thanks for my grandparents. They have
been like parents for me in all my life, they were always ready to help me and
my family in every occasion they had. I owe you a lot.
Contents
1 Introduction 1
1.1 Contribution of the Thesis . . . . . . . . . . . . . . . . . . . . . 2
1.2 Overview of the Thesis . . . . . . . . . . . . . . . . . . . . . . . 3
2 HVAC systems 5
2.1 Description of general HVAC systems . . . . . . . . . . . . . . . 5
2.2 Peculiarities of the KTH HVAC Testbed . . . . . . . . . . . . . 13
4 Control strategies 49
4.1 The current practice Proportional Integrative (PI) controller . . 49
4.2 The considered Model Predictive Control (MPC) strategy . . . . 51
5 Experimental Results 73
5.1 Testing the MPC solution adopted to control the cooling actuation 73
5.2 Test of the whole MPC . . . . . . . . . . . . . . . . . . . . . . . 77
6 Conclusions 85
7 Further developments 87
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
vi Contents
List of Figures
3.1 Electric scheme of the model of the walls. The three resistances
j
1/ho , Rwall and 1/hi are placed between the equivalent temper-
j j j j
ature Tee , and the temperatures Twall,o , Twall,i and Troom . Rwall
[°C/W] and C j [J/°C] are the thermal resistance and the thermal
capacity of the j-th wall respectively . . . . . . . . . . . . . . . 32
3.2 Validation of the model performed with the software IDA ICE. . 32
3.3 Comparison between the simulated temperatures obtained with
the physical model and the actual measured room temperature. 33
3.4 Validation of the CO2 physical model. . . . . . . . . . . . . . . . 34
3.5 Fitting of the CO2 models with the validation set of data. . . . 36
3.6 Validation of the CO2 models. . . . . . . . . . . . . . . . . . . . 36
3.7 Picture of the motes attached to the radiator to run the test to
get the mean radiant temperature. . . . . . . . . . . . . . . . . 39
3.8 Test on the radiators: first radiator temperature response. The
motes are placed on the radiator in this order: 1032 on the top
right, where there is the hot water inlet,1035 on the top left,
1030 in the center, 1034 on the bottom left and 1033 on the
bottom right, where there is the hot water outlet. . . . . . . . . 40
3.9 Test on the radiators: Comparison between motes in the first
radiator (1035, 1030) and in the last (1036, 1037), placed in the
same position on the radiator. Motes 1035 and 1036 are placed
on the top left corner of the first and last radiator respectively,
while Sensor 1030 and Sensor 1037 are placed in the center. . . . 41
3.10 Relation between mass flow and opening valve percentage . . . . 44
3.11 Fitting between real supply air temperature of the air condition-
ing outlet and the simulated one. . . . . . . . . . . . . . . . . . 46
5.1 Simulation on the second level MPC for the Tsa . The reference
is set to 17℃ the ventilation is constant at 30%. . . . . . . . . . 74
5.2 Simulation on the second level MPC for the Tsa . The reference
is set to 18℃ the ventilation is constant at 30%. . . . . . . . . . 74
5.3 Test on the equilibrium point method for the Tsa . The reference
is set to 17℃ and the ventilation is constant at 30%. . . . . . . 75
5.4 Test on the equilibrium point method for the Tsa . The reference
is set to 18℃ and the ventilation is constant at 30%. . . . . . . 75
5.5 Test on the MPC for the Tsa . The reference is set to 17℃ and
the ventilation is constant at 30%. . . . . . . . . . . . . . . . . 76
5.6 Test on the MPC for the Tsa . The reference is set to 18℃ and
the ventilation is constant at 30%. . . . . . . . . . . . . . . . . 76
5.7 Test 1 on the MPC. The temperature comfort bounds are set to
20 ℃ to 23 ℃ while the upper bound of the CO2 concentration
is 700 ppm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
5.8 Test 2 on the MPC. The temperature comfort bounds are set to
20 ℃ to 23 ℃ while the upper bound of the CO2 concentration
is 700 ppm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
5.9 Test 3 on the MPC. The temperature comfort bounds are set to
20 ℃ to 23 ℃ while the upper bound of the CO2 concentration
is 700 ppm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
5.10 Test 4 on the MPC. The temperature comfort bounds are set to
20 ℃ to 23 ℃ while the upper bound of the CO2 concentration
is 750 ppm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
x List of Figures
Introduction
1
Buildings account for a surprisingly high percentage of energy consumption.
As reported in [1], in 2004 the United States the management of buildings
consumed the 41% of the total energy spent by mankind. In the EU this figure
was reported to be 37% of the final energy, bigger than industry (28%) and
transportation (32%) . In the UK, the proportion of energy use in building is
39%, slightly above the European average.
Environmental concerns pair with the large and attractive opportunities that
exist to reduce buildings’ energy use. To give some figures, the International
Energy Agency’s (IEA) targets a 77% reduction in the planet’s carbon footprint
by 2050. At the same time reports by the World Business Council for Sustainable
Development (WBCSD) in 2009 suggest that the possibility of cutting the
energy consumptions in buildings is dramatic, comparable to the amount of
energy currently required by the entire transportation sector.
The vision of the mainstream researchers is that these energy savings can
be achieved by exploiting information, or, to use a buzz-word, by implementing
intelligent buildings. This means to control buildings using meaningfully the
data coming from the various information sources available now or in the near
future.
2 Introduction
• rooms occupancy patterns that are usually unknown or highly non sta-
tionary in time;
The role of this thesis is thus to analyze, standing on the shoulders of giants,
what affects MPC schemes in real HVAC systems. Thus to see, from practical
perspectives, what plays a critical role and what needs to be addressed in the
future to improve their energy-savings performance.
Specifically the thesis describes in details the implementation of MPC
schemes on a real testbed. By doing so we achieved some specific contributions,
that can be summarized in:
• tailor classical MPC schemes to a real HVAC testbed, and identify the
idealizations that are often assumed in literature. This aims to understand
how much the practical problems encountered during implementations
can lead to deviations from theoretical findings;
users to change their behavior, e.g., have to be worn or carried. This means
that doing research on HVAC systems requires to do not resort to any advanced
sensing technology that is expensive, generating privacy concerns or requiring
changes in user behavior, e.g., cameras, Radio Frequency Identification (RFID)
tags, or wearable sensors.
In a schematic way, the most used hardware tools are:
• cameras;
• RFID tags.
Simple sensors are used in many energy intelligent buildings in the interest of
activity recognition. For instance, PIR based sensors are often used (especially
with lighting system) for occupancy detection. The sensors are connected
directly to local lighting fixtures. These PIR sensors are also simple movement
sensors and often cannot actually determine if the room is occupied or not. E.g.,
if the persons stand still, they will fail in detecting the occupancy. PIR sensors
are used for instance in [2], where Padmanabh et al. investigate the joint use of
microphones and PIR sensors for inferring the scheduling of conference rooms.
An other project where PIR sensors have been used is the AIM Project [3],
where authors used sensors to get some physical parameters, like temperature
and light, as well as PIR to infer user presence in each room of a house.
Indoor activity recognition is in general implemented to provide inputs to a
control strategy that aims for energy savings in buildings. To this aim, other
sensors than PIRs can be used: in Greener Building [4] authors perform indoor
activity recognition using simple infrared, pressure and acoustic sensors. An
other strategy is to use door sensors. For instance [5] uses them in conjunc-
tion with PIR sensors to automatically turn off the HVAC system when the
occupants are sleeping or away from home. Also in [6] Agarwal et al. chose
to use a combination of a magnetic reed switch door sensor and a PIR sensor
2.1 Description of general HVAC systems 7
hook sensors are used to determine if rooms are in occupied states. The authors
use Markov chains to model the occupied state of individual rooms, where the
transition matrix probabilities are calculated by examining the distribution of
the sojourn times of the observed states.
All these works focus on the creation of occupancy models, that are then
exploited for control purposes. There are indeed several manuscripts reporting
usages of these models. E.g., in [20] daily occupancy profiles of occupancy are
used in conjunction with a simple PID controller that works only on the heating
accordingly to the profile, trying to set the indoor temperature to a certain
set-point. In [5] the HVAC system is turned on or off when the occupants are
away or asleep. This smart thermostat uses a Hidden Markov Chain (HMC)
model to estimate the probability that the home is in one of the states away,
active or sleep with transition every 5 minutes.
A lot of literature considers also model predictive control strategies applied
to occupancy models. For example, in [8] Dong et al. use a Gaussian Mixture
Model to categorize the changes of a selected feature. These are observations
for an Hidden Markov Model that estimates the number of occupants. To
estimate the duration of the occupants in a certain area it has been used a
Semi Markov Model based on the pattern of the CO2 acoustic, motion and
lightning changes. All these information are given to a Non-Linear MPC that,
solved by dynamic programming, gives the optimal control profile to use.
cost ones.
In this context it is important to consider also the uncertainty of the pre-
dictions. [29, 30, 31, 32] have all considered also these uncertainties, even if
in different ways. In [29], authors incorporate a stochastic occupancy model
within the control loop. [30] instead proposes a stochastic predictive building
temperature regulator where weather and load disturbances are modeled as
Gaussian processes. [31] also uses a stochastic MPC and weather predictions.
Firstly it solves a non-convex optimization problem and then it applies a distur-
bances feedback. [32] finally considers stochastic approach on the uncertainty
of the forecast disturbances (the outside temperature, the occupancy and the
solar radiation) solving the problem considering a scenarios based approach
and a statistical learning procedure to learn these statistics from real and local
data.
Effect of automatic blinds and lighting control also these systems have
an important effect on heating and cooling requirements. A noticeable paper
in this subject is [22], where the authors investigate the reduction in annual
primary energy requirements for indoor climate control achieved in Rome by
applying automated lighting control.
Remarks the current academic trend is to build testbeds and perform ex-
periments on it to validate the simulative results. The most famous are the
one from the ETH Zurich (Switzerland) [33], and the one of the University of
California, Berkeley, [34]. Confirming a trend followed also in other automatic
control frameworks, both these groups are applying Model Predictive Control
strategies.
We nonetheless notice that the testbed considered in the current thesis has
its own peculiarities, not only from topological points of view (i.e., the map of
the building) but also in the structure of the HVAC system (i.e., the actuation
system) and, even more importantly, in the climatic environment where it lies.
Thus some care must be placed in comparing and assessing the architectural
choices made by the designers of these testbeds.
2.2 Peculiarities of the KTH HVAC Testbed 13
Figure 2.1: External view of the Q building in Stockholm, Sweden. The building is
composed by 7 floors, from floor 2 to floor 8. Floor 2, that is actually the first floor, is
underground.
Figure 2.2: Map of the second floor of the Q building. The floor is underground.
The testbed comprises the floor shown in Figure 2.2. The floor is composed
by a main corridor where all the rooms are facing: four laboratories, one
14 HVAC systems
conference hall, one storage room and one study room. All the rooms of the
second floor of the KTH Q building, except the storage room and a PCB Lab
are equipped with a HDH sensor on the wall surface. This allows to detect
temperature and CO2 level in each rooms. Referring to Figure 2.2, the database
gives information on the temperature and CO2 of rooms A:213, A:225, A:235
and A:230. The thermal levels and the air quality of these rooms can then be
controlled by venting, cooling and heating actuators.
Our attention is primarily on room A:225, informally called the water tank
lab. In fact, due to regulations limitations, the research team performing
automation experiments on this testbed has permissions to actuate only on
this limited area of the second floor. To date, thus, this is the only room that
is actively controlled.
The water tank lab (WTL) is equipped with:
• an auxiliary PLC that allows the user to control the actuation signals.
We notice that the auxiliary PLC allows switching between the default controller
(described in the following section 2.2) and the controllers implemented by the
research team.
Since the final aim of the project is to control climate features of the indoor
environment, it is of paramount importance to describe in precise details the
functioning of the actuation systems. The main sources of climate control are
3: ventilation system, heating system and the cooling system. In the next
sections we will describe them in precise details. For convenience we refer to
the schematics offered in Figure 2.2.
The air heating system exploits common radiators. More precisely, in the
WTL there are four radiators connected in parallel. As every normal radiator,
they are heated by hot water transitioning through their circuits. It must be
noticed that this heated water comes from a district heating system, also called
2.2 Peculiarities of the KTH HVAC Testbed 15
Figure 2.3: Diagram of the actuation systems present in the water tank lab. This scheme
shows the degrees of freedom and the constraints that must be faced when designing air
quality control schemes for the considered testbed.
60
50
40
30
20
Figure 2.4: Map showing the temperature of the water flowing through the radiators as a
function of the external temperature. The map represents reference temperatures, since it
neglects all the possible dynamics on these quantities.
Figure 2.5: Photos of one of the radiators, the fresh air inlet, the exhausted air outlet and
the air conditioning outlet present in the water tank lab.
units. The fresh air flow for areas with special applications (like laboratories
or conference halls) is regulated by a Demand Controlled Ventilation (DCV),
while for floors housing office areas there is instead a constant fresh air flow. In
both these two cases venting is provided only in the day time and in a specific
time slot, specifically from 07:00 to 16:00.
In our particular case the venting and the cooling systems are actually
strictly connected. Indeed the air system comprises only one circuit that
provides fresh air to the venting and cooling system at a temperature that is
normally between 20 and 21 degrees, and that it is at the same pressure in the
whole duct. In more details the system composed by heat exchanger, pumps
and a heating/cooling system.
The ventilation system is composed by two parts: one for getting fresh
air and one for taking away the exhausted air. Fresh air is supplied in the duct
by one of the ventilation units, while the damper regulates the airflow that
comes into the room. The air outlet is just a hole in the wall, where there is a
tube with a dumper inside, that allows the air to flow through.
We notice that this exhaust air then flows into a duct that is eventually
carried to the heater exchanger, so that a “free” pre-heating is performed to the
fresh air coming inside. As shown in the schematics in Figure 2.6, in the WTL
the ventilation duct is split in two equal branches, each with two ventilation
and two air conditioning outputs.
Figure 2.6: Scheme of the air inlets present in the water tank lab.
The cooling system is instead based on air conditioning units working with
induction principles (a schematic drawing is shown in Figure 2.7). The primary
18 HVAC systems
Figure 2.7: Scheme of the air conditioning system of the water tank lab.
We notice that the AC unit can also be used for heating purposes. In this
case the only difference from the cooling process is that the water that is flowing
in the coil is now warm. We notice that, as for the temperature of the water
flowing through the radiators, the temperature of the water flowing through
this cooling coil is not controllable by the users. As for the radiators case, also
this temperature depends statically on the outside temperature. During our
experiments this temperature was around 16 ℃.
Continuing the analogy with the heating system, actuation of the cooling
subsystem is performed through a valve that is placed before the chilled water
circuit and whose opening percentage can be set using the SCADA web interface.
We notice that if the ventilation system is running only the venting subsys-
tem, fresh air is coming from the cooling unit nozzles also (around the 30% of
2
A plenum is a housing where it is created and stored air with a pressure greater than
the atmospheric one
2.2 Peculiarities of the KTH HVAC Testbed 19
the total amount of the available air flow). Vice-versa, when we want to cool
we need an air flow to chill. This leads us to notice the very important feature:
1. the fresh air from outside is imported through a valve (denoted with the
code ST201);
3. after that the air is processed by an heater exchanger which exploits the
heat of exhaust air flow. As shown in the Figure 2.8 the imported fresh
air is warmed up to 19.4℃;
4. the pump TF001 then pushes the warmed air to the heating and cooling
system sequentially; due to this the temperature of the fresh air that
flows through the ducts is around 20℃ in each room;
Summarizing, when the temperature of the room is below 20℃ the air from
the ventilation helps the heating system to increase the indoor temperature.
Otherwise, if the temperature is greater then 20℃the ventilation system helps
to lower the room temperature.
Figure 2.8: SCADA interface of the system that provides the fresh air to the venting and
cooling system
WSN
To gather further information on the status of the indoor environment the
testbed features an ad-hoc Wireless Sensor Network (WSN) composed of Tmote
3
A Soft PLC is basically a software package which emulates the functionality of a standard
PLC inside a PC. The product that is used in the KTH testbed is a Fidelix Soft PLC. It has
Internet access and is able to communicate as an OPC client to an OPC server.
2.2 Peculiarities of the KTH HVAC Testbed 21
Sky nodes. These Tmote Sky devices include a number of on-board sensors to
measure light, temperature and humidity. In addition of that, other external
sensors may be connected to the motes, using the dedicated ADC channel on
the opportune expansion area.
In particular some motes are equipped with an additional CO2 and temper-
ature sensor (this has been done specially to avoid alterations in the measured
temperatures induced by the heat that the motes microprocessor release, and
also to to reach places that could not be accessible in other ways).
Figure 2.9: A Tmote Sky with highlighted the various measurements systems.
The WTL currently comprises 10 motes in the WTL, 4 motes in the rooms
beside, 1 in the corridor and 1 outside the building. The nodes form a star
network, and send data to a root mote directly connected with a server collecting
and storing all the information (see Figure 2.11).
The motes forwards the sensed data to the main server every 30 seconds.
The list of the nodes and of their main features are summarized in Table 2.1.
People counter
To measure the room occupancy the testbed features a tailored people counter,
mounted over the entrance of the WTL. The counter is a thermal based camera
commercialized by IRISYS and composed by two modules: the dual view IP
and the node IP master.
The node IP master IRC3000 [35] is a people counting devices with the
imaging optics, sensor, signal processing and interfacing electronics all contained
22 HVAC systems
Figure 2.10: Tipical star network topology, it is used also in our network
1
2
11
1 Root
20
109
12 38
5 35 37
213
39 36
110
4
111
8 9 7
Table 2.1: Summary of the mote of the WSN (T, H, C, L stand for temperature, humidity,
CO2 and light respectively)
24 HVAC systems
within a molded plastic housing. The unit is used in a downward looking manner,
as the unit functions optically recognize the heat emitted by people passing
underneath as infrared radiation, collected through a germanium lens with
a 60’ field of view. The sensing area is a square on the floor whose width is
approximately equal to the mounting height.
The dual view IP IRC3030 [36] multiplexes both the thermal people count
data, the stored count data, diagnostic information and the video stream into a
single IP data stream. The IP capability allows remote viewing, configuration
and data collection over IP infrastructure, either over an in-store LAN, or for
worldwide viewing from remote locations over the Internet.
Figure 2.12: The people counting devices: left, the IRC3030 device. Right, the IRC3000.
Weather forecasts
As highlighted in our literature review, the knowledge of the future outdoor
conditions is crucial for achieving good control performance in terms of energy
savings. To this aim the testbed server fetches and stores information the web
site www.wunderground.com. More precisely, the available data are:
2.2 Peculiarities of the KTH HVAC Testbed 25
• temperature (current and the hourly forecasts for the next 72 hours);
• wind speed (current and the hourly forecasts for the next 72 hours);
• wind direction (current and the hourly forecasts for the next 72 hours);
• precipitation (current and the hourly forecasts for the next 72 hours);
Figure 2.13: A scheme representing the whole testbed system; LabVIEW is the tool that
allow the user to communicate with the whole network by a collection of virtual instruments.
PLC virtual instrument the server continuously runs an OPC Server that
listens data coming from the dedicated PLC. In the meantime, an OPC Client
runs on a virtual instrument and processes this data from the PLC. Eventually,
this information is sent to the dedicated database.
26 HVAC systems
Database and control virtual instruments all the data coming from the
previous virtual instruments are received by an additional virtual instrument,
database.vi, that writes them into a database. This instrument sends also
these real-time data to another virtual instrument, control.vi, that enables
users to have remote access to the sensed data and it also allows the actuation.
We notice that user can have access to this information only through an
appropriate client and credentials.
Remote access
As already written in the previous sections, all the sensed information is
stored into a database. The central server also runs an Apache Web Server
that allows the access to this database through the dedicated web page http:
//hvac.ee.kth.se/. With a simple web interface, shown in Figure 2.14, it is
possible to download information about the system in a handy .txt file.
Accessing the data and giving actuation commands is possible by using some
other virtual instruments, like ControlConnectToHVAC.vi or ControlGetDataPlcs.vi4 .
These instruments thus allow every user with LabVIEW to potentially actuate
remotely the system. Some of these instruments have also been implemented
in Matlab, so that users can run control algorithms remotely.
4
The complete list can be found on https://code.google.com/p/kth-hvac/wiki/
RemoteAccess#Creating_connection_to_HVAC_system with more explanations on how to
use them, and also with the possibility of downloading them.
2.2 Peculiarities of the KTH HVAC Testbed 27
Figure 2.14: The web interface that allows every single user to download the sensed data
and the actuation command of the system.
28 HVAC systems
Building model and System
3
identification
• no infiltrations are considered, so that the inlet airflow in the zone equals
the outlet airflow;
• the zone is well mixed, i.e. the temperature and the concentration of CO2
are constant with respect to the space and do not depend on the place
they are measured;
All the parameters involved in this subsection are described in Table 3.1
dTroom P P
mair,zone cpa = Qvent + Qcool + Qheat + Qint + j Qwall,j + j Qwin,j .
dt
(3.1)
In (3.1), the left-hand term represents the heat stored in the air within the
room. Qvent is the heat flow due to ventilation, Qcool and Qheat are the heating
and cooling flows. These are necessary in order to keep the room environment
within thermally comfortable conditions. The quantity Qint incorporates the
internal gains, which are given by the sum of the heat flows due to occupancy,
equipment and lighting. Qwall,j and Qwin,j represent the heat flows exchanged
between walls and room and windows and room respectively. Each term of the
Equation (3.1) is:
Qvent = ṁvent cpa ∆Tvent = ṁvent cpa Tai − Troom ,
Qcool = ṁcool cpa ∆Tcool = ṁcool cpa Tsa − Troom ,
Qheat = Arad hrad ∆Trad = Arad hrad Tmr − Troom ,
Gj Ajwin I j
P
X Tamb − Troom j
+ j
+
j
Rwin mair,zone cpa mair,zone cpa
(3.3)
In order to have the whole description of the temperature dynamics, we also
j
need to model the behavior of the indoor wall temperature, say Twall,i , of
each surface. These temperature signals are calculated by means of an energy
balance between the outdoor and indoor surfaces. All the walls are modeled as
a “two capacitance and three resistance” systems (2C3R), where the thermal
capacity, denoted by C j , is determined using the Active Heat Capacity model
proposed by [38]. A representation of such a model is shown in Figure 3.1;
solving the circuit we can find in/out relationships for wall temperatures. More
precisely, such relationships are
" j j
#
Twall,i − Twall,o
ho Ajwall Teej − Twall,o
j
j
+ j
dTwall,o Rwall
= (3.4)
dt C j /2
" j j
#
Twall,o − Twall,i
hi Ajwall Troom − Twall,i
j
j
+ j
dTwall,i Rwall
= (3.5)
dt C j /2
The equivalent external temperature Teej accounts for the different radiation
heat exchange due to the orientation of the external walls. The outdoor
temperature is modified by the effects of radiation on the j-th wall.
aI j
Tee,j = Tamb + . (3.6)
αe
All the values of the parameters were determined by means of evaluations based
on the geometry of the building, the manufacturing materials and the knowledge
32 Building model and System identification
1 j 1
h0
R wall hi
j j
j Twall,i Twall,o Troom
Tee
j j
C C
j
Figure 3.1: Electric scheme of the model of the walls. The three resistances 1/ho , Rwall
j j
and 1/hi are placed between the equivalent temperature Tee , and the temperatures Twall,o ,
j j j
Twall,i and Troom . Rwall [°C/W] and C [J/°C] are the thermal resistance and the thermal
capacity of the j-th wall respectively
28
temperature [℃]
27
26
25 tMatlab
tIDA
24
0 20 40 60 80 100 120 140 160 180
time [h]
Figure 3.2: Validation of the model performed with the software IDA ICE.
In Figure 3.3 a comparison between the simulation of the model using real
3.1 Physics-based model 33
21.2
measured
21 simulated
temperature [℃]
20.8
20.6
20.4
20.2
20:00 04:00 12:00 20:00 04:00 12:00
time
Figure 3.3: Comparison between the simulated temperatures obtained with the physical
model and the actual measured room temperature.
appears that the model is not able to fit adequately with the measured data.
However, it may be good for capturing long period trends. The faster dynamics
of the room temperature are not properly followed by our model. Nevertheless,
we shall make use of this model, since we assessed that its accuracy is good
enough for our purposes.
dCCO2
V = Cin − Cout + Cocc . (3.7)
dt
where
1
We made the reasonable assumption that the air flowing out of the room has the same
concentration CO2 of the air inside the room
34 Building model and System identification
The derived model was then discretized by using the Euler backward method,
which yields (the sampling time is neglected for simplicity)
CCO2 (t + 1) = CCO2 (t) + ṁair (CCO2 (t) − CCO2 ,i ) + gCO2 Npeople (t). (3.10)
We assessed that this model could not describe the CO2 behaviour accurately
enough. Its main drawback is given by the fact that no zero decaying happens
if the system is not excited. In this way, all the unavoidable errors accumulate,
making the model outcomes differ substantially from the real behavior. An
example of this is in Figure 3.4. For this reason, we decided to identify a new
600 real
CO2 concentration [ppm]
physical model
400
200
−200
where y(t) represents the output, u(t) the input, and w(t) noise accounting
fitting inaccuracy and prediction errors. First, we assessed the predictive ability
of these models when only occupancy is considered. Furthermore, in order to
adhere with the physical description of the system, we set the model order to
1-1-1, i.e. one regression coefficient on the output, one on the input and one
delay. The model class turned out to be
Here, the output y(t) represents the CO2 concentration in the room minus the
concentration of CO2 of fresh air, that is y(t) = CCO2 (t) − CCO2 ,i := ∆CO2 (t).
In this way, the dynamics of the system could be captured more propoerly
As shown in Figure 3.6, we could witness a substantial improvement on the
prediction of the concentration of CO2 . Since our final scope is to control the
CO2 level, we needed to consider also the effect of an input, called u(t), which
is given by the mass flow incoming into the room with a lower concentration of
CO2 . Then the model class that we obtained was
where in particular
u(t) = ṁair (CCO2 (t) − CCO2 ,i ) (3.14)
Both these models gave a good fitting on the training data set used for the
identification process (94.7% e 93.8% respectively for the first and the second
formulation); this is shown in Figure 3.5. These model performed well also in
the validation phase, where other data were used. The results are shown in
Figure 3.6.
In order to complete our analysis, we also tried other type of models, like
Output-Error models, which performed worse than ARX. Moreover, we tried
to increase the order of the ARX model. However, increasing the order gave
worse results in fitting both training and validation data. According with all
36 Building model and System identification
600
real
580 occupancy
occupancy & u(t)
560
CO2 concentration [ppm]
540
520
500
480
460
440
420
400
380
0 1,000 2,000 3,000 4,000 5,000
time [min]
Figure 3.5: Fitting of the CO2 models with the validation set of data.
real
occupancy
600 occupancy & u(t)
CO2 concentration [ppm]
550
500
450
400
these considerations, the final model for describing the CO2 concentration is
then an ARX111 that accounts for both occupancy and input u(t) of (3.14).
A reasonable sample time of the discrete model was 100 . Hence, our adopted
model is
• Heating: link the Tmr to the valve opening percentage of the radiator.
• Venting: link ṁair , ṁvent and ṁcool to the dampers opening percentage of
the venting (inlet and outlet).
• Cooling: find a relationship between Tsa and the the valve opening
percentage of the cooling.
In the next subsection we present all the tests performed on the testbed.
Figure 3.7: Picture of the motes attached to the radiator to run the test to get the mean
radiant temperature.
40 100
1032 Heating
38 1035 90
1030
36 1033 80
1034
34 Tmr 70
Temperature [℃]
32 60
percentage
30 50
28 40
26 30
24 20
22 10
20 0
0 20 40 60 80 100 120
time [min]
Figure 3.8: Test on the radiators: first radiator temperature response. The motes are
placed on the radiator in this order: 1032 on the top right, where there is the hot water
inlet,1035 on the top left, 1030 in the center, 1034 on the bottom left and 1033 on the bottom
right, where there is the hot water outlet.
3.2 Devices to be identified 41
40 100
1035 heating
38 1036 90
1030
36 1037 80
34 70
temperature [℃]
32 60
percentage
30 50
28 40
26 30
24 20
22 10
20 0
0 20 40 60 80 100 120
time [min]
Figure 3.9: Test on the radiators: Comparison between motes in the first radiator (1035,
1030) and in the last (1036, 1037), placed in the same position on the radiator. Motes 1035
and 1036 are placed on the top left corner of the first and last radiator respectively, while
Sensor 1030 and Sensor 1037 are placed in the center.
42 Building model and System identification
the impossibility of getting hot water during the tests, secondly because we
were running our tests during the summer time. What we had to employ
was an empirical characterization of the actuation command, considering the
temperature of the hot water. However, for our final goal this was insufficient,
thus the first step must be repeated for obtaining an improvement.
In this subsection we seek for a relation between the opening valve percentage
of the dumper of the ventilation system (Av (t)) and the air mass flow actually
carried into the room (ṁair (t)).
Our understanding of the ventilation system control design leads us to
deduce that this relation has to be approximately linear. A linear-quadratic
relation with a small coefficient on the quadratic term is also considered.
As explained in Section 2.2 the ventilation duct that comes in the testbed
is split in two equal branches with the same characteristics, and accordingly
with the same air mass flow4 . Both the branches are in turn split in two parts:
one part for the cooling system and one for the ventilation. Thus, we can write
where ṁvent (t) is the part of air mass flow for the ventilation system and ṁcool (t)
is the one for the cooling system.
We decided to measure the air mass flow (both in the cooling duct and
the venting duct) at four different percentages of valve opening (30%, 50%,
70% and 100%). We attempted to build a map assuming that there is no
dynamic features behind, i.e. the opening of the valve reaches immediately the
corresponding air mass flow5 .
These measurements were made, thanks to the support of a technician,
using an anemometer. We measured the average air velocity (vair ms ), by
4
It seems reasonable, due to the symmetric geometry of the system and the operating
conditions of the ventilation system, to assume that the branches are specular. The measure-
ments have then been carried out only on one branch. According to the previous assumptions,
the total air flow is twice the air flows in the measured branch
5
This assumption has been done because the time constant to reach the steady state
values are considerably small compared to the other time constants of the system
3.2 Devices to be identified 43
l
means of which we estimated the volumetric air flow (Qair s
)
l
Qair = vair · Apipe (3.17)
s
In the above formula, Apipe represents the area of the section of the pipe6 . The
diameters of the cooling pipe and of the venting pipe are 0.16m and 0.20m
respectively. The air mass flow is then the given by
kg
ṁ = 2 · Qair · ρ (3.18)
s
kg
where ρ ' 1.225 m 3 is the air density, and the scalar 2 is due to the fact that
we have two equal branches. The results we found are summarized in the Table
(3.2)
Table 3.2: Measurements for the air velocity and the corresponding volumetric air flows
and mass flow of the branches, where Av is the venting valve opening percentage.
With the available data, and with the knowledge that the plant was built
to give a possibly linear response, we decided to fit this value using a linear
relation. However this solution was not really precise and gave a large fitting
error. For this reason we decided to use a quadratic function to interpolate
our measurements. In order to fit the data we used the embedded Matlab tool
cftool. The result obtained are shown in Figure (3.10); the parabolic functions
we found are of the form
6
Because of the geometry of the pipes, that are straight, we can assume that the average
air velocity is exactly the one we measured
44 Building model and System identification
where
ac = −9.789 · 10−06 bc = 0.002118 cc = 0
−05
av = −1.885 · 10 bv = 0.004564 cv = 0 (3.20)
aair = −2.8639 · 10−05 bair = 0.006682 cair = 0
0.4
Cooling Mass Flow
mass flow [Kg/s]
0.1
0
0 20 40 60 80 100
percentage [%]
Figure 3.10: Relation between mass flow and opening valve percentage
Clearly, in order to obtain the opening percentage needed for having a given
mass flow amount, we can simply use the inverse formula7 , obtaining
q
b − bc,v,air 2 − 4 · ac,v,air · cc,v,air + 4 · ac,v,air · ṁcool,vent,air
Av = − (3.21)
2 · ac,v,air
Tsa (t + 1) = αTsa (t) + βTsa (t − 1) + γAc (t) + δAc (t)Av (t) + Tai (t) (3.22)
7
We need to be careful to choose the correct root of the quadratic equation
3.2 Devices to be identified 45
8
Actually, to be sure of the results, we test it also in the whole period and also in other
data sets. However, here we prefer not to add more results to keep the presentation brief.
46 Building model and System identification
where Tsa is the vector with the real response of the system, whose mean is T̄sa ,
and T̂sa is the vector with the response of the identified system, whose mean is
¯
T̂sa .
The parameters that were found are
measured
21 simulated
20
temperature [℃]
19
18
17
16
20:00 23:00 02:00 05:00 08:00 11:00
time
Figure 3.11: Fitting between real supply air temperature of the air conditioning outlet and
the simulated one.
behavior of the temperature of the air coming from the air conditioning system,
and use it in our control system.
48 Building model and System identification
Control strategies
4
This section describes the main control strategies considered in the thesis.
band that represents the desired temperature range. From practical per-
spectives the control strategy is not endowed with temperature reference
signals, but rather reference band. It is indeed a dead zone controller: if
the temperature is inside the comfort band then no control actions are
taken. More precisely, during summer the band is defined by the interval
[21 − 23]℃. If the measured temperature does not belong to this interval
then the PI controller starts actuating to bring the temperature back to
this dead zone. The control commands are computed with a frequency of
one command per second. We notice that this control strategy does not
take into account neither energy efficiency nor actuators wear indexes;
CO2 levels controller: this controller actuates only the ventilation system.
The control strategy is similar to the previous one, with the CO2 ppm
levels dead zone that ranges from 0 to 850.
Figure 4.1 shows some measured behaviors of the two previously mentioned
controllers. We can notice that sometimes the behavior of the actuation signals
do not follow the rules suggested by Akademiska Hus. Moreover the previously
described comfort bounds are not always respected: we indeed noticed that
sometimes the temperature violation is as big as half Celsius degree.
100
cooling
24
80
temperature [℃]
23 60 percentage
22 40
20
21
temperature
0
0 100 200 300 400 500 600 700 800
time [min]
Figure 4.1: Example of the actuation signals induced by the Akademiska Hus PI controller:
cooling action.
4.2 The considered Model Predictive Control (MPC) strategy 51
i.e., the optimal cost (formally, the biggest lower bound of f (z) over the set S).
If J ∗ = −∞ we say that the problem is unbounded below. If the set S is empty
then the problem is said to be infeasible and we set J ∗ = +∞ by convention.
If S = Z then the problem is said to be unconstrained.
If z ∗ in (4.1) is not unique, one is in general interested in finding one of the
instances of these optimal variables. In this case the following equality holds:
inf f (z)
z
subject to gi (z) ≤ 0 for i = 1, . . . , m
(4.4)
hi (z) = 0 for i = 1, . . . , p
z∈Z
Figure 4.2: Basic description of the main functioning of a Model Predictive Control (MPC)
scheme [44].
Cost functions
The cost functions (abbreviated often with “cost”) generally serve two purposes:
induce stability in the plant and describe the performance indexes. Stability
is achieved by choosing costs that are Lyapunov functions for the closed loop
system. In practice, this requirement is generally relaxed for stable systems
with slow dynamics, such as buildings, and this increases the freedom to select
the cost strictly on a performance index basis. Costs are generally, but not
always, used to specify a preference for one closed-loop behavior over another.
E.g., one may prefer to achieve minimum energy instead of maximum comfort.
It is nonetheless common to describe costs as convex combinations of these
performance indexes.
Reflecting the fact that this induces simpler optimization problems, the
majority of the most common cost functions are convex. Examples are:
Quadratic regulators (or trackers) are s.t. the relative weighting between
the states and the inputs provides a trade-off between regulation quality and
energy of the inputs. If the system is unconstrained, or the constraints are not
4.2 The considered Model Predictive Control (MPC) strategy 55
active, then the problem reduces to a classic Linear Quadratic Regulator (LQR).
In the context of building control scenarios, such a cost would generally only
be used at the lowest level to replace, for example, existing PIs or rule-based
controllers.
Integral costs, instead, weight the integral of the energy of the inputs. This
is a common choice whenever the performance index is the minimization of the
used energy.
Dynamics
schemes are:
Linear models are of course the most common models. Importantly, they
are the only one that lead to a convex and easily solvable optimization problem.
Input-affine models can instead cover a large number of very complex
systems, at the price of being in general very difficult to handle. We nonetheless
notice that there are recent theories that in some circumstances provide very
simple and stabilizing recipes. As explained later in Section 3.1, our building
model belongs to this class, since it contains a bilinear term between the states
and the inputs. We then notice that such a model admit some mathematical
tricks that allow efficient management of their dynamics.
Hybrid models, in this case piecewise affine (PWA) models, contain a mixture
of discrete and continuous components, such as switches or valves in combination
with continuous systems. This class of models is extremely general and can
be used to approximate any smooth system to an arbitrary degree of accuracy.
Optimization problems defined over this class of systems involve treating mixed-
integer values. The corresponding optimization problems are generally hard to
be solved, although many well-tested methods are available for some special
cases.
Non-linear models are the most general models. Due to their generality
they are significantly more difficult to handle and thus (a part some specific
examples) not considered for MPC purposes.
Constraints
The most widely used constraints are the linear (or polyhedral) ones. They
are generally used to specify upper/lower bounds on the various system variables.
They can also be used to approximate non-linear convex constraints to an
arbitrary degree of accuracy. Linear constraints also result in the simplest
optimization problems. Convex quadratic bounds correspond to ellipses, while
chance constraints limit the probability that a bound will be violated. Second
order cone constraints, instead, bound the 2-norm of a linear function of the
state or input. They are typically used in several forms of stochastic MPCs.
• the cost function weights the integral of all the control actions;
• the constraints represent the upper and lower bounds on the inputted
energy, the possible actuator ranges (e.g., the valve opening percentages,
that must be restricted in the range 0% to 100%), or the various comfort
requirements for the room temperature, the indoor air quality. All these
constraints are assumed linear;
• the forecasts are assumed as certain. I.e., the forecast are deterministic
quantities.
The MPC accounts for two specific problems: to bound the CO2 concen-
tration and the indoor temperature levels inside certain comfort ranges. As
a consequence we design two separated MPC problems that work in cascade:
58 Control strategies
the first is dedicated to the management of the CO2 levels. The second to the
temperature. The first targets to return the minimal level of fresh air flow
that must enter in the room to maintain a certain comfort range. The second
instead computes the actuation commands to let the temperature be in its
comfort range.
The main performance index considered while designing the cost functions
is the amount of energy spent to maintain the internal comfort levels. The
optimization routines thus aim to find the control references that satisfy the air
quality levels while spending the least amount of energy. We also notice that we
consider two separated MPCs to obtain linear models, exploiting the fact that
the dynamics of the CO2 levels is decoupled from the one of the temperature.
The designed MPC cycles the following steps:
6. apply the computed control actions (only the first sample, in accordance
with the MPC paradigm);
The models (3.3) and (3.15) described in Section 3.1 contain nonlinearities
that can lead to intractable problems. To address this issue we derive linear
equivalent formulations of the CO2 concentration model (in Section 3.1) and of
the room thermal model (in Section 3.1).
value of the CO2 in the outside environment, around 390 ppm). Since CCO2 ,i is
the minimum level that the indoor air may have, CCO2 − CCO2 ,i is a nonnegative
variable. Hence, the CO2 concentration dynamics can be described by the
discrete LTI system
where
xCO2 (k) = CCO2 (k) − CCO2 ,i
where
u(k) = ṁmin
air · xCO2 (k)
u(k) = ṁmax
air · xCO2 (k)
max
y = CCO2 − CCO2 ,i
max
with t is the current point in time, N is the prediction horizon and CCO 2
is
equal to the desired upper bound of the CO2 concentration.
k−1
X k−1
X
xCO2 (k) = yCO2 (k) = ak xCO2 0 + ak−i−1 buCO2 (i) + ak−i−1 ewCO2 (i).
i=0 i=0
Thanks to the previous model we can derive the matrices to be given to the
subsequent CO2 -MPC problem. For the sake of brevity and exposition clarity
we omit to write all the passages in detail. Eventually, the control variable
ṁair can be computed by means of the inverse formula
uCO2 (k)
ṁair (k) = .
CCO2 (k) − CCO2 ,i
Considering the model presented in Section 3.1 we can express the heat due to
the ventilation and the cooling as
Qair = Qvent + Qcool = ṁvent cpa ∆Tvent + ṁcool cpa ∆Tcool = ṁair cpa ∆Tair
(4.13)
= ṁair cpa Tair − Troom = ṁair cpa ∆Th − ∆Tc = cpa (uh − uc ),
where Tair is considered to be a mix of the temperatures of the air from the
venting outlet, of Tai , and of the air coming from the cooling outlet, Tsa .
It is important to comment the meaning of the nonnegative variables ∆Th ,
∆Tc , uh and uc . If we use only the ventilation system then Tsa is equal to the
temperature of the venting duct, and thus Tsa = Tai . In this case thus
that implies uh > 0 and uc = 0. Conversely, if we use also the cooling1 uc > 0
that implies Tsa < Tai . This means that we are looking for a way to know
from our optimization problem if we need to cool or heat the room, and then
eventually to know if we need to actuate against Tsa with the cooling system.
In fact the inputs uh and uc , multiplied by cpa , model respectively the portion
of the ventilation heat flow due to heating and cooling.
1
We recall that in order to cool we actually need the ventilation system to be on.
4.2 The considered Model Predictive Control (MPC) strategy 61
Hence, the room temperature dynamics can be described by the LTI system
a1,2 = 0
A1
a1,3 = hi mairwall
cpa
..
.
a1,12 = 0
A6
a1,13 = hi mairwall
cpa
a2,1 = 0
h A1 1
a2,2 = − Co 1 wall − 1
Rwall 1
Cwall
wall
1
a2,3 = 1
Rwall 1
Cwall
a2,4 = 0
.. ..
. .
a2,13 = 0
hi A1wall
a3,1 = 1
Cwall
1
a3,2 = 1
Rwall 1
Cwall
hi A1wall 1
a3,3 = − 1
Cwall
− 1
Rwall 1
Cwall
a3,4 = 0
.. ..
. .
a3,13 = 0
.. ..
. .
hi A6wall 1
a13,13 = − 6
Cwall
− 6
Rwall 6
Cwall
,
62 Control strategies
G1 ∗A1win
1 c
1 1 Arad hrad
Rwin mair cpa mair mair cpa
mair mair mair cpa
ho A1 ho A1wall αa
Cwall1
wall
1
Cwall
e
0
0 0 0
Bc = and Ec = ,
.. .. .. 0 0 0
. . .
.. .. ..
. . .
0 0 0
0 0 0
x(k) ∈ R13 is the state vector containing the room temperature and the inner
and outer temperatures of all the walls,
h i>
x(k) = Troom 1 1 6 6
Twall,o Twall,i ... Twall,o Twall,i
u(k) and w(k) ∈ R3 are the vector of our inputs and the vector of random
disturbances at time k respectively
h i>
u(k) = uh (k) uc (k) ∆Th,rad (k) ,
h i>
w(k) = Tamb (k) I 1 (k) Npeople (k)
Since we want the room temperature at time k as our system output, our
C ∈ R13 will be h i
Cc = 1 0 . . . 0
This continuous system is then discretized using the Backward Euler Method
with a sampling time of 100 . This leads to the discrete LTI system
The MPC problem for the room temperature can eventually be formulated
as
4.2 The considered Model Predictive Control (MPC) strategy 63
where
ch = cc = cpa
cr = Arad hrad
uh = 0
uh = cpa ṁmax worst case
air (Tai
worst case
− Troom )
uc = 0
uc = cpa ṁmax worst case
air (Tair
worst case
− Troom )
ur = 0
worst case
ur = Arad hrad ∆Th,rad
y = ymin = Tmin
y = ymax = Tmax
and only for the first sample t of the control horizon we add also
uh (t) = uh ∗ = cpa ṁmin
air (Tai (t) − Troom (t))
Let x0 denote the current state. It then follows from the linear model (4.16),
that the room temperature dynamics over the prediction horizon N can be
64 Control strategies
written as
k−1
X k−1
X
k k−i−1
x(k) = A x0 + A Bu(i) + Ak−i−1 Ew(i).
i=0 i=0
Let then
T
T
Y := y0T , . . . , yN Y ∈ RN
−1 , (4.17)
T
U := uT T
U ∈ R3N
0 , . . . , uN −1 , (4.18)
h iT
T T
W := w0 , . . . , wN −1 , W ∈ R3N (4.19)
h iT
T
A := (A) . . . (A ) N T (4.20)
B O
. ..
B := .. . (4.21)
N −1
A B ... B
E O
. ..
E := .. . (4.22)
N −1
A E ... E
C := diag(C, . . . , C) (4.23)
h i
Gx := CA (4.24)
h i
Gu := CB (4.25)
h i
Gw := CE (4.26)
T
ge := −ymin (k)T · · · − ymin (k)T ymax (k)T · · · ymax (k)T
(4.27)
g := ge − Gx x0 (4.28)
" #
−I3N
F := (4.29)
I3N
T
f := −umin · · · − uT
T T T
u
min max · · · umax (4.30)
" #
−1 0 0 . . . 0
H := (4.31)
0 −1 0 . . . 0
T
h := −uh ∗ − uc ∗
(4.32)
where O is a zero matrix with appropriate dimensions and I3N ∈ R3N ×3N is the
identity matrix. Hence we can express the output Y over the whole prediction
4.2 The considered Model Predictive Control (MPC) strategy 65
Y = C(Ax0 + BU + EW ) (4.33)
and the constraints on the output and the inputs over the whole prediction
horizon N as
Gu U + Gw W ≤ g
FU ≤ f
HU ≤ h.
Notice that we consider time varying bounds on the room temperature, ymin (k)
and ymax (k), which accounts for the effects of time varying occupancy. For
instance we can set different bounds for the day and for the night. We notice
that it may be dangerous to have sets of bounds that differ very much. E.g.,
allowing really low temperatures during night periods may lead to severe power
consumptions when the system has to raise the temperature when the day
comes.
Post processing
The values obtained from the previous MPC problems can not be directly used
to command the actuators. Indeed the assumptions made in Section 4.2, stating
that the problems can be reduced to linear optimization problems, must be
modified to account for the peculiarities of the hardware in the testbed. Our
choice is to exploit a post-processing phase that transforms the information
coming from the two previous MPCs into signals that correspond to how much
the various valves of the plant should be open.
Consider then that the information coming from the temperature MPC
is composed by uc , uh , ∆Tmr . From the CO2 MPC instead provides ṁmin air ,
the lower bound on the air flow rate. The following Algorithm 1 reports this
transformation procedure. Notice that this algorithm does not handle Tmr
because our tests have been performed during the summer season, where, as
already said before, radiators do not receive warm water. We now comment
Algorithm 1. The first three rows check if there is a simultaneous need of cooling
and venting. This case is due with a big probability to the need of a ventilation
carried by the last two constraints added in the Problem 4. If uc > uh what
66 Control strategies
Algorithm 1 Post-processing
1: if uh ≥ 0 and uc ≥ 0 then
2: if uc ≥ uh then
3: uc = uc − uh
4: if uh = 0 and uc = 0 then
5: Tsa = 20.5
6: ṁair = 0
7: else if uh ≥ 0 and uc = 0 then
8: Tsa = 20.5
uh
9: ṁair = Tai −T room
considering Tair like a mixture of air form the two different branches. From the
equation (4.34) are coming also the formulas in the rows 19 and 22, used to
bound eventually cases where the formula in the row 13 takes us to lower or
higher values of Tsa , that are set in the limits of our comfort range.
At the end we do a security check to be sure that the value that actually we
are giving it is greater than the required lower bound. If at the end we have an
ṁair different from 0[kg/s] it means that we have to actuate the corresponding
percentage for the venting valve. Viceversa, if we have a Tsa that is lower than
20℃ it means that we have to cool the room.
1. ∆Th,rad , i.e., how much the valve relative to the radiators should be open;
2
This is due to follow our assumption of a lower cost for the cooling action compared to
the venting action
3
The part that is coming only from the venting branch
68 Control strategies
2. ṁvent , i.e., how much the valve relative to the air venting should be open;
3. Tsa , i.e., how much the valve relative to the air cooling system should be
open.
Air mass flow ṁvent as written in Section 3.2 we model the relation between
the needed air mass flow and the venting opening valve percentage as a linear
relation. This implies that the transformation is a mere rescaling of the output
of equation (3.21).
where
Considering the constant input Ureg that carries the system to the equilibrium
point x = Tsa,ref we find
It can be noticed that this kind of control law does not rely on feedback
mechanisms.
The second solution is instead developed as follows: start from (4.35), and
consider that we have a system with a constant disturbance on the state (the
constant matrix E). Let then the input be ∆u(k) rather than u(k). Adding
the state
xu (k) = u(k − 1) (4.40)
xu (k + 1) 0 0 1 xe (k) 1 0
h i x(k)
y(k) = 1 0 0 xr (k)
xe (k)
(4.41)
70 Control strategies
xu (k + 1) x (k)
u (4.42)
x(k)
y(k) = C xr (k) .
xu (k)
The optimal input can then be found as the solution of the following optimization
problem:
Problem 5 (Formulation of the MPC for the control of the cooling actuation).
Pt+N −1 2 2
W y y(k + 1) − r∗
min k=t + W ∆u ∆u(k)
∆u(t),...,∆u(t+N −1)
subject to u ≤ u(k) ≤ u k = t, . . . , t + N − 1
∆u ≤ ∆u(k) ≤ ∆u k = t, . . . , t + N − 1
y ≤ y(k) ≤ y k = t, . . . , t + N − 1
(4.43)
HA xt + HB ∆U + HE 1N ×1 ≤ u 1N ×1
HA xt + HB ∆U + HE 1N ×1 ≥ u 1N ×1
I ∆U ≤ ∆u 1N ×1
(4.44)
I ∆U ≥ ∆u 1N ×1
C A xt + CB ∆U + CE 1N ×1 ≤ y 1N ×1
C A xt + CB ∆U + CE 1N ×1 ≥ y 1N ×1
4.2 The considered Model Predictive Control (MPC) strategy 71
The cost function minimization problem in (4.43), taking the weight matrices
equal to
W y = IN ×N , W ∆u = θ IN ×N
becomes
Pt+N −1 > P −1
y(k + 1) − r∗ y(k + 1) − r∗ + θ t+N
min∆ U k=t k=t ∆u(k)2
>
= min∆ U 2x> >
t CA CB ∆ U + 2 CE 1 − r 1
∗
CB + ∆ U > CB> CB ∆ U + ∆ U > ∆ U
>
2 x> > ∗
CB ∆ U + ∆ U > CB> CB + θIN ×N ∆ U
= min∆ U t CA + CE 1 − r 1
| {z } | {z }
Ω Φ
(4.45)
∗
and where r is the reference signal, constant during the whole control horizon.
The whole problem can be written as:
min Ω ∆ U + ∆ U >Φ ∆ U
∆U
subject to G ∆ U ≤ S xt + W
100
20 cooling
80
temperature [℃]
percentage
60
18
40
20
16 Tsa
0
0 4 8 12
time [min]
Figure 5.1: Simulation on the second level MPC for the Tsa . The reference is set to 17℃
the ventilation is constant at 30%.
100
20 cooling
80
temperature [℃]
19
percentage
60
18
40
17
20
16 Tsa
0
0 4 8 12
time [min]
Figure 5.2: Simulation on the second level MPC for the Tsa . The reference is set to 18℃
the ventilation is constant at 30%.
5.1 Testing the MPC solution adopted to control the cooling
actuation 75
(Figure 5.3 ). But when the reference changes to 18℃, then Tsa struggles to
cross the 19℃ threshold (Figure 5.4) with around one degree of error. This
error is not tolerable for our purposes.
21 100
cooling
20 80
temperature [℃]
percentage
19 60
18 40
17 20
Tsa
16 0
0 4 8 12 16 20
time [min]
Figure 5.3: Test on the equilibrium point method for the Tsa . The reference is set to 17℃
and the ventilation is constant at 30%.
21 100
cooling
20 80
temperature [℃]
percentage
19 60
18 40
17 20
Tsa
16 0
0 2 4 6 8
time [min]
Figure 5.4: Test on the equilibrium point method for the Tsa . The reference is set to 18℃
and the ventilation is constant at 30%.
The results given instead applying the MPC controller to the real system
are shown in Figure 5.5 and 5.6.
76 Experimental Results
21 100
cooling
20 80
temperature [℃]
percentage
19 60
18 40
17 20
Tsa
16 0
0 4 8 12 16 20
time [min]
Figure 5.5: Test on the MPC for the Tsa . The reference is set to 17℃ and the ventilation
is constant at 30%.
21 100
cooling
20 80
temperature [℃]
percentage
19 60
18 40
17 20
Tsa
16 0
0 2 4 6 8
time [min]
Figure 5.6: Test on the MPC for the Tsa . The reference is set to 18℃ and the ventilation
is constant at 30%.
5.2 Test of the whole MPC 77
We can notice that the equilibrium is never reached, and that there exists
a swinging response around the reference temperature. Furthermore the re-
quired temperature is never precisely reached. The comparison between these
controllers lead us to choose the second strategy to solve problem 5 because it
seems more reliable and respecting the conditions of the system.
Qmin
air = 0
J kg
Qmax
air ≈ c pa Kg K
0.4 s · 7K ≈ 3kW < 3.5W.
Qmin
vent = 0
Qmax
vent = 3.5kW
Qmin
cool = 0
Qmax
cool = 3kW
Qmin
rad = 0
Qmax
rad = 8kW
To test the CO2 MPC we used a slightly different approach, and set the
bounds accordingly with the status of the system. More precisely we assume
78 Experimental Results
that the CCO2 ,i concentration is constant, equal to the external one and thus
assumed to be 390 ppm. The bounds are thus set to
ṁmin
air xCO2 (k) − CCO2 ,i ≤ uCO2 (k) ≤ ṁmax
air xCO2 (k) − CCO2 ,i
0 ≤ uCO2 (k) ≤ 0.4 xCO2 (k) − 390 .
The bounds setting our comfort levels have then been derived using the
configuration suggested by Akademiska Hus. I.e., we copied the settings for
the controller described in Section 4.1 in page 49. The dead zone band band
adopted has thus been decided using a trade off between the wellness of the room
occupants. Notice that we did not force a small set of plausible temperatures
to our MPC solver: in this way we minimize risks of infeasible optimization
problems.
In total we set up 4 tests:
• Test 1:
• Test 2:
• Test 3:
• Test 4:
To run these tests we provide to our controller weather, thermal radiations and
occupancy forecasts. To this point we set:
The proposed main MPC program runs every 10 minutes with a prediction
horizon of 8 hours. The low level MPC, as anticipated in Section 4.2 at page
67 and whose results are shown in Section 5.1, works when the main MPC
requires cooling actuation. From practical perspectives it works every minute
for the ten minutes needed. Figures 5.7, 5.8, 5.9, and 5.10 present the results
of our tests.
In all the tests the proposed control schemes respect almost everywhere the
comfort bounds. We indeed notice that during these experiments the room
temperature crossed the bound only few times and only for really short periods.
In all the cases the output of the CO2 MPC did not give to the temperature
MPC any bound. Test 4 then considers a case where the room occupancy is
80 Experimental Results
22.5
22
Troom
21.5
520 CO2
[ppm]
500
480
460
1,000 Qc
750
[W]
500
250
1,000 Qh
750
[W]
500
250
venting cooling
100
[%]
75
50
25
22.5 Tsa Tsa ref.
20.5
[℃]
18.5
16.5
4 Npeople
[Npeople ]
3
2
1
20 Tout
[℃]
19
18
11:00 11:30 12:00 12:30 13:00 13:30 14:00
Figure 5.7: Test 1 on the MPC. The temperature comfort bounds are set to 20 ℃ to 23 ℃
while the upper bound of the CO2 concentration is 700 ppm.
5.2 Test of the whole MPC 81
22.5
22
Troom
21.5
570 CO2
[ppm]
520
470
1,200 Qc
[W]
900
600
300
1,000 Qh
750
[W]
500
250
venting cooling
100
[%]
75
50
25
22.5 Tsa Tsa ref.
20.5
[℃]
18.5
16.5
4 Npeople
[Npeople ]
3
2
1
Tout
20
[℃]
19.5
19
14:30 14:45 15:00 15:15 15:30 15:45 16:00
Figure 5.8: Test 2 on the MPC. The temperature comfort bounds are set to 20 ℃ to 23 ℃
while the upper bound of the CO2 concentration is 700 ppm.
82 Experimental Results
22.5
22
21.5
520 CO2
[ppm]
500
480
460
2,000 Qc
1,500
[W]
1,000
500
1,000 Qh
750
[W]
500
250
venting cooling
100
[%]
75
50
25
22.5 Tsa Tsa ref.
20.5
[℃]
18.5
16.5
4 Npeople
[Npeople ]
3
2
1
22 Tout
21
[℃]
20
19
10:00 10:30 11:00 11:30 12:00 12:30 13:00
Figure 5.9: Test 3 on the MPC. The temperature comfort bounds are set to 20 ℃ to 23 ℃
while the upper bound of the CO2 concentration is 700 ppm.
5.2 Test of the whole MPC 83
22.5
22
Troom
21.5
650
CO2
[ppm]
600
550
2,000 Qc
[W]
1,000
0
1,000 Qh
750
[W]
500
250
venting cooling
100
[%]
75
50
25
22.5 Tsa Tsa ref.
20.5
[℃]
18.5
16.5
8 Npeople
[Npeople ]
6
4
2
23.5
23
[℃]
22.5
Tout
22
14:00 14:15 14:30 14:45 15:00
Figure 5.10: Test 4 on the MPC. The temperature comfort bounds are set to 20 ℃ to 23
℃ while the upper bound of the CO2 concentration is 750 ppm.
84 Experimental Results
very high, meaning thus a hight CO2 production rate. Even in this case no
lower bounds has been reached: first of all the CO2 concentration never reached
alert levels. This is also thanks to the Temperature MPC, that with its effort
to decrease the temperature provided an additional boost to the ventilation
system and thus helping the CO2 to decrease.
We also notice that, as expected, during the tests the MPC controllers were
not requiring heat demands. The cooling action performed by the low level
MPC moreover reproduced our expectations, and the Tsa followed gracefully the
given reference. Let us clarify that the temperatures referring to the periods for
which the ventilation system was not active do not invalidate the heat balance.
In fact in this case no air is flowing out of the cooling outlet and thus no cooling
action is given to the environment.
Finally, to evaluate the goodness of our controller we should compare
it with the current practice PI used by Akademiska Hus. We then notice
that performing such a comparison is actually a very difficult task. Indeed
different control systems are meaningfully comparable only when facing the
same conditions. Even knowing exactly figures for the amounts of consumed
powers would not ameliorate this issue. In any case since the PI just neglect
considerations about energy efficiency while our MPC is actually tailored for
that purpose, we make the rather intuitive claim that probably our controller
is less energy-hungry. We also assert that our controller is, from rational points
of view, showing a generally more meaningful behavior. Consider in fact the
plotted behavior of the default controller in Figure 4.1 on page 50, and consider
that the performance is often inefficient. Constraint violations are indeed very
frequent and the high frequency of the actuation commands neglects actuators
wear considerations. Our controller instead generates much smoother reference
signals, and violates much fewer times the comfort bounds.
Conclusions
6
The experience we matured designing the controller tells us that a necessary
condition to derive meaningful control laws is to be aware of how the actuators
work. Designers must have precise knowledge on how the actuation commands
are influencing the controlled system, otherwise actuation could actually lead
to negative effects. Models and controllers must be derived and designed only
after a deep understanding of the structure of the whole system.
An other lesson learned is that there is actually space for improving the
energy efficiency of buildings by just acting on the control laws. Accordingly
to some experts opinions, the building where the testbed is located is rather
well insulated and with good actuation systems. Nevertheless our experiments
suggest that its energy demand could be greatly diminished. In this regards, we
notice that who is managing the system seems to be not to so conscious of what
the current control system is actually doing. In any case, the current practice
is for sure not considering important information such as weather forecasts
and occupancy models. Moreover the current control scheme is neglecting
energy efficiency considerations. We thus feel like to claim that a more mindful
approach to the control of the indoor conditions could give serious improvements
both on the wealth of the occupants and on the energetic bills.
86 Conclusions
Even if we could not measure the actual energy consumption of the two
schemes, we are confident that our method, if well designed, is better from
many point of views. The main conclusion that we draw from the analysis
of the results of the tests we performed is that predictions play a big role in
obtaining meaningful control rules. We eventually report that we actually do
not know if it is more important to have better occupancy predictions, better
model accuracy or more consistent forecast predictions. This thesis in fact
faced the general problems that raise when making the system run for the
first time, and only scratched the surface of the mountain of problems and
interesting hidden questions. Nonetheless it has signed a possible path, and
shown that the path is meaningful and full of promises.
Further developments
7
At the end of this path we are conscious that this field could be rich of possible
improvement and possible questions that only a deeper study could show. We
present now a list of prospects that came out working on this thesis.
Identify a relation for the radiator actuation the test we did on the
radiator was insufficient. Fortunately we have run tests on the summer time
thus this actuation was useless. In winter time a better knowledge on this
argument is fundamental to guarantee the wellness of the occupants, especially
with the cold Swedish weather.
Forecasts the occupancy forecasts to date are given by the patterns of the
previous week. An improvement of this prediction method could effect the
controller performances. It should be interesting to test how much good
predictions can change the MPC control strategy.
Energy efficiency to date we are not aware about how much money our
actuation costs. It should be interesting to find a direct relationship between
the valve opening and the energetic bill.
Bibliography
[10] S. Hay and A. Rice, “The Case for Apportionment,” in Proceedings of the
First ACM Workshop on Embedded Sensing Systems for Energy-Efficiency
in Buildings - BuildSys ’092, 2009, pp. 13–18.
[34] Y. Ma, A. Kelman, A. Daly, and F. Borrelli, “Predictive Control for Energy
Efficient Buildings with Thermal Storage,” IEEE CONTROL SYSTEMS
MAGAZINE.