Hierarchical energy management scheme for residential communities under grid outage event

: The ever-increasing energy demand and extreme weather days lead to more frequent power outage events. This paper proposes a hierarchical energy management scheme for residential communities, aiming to facilitate energy sharing among houses and minimize the impact on the grid outage on the whole community. In the proposed model, the complexity of scheduling residential energy resources of multiple houses is decomposed into a bi-level structure, in which the Home Energy Management System (HEMS) of each house iteratively interacts with the Community Energy Management System (CEMS). In the upper layer, the CEMS receives the information of the planned outage; it then solves a social warfare optimization model to determine: (1) charging/discharging power of a community battery energy storage system, and (2) load re-shaping instructions of each house. In the lower layer, the HEMS of each house performs appliance-level autonomous scheduling to try to satisfy the load re-shaping instructions received from the CEMS. The autonomous scheduling result of individual HEMSs are sent back to the CEMS, and the latter updates the upper-layer result based on the received result. This process continues until the convergence criteria is achieved. Extensive simulations are conducted to validate the proposed solution


Nomenclature
Sets Ω n CA1 set of the non-interruptible, controllable appliances of the nth house

Introduction
Owing to the ever-increasing energy demand and extreme weather days caused by global climate change, power outage events are becoming more frequent [1]. For example, statistical data shows that the average number of blackout events in the USA doubles every five years [2]. Grid outage events can be generally classified into two categories: planned outages and unplanned outages. Unplanned outages refer to outages incurred by unexpected events, such as transmission line faults caused by extreme weather or unexpected accidents. Planned outages refer to temporary outages scheduled by the utility. These scheduled outages are often due to some pre-determined reasons such as system maintenance and load shedding. Planned outages are not uncommon in modern grids. For example, between 2015 and 2016 there have been roughly 1700 planned power outages across Australia due to equipment maintenance, while each outage has affected at least 500 customers [3].
Operating at the edge of the grid, modern buildings have been transforming from being pure energy consumers to energy 'prosumers (producers and consumers)' [4]. Penetration of building-side distributed renewable energy sources, smart sensors and actuators, and building automation facilities provides fundamental support to implement self-energy supply for buildings during a grid outage period. In particular, for planned outage events, since the critical information of the outage (i.e. starting time and duration) is known in advance, energy management strategies can be developed to enable buildings to optimise their energy usage over the planned outage horizon (OH) while minimising the life disturbance to the user.
While building energy management is extensively studied in the literature (e.g. [5][6][7][8]), only limited research studies have focused on building energy management problems in the case of grid outage events [9][10][11][12]. These research studies are based on 'vehicleto-home (V2H)' scenarios, in which the plug-in electric vehicle (PEV) is harnessed to provide power for residential buildings in outage events. Tttle et al. [9] consider a rule-based V2H control strategy: when there is surplus PV solar power, the PEV's battery is charged until the maximum state-of-charge (SOC) level is reached. In all other cases, the energy from the PEV's battery is taken to power the home load. The authors of [10,11] studied the application of V2H under planned outages. Roche et al. [10] developed a V2H system to power a house, which operates in two modes: (i) risk-prone mode, in which the user prefers to ensure the comfort degree on the appliance usage. In this mode, the comfort level of the thermostatically con-trolled appliances (TCAs) is set to be high, and all non-thermostatically controlled appliances (NTCAs) are ensured to operate; and (ii) risk-adverse mode, in which the user prefers to maximise the self-power supply duration of the house. In this mode, the comfort level of the TCAs is set to low, and the NTCAs with low priorities are turned-off. Shin et al. [11] propose an optimisation model that coordinates and controls both the gasoline engine and battery of a plug-in hybrid electric vehicle (PHEV) to power a house under planned outages. In industry, the Nissan Motor Company Ltd demonstrated an off-grid self-sufficient smart home in 2011, referred to as the 'leaf-to-home' [12]. In this demonstration, the house is completely powered by solar panels and a Nissan Leaf electric vehicle.
The authors of [9][10][11][12] studied the energy management of a single residential house/unit under planned outages. By equipping it with distributed renewable energy sources (e.g. rooftop photovoltaic (PV) solar panel or wind turbine), there would be opportunities for individual residential houses/units to share energy with each other and sustain the grid outage duration together. To the best of the authors' knowledge, there is little work studying the community-level energy management problem under grid outages. The only reported work is found in [11], in which the authors extend their proposed V2H system to a 'V2Hs' scenario. In that scenario, multiple PHEVs that belong to different units are controlled centrally to serve the community to sustain the outage duration. However, the work in [11] is limited in two aspects: (i) it only considers electric vehicles, and it does not consider other types of controllable building energy resources. For example, the home load's reduction and time-shifting flexibilities are not exploited and these can contribute to reduce the impact of grid outage (see Fig. 1); and (ii) the centralised structure of the V2Hs system would make the energy management model computationally difficult when there is a large number of houses. This limits the application scale of technology.
We study the energy management problem for a residential community under planned grid outage events. As an innovative contribution to this less-investigated area, we propose an energy management system (EMS) to optimise a social warfare objectiveminimise the un-served load of the community over the planned OH. To tackle the large dimension complexity induced by a large number of residential energy resources present in the multiple houses, the proposed EMS decomposes the energy management workflow into two layers. In the upper layer, the community EMS (CEMS) receives the planned outage information; based on which, it solves a social warfare maximisation model to determine the charging/discharging of the community battery energy storage system (BESS) and the load-reshaping decision of each house. In the lower layer, the home EMS (HEMS) of each house performs appliance-level scheduling to schedule the operation of the controllable appliances in the house, to satisfy the load-reshaping instructions sent from the CEMS. The autonomous scheduling result obtained with the individual HEMSs are sent back to the CEMS, and these are used by the latter updates upper-layer decisions. This process continues until the convergence criteria are achieved.
Compared with existing work [9][10][11][12], the proposed EMS is innovative in the following aspects: (i) The proposed EMS is able to facilitate the cooperation of multiple houses and enhance the self-energy supply capability of the whole community. (ii) It incorporates the BESS's energy storage capability and the load re-shaping capability of controllable appliances into a comprehensive framework, which would provide more energy management flexibility for the occupant in outage periods. (iii) It adopts a decomposed structure, enabling the approach to be more scalable and practical for use with varying numbers of houses/units without incurring significant computational burdens. (iv) The decomposed structure also enables the user's sensitive data (i.e. appliance-level information) is autonomously managed by the local HEMS, rather than being exposed to other community entities.
This paper is organised as follows. Section 2 gives an overview for the community EMS; Section 3 presents the mathematical models of the hierarchical energy management workflow; Section 4 presents the problem-solving approach; Section 5 reports the numerical simulation study and key findings; finally, the conclusion is given in Section 6.

System overview
In this section, we present an overview of the system schematic and discuss some relevant implementation technologies.

Schematic of the system
The schematic of the system is shown in Fig. 2. We consider a community consisting of N houses; each house is equipped with a rooftop PV solar panel and a HEMS. The HEMS autonomously manages the operation of a set of controllable appliances in the house. There is a CEMS and a shared BESS installed on the community side. The BESS can absorb surplus power generated by the rooftop PV solar panels in the community, and discharge power to serve the community. The CEMS can communicate with the HEMSs and control the community BESS.
After a planned outage is scheduled, the utility firstly sends the outage information to the CEMS, which includes the starting time and duration of the outage. After receiving the outage information, the CEMS forwards it to HEMSs. The HEMSs then perform home load forecasting and solar power output forecasting, which can be done using the embedded programs implemented in the HEMS or third-party web services. When the outage happens, the physical connection between the distribution system and the community is disabled; the community then operates as an islanded microgrid, in which the CEMS and multiple HEMSs manage and control the energy resources in the community (i.e. the community BESS and the controllable appliances and solar panel in each house).
Based on the forecasted home load and solar power, the CEMS interacts with the HEMSs to collaboratively determine the charging/discharging power of the community BESS as well as the operations of controllable appliances of each house, with the objective of maximising the social warfare of the community, i.e. totally served load of the community during the outage period. Details of the hierarchical collaboration process are introduced in Section 3.

Implementation technologies
In grid outage events when the physical connection between the community and the external grid is interrupted, operation of the EMS relies on wireless communication facilities. Different domains of communication protocols can be applied.
Several short-range home area network protocols that implement IEEE standards can be used to support the machine-tomachine communication between the HEMS and on-site household appliances, such as WiFi (IEEE 802.11 standard), Bluetooth (IEEE 802.15.1 standard), and ZigBee (IEEE 802.15.4 standard). Neighbourhood area network protocols can be used to facilitate communication between HEMs and the CEMS. These protocols include WiMax (IEEE 802.16 standard) and cellular technologies such as 4G/5G. In a larger scale, wide-area network protocols such as transmission control protocol (TCP)/internet protocol (IP) can be used to facilitate communications between the CEMS/HEMS and external entities such as the utility and third-party web services.
Data of the community, such as the historical solar power data and the houses' meter data, can be stored in the local data storage in each house, or stored in third-party clouds and accessed through TCP/IP and web service interfaces [13].

Modelling of controllable household appliances
We assume that for each house (indexed by n), its HEMS manages the following three types of controllable appliances.
(i) Ω n CA1 : set of controllable appliances that operate at the nominal power and have a prescribed energy consumption that must be completed between a specific time range. Their operations cannot be interrupted. Examples of appliances of this group are coffee machines, rice cookers, and toasters. (ii) Ω n CA2 : set of controllable appliances that operate at the nominal power and have a prescribed energy consumption that must be completed between a specific time range. The operation of these appliances can be interrupted and resumed later. Appliances that fall under this category would include washing machines and dish washers.
: set of controllable appliances operating with power in the range of [P a, n lim , P a, n dsr ], a ∈ Ω n CA3 but without a total energy consumption requirement. Instead, a certain disutility metric can be applied to measure the dissatisfaction of the user for deviating from a nominal operating point. Typical appliances in this class include air conditioners, heaters, lights etc.

Workflow of community energy management under planned outages
The proposed energy management is based on the bi-level programming technique, which was originally proposed in [14]. As a kind of distributed optimisation technique, a bi-level programming problem is often modelled as a two-layered, leaderfollower structure. The leader's decision will influence the follower's strategy, and the follower's response will be fed back to the leader and influence the leader's decision.
For the application studied, the CEMS is the leader and the HEMSs act as the followers. Two horizons are considered (Fig. 3): one is the 'life scheduling horizon (LSH)', and another is the 'OH'. The LSH is often performed on daily basis and represents the period in which the user wants to accomplish his/her daily lifestyle tasks (e.g. cooking and clothes washing); the OH represents the period covered by the grid outage event. The OH is a sub-segment of LSH. The purpose of energy management is thus to satisfy the lifestyle tasks of the community users over the LSH as much as possible. The overall workflow of the EMS is described by the algorithm shown in Fig. 4. Firstly, the CEMS receives outage information from the utility (line 1); then, the CEMS and HEMSs collaboratively make operational decisions on the community's energy resources (lines 3-9). The CEMS solves an upper-level social maximisation model to decide: (i) the charging/discharging power of the BESS and (ii) re-shaping decisions of the load for each house (line 3). The CEMS then sends the load shifting and reduction instructions to each HEMS (line 4). After receiving the load shifting and reduction instructions, the HEMS solves a lowerlevel autonomous scheduling model to determine the operational plans for the household's controllable appliances, with the aim of minimising the deviation between the house's scheduled power consumption and the instructed power consumption sent by the CEMS (lines 5 and 6). The HEMS's scheduling result is sent back to the CEMS and based on it the latter updates the upper-level decisions (lines 7 and 8). Such a process continues until the CEMS announces no new schedules for two consequent optimisations.

3.3
Upper-level: community-scale social warfare maximisation model In this study, the social warfare objective is defined to minimise the amount of unserved load of the whole community over the planned OH. The upper-level energy management model is defined as where L n sch = [L 1 sch , …, L T lsh sch ] denotes the power consumption vector of the nth house over the whole LSH, scheduled by the upper-level scheduling model (1); P n ca is the decision variable matrix of the low-level scheduling model, which will be introduced in the next sub-section; L t lost is the unserved load (or known as 'lost load') of the community at time slot t (kW), calculated as Model (1) includes two items: (i) the first one is the total unserved load of the community; and (ii) the second one is the scheduling deviation between the upper-and low-level energy management models, which is integrated into model (1) Equation (3) models the variation of energy stored in the BESS; (4) calculates the SOC of the BESS; (5) restricts the maximum charging/discharging power of the BESS must below its rated power; (6) ensures that when the BESS is charging, its charging power cannot exceed the surplus solar power of the community; (7) ensures the SOC of the BESS is maintained within an allowable range, to protect the lifetime of the battery. (b) Total energy consumption constraint for the house, which is expressed by the condition that the total amount of the rescheduled energy consumption of each house cannot exceed the house's originally desired consumption amount (c) House load reduction constraint. The CEMS needs to ensure that for each house, its reduced total power consumption cannot be larger than a threshold pre-specified by the user The decision variables of the upper-level energy management model include P t bess and L n, t sch .

Lower-level: autonomous home energy management model
After solving models (1)-(9), the CEMS determines L n sch for each house, and sends it to the HEMS of each house. By receiving the home load re-shaping instruction, each HEMS schedules its managed home energy resources (HERs) to comply, as much as it can, with the specified instructions where L n, t hems is the total power consumption of the nth house at time slot t, scheduled by the HEMS (kW). It is calculated by the sum of the power consumed by the controllable appliances and must-run, uncontrollable appliances L n, t hems = ∑ a ∈ Ω n CA P a, n, t ca + L n, t mr n = 1: N where Ω n CA is the set of all controllable appliances of the nth house, i.e. Ω n CA = Ω n CA1 ∪ Ω n CA2 ∪ Ω n CA3 . To minimise model (10), the HEMS of the house needs to determine the power consumption profile of each controllable appliance. This can be expressed as the following matrix, which represents the decision variables of model ( (12) where A n denotes the total number of controllable appliances of the nth house, i.e. A n = Ω n CA . Model (10) is subjected to the following constraints: (a) Operation time range constraint of the controllable appliances P a, n, t = 0 t < δ a, n 1 and t > δ a, n where t a, n * represents the time interval when the appliance a of the nth house is the first time to be turned on. . For the appliances in Ω n CA3 , their power consumption must be controlled within the allowable range P a, n lim ≤ P a, n, t ≤ P a, n dsr ∀a ∈ Ω n CA3 , δ a, n  (16) makes it hard to be solved by the mathematical programming solvers. In this study, we use a heuristic optimisation algorithm previously proposed by the authors -natural aggregation algorithm (NAA) [16] to solve the lower-level model. The reason for using NAA is that the authors have developed a handy and well-packaged NAA solver, which has been successfully applied in many smart grid optimisation problems (e.g. [17,18]). Of course, other heuristic optimisation algorithms can also be applied to solve the lower-level model without altering the whole energy management framework's structure.

Encoding scheme of lower-level model in NAA
In NAA, each individual is encoded as a vector with Ω n CA1 + ∑ a ∈ Ω n CA2 ∪ Ω n CA2 (δ a, n end − δ a, n begin + 1) dimensions, representing a potential appliance operation solution for model (10). The encoding scheme is as follows: (i) The first Ω n CA1 dimensions are integer variables, representing the starting time interval of the appliances in Ω n CA1 . The corresponding task completion time can be calculated based on the starting time and the appliance's operation cycle.
(ii) The next ∑ a ∈ Ω n CA2 (δ a, n end − δ a, n begin + 1) dimensions are binary variables, representing the ON/OFF status of appliances in Ω n

CA2
; each consequentially δ a, n end − δ a, n begin + 1 dimensions represent the ON/OFF status of the appliance a within its permitted operation time range [δ a, n begin , δ a, n end ].
(iii) The last ∑ a ∈ Ω n CA3 (δ a, n end − δ a, n begin + 1) dimensions are binary variables, representing the power consumption of appliances in Ω n

CA3
; each consequential δ a, n end − δ a, n begin + 1 dimensions represent the power consumption value of the appliance a within its permitted operation time range [δ a, n begin , δ a, n end ].

Optimisation procedures
The whole optimisation procedures follow the algorithm in Fig. 4, which are visually depicted in Fig. 5. Firstly, the model of each house is set up, including the must-run load profile, PV solar power output profile, and the configuration of different kinds of controllable appliances. The community BESS's model and grid outage information are also setup. Then, Mosek optimisation toolbox is used to solve model (1). The outputted decision variables of model (1) is saved into Matlab data files, and are retrieved by the NAA solver. Based on the load re-shaping instructions scheduled by the CEMS, the NAA solver solves model (10) for each house to determine P n ca and L n hems , where L n hems = [L n, 1 hems , …, L n, T lsh hems ]. The result is saved into Matlab data files as well and retrieved by the Mosel optimisation toolbox. The upper-and lower-level optimisation models are then iteratively solved until the convergence criteria are met. In this study, the convergence criteria are set as the objective function value (1)'s difference of two consequential iterations is <0.5.

Simulation study
Numerical simulations are conducted to validate the proposed system. All programmes are implemented in Matlab and executed on a personal computer with 4-GB memory and two Intel Xeon processors.

Simulation setup
We simulate a residential community with four houses that participated in the residential energy management scheme. The four houses are indexed as House 1,…, House 4. A community BESS is set up, with configurations shown in Table 1. All four houses are assumed to be installed with rooftop solar panels, with a capacity of 4, 4, 3, 3.5, and 3 kW, respectively. Fig. 6 shows the forecasted 24-h solar power output profile of House 1. Since the four houses are located in the same geographical location, it is assumed that they receive similar solar radiation. Therefore, to simulate the solar power output of the other three houses, we simply scale the solar power profile shown in Fig. 6 based on their solar panel capacities and assign it to each house.
Each house is assumed to have a set of controllable appliances that are managed by the HEMS programme. As a demonstration, Table 2 shows the controllable appliances of House 1. In Table 2,   Fig. 5. It can be seen from Fig. 3 that if there are no proper energy management measures, lots of household loads will be lost in the grid outage event. The proposed energy management scheme is then applied. We also compare the proposed model with other three benchmark cases: (i) Case 1 (the proposed model): with a community BESS and energy management scheme.
(ii) Case 2: with a community BESS but no optimisation. In this case, rule-based control strategies on the BESS: the surplus solar power is directly charged into the BESS; the deficit community load is directly compensated by the BESS. Constraints (5)- (7) are also applied to the BESS. (iii) Case 3: without community BESS and energy management.
(iv) Case 4: with centralised optimisation approach, similar with the ones reported in [19,20]. In this case, all the community BESS and controllable appliances of the four houses are centrally scheduled by a community EMS, subjected to the following objective function: and all the operational constraints of the appliances and BESS, which are presented in Section 3, are applied. To better illustrate how the community BESS can accommodate the PV solar power and household load-reshaping, we assume the BESS at the beginning of the grid outage duration is almost empty (i.e. its initial SOC is 10%), which means no extra energy can be used over the grid outage period.
After seven iterations, the hierarchical energy management process terminates. The final scheduling results are shown in Figs. 8 and 9. Fig. 8 shows the desired and re-shaped load of the whole community and the BESS operation results. The result shows that in the morning time when there is surplus solar power, the community BESS is charged to more than 40% of its energy capacity. Then in the grid outage period (12-7 pm), the BESS is discharged to serve the load. Meanwhile, the community load is significantly re-shaped in the outage period to accommodate the BESS. Fig. 9 shows the scheduling details of House 1. The other three houses follow with similar scheduling patterns. In Fig. 9b, each solid line with a specific colour represents a controllable appliance listed in Table 2. It shows that with some unavoidable deviations, the HEMS of each house tries to schedule the appliances to follow the load profile instruction sent by the CEMS. The numerical comparison results of the proposed system and the other four benchmark cases are reported in Table 3. Since cases 2 and 3 are rule-based, their computational costs are considered to be zero. The results show that, with the proposed system (case 1), a total 3.32 kWh load of the community is lost over the outage  period. When there is neither BESS nor energy management (case 3), 30.71 kWh load is lost due to the outage. When there is BESS but no energy management process (case 2), a total load of 14.58 kWh is unserved. This is better than case 3 but still significantly worse than the proposed approach. It is noticeable that case 4 represents a centralised optimisation case in which the global optimal solution could be obtained. However, the resulted huge dimension of the centralised scheduling model leads, on the one hand, to a difficult computational to find the globally/near-globally optimal solution and, on the other hand, to very high computing time (more than 18 h). In summary, these comparisons well demonstrate the efficiency of the system proposed in this study. Fig. 10 shows the convergence of the iterative bi-level programming process. The main figure shows the variation of the two objective values in model (1), and the small figure shows the weighted sum of the two objective values with the setting of α = 1. It shows that the weighted sum is iteratively improved until the seventh iteration, which indicates the convergence of the bi-level programming process.

Scenario 2: 24-h grid outage event:
We consider another scenario, in which the outage lasts for one day (i.e. 24 h). The community's scheduling results are shown in Fig. 11. The comparison result under this scenario is reported in Table 4. Again, Table 4 shows the proposed system can well serve the community during the outage event (only 52.49 kWh load is lost); when there is no BESS and/or energy management (cases 2 and 3), the community is significantly affected by the outage. In this scenario, the centralised optimisation (case 4) cannot generate solutions within feasible time due to the huge problem dimension.

Evaluation with different community sizes
We now consider the application of the proposed system on communities with a larger number of houses to evaluate the influences of the community size. The outage duration is set from 12 pm to 7 pm. For the purpose of this study, we simply duplicate the settings of the four houses with some small modifications to simulate other houses. Correspondingly, the power capacity of the community BESS is set to be 20, 40, 60, 180, and 360 kW for the 10-, 20-, 30-, 100-, and 200-house scenarios, respectively. The results of unserved loads are shown in Table 5. Clearly, with the increase of the house number, our proposed technique can serve more energy for the community when compared to the results obtained with the other benchmark approaches.

Conclusion
This study presents a hierarchical energy management technique for facilitating a residential community to sustain through a grid outage duration. To tackle the difficulty of high optimisation dimensions caused by a large number of RERs in the community, the proposed method decomposes the energy management process into two layers. Our simulations show that through iterative communications between the CEMS and individual HEMSs, the proposed method can significantly enhance the self-power supply    capability of residential communities during grid outages. Moreover, such decomposition also has the advantage of preserving the privacy of individual houses (i.e. appliance-level scheduling data).

Acknowledgments
This work was supported by the Australian Research Council through its Future Fellowship scheme (FT140100130), in part by an Australian Research Council Discovery Project (DP170103427), in part by an ARC research hub for integrated energy storage solutions (ARC IH180100020), and in part by the UNSW Digital Grid Futures Institute cross-disciplinary research funding for smart campus.