0% found this document useful (0 votes)
50 views6 pages

MPC Hvac

Uploaded by

as147
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views6 pages

MPC Hvac

Uploaded by

as147
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Optimal Demand Response in a building by Battery

and HVAC scheduling using Model Predictive


Control
Divya T. Vedullapalli, Student Member, IEEE Bill Schroeder
Ryan Baumgartner
Ramtin Hadidi, Member, IEEE
conEdison Battery Storage
The Holcombe Dept. of ECE Valhalla,NY USA
Clemson University [email protected]
Clemson, USA
dvedull, rhadidi @ clemson.edu

Abstract—The objective of this project is to develop a load should be such that its life time is maximized reducing the stress
forecasting technique and demand management algorithm for a on it. Forecast errors often to infeasible/sub-optimal solutions.
building to schedule battery and Heating Ventilation Air Linear programming, heuristic methods and dynamic
Conditioning system (HVAC) using the Model Predictive Control programming [4] can be used for optimization of the battery
(MPC). Behind-the-meter energy storage is used for modifying the
load shape and minimizing the demand charge of a building.
schedule. Stochastic type of control strategies need historic load
Thermal mass of the building can also be utilized to store the profile, weather forecast and optimal grid limit. [5] uses ARMA
heat/cool energy and HVAC is scheduled to minimize power to forecast and plan day-ahead schedule and online
consumption during peak times. This paper optimizes the battery optimization by receiving real time SCADA data. [6], [7]
schedule to minimize the monthly electricity bill. The load profile calculate the optimal grid limit and battery schedule by
has to be forecasted and this algorithm uses a two-part forecaster combining multiple forecasts for the same day. They are
where a deterministic part uses exponentially weighted moving adaptive algorithms which dynamically calculate the threshold
average (EWMA) model accounting for longer term trends and a limits resulting in more optimal savings. Closed loop control
second order regression model (AR2) accounting for the short techniques are based on Model Predictive Control (MPC). MPC
term variations. A novel mathematical model has been proposed
for calculating HVAC power consumption with a given thermostat
is the most emerging technique for the battery scheduling
schedule. Greater savings can be realized by augmenting this problem since it computes the trajectory of future control inputs
algorithm with HVAC scheduling and authors are working on it to optimize the future behavior of the plant output. [1] discusses
minimize HVAC power consumption during peak hours without a MPC based approach which includes battery degradation cost
causing thermal discomfort to the residents of the building. and maximizes the return on investment and battery life for the
owner. It does not include a forecaster for load.
Keywords—Battery Management System (BMS), Demand [8] simulates the thermal performance of a building using RC
management, HVAC Scheduling, Load Forecaster, Model Predictive network combination and uses battery and PV for demand
Control (MPC)
response utilizing thermal storage. [9] proposes a control
strategy for the HVACs in response to real time prices for peak
I. INTRODUCTION load reduction. [2], [3] and [10] derive a mathematical model
for HVAC and use it for optimization with MPC in presence of
With increasing demand for electricity, utilities employ time of use electricity pricing. [11] co-schedules HVAC and
Time-of-Use (TOU) pricing schemes for energy and/or include BESS to optimize the power consumption during peak hours.
demand charges during peak hours to avoid installation of new Most of the existing papers use single stage auto regression
capacity. Hence reducing the demand during peak hours can models for forecasting the load and use MPC for scheduling the
result in electricity bill reduction. A battery can be utilized to battery. This paper is an extension of authors work in [12]
shift the load partially during peak to off-peak time and reduce which implements a two stage forecaster with exponentially
the electricity cost [1]. According to the DOE statistics, Heating weighted moving average (EWMA) model as deterministic part
Ventilation Air Conditioning system (HVAC) is a major and auto regression model whose parameters change adaptively
consumer of electricity in commercial buildings. A building’s as the stochastic part of the forecaster. Later MPC can be used
thermal mass can be used as a virtual battery to store the heat to find the optimal schedule of battery and HVAC where the
energy by pre-cooling or pre-heating during off-peak hours and grid limit changes adaptively avoiding unnecessary peak
reducing the thermostat set-points during peak hours to reduction. The next section discusses the framework of the
reducing the power consumption [2], [3]. An accurate forecast proposed algorithm. Forecasting technique for the load, battery
of the load consumption profile is necessary to find the scheduling algorithm, HVAC model identification and Model
battery/HVAC operation schedule. The schedule of the battery

978-1-5386-7551-9/19/$31.00 ©2019 IEEE


Authorized licensed use limited to: Birla Inst of Technology and Science Pilani Dubai. Downloaded on March 05,2023 at 05:03:50 UTC from IEEE Xplore. Restrictions apply.
Predictive control are discussed. Section III describes the case forecast at that period. Later the stochastic part of the signal X t
studies for the simulation followed by results and conclusion. is calculated based on true demand data from the meter using
eq. (2).
II. DEMAND MANAGEMENT ALGORITHM X t = Et − Dˆ t , d (2)
Fig. 1 shows the schematic of the proposed algorithm. Later, using the stochastic parts of the signal, stochastic
Initially the load profile has to be forecasted based on past load forecasts for the next 24 hrs. are calculated by Auto-Regression
and the calendar day-types whether the building is unoccupied (AR3) model as shown in eq. (3).
or occupied followed by unoccupied day / occupied day. This
Xˆ t + = 1 X t +  2 X t − +  3 X t − 2
Xˆ =  Xˆ +  X +  X
t + 2 1 t + 2 t 3 t −

Xˆ t + 3 = 1 Xˆ t + 2 +  2 Xˆ t + +  3 X t
.
. (3)
Ф1, Ф2 and Ф3 are the auto regression parameters and are to
be adaptively estimated by minimizing a time dependent
function J given by eq. (4).
t
Min J ( , t ) =   t −i ( X i − Xˆ i ) 2 (4)
i =1
α is the forgetting factor and ranges between 0.98 and 0.995
such that the distant data is weighted less. The deterministic and
Fig. 1 Schematic of proposed demand stochastic parts are combined to get the final forecast for the
management algorithm
next 24 hours. The performance of this forecaster is compared
load profile and weather data is given to energyPlus [13] which with other existing forecasters in MATLAB like: The result
calculates the HVAC power and building power consumption from the forecaster is given to the optimizer which finds the
by taking into account the heat gains due to electric equipment optimal schedule of the battery using MPC.
and occupants of the building. This can be used to identify the
mathematical model of HVAC and MATLAB is used for B. Battery scheduling algorithm
optimization of HVAC schedule and battery schedule. Building The schematic of a general demand management system with
Controls Virtual Test Bed (BCVTB) [14] is an interface battery is shown in Fig. 2, in which arrows represent directions
between energyPlus and MATLAB. of power flows in the system. P1(t)/P2(t) is the
charging/discharging power for the battery respectively and
A. Forecaster P3(t) is the power from grid to the load. The goal of the demand
In order to get an optimal operation schedule, the load side management algorithm is to determine the optimal
consumption has to be forecasted with high accuracy. Else, due Grid
to errors in real time, the previously calculated battery schedule
may not be an optimal one for peak demand reduction. The P1 P3
forecaster in our paper is adopted from [15]. It has two parts,
deterministic and stochastic models. The real time demand data
will be an input to the forecaster. Days are classified into P2
Battery Load (PL)
occupied and unoccupied types depending on the load demand
pattern. An occupied day is a working day and unoccupied day
is holiday/weekend. Based on the past load data and type of Fig. 2: Schematic of load management with battery
day, the deterministic model calculates the forecast for the next schedule of battery (P1(t) & P2(t)) for minimizing electricity
24 hours using Exponentially Weighted Moving Average cost while satisfying customers’ load and obeying battery
(EWMA) model. Lookup table is used to store the past data and operating conditions. This problem can be formulated as a
corresponding day types. Initially, the deterministic forecasts Mixed Integer Linear Programming (MILP) and is shown in
are determined for 1 through 24 hours using eq. (1). Eq.(5-10). ρE(t) is the energy rate and ρD(t) is the demand rate
Dˆ t , d = Dˆ t , d − +  ( Et , d − − Dˆ t , d − ) (1) at time t.
N
where Dˆ t , d is the deterministic forecast of the load at time Minimize J =  ( P1 (t ) + PL (t ) − P2 (t ) ) * t *  E (t ) 
P1 , P2 , PShave
t =1
step ‘t’ and day ‘d’. ‘γ’ is number of days since previous similar
+ max( P1 (t ) + PL (t ) − P2 (t )) *  D (t ) (5)
type of day. Et , d − is the true electrical demand at the same time
subject to
period from previous similar day and Dˆ t , d − is the deterministic

Authorized licensed use limited to: Birla Inst of Technology and Science Pilani Dubai. Downloaded on March 05,2023 at 05:03:50 UTC from IEEE Xplore. Restrictions apply.
t −1
1 t −1 output. e(k) is the noise sequence. The schedule of the HVAC
C  P1 ( )t −  P ( )t i.e., Tsp(k) are to be determined by optimization such that the
 =0 D =0
2

SOC (t ) = SOC (0) + (6) cost of HVAC power is minimized as shown in eq. (14).
BCap
 Ppeak 
C (t ) K  P1 (t )   P(k ) 
 Charge/Discharge (7) Min   D (k )  E (k ) 0 0   (14)
(1 − C (t )) K  P2 (t )   TZ (k ) 
 
0  P1 (t ) + PL (t ) − P2 (t )  PShave (8) TSP (k ) 
SOC min
 SOC (t )  SOC max
(9) s.to.
0  Pi (t )  Pi ,max ; i = 1, 2 (10)  T (k ) 
AP ( z ) P(k ) − BP ( z )  SP =0 (15)
The objective function Eq. (5) has two parts, first one is the
Tamb (k ) 
energy charge and second one is the demand charge. The
second term refers to the peak power drawn from the grid over
a billing cycle which is the maximum of the grid power over a  T (k ) 
defined time t=1 to N. The demand charge is calculated for each AT ( z )TZ (k ) − BT ( z )  SP =0 (16)
month depending on the peak of the demand. The objective is Tamb (k ) 
to minimize the annual electricity bill accounting for seasonal lb  TZ (k )  ub (17)
variations of the load and electricity price. Eq. (6) is the energy 0  P(k )  Ppeak (18)
balance constraint where SOC is the state of charge of the
battery,  C and  D are the charge and discharge efficiencies of lb  TSP (k )  ub (19)
the battery. BCap is the KWH rating of the battery. βC in Eq. (7) Constraints (15) and (16) are the mathematical model equations
is a binary variable which ensures that only either P1 or P2 is of HVAC and eq. (17&19) are the constraints on thermal
non-zero at any given time since battery cannot charge and comfort of building occupants.
discharge at the same time. Eq. (8) is the constraint for limit on
the peak power from grid for peak shaving application. D. Model Predictive Control (MPC)
Constraints in eq. (9) and (10) represent the limits on SOC and The objective of MPC is to compute the trajectory of future
the power ratings of the battery. To make the above formulation control actions to optimize the future behavior while satisfying
a linear programming problem, substituting eq. (8) in eq. (5), the constraints. Optimization is performed within a limited time
the objective can be written as eq. (11). window (prediction horizon-24hrs). Only the first hour control
N action is taken and the optimization process is repeated from
Minimize J =  ( P1 (t ) + PL (t ) − P2 (t ) ) * t *  E (t )  the next hour till the end of the optimization period. As shown
P1 , P2 , PShave
t =1
in Fig. (3), the forecaster provides the load profile for the next
+ PShave *  D (t ) (11) 24 hrs in steps of 15 min to the optimizer, which calculates the
Model Predictive Control is employed to solve this control input for the same 24 hrs. Later the forecaster may
optimization problem and is described in next sections. change its parameters adaptively based on forecaster and the
future prediction can change, thus the optimizer recalculates the
C. HVAC Scheduling control input for every 15 min.
The energy consumption of a building is calculated using
energyPlus. Building occupancy schedule, equipment operation
schedule, ambient temperature, HVAC set points for various
zones in the building can be given as inputs and the simulation
in energyPlus gives the energy consumption profile of the entire
building along with the HVAC power as outputs. Using HVAC
temperature setpoints Tsp and ambient temperature Tamb as
inputs, Power consumption P and zone internal temperatures TZ
as outputs, the HVAC mathematical model can be identified
using MATLAB. The discrete time ARX models are used for
HVAC modeling and are given by eq. (12,13).
 T (k ) 
AP ( z ) P(k ) = BP ( z )  sp  + e( k ) (12)
Tamb (k ) 
Fig 3. MPC strategy
 T (k ) 
AT ( z )TZ (k ) = BT ( z )  sp  + e( k ) (13) This moving window technique has several advantages
Tamb (k )  compared to a regular MILP solution. More optimal solution
where AP, BP are system matrices for HVAC power output can be resulted if the objective is calculated for a year instead
and AT, BT are system matrices for HVAC zone temperature as of a month. Using a regular MILP, the number of optimization

Authorized licensed use limited to: Birla Inst of Technology and Science Pilani Dubai. Downloaded on March 05,2023 at 05:03:50 UTC from IEEE Xplore. Restrictions apply.
variables will be tremendously high for longer optimization The input data required for the proposed controller is very
intervals. But when MPC is used, the prediction horizon less compared to that of other forecasters. Also some amount of
decides the number of optimization variables and the moving data is required for training the SVM, NN and Reg. tree
window concept assures the optimality. The results section forecasters. The simulation time for the proposed forecaster to
explains few other advantages of MPC over regular forecast load for one year is in the order of seconds while that
optimization. of others is in the order of minutes. Thus the proposed
forecaster shows better performance than the remaining
III. SIMULATION & RESULTS techniques.
A. Forecaster B. Battery Scheduling
The proposed controller is tested on a one-year past building The electricity rate structure is taken from SCE&G pricing
data at Clemson University Restoration Institute. The forecaster policy which has peak and off-peak charges for both energy and
is compared with other available forecasters in MATLAB like demand during summer and non-summer months.
Support Vector Machine (SVM), Neural Network (NN) and It is given in Fig. 6.
Regression tree techniques. The predictors for forecasting load
using these techniques are the 168 hr. (previous week) lagged
load, 24 hr. (previous day) lagged load, previous day average
load, hour of the day, day of the week, month and holiday
indicator. The performance of these forecasters are compared
with daily MAPE (Mean Average Percentage Error) which is
given by eq. (20).
 1 24 y (t ) − yˆ (t ) 
Daily MAPE =    (20)
 24 t =1 y (t ) 
y (t ) : True value
yˆ(t ) : Forecasted value
Fig 6. Rate structure used for simulation
Fig. 4 shows the forecasted vs. true power comparison for all
the forecasters. The frequency distribution of performance
index for these methods (Daily MAPE) is shown in Fig. 5. One The battery parameters assumed for simulation are given in
year of load data has been processed with the forecasters for table I.
comparison. TABLE I: BATTERY PARAMETERS

Parameter Value

Battery Capacity 28.8 KWH

Charge Efficiency 85%

Discharge Efficiency 80%

Initial SOC 16 KWH

Minimum SOC 20% of Cap.

Maximum SOC 80% of Cap.


Fig 4. True vs forecasted powers

70 Fig. 7 shows the grid power with and without BESS using
60 MILP optimization. As it can be seen, even though the peak
Frequency (%)

50 demand occurs during the beginning of the month, the


40 algorithm schedules the battery to decrease load to a lesser
30 value in the following days. Since the monthly peak has already
20 occurred, it is not necessary to decrease demand lower than this.
10 MPC does not schedule battery for unnecessary peak reduction
0 as it can be seen form Fig. 8.
0-5 5-10. 10-15. 15-20 20-25 25-30
Daily MAPE range

Proposed Method SVM NN Reg. tree


Fig 5. Frequency distribution of MAPE

Authorized licensed use limited to: Birla Inst of Technology and Science Pilani Dubai. Downloaded on March 05,2023 at 05:03:50 UTC from IEEE Xplore. Restrictions apply.
Peak for the month

Fig 7. Optimized grid power with MILP


Fig 10. SOC of battery with schedule from MILP

Fig 8. Optimized grid power with MPC

The battery SOC profile for both the optimizations is shown in Fig 11. Monthly bill comparison with and without
Fig. 9 & Fig. 10. The schedule from MPC has lower stress on BESS
the battery as it has lesser number of charge/discharge cycles
compared to that of schedule from MILP.
C. HVAC Modeling
The energy consumption of a building is calculated using
EnergyPlus. Building occupancy schedule, equipment
operation schedule, ambient temperature, HVAC set points for
various zones in the building can be given as inputs and the
simulation in EnergyPlus gives the energy consumption profile
of the entire building along with the HVAC power as outputs.
Using HVAC temperature setpoints Tsp and ambient
temperature Tamb as inputs, Power consumption P and zone
internal temperatures TZ as outputs [2], the HVAC
mathematical model can be identified using MATLAB. The
discrete time ARX models are used for HVAC modeling and
are given by eq. (12) & (13)
It was observed from the simulation studies that the steady
state operating point for Tsp change the mathematical modeling
Fig 9. SOC of battery with schedule from MILP
matrices. The HVAC operation is sectionalized for different
The annual electricity bill comparison is shown in Fig. 11. The setpoints and each section has different system matrices. Fig.
annual electricity bill without a battery is $111K. The bill after 12 compares the results of two types of HVAC modeling:
scheduling the battery according to MILP optimization is (i) Sectional estimate which is discussed earlier
$105K and with MPC is $95K. Thus MPC schedule saves
~15,000 USD (~13.5% of its electricity bill) per annum.

Authorized licensed use limited to: Birla Inst of Technology and Science Pilani Dubai. Downloaded on March 05,2023 at 05:03:50 UTC from IEEE Xplore. Restrictions apply.
(ii) Estimating using a single model for the entire period [7] J. Neubauer, M. Simpson, J. Neubauer, and M. Simpson,
“Deployment of Behind-The- Meter Energy Storage for Demand
Charge Reduction Deployment of Behind-The- Meter Energy
Storage for Demand Charge Reduction,” no. January, 2015.

[8] B. Du, G. Verbic, and J. Fletcher, “Thermal modelling for demand


response of residential buildings,” 2017 Australas. Univ. Power Eng.
Conf. AUPEC 2017, vol. 2017–Novem, pp. 1–6, 2018.

[9] J. H. Yoon, S. Member, R. Baldick, and A. Novoselac, “Dynamic


Demand Response Controller Based on Real-Time Retail Price for
Residential Buildings,” vol. 5, no. 1, pp. 121–129, 2014.

[10] J. Ma, S. J. Qin, B. Li, and T. Salsbury, “Economic model predictive


control for building energy systems,” IEEE PES Innov. Smart Grid
Technol. Conf. Eur. ISGT Eur., pp. 1–6, 2011.

Fig 12. HVAC Mathematical modeling [11] T. Wei, T. Kim, S. Park, Q. Zhu, S. X.-D. Tan, N. Chang, S. Ula, and
M. Maasoumy, “Battery Management and Application for Energy-
Efficient Buildings,” Proc. 51st Annu. Des. Autom. Conf. Des.
It can be seen that model (i) is a better replica of the true power Autom. Conf. - DAC ’14, pp. 1–6, 2014.
in terms of the demand bill than model (ii) where the power
profile is almost flat without any spikes. Hence model (i) will [12] D. T. Vedullapalli, R. Hadidi, B. Schroeder, and R. Baumgartner,
“Adaptive Scheduling of the Battery for Peak shaving using Model
be more useful for the demand charge reduction algorithm than Predictive Control,” in 2018 IEEE Electronic Power Grid (eGrid),
model (ii). 2018, vol. 3, pp. 1–5.
IV. CONCLUSIONS
[13] U. D. of Energy and LBNL, “energyPlus Engineering Reference,”
Algorithms for battery controller and HVAC scheduling are 2017. [Online]. Available: https://energyplus.net/documentation.
designed individually using MPC for peak shaving
applications. Annual savings of 13.5% have been achieved. The [14] LBNL, “Building Controls Virtual Test Bed,” 2016.
forecaster parameters adaptively change depending on the
recent forecast errors. This forecaster performance can be [15] J. . Seem and J. . Braun, “Adaptive Methods for Real Time
Forecasting of Building Electrical Demand.pdf.” .
improved by accounting for day-types even in the stochastic
part. It is very fast and needs less data. A new mathematical
model for the HVAC has been proposed Authors are working
on co-optimization for battery and HVAC scheduling utilizing
the thermal mass of the building using EnergyPlus.

REFERENCES
[1] P. Fortenbacher, J. L. Mathieu, and G. Andersson, “Modeling,
identification, and optimal control of batteries for power system
applications,” 2014 Power Syst. Comput. Conf., pp. 1–7, 2014.

[2] J. Ma, J. Qin, T. Salsbury, and P. Xu, “Demand reduction in building


energy systems based on economic model predictive control,” Chem.
Eng. Sci., vol. 67, no. 1, pp. 92–100, 2012.

[3] J. Ma, S. J. Qin, and T. Salsbury, “Application of economic MPC to the


energy and demand minimization of a commercial building,” J. Process
Control, vol. 24, no. 8, pp. 1282–1291, 2014.

[4] A. Oudalov, R. Cherkaoui, and A. Beguin, “Sizing and optimal operation


of battery energy storage system for peak shaving application,” 2007
IEEE Lausanne POWERTECH, Proc., no. 1, pp. 621–625, 2007.

[5] Z. Taylor, H. Akhavan-Hejazi, E. Cortez, L. Alvarez, S. Ula, M. Barth,


and H. Mohsenian-Rad, “Customer-side SCADA-assisted Large Battery
Operation Optimization for Distribution Feeder Peak Load Shaving,”
IEEE Trans. Smart Grid, vol. 3053, no. c, pp. 1–12, 2017.

[6] R. T. De Salis, A. Clarke, Z. Wang, J. Moyne, and D. M. Tilbury, “Energy


storage control for peak shaving in a single building,” IEEE Power
Energy Soc. Gen. Meet., vol. 2014–Octob, no. October, pp. 1–5, 2014.

Authorized licensed use limited to: Birla Inst of Technology and Science Pilani Dubai. Downloaded on March 05,2023 at 05:03:50 UTC from IEEE Xplore. Restrictions apply.

You might also like