• No results found

Thermal Dynamic Model Development and Model Predictive Building Control using an Extensive Sensor Network

N/A
N/A
Protected

Academic year: 2021

Share "Thermal Dynamic Model Development and Model Predictive Building Control using an Extensive Sensor Network"

Copied!
52
0
0

Loading.... (view fulltext now)

Full text

(1)

and Model Predictive Building Control

using an Extensive Sensor Network

A senior design project submitted in partial fulfillment of

the requirements for the degree of Bachelor of

Science at Harvard University

Ald´ıs Elfarsd´

ottir

S.B. Degree Candidate in Engineering Sciences

Environmental Science and Engineering

Faculty Advisor: Dr. Na Li

Mentors: Dr. Bin Yan, Dr. Yang Zheng

Harvard University School of Engineering and Applied Science

(2)

Thermal Dynamic Model Development and

Model Predictive Building Control using

an Extensive Sensor Network

A case study in HouseZero

Ald´ıs Elfarsd´

ottir

Abstract

The Harvard Center for Green Buildings and Cities houses an extensive sensor network at its headquarters, dubbed HouseZero for its energy performance goals. To meet energy and thermal comfort targets, this project uses data from House-Zero’s third floor lab space to build a data-driven State-Space Model of indoor air temperature and a Model Predictive Controller for natural ventilation. Parameter estimation method, model order, and variable selection among 30+ sensor inputs are analyzed to select a model that predicts indoor air temperature with an R2 > 0.8 on validation data while meeting other specifications of complexity and fit to esti-mation data. The model predictive controller developed with YALMIP and CVX in MATLAB uses 10-step predictions from the selected model to output time-varying window opening sequences. Hour-long control trials in realistic winter conditions (outdoor temperature < setpoint < room temperature) yield promising results with a tracking error < 1.33oC to the setpoint. Results demonstrate the achievability of the target thermal comfort range of 20-26.5oC, and the potential for the project’s

op-timization framework to incorporate energy consumption objectives in future work.

Keywords: State-Space Model, Model Predictive Control

(3)
(4)

Declaration

I hereby submit this thesis in partial fulfillment of the requirements for the degree of Bachelor of Science in Engineering Sciences: Environmental Science and Engineering at Harvard University.

(5)

To Dr. Na Li, Dr. Bin Yan, and Dr. Ali Malkawi, thank you for inviting me to contribute to the HouseZero project, and for granting me access to the third floor lab space as a test bed for control trials. To Dr. Na Li, I aspire to your level of fluency and clarity of mind in developing cutting-edge algorithms to solve systems control problems, and thank you deeply for your undivided attention and thoughtful mentorship during our advising meetings.

To Dr. Bin Yan, thank you for your generosity in allowing me on multiple occasions to use your desktop and work space when implementing the controls and downloading sensor data from the server. To Bob Marino, thanks for letting me into the building each time I arrived for a visit. My many thanks to Dr. Yang Zheng for generously providing control optimization advice, two weeks into your arrival as a post-doctorate in Dr. Li’s group. Thank you Xin Song for setting aside the time and thought to troubleshoot the first iteration of control optimization with me. And to Dr. Yue Lu, thanks for taking the time to go over my statistical analysis.

To Dr. Anas Chalah and Melissa Hancock, my ES100 section leaders, I express my greatest appreciation for your values of efficiency, communicative clarity, and design goal accountability during our weekly meetings, as well as your resourceful-ness in pointing us toward appropriate resources and contacts when needed. I thank my section teammates for weekly discussions, feedback, and positive visions of fi-nal outcomes: Daniel Getega, Anubha Srivastava, Ibrahim Elnaggar, Julie Militza Ortiz, Sam Meijer, Ashlyn Frahm, Adam Vareberg, and Ethan Henry Wong.

To Dr. Salma Abu Ayyash, I revere your organizational efficacy in coordinating ES100 and thank you for your technical feedback on report drafts. To my concentra-tion advisor and design reviewer Dr. Patrick Ulrich, thank you for your academic guidance through these years. To Dr. Nishant Sule, thank you for your Design Review feedback and for lending the Windows laptop through the Active Learning Labs. To my peer reviewers Anthony Turner and David Xu, thank you for your thoughtful feedback at the Design Review.

(6)

Contents

1 Introduction 10 1.1 HouseZero . . . 10 1.1.1 Design motivation . . . 10 1.1.2 Design features . . . 11 1.2 Project overview . . . 12 1.2.1 Objective . . . 12 1.2.2 Design contribution . . . 13 1.2.3 Design process . . . 13 1.2.4 Summary of findings . . . 14 1.2.5 Future developments . . . 14 1.2.6 Report structure . . . 15 2 Model Development 16 2.1 Define . . . 16

2.1.1 State of the art in system identification . . . 16

2.1.2 State-space model formulation . . . 17

2.1.3 System identification using N4SID . . . 18

2.1.4 Alternative approach . . . 19

2.2 Design . . . 20

2.2.1 Specifications . . . 20

2.2.2 Balanced fit . . . 21

2.2.3 Variable selection process . . . 21

2.2.4 Training and validation split . . . 21

2.3 Build . . . 22

2.3.1 First iteration . . . 22

2.3.2 Second iteration . . . 23

2.3.3 Third iteration . . . 24

2.4 Measure . . . 25

2.4.1 Prediction horizon fit percent . . . 25

2.4.2 Linear simulation R2 . . . 26

2.5 Analyze . . . 26

2.5.1 Model specification check . . . 27

2.5.2 Model development insights . . . 29

3 Predictive Control Design 30 3.1 Define . . . 30

3.1.1 State of the art in control design . . . 30

(7)

3.1.3 Model predictive control . . . 32

3.2 Design . . . 33

3.2.1 Specifications . . . 33

3.3 Build . . . 34

3.3.1 Optimization problem of the final iteration . . . 34

3.3.2 Comparison of builds by iteration . . . 34

3.3.3 Future reformulations of the optimization problem . . . 35

3.3.4 Control trial set-up . . . 36

3.4 Measure . . . 37 3.4.1 First iteration . . . 37 3.4.2 Second iteration . . . 38 3.4.3 Third iteration . . . 39 3.5 Analyze . . . 40 3.5.1 Specifications met . . . 40

3.5.2 Z-test of significance in tracking error reduction . . . 42

3.5.3 Summary of key design decisions . . . 43

4 Conclusion 45 4.1 Accomplished design goals . . . 45

4.1.1 Contribution to system identification methods . . . 45

4.1.2 Contribution to model predictive control design . . . 46

4.2 Future steps . . . 47

A Appendix 51 A.1 System matrices, third iteration models . . . 51

A.2 Analytical controllability using matrices . . . 52

A.3 Data and code availability . . . 52

(8)

List of Figures

1.1 HouseZero and its sensor network . . . 12

1.2 Design process overview . . . 13

1.3 Third floor lab space . . . 14

2.1 Sensor data, scaled, with visible data gaps . . . 21

2.2 Training and validation sets, room temperature only . . . 22

2.3 First iteration branches of model development . . . 23

2.4 Second iteration branches of model development . . . 24

2.5 Second iteration branches of model development . . . 25

2.6 Prediction horizon 1-15 min fit percents, training vs. validation . . . 26

2.7 Linear simulation fits to training and validation models . . . 26

3.1 Model Predictive Control schematic . . . 33

3.2 Control trial set-up . . . 37

3.3 First iteration control trial . . . 38

3.4 Second iteration control trial . . . 39

3.5 Third iteration control trial . . . 40

3.6 Third iteration room temperature response . . . 40

(9)

2.1 Model design specifications . . . 20

2.2 Model variables selected in second iteration models used for MPC . . 24

2.3 Comparing first, second, and third iteration models . . . 27

2.4 Second iteration model metrics suitable for MPC . . . 28

3.1 Control specifications . . . 34

3.2 Comparing control optimization formulation by iteration . . . 35

3.3 Future potential objective functions . . . 35

3.4 Comparing first, second, and third iteration control trials . . . 41

3.5 MPC first iteration tracking errors . . . 41

3.6 MPC second iteration tracking errors . . . 42

3.7 MPC third iteration tracking errors . . . 42

3.8 Z-statistic significance of tracking error reductions with MPC . . . 43

A.1 A,C,K coefficients for states, response, and prediction error . . . 51

(10)

Chapter 1

Introduction

1.1

HouseZero

Originally built in 1924, the three-floor residential structure in Cambridge, Mas-sachusetts was retrofitted to a Net Zero Energy office building in 2018. It is the headquarters of the Harvard Center for Green Buildings and Cities, founded and directed by Dr. Ali Malkawi, and serves as a living laboratory and test bed for building energy research and control optimization technologies [14].

1.1.1

Design motivation

The building sector alone accounts for 40% of global energy consumption and 30% of greenhouse gas emissions from that energy production and distribution. While many new buildings and planned constructions achieve Net Zero Energy targets by producing as much as they consume for heating, cooling, and operations, the retrofit potential toward Net Zero Energy has not thoroughly been explored for the existing building stock. It is estimated that 65% of the expected building stock by 2060 has already been constructed in developed countries [30].

By retrofitting an existing residential structure, the Center for Green Buildings and Cities demonstrates its commitment to developing efficient energy solutions for the existing building portfolio. Moreover, HouseZero takes into account the embod-ied energy of construction materials, building operation, and equipment plug-loads. Over the intended 60-year lifespan of the building, it is expected that surplus renew-able energy from its geothermal heat pump and rooftop solar panels will completely offset the carbon emissions from equivalent energy used throughout the intended lifespan of the building, including construction.

Performance goals

Among its performance goals, HouseZero seeks to:

1. Require nearly zero energy for heating and cooling. This means the house should be able to produce as much energy as it requires for operation.

2. Maintain a target thermal comfort range of 20-26.5oC. This range should be

(11)

3. Use 100% natural ventilation. This eliminates the need for energy- intensive heating, ventilation, and air conditioning systems (HVAC).

1.1.2

Design features

The retrofit features 100% natural ventilation with automated window operation, and a thermally-activated building system with a geothermal ground-source heat pump. The building also integrates photovoltaic panels, solar hot water heating, and battery storage. It is equipped with more than 300 real-time sensors and actuators for optimized control, operation, monitoring [31, 14].

• HouseZero’s envelope, floors, and walls function to store and transfer heat in accordance with the season. This lends the house a high thermal inertia, which means thermal conditions are relatively stable compared to a building with an envelope subject to large amounts of uncontrolled air leakage or built with ma-terials that do not store heat well. Uniquely, this demonstrates how the Center for Green Buildings and Cities embraces an ecologically inspired approach to building energy solutions. Just as living organisms adjust themselves to their surroundings, a building through its envelope and materials may adjust itself seasonally and on a day to day basis according to thermal comfort targets for occupants.

• Instead of using reliable but energy-intensive Heating, Ventilation, and Air Conditioning (HVAC) systems, HouseZero relies on 100 % natural ventilation for air conditioning and ventilation needs. To address the design challenge of how to harness natural ventilation potential full-time without HVAC, en-ergy and weather computational simulations allowed the design team to make informed decisions about the building’s behavior in local environmental con-ditions, driving the design of the mechanical structure, orientation, and mate-rials.

• HouseZero’s approach to heating and cooling is to employ a Thermally- Acti-vated Building System (TABS). This makes use of internal structures – floors and walls – as energy storage and radiant heating and cooling surfaces depend-ing on the season. Water pipes embedded in the concrete slabs are connected to a heat pump to provide heating and cooling. By using a ground-source geothermal heat pump, the system draws up relatively warm water during the winter months, and relatively cool water during the summer months due to the stable temperatures of water at depth in the insulating ground – and distributes hot or cold water through pipes in the radiant floors and walls to heat or cool the indoor space. TABS has emerged as an energy-efficient and economical strategy for heating and cooling in Europe, and is demonstrating its potential in HouseZero as well [31].

(12)

Data-Driven Model Development for Model Predictive Building Control

valve in accordance with a rule-based algorithm that seeks to control the in-door air quality and temperature [31]. This existing control method is covered further in Chapter 3.

Figure 1.1: HouseZero and its sensor network

1.2

Project overview

1.2.1

Objective

The objective of this project is to help HouseZero achieve its thermal comfort per-formance goal. The current rule-based operation system enables the system to meet thermal comfort requirements only 48% of the time. In order to do achieve thermal comfort targets, the first step is to develop an understanding of the house’s thermal dynamics. Once an understanding has been established, it can be used to develop a predictive controller for the windows and heat valve. This controller will interface between the sensor network and existing WindowMaster actuator system.

(13)

1.2.2

Design contribution

This project is motivated by contribution to growing research in the areas of Sys-tem Identification and Model Predictive Control using the unique opportunity and resources that HouseZero offers to develop and test the predictive performance of a data-driven model for control applications.

Novelty lies in the process of assessing and factoring the influence of 14+ building and weather input variables into the identification of a system model and design of a predictive controller. Quantitative aims included in the specifications include a maximization of model fit and improvement in baseline control efficacy. Meeting the specified aims justifies further development of the project’s model and control formulation to achieve HouseZero’s thermal comfort levels and energy performance goals.

1.2.3

Design process

Figure 1.2: Design process overview

The overall design process depicted in Figure 1.2 has five main components: 1. Data Collection. The third floor lab space functions as this project’s test

bed with its contained structure, approximately 10 m2 in floor area, its

com-prehensive sensor network, and controllable features including the actuated windows and heat valve.

2. Pre-processing. Using the Python Pandas package, this step splits the data into subsets with which to train and validate models of the lab space.

(14)

Data-Driven Model Development for Model Predictive Building Control

4. Control design and evaluation. The best of the developed models is used to predicts the response of control inputs such as window opening and heat valve position.

5. Implementation trials and reporting. Working between MATLAB control script and WindowMaster control interface, the Model Predictive Controller is tested over hour-long trial periods. Results are analyzed in Chapter 3.

Figure 1.3: Third floor lab space

1.2.4

Summary of findings

Model system identification. Parameter estimation method, model order, and variable selection among the sensor inputs are analyzed to select a model that pre-dicts indoor air temperature with an R2 > 0.8 on validation data while meeting other

specifications of complexity and fit to estimation data. Two second order models – one trained on the full dataset between August and December, and one trained on part of the dataset between October 26 to November 13 – meet all criteria for use in Model Predictive Control. They used 14 variables to accurately predict room temperature with an R2 close to 0.9 on validation data.

Model predictive controller design. A model predictive controller for each selected model is developed with YALMIP and CVX in MATLAB. They give 10-minute predictions of room temperature and solve an optimization problem to min-imize tracking error, then output optimal window opening sequences for the time period. Only the first 5 minutes are implemented to maintain accuracy, and fea-sibly accommodate the manual implementation set-up. Hour-long control trials in representative conditions (outdoor < setpoint < room temperature) yield promising results with a tracking error < 1.33oC to the setpoint, demonstrating achievability of the thermal comfort targets and good potential for reformulation to optimize energy efficiency in future developments.

1.2.5

Future developments

While the control script can output heat valve commands in addition to window opening sequences, on-going laboratory developments for the heat valve controller limit preliminary testing to window controls. Using the design presented in this report, future developments can readily include heat valve outputs. Given that

(15)

HouseZero already relies on renewable energy sources, the net zero energy target is not at the forefront of this project’s design goals. Future developments can likewise build on the framework presented in this report to optimize for energy consumption in addition to thermal comfort.

1.2.6

Report structure

This report is structured in two parts. The first covers Model Development and the second covers Control Optimization. Each is structured according to the framework of: Define, Design, Build, Measure, and Analyze.

Chapter 2 covers the Model Development process, beginning with an overview of system identification methods and State-Space Model theory. It then presents design specifications for three iterations of model development that are covered in the Build section. Results from linear simulations are analyzed to check whether the models are suitable for use in predictive control, and key design decisions are summarized in closing.

Chapter 3 dives into the design and implementation of the Model Predictive Controller, starting with a technical description of MPC, a motivating description of baseline rule-based control and performance. The text then moves into design specifications, and a formulations of the underlying optimization problem, as im-plemented in MATLAB. Three iterations of control trials employing various State-Space Models are discussed. The particular experimental set-up for in-lab trials is described and justified based on a compilation of insights from the first two itera-tions. Final experimental results are presented and analyzed, yielding key design decisions for future work and promising results for the conclusion in Chapter 4.

(16)

Chapter 2

Model Development

2.1

Define

2.1.1

State of the art in system identification

How is it possible to control a system with unknown behavior? The first step is to identify the system and mathematically describe its behavior. The procedure for system identification follows a logical flow: (1) collect the data, (2) choose a model structure, (3) parameterize the model, and (4) validate and select the best model according to application criteria. While a model can never fully or truly describe a system in its entirety, it can capture and describe certain aspects of interest to an extent that is sufficient for intended applications [20]. The following subsections describe how this project follows the system identification logic. Broad concepts are made specific to the case of modeling indoor air temperatures using an extensive sensor network, toward an application in control.

Data collection

Three essential methods for data collection are to use a retrospective study of his-torical data, an observational study (no user inputs), or designed experiments (with user inputs) [5]. The majority of system identification for this project is based on observed and historical data between August 28 and December 3, 2018. Experimen-tal design comes into practice for control trials, but is not used for the purpose of identifying underlying system dynamics of the regular lab space operation. For this purpose, it is sufficient to use observed and historical data.

Model structure

At its core, a model maps past data to the space of the output, Z, as generalized in Equation 2.1 [21]. ˆy represents the modeled response of the system, which may vary with time t. θ is a vector of finite dimensions that parameterizes the mapping between inputs and outputs. This suggests the time varying response of the system is some function, g of mapping inputs to outputs, and the past output of the system.

ˆ

y(t|θ) = g(θ, Zt−1) (2.1)

Two broad classes of systems are Linear Time-Invariant Systems, and Time-Varying and Nonlinear Systems. Often, nonlinear behaviors of real systems can be captured

(17)

by linear approximations. Such is the case of thermal dynamics in the lab space under consideration. Time-invariance refers to the use of constant coefficients to parameterize the mapping between inputs and outputs.

In accordance with intended control applications, this project applies a State-Space Model structure to understand the relationship between input and output signals [3]. This corresponds with the Linear Time-Invariant formulation. In this case, the inputs are the control and disturbance variables such as window opening and weather, and the output is the room temperature response. Other Linear Time-Invariant model structures include linear regressions and Box-Jenkins models, as described in [21], however they are not widely used in control applications. Other studies have similarly applied State-Space models to understand and control the thermal dynamics of building systems [8, 18, 19, 32].

Model parameterization

Approaches to model parameterization can be classified in accordance with the extent of their reliance on purely physical principles and measured data streams. Black-box methods formulate system models based purely on measured input and output data, and do not require physically-based derivation of system equations. Grey-box methods derive physical equations to describe dynamical behavior, and pa-rameterize them with known or measured parameters of the specific system. White-box methods rely purely on simulation using whole-building analysis tools such as TRNSYS, Energy-Plus, ESP-r and others [8]. On-going research explores the poten-tial of combined approaches [29]. State-Space Models can be formulated using any combination of the above approaches [8, 18, 19, 21]. In this case, the sensor network of HouseZero justifies the use of a black-box model and associated parameterization techniques.

In parameter estimation, the objective is to minimize model prediction error, find parameters with the maximum likelihood of accuracy, or find least-squares parameters associated with the best fit in a linear regression [20]. Various algorithms are developed based on these objectives, and are used in different applications. State of the art parametrization solvers are readily available in the MATLAB Optimization Toolbox, including State-Space system identification methods (e.g. N4SID). The N4SID method enables the determination of states and system matrices, yielding simplified models for use in model predictive control [18]. An advantage of using N4SID is it does not require use of EnergyPlus or TRNSYS modeling software for whole-building energy analysis.

Model validation and selection

In the case of intended control application, validation tests should assess how the model is able to predict room responses to changes in control variables, such as window opening or heat valve position. In this Chapter, the section on Design specifications lays out validation criteria.

2.1.2

State-space model formulation

(18)

Data-Driven Model Development for Model Predictive Building Control

21]. The basic concept of the state-space system of Equations 2.2 and 2.3 is to parameterize the system matrices: A, B, C, D, and F according to the system’s input and output data. The state vector, x(t), captures the dynamic status of the room system with a set of states that do not necessarily link to physical properties. This poses an advantage when deriving a data-driven model for unfamiliar systems. It is possible to derive physically-meaningful parameters where the heat capacities and transfer rates of the building materials are known, as researchers have done with Resistance-Capacitance state-space model formulations [8]. However, for control purposes, it is sufficient to have properly identified yet un-physical states and system matrices that can best estimate the behavior of the room temperature. The state vector x(t) has as many elements as there are orders to the problem.

x[t + T s] = Ax[t] + Bu[t] + F d[t] + Ke[t] (2.2)

y[t] = Cx[t] + Du[t] + e[t] (2.3)

In this discrete formulation, the next state of the room, x[t + T s] is influenced not only by its prior state, x(t), but also by control inputs, u(t), disturbances, d(t), and prediction error feedback, e(t). T s is the time step, which may be ≥ 1 second or ≥ 1 minute, depending on the interpolation of the data set. Comprehensive control inputs would include the position of south-facing windows, skylight, and heat valve. Lab limitations reduce the control vector to a scalar value of skylight position (% opening). Disturbances include CO2, humidity, outdoor air temperature, wind

direction, and wind speed. The response variable, y(t) is the room temperature predicted by the model, and is derived from the states, controls, and prediction error. The prediction error term e(t) represents observed minus predicted room temperature.     x1 x2 · · · xn     =      a1,1 a1,2 · · · a1,n a2,1 a2,2 · · · a2,n .. . ... . .. ... am,1 am,2 · · · am,n          x1 x2 · · · xn     +      b1,1 b1,2 · · · b1,n b2,1 b2,2 · · · b2,n .. . ... . .. ... bm,1 bm,2 · · · bm,n          u1 u2 · · · un     (2.4)

In expanded form, the matrices A, B, state vector x(t), and control vector u(t) appear for example in Equation 2.4.

2.1.3

System identification using N4SID

The MATLAB N4SID function is a statistically-based data-driven system identifi-cation method. First, it estimates the states that describe the system, based on input data. As described in [18], a block Hankel matrix is constructed from input and output data, and partitioned based on past p, and future f inputs (Equation 2.5).

(19)

U (0|2i−1) =               

u(0) u(1) · · · u(j − 1)

u(1) u(2) · · · u(j)

..

. ... . .. ...

u(i − 1) u(i) · · · u(i + j − 2) u(i) u(i + 1) · · · u(i + j − 1) u(i + 1) u(i + 2) · · · u(i + j)

..

. ... . .. ...

u(2i − 1) u(2i) · · · u(2i + j − 2)                =U (0|2i − 1) U (i|2i − 1)  =Up Uf  (2.5) The model order, n is then determined by oblique projection, equivalent to mul-tiplying the extended observability matrix, state vector, and decomposition of the singular value, as in Equation 2.6 [18].

n = rankUp Yp  + rankUf Yf  − rank     Up Yp Uf Yf     (2.6)

N4SID then uses the the states, input data, and output data to determine the system matrices, A, B, C, and D by applying least squares methods to Equation 2.7. Ultimately, N4SID aims to minimize prediction error with best-fit coefficients for the system of equations that describes the room [15, 18].

X(i + 1) Y (i|i)  =A B C D   X(i) U (i|i)  (2.7) Equation 2.7 displays a single B matrix, which is partitioned into the control B and disturbance F system matrices presented in the state-space formulation for this project (Equation 2.2). K is then derived by comparing the model predicted room temperature with estimation output data.

2.1.4

Alternative approach

A limiting factor in using N4SID is that it requires contiguous input and output datasets. This adds a design requirement that necessitates resampling, interpolating, and filling data gaps in any sensor data that is used to train a model, as illustrated later in Figure 2.2.

An alternative approach is to code an optimization problem using YALMIP and CVX that yields best-fit coefficients to model estimation data sets that are not necessarily time-contiguous. The predictions can be written as follows for a 10-step prediction horizon in Equations 2.8-2.11. Lowercase a and b represent the coefficients in system matrices A and B. x(t) represents the predicted state estimation for timee t, and u(t) represents the control value for that time step.

e

x(1) = ax(0) + bu(0) (2.8)

e

(20)

Data-Driven Model Development for Model Predictive Building Control ..

. (2.10)

e

x(10) = ax(9) + bu(9) (2.11)

Gathering the state and control variables into a matrix denoted G, and the coefficients a and b into a vector, this series of equations can be written as a system of matrices (Equation 2.12).      e x(1) e x(2) .. . e x(n)      =    x(0) u(0) .. . ... x(9) u(9)    a b  = Ga b  (2.12)

By the following minimization objective, the coefficients of the system matrices can be derived accordingly (Equation 2.13).

min a,b X i ||ex(i) − x(i)||2 = ||G a b  − x||2 (2.13) a b  = G−1x

For preliminary model development, N4SID is chosen for time effectiveness. A promising future step would be to formulate and solve this optimal parameterization method in MATLAB, which could handle data gaps and update dynamic system models in real-time.

2.2

Design

2.2.1

Specifications

Specification Value Units

Utilize sensor network ≤ 30 input data streams

Capture time constants 1-15 seconds, minutes

Minimize complexity < -1e4 Akaike Information Criterion (AIC)

High estimation fit < 1e-2 Mean standard error (MSE)

High validation fit ≥ 90% Fit % at 15-minute prediction horizon Balanced fit < 10% |estim fit % – valid fit %| at 15-min Explain variation in data > 0.8 R2 on validation sets

Table 2.1: Model design specifications

The model design specifications in Table 3.1 are intended to ensure that the model is based on a representative and sufficient set of sensor data and accurately predicts temperatures under fluctuating room conditions. The extent to which the model can predict temperature evolution based on control and disturbance vectors is measured not only by the mean standard error (MSE) between modeled and measured data but also by model fit to validation data. A threshold of model

(21)

complexity is also imposed via the Akaike Information Criterion (AIC), which is minimized in simpler models. The time step of the model should capture important time constants of change resulting from window opening, on the order of seconds to minutes. The difference between 1 second and 1 minute models is tested in the second and third iterations of the Build phase.

2.2.2

Balanced fit

A design challenge in choosing a model for predictive control is to balance fit to estimation and validation data. The better a model fits its estimation data, the less likely it will fit well to data on which it is not trained, and vice versa. Statistical indicators of model fit to training and validation data determine whether the models meet design specifications, including Fit % to estimation and validation data, and R2.

2.2.3

Variable selection process

In utilizing the sensor network, it is important to select appropriate variables for the inputs, including controls and disturbance variables [23]. Figure 2.1 plots ten sensor streams that were incorporated in the second iteration of model development. Other sensors in the network include blind positions, ventilation mode, qfresh – a measure of fresh air, surrounding temperatures and humidities, wind speed, and wind direction.

Figure 2.1: Sensor data, scaled, with visible data gaps

2.2.4

Training and validation split

(22)

Data-Driven Model Development for Model Predictive Building Control

three model development iterations subdivide all the sensor data starting from late August. Each subdivision is used to both train and validate models, nearly doubling the model development power of the collective data set.

The highlighted datasets are labeled Before and After according to their positions before and after the October data gap. To develop a model on the Full data set, the October data gap is interpolated with a linear spline function in order to apply the N4SID parameter estimation algorithm.

Figure 2.2: Training and validation sets, room temperature only

2.3

Build

2.3.1

First iteration

First iteration models are based on conditional clusters of data. Training sets consist of the longest contiguous portions of data satisfying each condition, or combination of conditions (as in fourth-order, fifth-order clusters). This iteration tests only first order models with a 1-minute time step, budgeting computational resources for generating the various cluster models.

To select variables chosen in this iteration, the linear regression function fitlm in MATLAB and statistical regression program SAS provide methods to determine the likelihood of various combinations of regressors to predict the room temperature (oC). If variables are statistically-significant based on MATLAB fitlm tests or the SAS tests for Cp metric, the variables are included as input data for the N4SID algorithm.

• 6 temps: outdoor air temperature (oC), slab temperature (oC), and the

tem-peratures of four adjacent rooms (oC). The selection of just temperatures is on the basis of unit-matching (oC input to oC output). This correlates the

room temperature with the temperature of its surroundings including neigh-boring rooms in the building, and outdoor air temperature. However, because this model does not include window opening, it cannot be used for a Model Predictive Control of the windows.

(23)

Figure 2.3: First iteration branches of model development

• 9 variables MATLAB fitlm: heat valve position (%), skylight window position (%), CO2 level (ppm), relative humidity (%), outdoor air temperature (oC),

slab temperature (oC), setpoint temperature (oC), wind direction (o), and wind speed (m/s). A p-value of 0.05 is the cutoff threshold for the 9 variables that are most likely to correlate with room temperature, based on the fitlm linear model fitting test in MATLAB.

• 18 variables SAS Cp criteria: heat valve actual status (%), heat valve command (%), occupancy, ventilation mode, CO2, humidity of surrounding rooms (%),

outdoor air temperature (oC), temperatures of surrounding rooms (oC), slab

temperature (oC), setpoint temperature (oC), wind direction (o), wind speed

(m/s). In the statistical analysis software SAS, the listed 18 variables yield a model with the lowest Cp criterion [23].

Conditions for clusters include: daytime, nighttime, heating on, heating off, rain-ing, not rainrain-ing, all combinations of the skylight “roof” and south-facing windows being open or closed, occupied, unoccupied. Higher order clusters combine condi-tions: for example, fourth order means no rain, the room is unoccupied, heating is on, and all windows are closed. The fifth order adds the condition that it is daytime. Training and validation sets are then established based on longest and second-longest contiguous time segments in each room condition.

2.3.2

Second iteration

(24)

Data-Driven Model Development for Model Predictive Building Control

Figure 2.4: Second iteration branches of model development Variable Description

Variable Abbreviation meaning limits, units

positR skylight “roof” position 0-100% open

positS south window position 0-100% open

heatvalve heat valve position 0-100% on

slabC temperature of radiant floor oC

humid room relative humidity 0-100%

co2 carbon dioxide concentration ppm

occ occupied, unoccupied -1,0

windir wind direction 0-360o

rain rain, no rain -1,0

oatC outdoor air temperature oC

temp31, temp33 adjacent room temperatures oC

temp22, temp23 adjacent lower room temperatures oC

Table 2.2: Model variables selected in second iteration models used for MPC

These 14 variables are selected by evaluating which disturbance variables enhance or detract from model fit to the full set of estimation data. If sensor streams improve the fit to estimation data, they are retained. If not, they are removed. Among those removed are extraneous variables specific to the installed WindowMaster window actuation system, such as ventilation mode and qfresh, a measure of fresh air.

2.3.3

Third iteration

A final model iteration experiments with further enhancing interpolated resolution from 1 minute to 1 second. Only 13 of 14 variables are used, neglecting one of the surrounding room temperature readings (temp 31, the third floor lounge adja-cent to the lab space). Nevertheless, the 1 second interpolation on data from late

(25)

November to late February encountered time and memory-consuming barriers to a full completion of analysis.

Figure 2.5: Second iteration branches of model development

2.4

Measure

This section compiles specification metrics for each iteration of builds. Estimation fit measures how well the model fits its training data, while validation fit measures how well a given model predicts room temperature during periods on which it is not trained. The latter holds important implications for the predictive control applica-tion.

2.4.1

Prediction horizon fit percent

The MATLAB compare function iteratively runs the model forward in time for a specified number of time steps. Design specifications are to achieve > 90% fit after a 15 minute prediction horizon so that if controls are implemented over 15 minutes without checking on server data, the model will still yield reliable predictions by the 15 minute mark. More likely, the system architecture will run the model in real time or up to 5 minutes. Thus a > 90% fit to validation data at the 15 minute prediction horizon offers a highly conservative measure of model predictive power for control purposes.

(26)

Data-Driven Model Development for Model Predictive Building Control

Figure 2.6: Prediction horizon 1-15 min fit percents, training vs. validation

2.4.2

Linear simulation R

2

A complementary way to measure model predictive power is to simulate the model, which can be done with MATLAB’s lsim function, as shown in Figure 2.7. While the function compare carries forth model outputs into the next step of predicted temperature, seeded by validation data at the start of each prediction horizon, the lsim procedure feeds input from the validation set once by specifying an initial value that corresponds to the initial state of the room in the validation period [22]. Thus, the compare function, even for a 15 minute prediction horizon tends to yield higher fit percentages than the lsim function does for R2.

Figure 2.7: Linear simulation fits to training and validation models

Figure 2.7 demonstrates how R2 regression fits decrease as the model is validated

against data that is further removed from its training set.

2.5

Analyze

This section analyzes the extent to which the measured model metrics meet desired specifications, and selects the best models to be used in Model Predictive Control.

(27)

2.5.1

Model specification check

Table 3.4 compares all iterations of model development against design specifications. Fit % and R2 averages neglect outliers with negative, unphysical fits. While Fit % measures how far removed predictions are from measured data points, R2 describes

the percent variation in measured data that is accounted for by the state-space model’s simulations.

Model Averages by Iteration

Design Specifications 1st 2nd 3rd

Uses sensor network (# vars) 6-18 X 14X 13 X

Time step 1-15 min 1 X 1 X 1 sec X

AIC < −10−4 -4.24e4X -2.9e5 X -3.91e7 X

MSE < 10−2 oC estimation 2.99e-3X 3.23e-3X 1.15e-7 X

> 90% valid fit at 15 min 74.76% 89.62% X memory

|fitestim - fitvalid| < 10% to 15 min 10.2 3.75 X overflow

R2 validation 0.56 ± 0.26 0.79 ± 0.19 0.50 ± 0.01

Evaluation baseline good for MPC unimproved

Table 2.3: Comparing first, second, and third iteration models

First iteration

On average, the clustered first order models only achieve about half of the spec-ifications. In part, the poor 74.76% fit to validation data, and unbalanced fit > 10% difference at the 15 minute horizon are due to the conditional clustering, which reduces the size of the training set to at most 3 days (e.g. contiguous times when it is not raining, the room is unoccupied, and heating is on). This limits the model’s ability to predict data from times that it is not trained on, including those times when the room experiences similar conditions. Additionally, the first order places a limit on the extent of fit to any set of data. Higher orders can capture the room’s dynamics more comprehensively.

Low average R2 fit (0.56 ± 0.26) to validation data precludes the use of these models in Model Predictive Control, which requires the model’s exposure to data it has not been trained on. Moreover, using cluster models for predictive control requires that individual models be developed for any possible combination of room conditions at any given time. The models must then be applied in real-time, in accordance with each set of conditions. Some of the first order models, though they utilize the sensor network, do not include the control variable (positR) as one of their sensor inputs, and thus cannot be used for control purposes.

Second iteration

(28)

Data-Driven Model Development for Model Predictive Building Control

The improvement in validation fits to an average R2 of 0.79 ± 0.19 in second iteration models as compared to first iteration supports the inherent predictive power in the full (unclustered) set of data, and confirms the advantage of using higher orders to capture the dynamic thermal behavior of the room.

Models to try with MPC

From the second iteration of model development, a few models meet all model design specifications. Table 2.4 describes two of the best models from the second iteration of model building. Namely, these are the second order fullrow model (14 weeks, Aug 28-Dec 3) and second order atrain model (2.5 weeks, Oct 26-Nov 14).

Best of second iteration models

Design Specifications Fullrow-2 Atrain-2

Uses sensor network (# vars) 14 X 14X

Time step (min) 1X 1 X

AIC < −10−4 -9e5 X -2e5 X

MSE < 10−2 oC estimation 1e-4 X 9e-5 X

> 90% valid fit to 15 min 96% X 96% X

|fitestim - fitvalid| < 10% to 15 min 1.4% X 3.4% X

R2 validation 0.92 X 0.88 X

Evaluation good for MPC good for MPC

Table 2.4: Second iteration model metrics suitable for MPC

The near-90% fits to validation sets at the 15 minute horizon indicates high model predictive power and justifies using these models in Model Predictive Control. Third iteration

The third iteration models’ small time step of interpolation (1 second) results in a memory overflow in the analysis of fit % over the prediction horizons. Due to the time- and memory-intensive nature of building and analyzing these high-resolution models, they are impractical for Model Predictive Control. Moreover, predicting forward even for 5 minutes is asking the model to step forward 300 steps to estimate the impact of an increase in window opening on room temperature response. This explains the low R2 values of 0.50 ± 0.01 in Table 3.4.

(29)

2.5.2

Model development insights

Recognizing that these particular results depend on model development design de-cisions, the following summary highlights pivotal design decisions and future recom-mendations in the model development process:

• Model order: This process develops models of order 1-3. Higher orders contribute to improvements in model fit to validation data.

• Time step: The time step of interpolation is 1 minute, primarily to capture minute-by-minute changes in occupancy and window opening. A time step of 1 second encounters computational expenses and memory overflows when testing prediction horizon up to 15 minutes.

• Prediction horizon: The prediction horizon of 15 minutes is a conservative metric that enables control action to take place in the first 5 to 10 minutes of each prediction segment while maintaining high accuracy, > 90% fit to validation data, and balanced fit to estimation data.

• Parameter estimation: MATLAB’s data-driven N4SID algorithm is used to parameterize the discrete state-space model formulation: multiple input single output (room temperature). Future developments may want to consider multi-ple outputs, including humidity and carbon dioxide levels for indoor air quality, and use the alternative optimization formulation posed in Section 2.1.4. It is also possible to develop greybox models based on physical knowledge of the space [29].

• Variable selection: By process of elimination using the full dataset (August 28 to December 3), 14 variables are selected without sacrificing model fit to estimation data. They are listed in Table 2.2. In the link between model devel-opment and control optimization, it is crucial to include the control variables in the development of the model so that their step changes have a predicted impact on room temperature.

• Control variables: The only control variable incorporated in the model is the position of the skylight or “roof” window (e.g. positR). Future developments should be able to control the heat valve and south-facing windows as well. • Training-validation split: Particular ways in which the full data set is

di-vided into training and validation sets also leave room for development. In the analysis process, validation sets that are closer in time to the training set yield higher prediction accuracy. This suggests the potential for real-time implementation to greatly improve model predictive performance.

(30)

Chapter 3

Predictive Control Design

3.1

Define

3.1.1

State of the art in control design

Optimizing controls for building operation is a widely implementable solution to reduce the energy demands of existing and future buildings. The sector’s overall 30% contribution to global CO2 emissions and 40% contribution to global energy demand

presents a control design challenge. State-of-the-art intelligent control systems can balance both energy and comfort management. Existing control methods include on-off scheduling, rule-based algorithms, fuzzy logic, proportional integral derivative, model predictive, optimal, adaptive, and artificial neural network controllers [29]. The following list gives a brief overview of each class of control systems, highlighting advantages and disadvantages that justify the selection of Model Predictive Control for this project’s application:

• On-Off Scheduling determines when equipment or heating and ventilation sys-tems should be turned on and off. On-Off Scheduling controls can be struc-tured based on time-of-day, or occupancy hours, or season. A good example is a programmable thermostat for radiators. While simple to program and implement, On-Off Scheduling has the drawback of a high potential for over-consumption of energy, and over-ventilation of indoor spaces [29].

• Rule-based controls are similar to on-off scheduling in that they apply controls to the heating and ventilation systems based on certain pre-defined conditions. An example could be a window actuation system that opens the windows for 3 minutes or a set duration when temperatures rise above 26.5oC [31].

Rule-based controls can reduce excessive system operation by only operating the systems under conditions that make them necessary. Their disadvantage is that the rules need to be known and defined before implementation, and any new rule must be manually programmed into the operating system.

• The core logic of Fuzzy controllers is a set of rule-based engines. Fuzzy Logic Controllers are typically applied to physical systems that are not easy to accu-rately mathematically model. Thus, control variables become fuzzy variables, which allow the uncertainty of each variable to be systematically modeled [17]. Embedding fuzzy logic in Model Predictive Controllers can in some cases improve system performance over ordinary MPC [9].

(31)

• PID controllers use feedback from the real-time system to modulate control based on error measurements: how far off is the system from desired operation (e.g. tracking error to temperature setpoint)? The algorithms then modu-late control action in proportion to the error itself, according to the integral of the errors over time, and according to the expected change in the error, calculated by a derivative. PID controllers require appropriate tuning of each proportional, integral, and derivative term in order to effectively reach system targets, which relies on system simulation [3].

• Model Predictive Controllers (MPC) rely on an underlying model of the sys-tem dynamics to predict optimal control sequences over a given time horizon. The optimality of the control sequences is based on the formulation of the un-derlying optimization problem, which may seek to minimize thermal setpoint tracking error or energy consumption. MPC is a closed-loop method of control that takes into account the system response to applied controls. Periodically, the model is updated with new initial conditions that reflect the actual state of the system. This reduces deviation between predicted and actual system behavior and leads to good tracking performance [29].

• Optimal controllers also rely on a dynamic model for predictions of optimal control sequences. Unlike MPC, optimal controllers are open-loop, which pose a disadvantage in control performance. This means the control sequence is implemented in the system without going back to periodically update the model with system responses and new initial conditions, which results in larger deviations between the predicted and actual performance of the system [29]. • Adaptive controllers rely on minimal a-priori knowledge of the physical

sys-tem and its disturbances, and have the ability to ’learn’ the syssys-tem by training models on input-output data. Adaptive controls appropriately and automati-cally vary control gains based on real-time feedback from the system [8]. • Artificial Neural Network control is an advanced technique for applications

to nonlinear dynamical systems. It combines the processes of system iden-tification and control implementation, essentially automating what a human designer would do to identify and control the system. At its core, a neural network is a system with inputs and outputs, and comprises numerous pro-cessing elements, each with its own weighting parameter. Changing elemental weights changes the behavior of the element and the network as a whole. In the process of training the network, weights are chosen to achieve the desired input and output relationship. The learning process for the neural network controller is to provide the correct inputs to drive the nonlinear system from its initial state to a desired state. It iteratively improves performance by testing controls on the emulated system network [25].

MPC selection

(32)

Data-Driven Model Development for Model Predictive Building Control

which is higher than any other representation of control techniques. From highest to lowest representation among the reviewed literature there is MPC, Fuzzy Logic, On-Off Scheduling, PID, Artificial Neural Networks, Fuzzy PID, Adaptive, then Optimal Control [29].

MPC offers an advantage over rule-based control systems in that it can incor-porate feedback from dynamic system modeling along with disturbance predictions such as weather forecasts. Correspondingly, MPC has led to enhanced energy sav-ings and performance for thermal control over other rule-based controls [29]. Prior research has also seen MPC outperform PID controllers optimized to reduce tracking error [28]. Compared to optimal controls, MPC offers the advantage of closed-loop feedback control. Crucially, HouseZero’s sensor network also provides appropriate feedbacks for MPC closed-loop deployment.

Thus, MPC is chosen for its compatibility with HouseZero’s sensor network and its potential to contribute to thermal and energy performance goals. By working with MPC, MATLAB, thermal objective parameters, and an office building, this project’s design contribution aligns with a majority of the literature reviewed by [29]. Based on the MPC implemented in this project, there is potential for transition into Adaptive MPC through the development of a software interface between the sensor server and the control algorithms. This interface will enable continuous training of the system model and optimization of controls for implementation. The prospect of employing fuzzy logic and neural networks also lends ideas for future work as fuzzy logic MPC and neural networks have the potential to improve control performance [9, 25].

3.1.2

Current system operation

Underlying HouseZero’s current control logic is a rule-based strategy for integrating thermal and ventilation controls [31]. With a time constant greater than 20 hours between valve opening and thermal room response, the thermally activated building system (TABS) requires advance weather forecasts to accommodate its high thermal inertia. The natural ventilation time constant is on the order of minutes to an hour, depending on differences in outdoor air temperature, opening area, and wind conditions. The windows are currently controlled to manage indoor air quality and carbon dioxide concentration in the winter. They can be programmed for cross ventilation and nighttime heat release in the cooling season. Bottom panels of windows can also be opened manually to additionally ventilate the space at any time of the year. Four operation modes currently use weighted forecasts of outdoor conditions to coordinate the slow-acting TABS and fast-acting natural ventilation [31]. In these various control modes for indoor air quality and temperature, baseline operation has achieved its thermal comfort target of 20-26.5oC for 48% of the time, opening windows 63% of the time, from August 28, 2018 through March 20, 2019.

3.1.3

Model predictive control

The process by which an optimal control sequence is predicted and implemented is Model Predictive Control. Given the State-Space Model of thermal dynamics in the lab space, it is possible to predict room responses to changes in control variables, and determine optimal control action for control targets [6, 18, 19, 21, 26, 32, 34].

(33)

Figure 3.1: Model Predictive Control schematic

As depicted in Figure 3.1, the State-Space Model is updated with new distur-bances at the start of each horizon, and predicts the room temperature response. The MPC algorithm then solves an optimization problem that minimizes thermal tracking error subject to the model and constraints, and outputs an optimal se-quence of controls for the time horizon. Recall that prediction accuracy declines as prediction horizon increases (Figure 2.6). For this reason, only the first few controls of each sequence are implemented to retain high prediction accuracy as the process continues over time.

This chapter builds on the last by bringing the State-Space Model into a Model Predictive Control design, addressing the core question of how to design a controller such that the room temperature closely tracks thermal setpoints. The lower the tracking error (difference between room temperature and setpoint), the more likely the room is to maintain the thermal comfort range of 20-26.5oC.

3.2

Design

3.2.1

Specifications

(34)

Data-Driven Model Development for Model Predictive Building Control

Specification Value Units

Utilize best of developed models

Time horizon (predict, implement) < 15 minutes

Realistic setpoints given controls 17-20oC such that set oC < roomoC

Outputs for manual tests 0-100 window opening (%)

Tracking error < 1.33oC roomoC – set oC baseline

Table 3.1: Control specifications

3.3

Build

3.3.1

Optimization problem of the final iteration

The overall structure of this optimization problem is pursuant to the objective to minimize temperature tracking error, subject to the State-Space Model of the sys-tem, and various constraints: the skylight window can open between 0-100%, and if feasible, the end constraint that the setpoint is predicted to be reached by the end of the time horizon, N minutes.

min ||y − ydes||2

s.t. x[t + T s] = Ax[t] + Bu[t] + F d[t] + Ke[t] y[t] = C ∗ x[t] + Du[t] + e[t]

0 ≤ u[t] ≤ 100 y[N ] = ydes

(3.1)

In state-space form, the control vector, u(t), has one row for each variable be-ing controlled. Each column is the control value for the next 1 minute time step. The code thus outputs a sequence of window opening commands (% open) for the skylight “roof” control variable: positR, over the 10-minute time horizon. The variables that cannot be controlled belong to the time-varying disturbance vector, d(t). In this case, d(t) includes CO2, humidity, outdoor air temperature, wind

di-rection, floor/slab temperature, south facing window position, heat valve position, occupancy, rain, and surrounding room temperatures.

3.3.2

Comparison of builds by iteration

The formulation of the optimization problem improves after the first iteration by including the prediction error term, Ke(t) in the State-Space Model, and an end constraint that the predicted temperatures at the end of the time horizon meet the desired setpoint. The parameterization method for the model in the first trial also differs slightly from the N4SID algorithm as it uses the SSEST algorithm intended for continuous formulations of State-Space Models. The rest of the control trials use N4SID-trained models.

The second control trial precedes the MPC model selection process, which in-forms the third control trial. The second and third control trials use a longer predic-tion horizon than the first. Implementing only the first half of the predicpredic-tion likely contributes to observed improvement in tracking performance.

(35)

Formulation of the optimization problem

Trial Date February 22 March 15 March 20

A, B, C, D, F, K ssest-atrain2 avalid2 atrain2 full2 atrain2

Setpoint, ydes (oC) 20 17.5 20 20 17.5 17.5

Time step (minutes) 1 1 1 1 1 1

Steps ahead 5 5 10 10 10 10

Steps implemented 5 5 5 5 5 5

Prediction error term No No Yes Yes Yes Yes

Window constraint? Yes Yes Yes Yes Yes Yes

End constraint? No No Yes Yes Yes Yes

Model naming convention is model training set and number of states. Table 3.2: Comparing control optimization formulation by iteration

3.3.3

Future reformulations of the optimization problem

Objective

For all control trials, the objective function remains unchanged: simply minimize the discrepancy between room temperature (y(t) = Cx(t)) and setpoint desired temperature (ydes). The metric to minimize is the Euclidean 2-norm:

||y − ydes||2 =

qX

(y − ydes)2 (3.2)

Future iterations of the objective function may test various structures of the objective function, including the energy loss associated with window opening, as listed in Table 3.3.

Cost Formulation Status

min ||y − ydes||2 current

min ||y − ydes||2+ Eloss future

min w1||y − ydes||2+ w2Eloss future

min Eloss future

Table 3.3: Future potential objective functions

A multi-objective approach is especially relevant when considering the trade-off between minimization of energy consumption and maximization of thermal comfort. Other studies have explored the application and development of multi-objective genetic algorithms (MOGA) to schedule controls using discrete predictive models for trade-offs between thermal comfort and energy consumption. In other approaches, the method of linear scalarization transforms a multi-objective problem into a single objective problem by weighing each cost component by a factor wi > 0 in an overall

summation of the objective function [29].

(36)

Data-Driven Model Development for Model Predictive Building Control

V = 0.15 ∗ 1000 ∗ A ∗p(TiC − ToC) ∗ H (3.3)

In Equation 3.3, V is the ventilation rate in L/s, 0.15 is a conversion factor for time, 1000 is the conversion factor for L/m3, A is the window opening area in m2, Ti is the room temperature in oC, To is the outdoor air temperature in oC, H is

the stack height or height of the building level with windows under consideration in meters.

E = V ∗ 0.0353 ∗ 0.24 ∗ 0.077 ∗ 1055.06 ∗ (Tif − Tof) (3.4)

In Equation 3.3, E is the Eloss in J/s, V is the ventilation rate in L/s, and 0.24 is the BTU/lboF heat required to raise a pound of air by 1oF according to [27].

0.075 lb/ft3 and 0.0353 ft3/L are conversion factors back to standard international units. 1055.06 J/BTU converts heat to SI units. Here, Tif and Tof represent the

indoor and outdoor air temperatures respectively inoF.

If Eloss represents the heat lost to window opening, the combination of this factor and the tracking error objective may slow the rate of approach to the desired setpoint: window opening extent and duration may be minimized to reduce heat losses. The decision of how to weigh competing objectives can be made a-priori, or through the process of optimization [13].

Alternatively, once the heat valve is controlled in addition to the windows, the Eloss term can measure the energy consumption associated with sending hot water through the pipes in the radiant floor slabs. It remains to be seen how MPC that controls both the heat valve and windows will compare to the existing rule-based algorithm that coordinates the thermally activated building system (TABS) with natural ventilation.

Constraints

As for constraints of the optimization problem, with real-time implementation, the time it takes the windows to open (1 second per 1% opening and closing) should also be factored into the start and end time of the actuating signal or optimization code to best approximate ideal window opening positions. Another constraint to consider is window opening duration, which impacts the frequency with which the window position will change, and its corresponding disturbance to occupant productivity (as the actuators are not completely silent).

3.3.4

Control trial set-up

The code structure from Equation 3.1 is implemented in YALMIP and requires manual inputs from the user every 5 minutes to update control sequences. A link to GitHub in the Appendix provides access to the code used in the trials. The outputted window opening sequence is then implemented manually via the computer interface shown in Figure 3.2 to control the skylight’s opening extent over the proceeding 5 minutes. This repeated process effectively closes the loop between model predictive control in MATLAB and actual implementation in the lab. Future developments may fully integrate and automate a real-time implementation in which the user need only hit run to start, and then collect results after any length of control trial.

(37)

For the duration of the control trials, both manually-operable and automated panels of the south-facing windows are closed. While this may inhibit cross-ventilation and wind-driven ventilation in the space, it allows separate controls to be tested for the skylight, and focuses on the effect of buoyancy-driven natural ventilation through the skylight.

Figure 3.2: Control trial set-up

3.4

Measure

This section presents measurements from each iteration of control development. Plots depict YALMIP output of window opening commands, actual implementation of window position via WindowMaster interface, indoor and outdoor air tempera-tures, and setpoint.

3.4.1

First iteration

Figure 3.3 plots results from two half-hour trials of distinct MPC scripts that use the same model with different setpoints. Between 12:00 and 12:30, the setpoint is 20oC, while between 13:00 and 13:45, the setpoint is 17.5oC.

(38)

Data-Driven Model Development for Model Predictive Building Control

Noticeable spikes around 13:00, 13:15, and 13:30 are due to multitasking: in the WindowMaster interface, the user presses a button to open the window by a few degrees, or open it all the way, with another button to stop the motion. These spikes are from not stopping the window from opening all the way while copying over new disturbance variables for the next script run.

A problematic finding in the February 22 control trial is that the control script outputs window opening commands when desired setpoint is higher than room tem-peratures. Based on this result, it appears that the model does not realize that opening windows in cold weather will reduce temperatures. The Analysis section discusses why this is not actually the case by pointing out errors in the formulation and implementation of the preliminary optimization problem.

Figure 3.3: First iteration control trial

3.4.2

Second iteration

Notably, the second trial is performed on a day when the indoor and outdoor tem-perature difference is not high. Consequently the room temtem-perature appears to converge to the setpoint by the end of the trial period. In comparison with the first trial’s control script output, the second trial provides more variation in window opening commands due to the restructuring of the script to predict 10 steps ahead, and the control implementation of only the first five.

Part I applies the second order avalid model between 11:00 and 12:00, and Part II applies the second order atrain model between 13:30 and 14:30. In between the two parts of the control trial, the room temperature rises back to nearly its starting temperature within the first 10 minutes. Two distinct patterns of window opening are characteristic of the respective models applied in this trial, and likely stem from model formulation. Each model uniquely parameterizes the effect of disturbance and control variables on room temperature, and thus outputs a different control sequence upon optimization in YALMIP.

At the end of this trial, the experiment is simply to leave the windows open such that the room temperature equilibrates with the outdoor air temperature. Visually,

(39)

it can be seen that both indoor and outdoor air temperatures begin to approach 20oC by 15:30. In this particular case, then, it seems a more effective controller

might just keep the window 100 % open in order to achieve target temperatures. However, the reason the MPC commands vary the window position with such fre-quency is because the time step of prediction and output is set to 1 minute, and the predicted temperatures vary with disturbance inputs. Ultimately in MPC it is the predicted temperature more than actual temperature that determine the controls, such that controls can anticipate and drive future changes in the system. It is ex-pected that with real-time input of prediction error in the script, this will improve the performance because the model will more accurately predict temperatures in the near future.

Figure 3.4: Second iteration control trial

3.4.3

Third iteration

Just as prior iterations display characteristic patterns of window opening unique to each model, the third iteration exhibits a particularly repetitive pattern of the control sequences despite new disturbance inputs every 5 minutes in Figure 3.5. This reflects a low sensitivity to changes in disturbance variables, which is indicated by the small magnitude parameter values (on the order of 10−5 to 10−8) in the system matrices for each model as listed in Table A.2. Indeed, the variables with higher weights (slab temperature, surrounding room temperatures) experience the least change over the course of the experiment, which has a steady slab temperature and surrounding room temperatures.

(40)

Data-Driven Model Development for Model Predictive Building Control

Figure 3.5: Third iteration control trial

Figure 3.6: Third iteration room temperature response

3.5

Analyze

3.5.1

Specifications met

In summary of the control trial iterations, only the third control trial meets all specifications (see Table 3.4). The first and second trials took place before the final models were selected by the process covered in Chapter 3. They are presented here primarily to illustrate how they inform the design process. In the tables that follow, temperature conditions and tracking error measurements are highlighted and analyzed from each trial. The tracking errors reported in Tables 3.5, 3.6, and 3.7 are then statistically analyzed with a Z-score test.

First iteration

Based on the first half of this control trial, the setpoint is higher than room tem-perature, and yet the script recommends window opening to heat the space. This reflects an infeasibility in the optimization problem due to lack of control over heat inputs, and requires that the setpoint in future experiments be set lower than room temperature.

References

Related documents

There is a demand for graduates with knowledge and skills in applying IT tools to cutting-edge marketing applications (e.g. customer relationship management, Internet marketing and

(S//NF) Intelligence Assessment: Detainee can provide information on his training background, as well as that of the other members of the Syrian Group in Syria, at the Syrian

Plasma nutfah kacang tanah yang mempunyai daya hasil produksi tinggi dan kadar minyak tinggi yaitu AH 1294 Si dan Lokal Gombong C, sedangkan berdaya hasil produksi

that assures at least a basic ductility is preferable to the others. This paper [16] concludes that to identify an efficient retrofitting method for existing open

This paper is part of a doctoral thesis that seeks to analyse critically the South African Cybercrimes and Cybersecurity Bill. The Gordon &amp; Ford categorisation can be a useful

The current students’ ICT skills did not satisfy the job market needs; other ICT skills were also found to be required by the job market including: web 2.0, web 3.0, and metadata;

In conclusion, premedication with 1µg/kg intravenous clonidine, has been found to be relatively safe as well as an effective method that provides stable haemodynamics and

With candy gums the ratio of the compression force to the deformation showed a definite decrease as the function of the storage