1. Introduction
Home battery storage systems (HBSS) and home energy management systems (HEMS) can be of significant benefit to future electricity distributions by moving household electricity usage away from peak consumption times [
1] and reducing the amount of local generation penetrating into the wider distribution system. This can also potentially help to defer the cost of grid re-enforcement associated with the increasing penetration of electric vehicles (EV), the electrification of heating, and the rapidly increasing use of domestic solar panels [
2]. This can also lead to reduced electricity costs for the domestic consumer. For example, employing HBSS to capture surplus photovoltaic (PV) energy or off-peak utility energy to meet demand at peak-tariff times has been demonstrated in [
3], and the use of demand side management (DSM) and the evolution of real-time pricing schemes also add to the capabilities of the HEMS to economically manage domestic electricity consumption [
4,
5].
Home energy management can be “optimized” using approaches such as model predictive [
6], mixed-integer linear programming (MILP) [
7], geometric programming, and dynamic programming [
8]. For example, the authors in [
9] used MILP optimization to manage a home with a HBSS, a PV array, and an EV with a “vehicle to home” option. A DSM strategy based on dynamic pricing and controlling power peaks was proposed in [
10] which used a MILP-based model of the structure with an EV and an energy storage system.
Reference [
11] presented a MILP-based HEMS together with an artificial neural network which forecasted residential loads. The energy management systems (EMS) and the forecasting model (using an artificial neural network (ANN)) employed the sample time of one hour for the load forecast; this is a very crude indication of the load profile as these profiles vary at a much faster rate. A rule-based EMS which aimed for optimized operation of a battery for use in electricity distribution grids with renewable energy sources (RES) has been proposed in [
12]. The EMS maximized the use of the RES and prevented reverse power flow into the distribution transformer. Reference [
12] controlled the battery considering only the current operating conditions without taking into account any potential changes in operating conditions—this could lead to impaired system performance.
To achieve an effective control for a HBSS based on predictions of load consumption and PV generation, [
13] divided a household storage controller into two levels: a global control level and a local control level. The global algorithm is formulated and solved by convex optimization to determine future charging/discharging schemes for the storage system. Reference [
14] proposed an alternative energy management scheme, integrating RES, electrical battery storage, and vehicle to grid. “Accurate” results are claimed, but clearly only running the algorithm once each day and using a sample time of one hour for management will lead to lower system performance due to the uncertainty of the generation and load demand.
Forecasting methods for PV generation and electricity consumption have been examined as part of several different studies. For example, in [
15] a comprehensive analysis of PV prediction methods was presented which divided forecasting into deterministic and probabilistic methods. Most of those studies used data from historical measurements and/or weather forecasts. A recent literature review categorized demand forecasting models as statistic based or artificial intelligence-based models [
16]. In [
17], a forecasting algorithm for home demand was presented. The forecasting algorithm used a short sample time to forecast home consumption for one day ahead. To the best of our knowledge, only a few of these studies quantify the influence of these forecasting methods on the effectiveness of HEMS for PV-battery systems [
18,
19].
There is a gap in knowledge for designing HEMS derived using the analysis of real load and generation data obtained from electricity prosumers. The current literature is found to include many studies which examine PV-battery systems using poorly justified assumptions concerning the HBSS model (idealistic models which can lead to significant errors in the calculated system financial returns [
20]) and/or datasets with a low sample resolution [
11] (which result in errors in the system design and sizing, as sharp and rapid power changes are not taken into account).
Many of the HEMS introduced in the literature (e.g., [
21,
22]) have not considered the effects of forecasting uncertainties or different sample times on the economic performance of the HBSS or have ignored the effect of accurately adjusting the battery’s overnight charging level [
23]. Furthermore, the effect of a combination of different forecasting methods on PV-battery systems is not well understood. A review [
24] suggested that the impact of forecasting on economic performance has not been studied in depth. Many studies quantify the operation of PV-battery systems by employing only one forecast method or assume a perfect forecast. The literature concludes that further investigation is required into the influence of forecasting for electricity demand and PV generation on the performance of PV-battery systems.
In addition, the selection of an appropriate overnight charging level for PV-battery systems has not been properly considered in the literature [
25]. A limited number of studies considered overnight charging [
26,
27], but the battery was fully charged overnight (during the off-peak electricity tariff period) as they did not include any intelligent overnight charging control algorithms. Selecting an appropriate overnight charging level enhances the economic performance of PV-battery systems.
This paper presents a detailed investigation of a HEMS which employs both a real-time controller (RTC) and a model predictive controller (MPC). Their performance is evaluated in the presence of forecasting errors for different control sample times and for different HBSS overnight charging levels and different tariff policies. The HEMS presented here aims to minimize home energy costs, reduce energy lost to the supply utility, improve the local consumption of PV generation (self-consumption), and decrease the system dependency on external systems for forecasting. Two types of management strategies have been used: (a) energy management based on a RTC, and (b) energy management based on an MPC. A case study for a home in the UK is presented, which has typical household appliances, rooftop photovoltaic (PV) generation and a HBSS. The key contributions of this work are:
This paper attempts to fill the gap in the literature by employing data for energy consumption and generation collected from real prosumers across the UK.
It studies the importance of designing an HEMS which is able to respond quickly to changes in the system by operating with a short sample time (in this case two minutes), and analyses the resulting impact on the annual energy costs and the ratio of annual lost PV generated energy to the utility.
It studies the performance of a HEMS which takes its own decisions locally while minimizing its dependence on external forecasting technologies (and complex communication infrastructures).
It summarizes the requirements and challenges for HEMS and their impact on household energy costs; this can be considered an aid to selecting an appropriate controller for each PV-battery system.
It studies the effect of forecasting errors, sample time resolution, tariff policies, the battery capacity and/or PV system on the performance of the MPC.
Experimental results for using an MPC-based HEMS are then presented to assess the performance of a real system.
The paper is organized as follows:
Section 2 introduces the operating algorithm for the RTC-based HEMS and the influence of the charging level for the low tariff period overnight.
Section 3 describes the operating algorithm of the MPC-based HEMS. This includes system modeling and the formulation of the optimization cost function (which is solved using a MILP approach).
Section 4 introduces the specific cases analyzed in this paper.
Section 5 shows the performance indicators which are used to assess the results obtained.
Section 6 shows the simulation results obtained using RTC-based HEMS.
Section 7 presents the experimental results obtained for MPC-based HEMS.
Section 8 shows the annual performance analysis for MPC-based HEMS, and finally,
Section 9 presents conclusions from this work.
3. Model Predictive Control-Based Energy Management System
The MPC aims to optimize the control actions for the current sample. At each time step (t), the MPC performs an optimization process and computes an optimal control sequence for a finite horizon [
28]. Only the first control action in the sequence is applied. Over the next time step (t + 1), the MPC receives new system measurements and recalculates the optimal control sequence for the next period.
In this paper, MILP optimization-based MPC is used to minimize the household energy costs, improve the self-consumption of PV generation and reduce energy lost through the control of the HBSS. The HBSS power settings obtained will ensure the best use of electrical energy. For every sample time, (1) forecasts for the profiles for PV generation and load demand over the next 24 h are obtained, (2) real-time measurements of the HBSS SOC are used to update the MPC, (3) MILP optimization is performed, and (4) the power references for the HBSS are updated. The time frame in which the MILP optimization is performed is t = 0:24 h. The optimization process is repeated every sample time (2 min). The HBSS control is optimized for subsequent time slots (from t = t + 1:24 h), noting that only the setting for the next time slot (t + 1) is sent to the HBSS.
3.1. Formulation of the Optimization Problem and Constraints
MILP optimization is used to minimize the household energy costs [
29]. MILP is an approach to optimization which solves constrained optimization problems which include an objective function and a set of variables and constraints [
30]. The formulation of the problem is defined as:
where
C, b are vectors and A is a matrix.
The objective function which needs to be minimized is the cost function in (2), which aims to minimize cost of energy and maximize the local use of the PV generation. The optimization finds the best solution to the objective function (2) from a set of potential solutions that meet the constraints, i.e., the equality constraints (5) and inequality constraints (9)–(15). A feasible solution is one that satisfies all constraints. The variables determined from the solution to the optimization problem are a set of optimal control settings “” for the next 24 h with a two-minute resolution. These settings are then forwarded to the HBSS.
The daily household energy costs “
” (2) that need to be minimized are comprised of payments (3) (e.g., for electricity purchased from the supply utility), and incomes (4) (e.g., for the energy exported to the supply utility) [
31]. The constraints are divided into: (a) the equality constraint function (5), and (b) the inequality constraint functions (9)–(11).
where
is the daily household energy costs (£);
is the cost of the energy purchased from the supply utility (£),
is the revenue of the energy exported to the utility (£),
is the sample time (h);
is the purchase tariff for electricity at time interval t (£/kWh),
is the sale tariff for electricity at time interval t (£/kWh),
is the electrical power drawn from the utility by the household at time interval t (kW): a negative value represents exporting power, whereas a positive value represents importing power.
(5)–(9) represent the model and the constraints of the home microgrid:
(5) describes the balance for the total active power in the home.
where
is the home’s electrical load at time interval t (kW),
is the power generated by the home PV system at time interval t (kW), and
is the HBSS (battery + converter) power charged/discharged at time interval t (kW): a negative value denotes that the HBSS charges; a positive value denotes that the HBSS discharges.
The model of the HBSS is represented by (6) and (7):
where
is the power charged/discharged by the battery at time interval t (kW);
and
are the energy stored in the HBSS at times t and t − 1, respectively (kWh);
are the efficiencies of the battery when discharging and charging, respectively (%).
is the energy capacity of the battery (kWh), whilst
is the state of charge of the battery at time t (%).
(8) represents the power converter model. The power converter receives its instruction from the HEMS and is used to control the HBSS.
where
is the efficiency of the power converter (%).
The HBSS power constraint (9) defines the highest power (
) that can be discharged/charged by the HBSS.
The HBSS SOC constraint (10) specifies the minimum and maximum SOC level of the HBSS. This constraint is used following the recommendation of the Institute of Electrical and Electronics Engineers (IEEE) [
32], where the SOC constraints prevent deep discharge or overcharging of the HBSS to maximize the HBSS lifetime. Deep discharging and overcharging of the HBSS substantially reduce the battery life [
33].
where
and
are the SOC limits (%) of the HBSS.
The battery power is classified as charging power and discharging power. The following constraints (11)–(15) are used to enforce the connection restrictions and make sure that the HBSS power is unidirectional during each sample time.
and are binary variables that ensure the HBSS power flows in one direction for a particular sample time; and are the HBSS discharge and charge power, respectively, at time interval t (kW).
3.2. Forecasting Methods
The operation of the MPC requires the use of forecasting for load demand and PV generation. In this research, the load profile and PV generation profile forecasted for the next 24 h are used in the optimization process to find the optimal reference values for the HBSS. The following methods have been used to forecast the demand profile for the household for the next day:
the previous day’s load profile (L-PD).
the previous week, same day load profile (L-PWSD).
the average load profile of the previous week (L-AV).
one of the load demand forecasting techniques (L-FP) of [
34], such as ANN, auto regression integrated moving average (ARIMA)+ANN, adaptive neuro-fuzzy inference system (ANFIS) which show better results for demand forecasting.
For PV forecasting for the next day, three forecasting methods have been used:
4. Case Study
The analysis undertaken is based around a typical UK house. It comprises common household appliances, rooftop PV generation and a HBSS. The house is connected to the supply utility. The household load profiles used are real measurements made in a UK based house [
35]. This data is sampled with a one-minute resolution for a whole year. The total annual energy consumption for the home is 4104 kWh: this value is close to 4200 kWh which is the UK average for a medium sized house [
36]. Measured data is also used for PV generation, obtained from the PVOutput.org website [
37] for a 3.8 kW rooftop PV located in Nottingham. The data is for a full year with a sample time of one minute. The PV generation profile was scaled down to be equivalent to the PV generation of a 1.4 kW peak system, which was considered appropriate for the home under study.
Three electricity purchase tariff schemes were considered, namely: (a) Economy 7 (E7), (b) time of use (TOU), and (c) real-time pricing (RTP). The householders also have to pay a standing charge (24 pence per day) to account for distribution infrastructure costs. When selling surplus energy to the main utility, a fixed export sale price of 3.79 pence/kWh is used. The E7 purchase tariff values are from RobinHood Energy, UK [
38]. The TOU purchasing tariff values are from Green Energy, UK [
39]. The real-time pricing tariff values are derived from a dataset based on the total UK electricity consumption, available from New Electricity Trading Arrangements (NETA) [
40], and lists the price per MWh associated with half hour timeslots. The export tariff values are from the Office of Gas and Electricity Markets (OFGEM) [
41].
Figure 1 shows the different tariff schemes used in this research.
The approach presented in [
42] for determining the best size for an energy storage system was used to select an appropriately sized battery (in terms of energy and power rating) and to optimize the charging-discharging boundaries for the system presented in this paper. Investment costs were set at £135/kWh [
43] for energy, £300/kW [
41] for power. These investment costs include the installation cost of the HBSS. The parameters of the HBSS used in this research are shown in
Table 1 [
44,
45].
7. MPC Based HEMS—Experimental Results
A laboratory system has been constructed to evaluate the performance of the MPC using a real HBSS in a typical operating environment. The MPC-based HEMS was tested experimentally for one day at the FlexElec Laboratory in the University of Nottingham, using the “Smart Home Rig” (SHR) shown in
Figure 3 and
Figure 4.
This SHR comprises:
Home battery storage system comprising (a) BYD lithium-ion battery pack, 6.4 kWh [
44] and (b) SMA bidirectional power converter, 2.5 kW [
45].
1.4 kWp PV system with a 3.68 kW SMA PV inverter [
47]. The PV solar panels are located on the rooftop of the FlexElec laboratory.
ZSAC Electronic AC load emulator, 5.6 kW [
48]: the programmable load emulator receives the digital load demand profiles and creates a real current/power profile drawn from one of the appliance sockets in the SHR. LabVIEW software and a NI CRio FPGA system [
49] extract the numerical load values from the database and send them to the programmable load emulator as a reference value.
Smart meter: a three-phase smart meter used to measure PV generation, load demand, and the power imported/exported by the house from/to the supply utility. The smart meter uses a two minute sample time [
50].
PC: Core i3-7100 CPU, 3.91 GHz PC: the PC is used to run the HEMS.
Raspberry Pi: used as a Modbus communication interface between the smart meter and the battery management software on the PC. It is also used as a communication interface between the battery management software on the PC and the battery power converter to send the optimal power settings to the SMA converter of the HBSS, and read the actual SOC of the battery.
Software used: (a) MATLAB—to execute the optimization algorithm and perform the forecasting process, and (b) LABVIEW software package—to control the programmable load emulator.
The HEMS-based MPC was implemented experimentally. At each sample time (every two minutes): (1) the Raspberry pi measures the SOC of the HBSS (from SMA converter in the HBSS) and sends it to the HEMS; (2) a MATLAB script is used to execute the MILP optimization and calculate the optimal power setting for the HBSS; (3) the Raspberry Pi receives the HBSS optimal power setting for just the next sample and passes it to the HBSS’s SMA inverter; (4) these steps are repeated every two minutes.
Figure 5 shows the performance of the MPC-based HEMS for one day. The TOU tariff scheme and a fixed export electricity tariff were used in this experiment. The methods used for forecasting demand and generation are the previous week same day load profile (L-PWSD) and the previous day generation profile (PV-PD), respectively. The mean absolute percentage error (MAPE) for the load and generation forecasts were 29.3% and 22.66%, respectively. A two-minute sample time has been used—the MPC updates the HBSS references every two minutes and it can therefore respond to relatively fast disturbances in the system.
A sample time of two minutes is the shortest sample time that can be used in this experiment. When a one-minute sample time was attempted for MPC operation, it was found that the MPC takes 5.62 min to perform just the optimization process, making a sample time of less than two minutes unfeasible for this experiment.
Figure 5a shows that the HEMS/BESS matches the household demand from 16:00 to 20:00 (during peak-tariff hours) so the home did not have to import energy from the main utility during this period. The PV generation was used in the home (including charging the HBSS) instead of being exported to the utility. From 00:00 am to 07:00 am (off-peak tariff time), a greater amount of energy was drawn from the supply utility at the low tariff rate (5 pence/kWh) to cover the home energy demands and charge the HBSS. It is clear from
Figure 5b that the HBSS was charged from both the surplus PV generation during daytime and the imported energy from the supply utility during the off-peak tariff time.
Unwanted export power can be seen in
Figure 5a (negative values of the utility power (black) profiles). The reason for this unwanted export was the errors associated with the load and generation forecasts at certain points in the day (i.e., when there is a sudden increase or decrease of the load or generation/export at power levels higher than the BESS can manage). The unwanted export power was one of the reasons for the lost energy when using the MPC for HEMS. The HECIR and ELR were 27% and 14%, respectively.
It is clear from
Figure 5b that the HBSS charged to 67% overnight (i.e., not to its maximum limit of 90%) because this overnight charging level (a) enables the HBSS to provide the expected load demand during the morning period (i.e., no energy is purchased from the supply utility from 7:00 to 10:00), and (b) leaves space for the surplus PV generation during the following day to be stored in the HBSS (i.e., no energy is exported to the main utility from 9:00 to 15:00). The battery is fully charged at 16:00hrs, ready for the peak tariff period.
9. Conclusions
This paper has assessed the performance of two home energy management systems based on (a) a real-time controller and (b) a model predictive controller over a one-year period. Using the real-time controller, the effect of adjusting the overnight charging level on the overall performance has been studied. The results showed that the lowest value for household energy cost increment ratio and the highest value for PV self-consumption ratio (i.e., 8.1% and 89.70%, respectively) could be achieved using a weather prediction for the next day to adjust the overnight charging level, but this would incur additional operational costs.
Load demand and PV generation forecasts can be made relatively easily using methods such as L-PWSD, L-PD, L-AV, PV-PD, and PV-AV, i.e., methods which use historical data only and do not require any complex forecasting model or meteorological data (i.e., temperature, irradiation, humidity, etc.), compared to using accurate prediction methods such as L-FP and PV-FP which require up-to-date weather prediction and complex modelling. L-FP and PV-FP forecasting packages achieve greater reductions in household energy costs and lower lost energy compared to simple prediction packages. However, these forecasting packages require a good communication infrastructure and also additional costs for complex modelling.
The performance of the MPC has been studied considering the effect of forecasting errors (this technique requires forecasting for its fundamental operation), the sample time, and different purchasing tariffs. The results show that with appropriate selection of the forecasting method for load demand and PV generation, a significant reduction in household peak energy demand from the supply utility and also the cost of home utility bills can be achieved. Using a 60 min sample time for MPC operation increases the household energy cost increment ratio by 35.2% and the lost energy ratio by 29.8% compared to using a two-minute sample time. Using a short scanning and response time of two minutes, the MPC controller can respond to changes in load and generation that occur over a short time, and therefore guarantees better performance and a higher reduction in costs for the householders. Using the time of use tariff scheme with a PV-battery system reduces the household energy costs even further compared to the other tariff schemes considered.