Berk Celik
email: berk.celik@utbm.fr

Robin Roche
email: robin.roche@utbm.fr

David Bouquain

Abdellatif Miraoui

A Miraoui Femto-St

Coordinated Home Energy Management in Community Microgrids with Energy Sharing Among Smart Homes

Keywords: Energy management, smart homes, neighborhood coordination, multiagent systems, electric vehicles

come   L'archive ouverte pluridisciplinaire

INTRODUCTION

By enabling bi-directional data flow in the power system through advanced metering infrastructure (AMI), the smart grid enables using complex control methodologies for more efficient, economical and reliable system management [START_REF] Bozchalui | Optimal Operation of Residential Energy Hubs in Smart Grids[END_REF]. The smart grid offers all users the ability to participate activity, including for the residential sector. In this respect, classical houses become smart homes, so customers can modify their electricity consumption patterns to increase their social benefitmostly to reduce their electricity bills-through monitoring, communication and control capabilities. These features present an opportunity to customers to value their participation in a local electricity market, in interaction with the utility, and for the benefit of both sides [START_REF] Yi | Real-time opportunistic scheduling for residential demand response[END_REF]. For instance, while users can reduce their electricity bills by coordinating their actions, as will be shown in this paper, the utility can also decrease the aggregated peak load for secure and economic management of the power system.

In order to control distributed resources in the power grid, detailed data must be gathered from all parts of the power network. However, processing such large amounts of data will cause a heavy communication and computation burden for the operator [START_REF] Celik | Increasing local renewable energy use in smart neighborhoods through coordinated trading[END_REF]. Especially, the rapid penetration of renewable energy sources (RES) and electrical vehicles (EV) due to environmental awareness creates a more complex infrastructure that needs to be controlled adequately. Moreover, customers would not be pleased with sharing de-tailed information about their consumption habits and fully releasing the control of their electricity resources to another entity. Therefore, a decentralized approach where customers are the controllers of their own resources proposes a more practical, secure and privacyprotecting solution.

However, uncoordinated control can paradoxically reduce the performance of the algorithms by causing undesired issues (such as: rebound peaks, overloading, contingencies) [START_REF] Li | Automated residential demand response: Algorithmic Implications of Pricing Models[END_REF]Therefore, establishing a coordination mechanism among smart homes where the action of a user influences the decision-making of other users is necessary for achieving efficient and reliable energy management. Various studies focus on decentralized coordination among multiple smart homes. For example, in [START_REF] Guo | Decentralized Coordination of Energy Utilization for Residential Households in the Smart Grid[END_REF], an energy management algorithm is presented for an area with a load-serving-entity and multiple households with RES, storage, and controllable and non-controllable loads, in order to reduce the electricity cost of the area. In [START_REF] Mohsenian-Rad | Autonomous Demand-Side Management Based on Game-Theoretic Energy Consumption Scheduling for the Future Smart Grid[END_REF], a scheduling game is presented for consumption to reduce the electricity cost and peakto-average ratio (PAR) of the residential area. In [START_REF] Deng | Residential Energy Consumption Scheduling: A Coupled-Constraint Game Approach[END_REF], another game-theoretic approach is used to reduce the PAR of the area using appliance and EVs scheduling.

In this paper, a coordination mechanism for energy sharing among smart homes is therefore presented for the day-ahead energy management in neighborhood areas. It uses multi-agent systems (MAS), where are a suitable concept for decentralized management and enable dynamic interactions among entities. It is assumed that only users own PV and battery systems (not the utility) and they can share their residual generation as soon as it is generated (without battery) or at a later time (with battery). Furthermore, EVs are considered to provide energy for self-consumption of the smart home without sharing with neighbors. Both of the battery systems (home and vehicle) have the same charging principle where they can charge from self-generation and/or the main grid. For coordinated control, two types of entities are designed as home agents and aggregator agent. Lastly, in this study, dynamic price model is used for billing users, where the unit price is associated to the energy drawn from the main grid for the aggregated consumption of the neighborhood area. Note that grid constraints (e.g., line and transformer capacities) are not taken into account in this study.

The remainder of this paper is organized as follows. In Section 2, the system model and dynamic pricing mechanism are described. In Section 3, the problem formulation is presented. In Section 4, the proposed coordination mechanism is described. Simulation results are given in Section 5. Finally, in Section 6, the paper is concluded.

SYSTEM MODEL

The studied neighborhood model consists of U users, and each user u is connected to an aggregator through a communication link. Smart homes are connected directly to the main grid where the aggregator has no authority to control the power system, but acts as an advisor in the neighborhood to help decision-making in the smart homes. Lastly, smart homes have two-way communication ability only with the aggregator, not with each other, due to privacy concerns of the end-user.

SMART HOME ENERGY SYSTEM MODELING

In the considered smart home model, all appliances are connected to a controller (the home agent) through smart plugs where the home agent can sense and control the home appliances. However, based on user preferences and controllability, home appliances are divided into three groups: non-controllable, controllableshiftable, and controllable-interruptible appliances. Non-controllable appliances must be used whenever they are turned on, and are not controlled by the home agent. On the other hand, the consumption profile of the controllable appliances can be altered based on the user-defined and appliance operation constraints.

In the smart homes, in total, 14 types of smart appliances are modeled, where 10 are non-controllable (TV, lights, etc.), 3 are controllable-shiftable (washing machine, clothes dryer, dish washer) and one is controllable-interruptible (EV). The set of appliances is defined as L u = {1, 2, l, ..., L u } where L u is the total appliance number of home u, which can be different at each home. For example, while some users have one TV, others can have more than one. During the simulation time set T = {1, 2, t, ..., T }, the consumption profile of a smart home P c u (t) is determined as:

P c u (t) = Lu l=1 P l u (t), ∀t ∈ T (1)
where P l u (t) is the consumption profile of an appliance that consumes constant power between the start and end times t ∈ [t s r , t e r ], and nothing when t / ∈ [t s r , t e r ].

Regarding generation, residential PV systems are considered in the smart homes. However, based on the user economic situation and physical constraints of the building, users may or may not have a PV system installed, and the installed capacity is different for each home. Hence homes generation profiles are different from home to home. The output of a PV system P g u (t) is calculated by:

P g u (t) = N p u • N s u • P pv u • (G(t)/G ST C ) (2)
where N p u and N s u are the number of parallel and seriesconnected modules of the PV array, and P pv u is the rated power of the PV module. It is assumed that all smart homes are located in same geographic area, thus all the PV systems in the neighborhood area receive the same irradiance G(t) (irradiance variations are considered negligible). G ST C (t) is the irradiance value (1000 W/m 2 ) in standard test conditions (1000 W/m 2 , 25 • C).

For the energy storage system, batteries are installed only in smart homes with PV. Generally, batteries are charged when there is surplus generation, and discharged when consumption is higher than generation. However, in this study, we assume that a home control system is able to charge from the main grid, shift discharging operations to high price hours, and discharge for neighbors' consumption. Based on the determined battery injected power (given in Section 3), the battery power P b u (t) and state-of-charge (SOC) SOC(t) are determined as:

P d u /η d u ≤ P i u (t) ≤ Ṕ c u • η c u ( 3
)
P b u (t) = P i u (t) • η c u : P i u (t) > 0 P i u (t)/η d u : P i u (t) ≤ 0 (4) SOC u (t) = SOC u (t -1) + P b u (t) • △t /E b u (5) SOC min u (t) ≤ SOC(t) ≤ SOC max u (t) (6)
where η d u and η c u are the charging/discharging efficiencies, P d u and Ṕ c u are the maximum discharging/charging injection powers and SOC min u (t) and SOC max u (t) are the maximum and minimum SOC levels of the battery, and E b u is the battery capacity. Lastly, △t is the time interval between two time steps.

Although EVs are considered as an appliance in this section, the power profile of EVs shows the same characteristic as home batteries. According to same principle, the power P v,i u (t) and SOC SOC(t) v u profiles of EVs are modeled with: u is the EV battery capacity.

P v,d u /η v,d u ≤ P v,i u (t) ≤ Ṕ v,c u • η v,c u (7)
P v,b u (t) = P v,i u (t) • η v,c u : P v,i u (t) > 0 P v,i u (t)/η v,d u : P v,i u (t) ≤ 0 (8)
SOC(t) v u = SOC v u (t-1)+ P v,b u (t) • △t /E v,b u (9) SOC v,min u (t) ≤ SOC(t) ≤ SOC v,max u (t) (10

PRICE MODELING

The electric cost of customers in the neighborhood is determined using a form of dynamic pricing where the price is related to the aggregated power provided by the main grid. In this study, the same electricity price is also used for the reverse power flow from smart homes to the grid. The neighborhood electricity price is determined in two parts: a dynamic part, and a combined part. The dynamic part is modeled using a quadratic function as:

ρ(t, P n (t)) = a(t)|P n (t)| 2 + b(t)|P n (t)| + c(t) (11)
where a(t) > 0, b(t) ≥ 0 and c(t) ≥ 0 are parameters of the quadratic function, P n (t) is the aggregated net consumption of the neighborhood and ρ(t, P n (t)) is the dynamic part of the neighborhood electricity price.

After that, the dynamic part is combined with a fixedtariff d(t) which represents the wholesale market price at the upper level:

λ(t, P n (t)) = d(t) + ρ(t, P n (t)) : P n (t) > 0 d(t) -ρ(t, P n (t)) : P n (t) ≤ 0 (12
) where λ(t, P n (t)) is the electricity price scheme is used for billing users in the neighborhood. According to (12), when there is surplus generation which causes reverse flow from the neighborhood to the main grid, the electricity price will be lower than d(t), which will increase the interest of consumption at these times. Thus, the same pricing can be used for billing both types of users (consumers and producers) at the same time when reverse power flows exist.

PROBLEM FORMULATION

Home agents aim to minimize the electricity bills of their users by scheduling their controllable appliances and controlling charging/discharging operations of the home battery and EV battery. This section describes the optimization problem which is solved by the home agents.

For controlling shiftable-appliances, a scheduling interval [ ts r , te r ] is defined by the user for each appliance. Inside this interval, the home agent chooses the best time to run an appliance without jeopardizing user comfort. It is assumed that when a shiftable appliance starts operating, it cannot be stopped by the home agent until the end of its cycle. The constraint formulation for shiftable appliances is given by:

[t s r , t e r ] ∈ [ ts r , te r ] (13)
The operation of some appliances can depend on others, such as washing machines and clothes dryers. Users, logically, prefer to use a clothes dryer the after washing machine has finished its work. Therefore, this constraint is formulated by:

t s wm < t s cd -(t e wm -t s wm ) (14)
ts wm < ts cd -(t e wm -t s wm ) (15)
where wm and cd are used for indexing the washing machine and the clothes dryer.

To model the control of charging/discharging actions of the home battery system, home agents determine P b u (t) for each time interval. However, before giving the formulation, we need to mention several important assumptions. Firstly, we considered that a home battery system is able to be charged by self-generation, neighborhood generation, and the main grid. However, it cannot be charged to sell energy to the main grid while saved energy can be used for self-consumption and neighborhood consumption. Secondly, based on the modeling of the electricity profiles, the time resolution can be chosen equal to very short values (such as 1-min. resolution) for more detailed simulation. In such a model, the controller has to use a high number of inputs (such as 1440 for 1-min.) to determine the battery output at each time step, which is computationally expensive. Therefore, in this study, we define a battery control interval Z which has a lower resolution than the actual profile to reduce the battery input number in the optimization problem from T to T /Z, without changing the actual profile resolution. Based on that, P b u (t) is determined with logical inputs γ u ∈ {0, 1, 2} by:

Ru(t) = Pa(t) -P n u (t) (16)
where C total (k) is the total neighborhood cost and k is the iteration index.

Lastly, the aggregator agent determines the sold battery powers in real-time (t -domain) for the users, according to the final decision of the home agents when system reaches convergence. This results from simultaneous optimization and communication on the l -domain, as there is a possibility of mismatch existence in the t -domain with the occurrence of the condition P a (t) < P s (t). To eliminate these mismatches, the aggregator agent appliesthe proportionalsource-matching method described in [START_REF] Celik | Coordinated Energy Management Using Agents in Neighborhood Areas with RES and Storage[END_REF]:

P s u (t) = P a (t) • P s,d u (t)/P d s (t) (26)
where P s,d u (t) is the battery sold power and P d s (t) is the aggregated battery sold power at the final iteration of the decision-making process. In (26), the battery sold power of the smart homes are determined based on the ratio between P d s (t) and P s,d u (t).

RESULTS

SYSTEM SETUP

In this section, performance results of the studied case are given and compared with a baseline case where users are modeled as classic passive consumers with no communication, no coordination and no energy sharing abilities. Therefore, home batteries charge when generation is higher than consumption with self-generation, and discharge when consumption is higher than generation for self-consumption. Also, EV batteries cannot provide energy for self-consumption in the smart home. However, we assume that EV battery charging stops when the minimum required SOC is reached for next day travel in the baseline case, for a fair comparison with coordinated control.

NUMERICAL RESULTS

The daily electricity bills of users are given for the baseline and the coordinated control scenarios in Fig. 1.

With the proposed coordination mechanism, all users in the neighborhood area can reduce their electricity bills compared to the baseline scenario, although they have different types of equipments. It is a vital outcome of the coordination mechanism, because if some users cannot earn some benefit in exchange for their effort and participation, they would lose interest in controlling their resources and would turn the controller off. Hence, this situation may lead to consumer disengagement.

In Fig. 2, the neighborhood power profile from the perspective of the main grid is given. From the results, firstly, it can be seen that coordinated control achieves decreasing the aggregated peak demand of the neighborhood area by shifting the consumption of the controllable appliances to low price hours and discharging the batteries during high price hours. Especially, the effect of energy sharing can be observed around 20:00. While the home battery system is used to discharge energy for self-consumption before 20:00 in the baseline scenario, home agents kept the stored energy and discharge for self-consumption and share energy with neighbors to reduce the neighborhood consumption under the purpose of reducing the area price. Secondly, Fig. 2. Neighborhood Electricity Profile (Provided and sold energy from/to main grid). some smart homes with batteries, rather than charging with self-generation, fully charge with the aggregated surplus generation of the neighbors around 11:00, while this energy is fed back in the baseline scenario. Therefore, locally generated energy is kept inside the neighborhood area and utilized more efficiently due to the sharing capability.

Lastly, numerical results for consumption costs and peak demand powers of the neighborhood are given for both algorithms in Fig. 3. According to the total results for the neighborhood, the proposed coordination mechanism achieves 14.36% cost and 17.55% peak reduction compared to the baseline scenario.

NEXT STEPS

Although the presented coordination mechanism achieves reducing the peak consumption of the neighborhood area from the main grid, distribution system constraints are not considered in the proposed coordination and problem formulation. The effect of central generation resources (wind turbine, central battery, etc.) on the decision-making of the home agents will be investigated in future works.

CONCLUSION

In this paper, we proposed a coordination mechanism with a decentralized approach, where home agents are the decision-makers and the aggregator is the advisor in the neighborhood area. The main idea of the presented algorithm is to reduce the aggregated peak demand power of the neighborhood in addition to reducing the daily electricity bill of the users by scheduling household appliances and controlling battery (both home and EV) charging/discharging operations through a form of dynamic pricing. Agent-based modeling is used to design home and aggregator agents. Simulations results showed that the proposed coordination mechanism achieves reducing the total electricity cost and the aggregated peak consumption of the neighborhood. Moreover, all types of home users benefit from participating in the coordination mechanism, hence their receive a return for their efforts.

  ) where η v,d u and η v,c u are the EV charging/discharging efficiencies, P v,d u and Ṕ v,c u are the EV maximum discharging/charging injection powers, SOC v,min u (t) and SOC v,max u (t) are the maximum/minimum SOC levels of the EV battery, and E v,b

For

  the simulation setup, the studied neighborhood area consists of U = 20 users, where two have a home battery, PV and an EV, one has a home battery and PV, three have PV and an EV, four have just PV and one has just an EV. Electricity profiles are modeled with a 1-minute time resolution (T = 1440, △t = 1/60). Battery control and communication intervals are chosen equal to 60 minutes Z = L = 60, and price coefficients are assumed constant and taken as a(t) = 5 × 10 -5 , b(t) = 8 × 10 -4 , c(t) = 0 and d(t) = 0.16 e/kWh.Lastly, a co-simulation platform with JAVA Agent DEvelopment Framework (JADE) and MATLAB is used for agent modeling and performance evaluation. Data is exchanged between JADE and MATLAB through TCP/IP ports, by defining a unique port for each agent. Simulations are performed on a desktop computer with an Intel Core i7-3770 CPU @ 3.4 Ghz, 7.8 GB RAM and a 64-bit Ubuntu 14.04 LTS operating system.

Fig. 1 .

 1 Fig. 1. Daily Electricity Bills of the Smart Homes and Types (A = home battery + PV + EV, B = home battery + PV, C = PV + EV, D = PV, E = EV, F = None).

Fig. 3 .

 3 Fig. 3. Neighborhood aggregated (a) costs and (b) peak demand powers.

where R n u (t) is the aggregated net profile, except the net profile of user u, and P a (t) is the aggregated profile of the neighborhood. f .charge refers to full charging with P g u (t) + P o u (t) (P o u (t) is the charged power from the main grid), p.charge refers to normal charging with P g u (t), idle refers to zero power, and b.discharge refers to battery discharging with P c u (t) + R n u (t) -P g u (t). After that, the power sold by the battery discharge P s u (t) is determined with:

Based on the above formulation, the discharged battery power is used firstly for self-consumption, then sold for the neighbors consumption.

Lastly, the EV battery power is determined by using the same principle defined for the home battery system, but with two exceptions. Although EV charging is typically based on a constant current / constant voltage method, advanced methods can be implemented for EV battery control [START_REF] Paterakis | Coordinated Operation of a Neighborhood of Smart Households Comprising Electric Vehicles, Energy Storage and Distributed Generation[END_REF]. First, we assume that an EV battery is only allowed to discharge for self-consumption of a smart home (vehicle-to-home: V2H), neglecting neighborhood consumption (vehicle-to-grid: V2G). Second, there should be some energy left in the battery of the EV for the next day morning travel. According to that, EV constraints and battery power P v u (t) are determined using the same logical inputs γ v u (z) = {0, 1, 2} by:

where t v arr and t v dep are the arrival and departure times of the EV, and SOC v u is minimum required SOC for next day travel when t = t v dep . f .charge, p.charge, and idle have the same meanings and formulations than above. v.discharge refers to vehicle discharge with P c u (t) -P g u (t). The home net power profile P n u (t) is calculated by:

Finally, the objective function solved by the home agent to minimize the daily electricity bill of the user is formulated as:

s.t. eqs. (3), ( 6), ( 7), (10), ( 13), ( 14), ( 15), ( 19), (20)

It can be noted that P s u (t) is removed in (21) and added in (22), on purpose. They are needed separately during the data exchange described in Section 4 for establishing the coordination among smart homes. Note that Z is only used to ease the battery optimization problem, and not for appliances.

COORDINATION MECHANISM

In this section, the coordination mechanism is described by presenting the communication structure among neighborhood entities. Due to privacy concerns of the users, we assume that, first, home agents do not communicate with each other, and second, they use averaged data while communicating with the aggregator. We define a communication interval L where home agents can calculate the average of the actual electricity profile for each L time interval. Based on that, when home agents send a message, they convert a matrix of electricity profiles as [1 × T → 1 × T /L]. Oppositely, when home agents receive the data, they re-convert it back as [1×T /L → 1×T ] (messages are denoted using "ˆ" to represent the difference between communicated data and actual data, such that P n u (l) is the communication data of the home net electricity profile P n u (t), and l is the time index of the communication data).

At the beginning of the coordination, the aggregator agent determines the neighborhood price, the aggregated net and sold battery power profile as λ(l, Pn (l) = d(l), Pn (l) = 0 and Ps (l) = 0. With the received information, home agents minimize their objective function simultaneously, then determine and send the home net electricity profile P n u (t) and the home sold battery power P s u (t) to the aggregator. After that, the aggregator agent calculates the aggregated profile Pa (l) = U u=1 P n u (l) and the aggregated battery sold power profile Ps (l) = U u=1 P s u (l), and determines the aggregated net electricity profile with:

Next, the aggregator agent determines the neighborhood price and sends λ(l, Pn (l), Pn (l) and Ps (l) to home agents. After that, home agents run the optimization again and send the determined data back to the aggregator agent. This process continues until change in total neighborhood cost between iterations becomes negligible C total (k) -C total (k -1) ∼ = 0.

C total (k) = Pn (l) • λ(l, Pn (l)) (25)