Multi-time Scale Home Energy Management Considering User Comfort

With the rapid development of household photovoltaics and electric vehicles, demand-side energy management has become an important means to release the burden of power grid during the load peaking period. In order to ensure the user comfort and reduce the cost of electricity, a multi-time scale home energy management method is proposed based on mixed integer programming algorithm. Firstly, on the basis of time-of-use electricity price, household photovoltaic, electric vehicles, storage batteries and HVAC are taken into consideration. And then, short time scale model of HVAC is adopted, which increases the rationality of modeling while discretizing. The simulation results verify the superiority of multi-time scale and the optimization effect of the proposed method, which can reduce the cost of electricity for users, smooth the load curve and improve the utilization efficiency of renewable energy.


Introduction
The uncertainty of load curve in the distribution network is increasing due to the large number of connection of household photovoltaic and electric vehicles. On one hand, the output of wind turbines and photovoltaic generators is highly volatile and intermittent, and the power generation curve is totally different from the conventional load curve [1]. On the other hand, the promotion of random loads such as electric vehicles will lead to a sharp increase in electrical load, which will worse or even collapse of the voltage level of the distribution network. As an important member of the grid demand side, prosumers will play an important role in demand response through energy management in the smart grid environment, which is mainly composed of household photovoltaics generators, electric vehicles, dispatchable load and household energy storage. Therefore, the home energy management system control method of prosumer has become a hot research direction.
Domestic and foreign scholars have achieved certain research results for HEMS. Zhu Jie saved the single-day total cost of the home microgrid by optimizing the charging and discharging period of the battery and electric vehicle, but she did not consider user comfort [2]. With the consideration of the user's economy and comfort, Wang Dezhi optimized the household energy allocation of the three types of load households by using the Pareto Nash equilibrium game [3]. Li Dezhi divided the user load, energy storage state and grid electricity price into five levels, and proposed a set of fuzzy control logic for household energy management [4]. Huang Wei introduces a penalty function in the objective function to ensure user comfort while pursuing the economics of the home microgrid [5]. Fan Wei used the event trigger mechanism to reduce the trigger frequency of the controllable load of water heaters, air conditioners and electric vehicles, and the electricity cost of home users is reduced with the guarantee of comfort [6]. Zhang Yusen has established a multi-time scale home energy optimization management model with the consideration of the maximum power constraints and the user-determined demand response event constraints [7]. In order to reduce the total household electricity bill and the user's discomfort to temperature, Yu Zh decomposed the family energy management optimization problem into two time scales, and proposed a multi-stage&multi-scale method based on model predictive control [8]. On the basis of the above research, Liu Yi proposed the equivalent condition for converting the problem into multi-time scale problem. A thermal model were proposed on the slow time scale considering the outdoor temperature change and the input power of the HVAC system [9]. Shafie-Khah introduced a response fatigue index to ensure residents' satisfaction and optimized the cost of customers in different demand response plans [10]. Melhem Fady Y uses the Taguchi method for experimental design, and proposes an optimized heuristic algorithm for home energy management [11].
The algorithm has superior computational speed compared to other algorithms.
In summary, the existing research has the following shortcomings. a: most of the studies have considered the inclusion of energy storage systems in the home microgrid, but do not consider the cost performance of the energy storage system. b: most of the studies rarely consider user comfort.
Based on the above research, the home energy management problem is studied here based on mixed integer linear programming algorithm. Compared with the existing results: First, in the home microgrid framework, the HVAC load is redefined and established both in single-time scale and multi-time scale. The load model in the home microgrid has also been improved here. Second, the necessity of battery systems in the home microgrid is discussed, which can be used to plan the internal equipment configuration of the home microgrid. Then mixed integer linear programming algorithm is used to optimize comfort-related controlled loads like HVAC. In brief, this method can optimize the load power consumption in the home microgrid, reduce the load peakto-valley difference, and thus reduce the adverse impact of load fluctuation to the power grid.

Battery Model
The battery and the photovoltaic power generation system can balance the power generation and load demand, respond to the dynamic changes of the system, and realize the smooth integration of the photovoltaic system into the power grid [10]. In order to establish an integrated optimization model for the whole process of charging and discharging, the operating power of the energy storage equipment is written as a unified expression. The battery charging and discharging model is as follows: where: E b (t) is the amount of electricity (kWh) of the battery during the t-th period; ɛ is the self-discharge rate of the battery; P b.ch (t) and P b.dis (t) are the charge and discharge power of the battery respectively (kW); η ch and η dis are the charge and discharge efficiencies of the battery, respectively. State of charge constraints: .min .max where: E b.min and E b.max are the minimum and maximum power of the battery respectively. In fact, in the formula (1), P b.ch (t) and P b.dis (t) must have a value of 0, which can not charge or discharge at the same time. To turn the problem into a mixed integer programming problem, establish charge and discharge power constraints [10]: where: u ch (t) and u dis (t) are the charge and discharge states of the battery, respectively, which are 0-1 variables. When u ch (t) is equal to 1, it indicates the state of charge, and when u ch (t) is equal to 0, it indicates the uncharged state; u dis( t) is the same.

Electric Vehicle Model
An electric vehicle is a vehicle whose driving force is derived from a vehicle battery and is driven by electric energy. Electric vehicles are quiet, environmentally friendly, and have energy storage characteristics. Unlike rigid loads, electric vehicles can be scheduled for a longer time range. This paper considers that the daily electric mileage of household electric vehicles is relatively fixed, so the daily charging power is relatively determined. The controlled constraints and full power conditions for establishing electric vehicles are as follows [11]: where: t EV.start and t EV.end are the start and end time of the electric vehicle's charging period respectively; P ev (t) represents the average charging power in the electric vehicle; C ev represents the amount of electricity required to be charged in one day; P n.ev indicates the electric vehicle Rated charging power.

HVAC Model
At present, there are many researches on the demand response of HVAC [12,13]. This paper considers that HVAC is a variable air volume type and the compressor operates in a cooling mode. The indoor temperature is affected by thermal resistance, heat capacity, cooking, solar radiation, wind speed, humidity, outdoor temperature, and HVAC. For the sake of simplicity, we assume that outdoor temperature and HVAC power are the main factors of the thermal model. The discrete time thermal model of HVAC can be described as follows [8,9]: Room temperature should meet: where: T ac (t) is the room temperature at time t; T out (t) is the outdoor temperature at time t; P a (t), R a and C a are the operating heat power, room thermal resistance and room heat capacity of the air conditioner, respectively; m and M is the upper and lower limits of room temperature, respectively. Compared to rigid loads and electric vehicles, HVAC is more relevant to user comfort, and shortening its time scale enables discrete-time thermal models to be closer to reality. Change the time scale from ∆t to ∆t s : where: ∆t s is a short time scale interval and K m is a multiple.
The problem translates into a multi-time scale optimization problem. s t  should be much smaller than t  . Since the outdoor temperature is not constant, and the power of HVAC is not reasonable within t  , it is difficult to guarantee the equivalence of problem transformation by using a single time scale.

Home Energy Management System
Considering Comfort

User comfort
User comfort is mainly for temperature-controlled load HVAC. We expect the temperature variable to be satisfied in a certain interval. These indicators are interval indicators. The structural comfort satisfaction function is as follows: where: t AC.start and t AC.end respectively indicate the opening time and shutdown time of HVAC, indicating the room temperature when air conditioning is turned on, T ] is the optimal temperature range for the user to feel comfortable; M, m are respectively allowed upper and lower bounds. This paper indicates the upper and lower bounds of the preferred temperature variable. If the weather is hot, the lower bound is taken as the air conditioner set temperature, and the upper bound is taken as the highest temperature at that time.

Objective Function
Based on various forecasting data, the home microgrid optimizes the charging capacity of batteries, HVAC and electric vehicles in various time periods in a time-of-use price environment. The optimization goal is to reduce the total operating cost of the home microgrid based on user comfort. Operating costs include photovoltaic full-power subsidy benefits, household electricity purchase costs, household electricity sales revenue, battery depreciation loss costs, and equivalent benefits of comfort. The objective function is: among them, 1 . .
where: K f is the equivalent conversion coefficient of comfort to income; op(t) is the real-time electricity price of the grid; psp(t) is the subsidy price of PV full power; sp(t) is the PV on-grid price; P pv (t) is the first T-time household photovoltaic power; P gb (t) and P gs (t) represent the purchased power and power sales of the system during the t-th period; b β is the charge-discharge depreciation coefficient of the battery.
The constraints are as follows. 1) Power balance of the home microgrid system:

t P t P t P t P t P t H t P t
where: P load (t) is the predicted rigid load.
2) Battery charge state and charge and discharge power limit as in formula (1) -formula (4) 3) The controlled period and full power constraint of the electric vehicle are as shown in formula (5)-(6) 4) The HVAC system satisfies the equality constraint of formula (14) 5) Purchase power and power sales constraints: .max 0 ( ) where: op(t) is the real-time electricity price of the grid; P gb.max and P gs.max respectively represent the limits of the household microgrid's purchased power and power sales.

Photovoltaic, Unschedulable Load and Electricity Price Parameters
This paper take the power usage of a prosumer in the early summer as an example. Taking into account the electrical inertia, the user's basic load is obtained based on the load prediction. For household photovoltaics, this paper uses 5kW household photovoltaic equipment, and its power generation can be predicted based on light intensity and temperature data. Photovoltaic power generation and basic load are shown in Figure 1.
It can be seen from Figure 1 that photovoltaic power generation and load levels fluctuate drastically, and the photovoltaic utilization rate produced by Prosumer is low.
The electricity price of the grid is based on the electricity price of the province in Guangdong. The grid electricity price, PV grid-connected price and PV charging subsidy price are shown in Table 1.

Energy Storage And Electric Vehicles
In this paper, a household battery with a capacity of 4 kWh is used, and the minimum power is 0.1. The maximum charge and discharge power of the battery is limited to 3 kW, the charge and discharge loss is 5%, and the self-consumption rate of the battery is 2%.
The battery capacity of household electric vehicle is 20kWh. Considering that the car is only used to meet the driving demand, it only needs to be fully charged before the next morning, regardless of its discharge to the grid. The electric vehicle set in this paper can be charged from 18:00 to 7:00 of the next day. It is charged with constant power. The charging power is P ev.ch =3.3kW, and the required charging time is N ev =6h.

HVAC Parameters
According to the temperature curve of a certain day in the early summer, the HVAC working time is set from 9:00 to 21:00; the room heat capacity is C a =0.525 kWh/°C; the room thermal resistance is R a =16°C/kW; the air conditioning is comfortable after opening. The interval is T min =23°C, T max =28°C; the rated power of the air conditioner is P aN =2kW.

Multiple time Scale Analysis
Set the long-term scale t  =1h, and the short-time scale s t  =15min. Comparing K f =0, K f = 5 and K f = 30, the room temperature changes of HVAC using long-term scale and short-time scale are shown in Figure 2. It can be seen from Figure 2 that during the 10~21 period when the HVAC is turned on, when the HVAC adopts the long-time scale, the obtained room temperature simulation pattern waveform has a sudden change or a long time constant. When the HVAC adopts a short time scale, the obtained room temperature simulation map waveform is smoother and closer to reality. The following analysis of HVAC uses short time scales and will not be described again. When K f =0, K f = 5, the room temperature of 20~21 is higher than the outdoor temperature, indicating that the air conditioner is turned off. It shows that when the equivalent conversion coefficient of comfort to profit is small, the system will sacrifice comfort and seek cost reduction, which is consistent with reality.
The electricity bill, battery depreciation expense and user comfort of the user under different K f are shown in Table 2. According to the table, when the user does not care about the comfort at all, that is, K f =0, a relatively lowest electricity cost can be obtained, at the cost of low user comfort. When users consider comfort, as the electricity bill increases, user comfort increases even more. In addition, different K f has little effect on the equipment depreciation cost of the home energy management system.

Analysis of Optimization Effects
The household microgrid studied can obtain energy from the main grid, household photovoltaics or batteries (discharge mode) to meet the energy consumption of the load, the battery (charging mode) and the charging of the electric vehicle. Excess power is sent to the grid when the self-use of home microgrid is saturated. The daily effect curve of the home energy management system is shown in Figure 3.
Under the constraints the power balance of the power grid, it can be seen that the proposed home energy management system found the optimal solution of the schedulable load. In one day, the amount of electricity purchased have been greatly reduced by household microgrids. During the day, it increased the purchase of electricity by charging or discharging and load transfer. In the 8~12 period, when the load is low, the home microgrid can sell electricity to the system, and self-sufficiency was achieved in the 13~16 period. During the 17th period of peak load, the storage battery discharge reduced the load peak. In summary, the optimal solution obtained effectively reduced the cost of electricity for users ensuring users' comfort.
The comparison method is used to analyze the power purchase characteristics of the home microgrid system in different operation modes in the early summer. The purchased power of the system under different operating modes is shown in Figure 4. As can be seen from Figure 4, the home energy management system can significantly reduce the purchase level of users in the 17~24 high electricity price period, and shift the schedulable load to the low electricity price period of 1~7. In addition, after adding energy storage, the system further reduced the power purchase power during the 17th and 23rd periods, and increased the local consumption of renewable energy.  The user fees and comforts of the system under different operating modes are shown in Table 3. As can be seen from Table 3, after adding HEMS, the user's electricity bill is significantly reduced, and the comfort is still within an acceptable range. In addition, the energy storage that accounts for the depreciation of the battery can further reduce the cost of electricity for the user and has less impact on comfort.

Conclusion
A multi-time scale family energy management method is proposed here based on mixed integer programming algorithm, which optimizes the use of electric vehicles, batteries and HVAC equipment under time-of-use price. A linearized user comfort evaluation standard is proposed based on human comfort temperature interval. The results of the example show that: The use of short-time scale modeling makes HVAC more reasonable and authentic. While ensuring comfort, the proposed HEMS can effectively reduce the user's electricity cost, smooth the user load curve, and improve the utilization efficiency of renewable energy. In addition, the use of household energy storage can slightly reduce the cost of electricity for consumers, which has limited impact on the home microgrid and the grid.