**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:


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.
