Optimal Energy Management of V2B with RES and ESS for Peak Load Minimization

In order to decrease fuel consumption and greenhouse gas emissions, electric vehicles (EVs) are being widely adopted as a future transportation system. Accordingly, increasing the number of EVs will mean battery charging will have a significant impact on the power grid. In order to manage EV charging, an intelligent charging strategy is required to prevent the power grid from overloading. Therefore, we propose an optimal energy management algorithm (OEMA) to minimize peak load on a university campus consisting of an educational building with laboratories, a smart parking lot, EVs, photovoltaic (PV) panels and an energy storage system (ESS). Communication networks are used to connect all the system components to a university energy management system (UEMS). The proposed OEMA algorithm coordinates EV charging/discharging so as to reduce the peak load of the building’s power consumption by considering the real-time price (RTP). We also develop a priority determination method for the time allocation of the optimal charging algorithm. Priority is determined by arrival time, departure time, state-of-charge (SOC), battery capacity and trip distance. The performance of the proposed algorithm is evaluated in terms of charging cost and peak load under the real environment of the university engineering building.


Introduction
Nowadays, electric vehicles (EVs) are receiving great attention due to their benefits in saving energy, decreasing greenhouse gas emissions, and reducing the dependence on conventional fossil fuels [1,2]. Driven by policies and regulations, the number of EVs is projected to rise significantly over the coming decades [3,4]. As the penetration rate of EVs is expected to continue growing exponentially, a lot of energy will be required to support EV charging. The influences of EVs on the power grid may include power losses (feeders overloading and transformer overloading) and power quality (harmonics, unacceptable voltage fluctuations and voltage profile) [5]. Without any control strategies, the charging process of EVs will significantly affect the electric power grid, especially during peak hours [6]. Among the possible solutions to cope with the new peak demand during peak hours is to increase power generation to handle the growth in vehicle charging or to upgrade the distribution end users to change energy usage habits, time-of-use (TOU), real-time pricing (RTP) and critical peak pricing (CPP) are different price-based options as defined by the US Dept. of Energy during different time-periods [24,25].
The activities of EVs including charging and discharging enable them to participate in various domains such as vehicle-to-home (V2H), vehicle-to-building (V2B), V2G and vehicle-to-vehicle (V2V) [26][27][28]. V2B consists of EVs, bidirectional chargers and small-scale renewable energy resources, such as photovoltaic systems and small-scale wind turbines. EVs are able to draw/transfer the energy from/to the building based on their battery status and offer services such as reducing the on-peak load of the building's power consumption through peak shaving, load shifting and valley filling.
This paper studies the impact of EV charging on the building's power consumption and presents a cost-effective solution for peak load minimization in an educational building equipped with a PV system and an ESS. In this work, we propose an optimal energy management algorithm (OEMA) for peak load minimization in a university campus. The system model consists of an educational building with laboratories, a smart parking lot, EVs, PV panels and an ESS. We also propose a time allocation scheme for EV charging and discharging based on priority. The priority determination rules are calculated based on different decision factors including both vehicle and user preference. We define three different priority levels as high, medium and low. Charging services will be allocated to EVs with higher priorities without violating the operational constraints of the grid. The proposed scheme is designed to minimize EV charging cost while balancing the load of the power grid. The simulation results outperformed the conventional charging method in terms of peak power and charging cost.
The remainder of this paper is organized as follows: Section 2 presents the system architecture and components. Section 3 explains the proposed optimal energy management algorithm in detail. Section 4 presents the simulation results and a discussion of different scenarios and the conclusion is given in Section 5.

System Architecture and Components
The system architecture considered in this work is shown in Figure 1. It consists of an educational building with laboratories (engineering building 2-7), a smart parking lot with 100 charging/discharging stations, PV panels, and an ESS. The power grid is connected to the system through a point of common coupling (PCC). The power grid supports the electric power for both the building and the parking lot. The university energy management system (UEMS) is a local controller responsible for serving both the building's energy demands as well as EV demands. The UEMS receives monitoring data from different sub-systems through communication networks. The major roles of the UEMS are:

•
To receive information about the real-time price from the power grid and the building's power consumption.

•
To receive information from PV and ESS to decide on their participation.

•
To receive information from newly arrived EVs and the priority determination of each EV.

•
To allocate time slots for EV charging with a low cost and discharging with a high cost by considering their priority and load profile.

•
To update the building load profile.

Building Model
This work considers the real case study for the power consumption of the engineering building (2-7) of Chonbuk National University, Jeonju Campus, South Korea. The rooms of the educational building are used for teaching, research and as laboratories. The main objective is to minimize the peak power consumption for the engineering building during peak hours by considering vehicle-to-building (V2B) and renewable energy sources (RES). Figure 2 shows the hourly power consumption during a working day.   Figure 3 illustrates the arrival time and departure time of 100 EVs. The characteristics of arrival time and departure time are defined using a Gaussian normal distribution of µ = 8:30 a.m., σ = 1 and µ = 6:30 p.m., σ = 2, respectively, given in Equation (1). The average daily trip distance is considered to be 50 km with a standard deviation of 10 km (µ = 50, σ = 10). In addition, the initial state-of-charge (SOC) of EVs are considered as randomly generated from 10% to 80%. The driving behavior of EV owners is dependent on their arrival time, departure time, initial SOC and daily trip distance.    Figure 3 illustrates the arrival time and departure time of 100 EVs. The characteristics of arrival time and departure time are defined using a Gaussian normal distribution of µ = 8:30 a.m., σ = 1 and µ = 6:30 p.m., σ = 2, respectively, given in Equation (1). The average daily trip distance is considered to be 50 km with a standard deviation of 10 km (µ = 50, σ = 10). In addition, the initial state-of-charge (SOC) of EVs are considered as randomly generated from 10% to 80%. The driving behavior of EV owners is dependent on their arrival time, departure time, initial SOC and daily trip distance.    (1). The average daily trip distance is considered to be 50 km with a standard deviation of 10 km (µ = 50, σ = 10). In addition, the initial state-of-charge (SOC) of EVs are considered as randomly generated from 10% to 80%. The driving behavior of EV owners is dependent on their arrival time, departure time, initial SOC and daily trip distance.

Photovoltaic Model
The PV panels are used to convert the sunlight to electricity. The position of the PV surface should be perpendicular to the sunlight. The output power during the day may be different based on solar irradiation, temperature and weather conditions. Equation (2) shows the output power of the PV system where η is the conversion efficiency of PV cells, S is the surface area of the PV surface, I is the solar radiation and Ta is the ambient temperature [29]. Figure 4 shows the predicted output power of PV panels considered in this work.

Energy Storage System Model
The energy storage system consists of electrochemical devices that are able to store energy either from AC or DC sources. The ESS can be considered as a load during charging and a controlled

Photovoltaic Model
The PV panels are used to convert the sunlight to electricity. The position of the PV surface should be perpendicular to the sunlight. The output power during the day may be different based on solar irradiation, temperature and weather conditions. Equation (2) shows the output power of the PV system where η is the conversion efficiency of PV cells, S is the surface area of the PV surface, I is the solar radiation and T a is the ambient temperature [29]. Figure 4 shows the predicted output power of PV panels considered in this work.

Photovoltaic Model
The PV panels are used to convert the sunlight to electricity. The position of the PV surface should be perpendicular to the sunlight. The output power during the day may be different based on solar irradiation, temperature and weather conditions. Equation (2) shows the output power of the PV system where η is the conversion efficiency of PV cells, S is the surface area of the PV surface, I is the solar radiation and Ta is the ambient temperature [29]. Figure 4 shows the predicted output power of PV panels considered in this work.

Energy Storage System Model
The energy storage system consists of electrochemical devices that are able to store energy either from AC or DC sources. The ESS can be considered as a load during charging and a controlled

Energy Storage System Model
The energy storage system consists of electrochemical devices that are able to store energy either from AC or DC sources. The ESS can be considered as a load during charging and a controlled generator during discharging. In order to prevent the ESS from undercharging and overcharging, the ESS is limited by its minimum and maximum energy storage, as given in Equation (3). We considered an ESS with a maximum charging and minimum discharging of 80% and 20%, respectively.

Proposed Optimal Energy Management Algorithm
The main objective of the energy management system is to minimize the total power consumption from the main power grid, as given in Equation (4).
where P grid,ts is the amount of power consumption from the main power grid at time ts, P Building,ts is the building power consumption at time ts, P i EV is the charging/discharging capacity of an EV at time ts, P ESS is the charging/discharging capacity of the ESS at time ts, and P PV is the generated power from the PV system at time ts. The coefficients α, β, and γ are related to EV, ESS, and PV, respectively, as shown in Equations (5)-(7).
EV is discharging at ts 0, EV is not participate at ts +1, EV is charged at ts ESS is not participate at ts +1, ESS is charged at ts PV output is not avaialble at ts +1, PV output is avaialble at ts In this work, the proposed optimal energy management algorithm (OEMA) assigns different priorities to EV charging by considering the status of the building's power consumption, PV output and ESS. We assume that time is slotted and indexed by an integer in T = {1,2, 3, . . . , T}, where T is the time-period. The time-period is 24 h consisting of time slots. The time slot size (∆ts) is 15 min. The main objective of this work is to minimize EV charging costs while balancing the load profile of the power grid. We calculate the required number of charging timeslots (Nt) for each EV based on Equation (8) where SOCreq is the desired SOC of the EV battery for the user for the next trip (departure time), Bev is battery capacity, P c is charging rate and η is the coefficient of charging power rate.
The EV charging cost is given in Equation (9) where C is the minimum EV charging cost, C elec (ts) is the charging cost, P c is the charging rate, and η is charging efficiency. Figure 5 illustrates the main flow chart of the proposed algorithm. The algorithm includes three main parts: ESS, PV output and EV charging/discharging with the user's preferences. The UEMS receives monitoring data from different sub-systems through communication networks. The major roles of the UEMS are: Step 1: -Initiation.

•
New day begins ts = 0. • Get the day-ahead load profile of the engineering building and PV output. • Get SOC of ESS.
Step 2: -Check Status of ESS.

•
Check ESS status at current ts then decide on the participation of ESS.
Step 3: -Check Status of PV output.

•
Allocate numbers of charging/discharging timeslots into the building load profile.
Step 5: -Update load profile • The load profile is updated. • If ts number is greater than 95, finish programming unless ts increased by one then go to step two.

Priority Determination Algorithm
The priority determination rules are calculated based on different decision factors including both vehicle and user preference. The main parameters of priority rules are arrival time, departure time, SOC, trip distance and battery capacity. After calculating the EV priority, the aggregator assigns these priorities to EVs for charging, as given in Equation (10) where Pr stay , Pr SoC , Pr trip and Pr batt are stay time, state of charge, trip distance and battery capacity, respectively. After EVs have been prioritized, the highest priority EVs are allocated first for charging (timeslots with low electricity cost).
We defined three different priority levels as high, medium and low, as shown in Table 1. Regarding the EV stay time, low priority is given if the EV stay time is greater than 6 h while high priority is considered if the EV stay time is less than 3 h. With respect to the initial SOC of an EV battery, we define a high priority for SOC as less than 20%, medium as 20-80% and low priority as a SOC greater than 80%. We also consider trip distance; low priority for a trip is less than 10 km, medium 10-60 km and high priority greater than 60 km. Two priority levels for EV battery capacity are defined; medium and low. Low priority is assigned to a battery capacity less than 30 kWh while medium priority is greater than 30 kWh. As a result, the charging service will be allocated to EVs with higher priorities without

Simulation Results
In this work, we considered a real case study to evaluate the performance of the proposed optimal energy management algorithm. The real data for the demand load profile of the engineering building 2-7, Chonbuk National University, Jeonju Campus, South Korea were obtained during a working day. We considered five different scenarios with different system configurations, as given in Table 2. We assumed the time slot size was set to be 15 min, the ESS capacity was set to 50 kWh, and the charging and discharging power of ESS was 6.6 kWh. The output power of the PV system was based on Reference [30]. Simulation parameters and assumptions are given in Table 3.   [31], as given in Table 4. The charging and discharging power for each EV was set to 3.6 kWh. The charging and discharging efficiency were configured as 0.90 and 0.85, respectively. The driver behavior regarding arrival time, departure time, and driving range is given in Table 5. The electricity cost of Korea Electric Power Corporation (KEPCO) during the summer season is shown in Table 6. We considered the electric rate of an educational tariff with option two [32]. We used C++ programming language for our real-time algorithm. Also, we used Qt Creator which is a cross-platform C++, JavaScript and QML integrated development environment which is part of the software development kit (SDK) for the graphical user interface (GUI).

Scenario One: Immediate Charging EVs
In immediate charging, EVs start charging directly upon arrival without any attempt to schedule or organize their needs. Figure 6 shows the result of the uncoordinated charging scheme where 100 EVs were charged immediately after arriving at the parking lot. The peak power consumption was about 208 kW at 11.00 a.m. The charging load of the EVs coincided with the building's daily peak demand hours. Both the PV system and the ESS were not configured in this scenario. The result showed that the impact of EV charging on the building power consumption was very severe.

Scenario One: Immediate Charging EVs.
In immediate charging, EVs start charging directly upon arrival without any attempt to schedule or organize their needs. Figure 6 shows the result of the uncoordinated charging scheme where 100 EVs were charged immediately after arriving at the parking lot. The peak power consumption was about 208 kW at 11.00 a.m. The charging load of the EVs coincided with the building's daily peak demand hours. Both the PV system and the ESS were not configured in this scenario. The result showed that the impact of EV charging on the building power consumption was very severe.

Scenario Two: EVs Coordinated Charging
The coordinated charging aims to manage/organize EV charging in order to decrease the peak power consumption of the building while fulfilling user requirements. Figure 7 shows the result of the coordinated charging scheme for 100 EVs. The PV system and the ESS were not considered as in scenario one. The proposed algorithm was able to manage the charging of EVs with minimum charging cost, however, power consumption showed two peaks during the periods of low charging cost. The first time period was between 9:00 a.m. and 11:00 a.m., and the second time period was at 1:00 p.m. The peak power consumption was about 192 kW at 10:15 a.m., which was lower than in scenario one.

Scenario Three: EVs, PV and ESS
Scenario three considers the cooperation among EVs, PV and ESS to reduce the building's power consumption. Compared to scenario one and scenario two, EVs were able to discharge part of their batteries in order to support the load demands of the building by providing power during peak

Scenario Two: EVs Coordinated Charging
The coordinated charging aims to manage/organize EV charging in order to decrease the peak power consumption of the building while fulfilling user requirements. Figure 7 shows the result of the coordinated charging scheme for 100 EVs. The PV system and the ESS were not considered as in scenario one. The proposed algorithm was able to manage the charging of EVs with minimum charging cost, however, power consumption showed two peaks during the periods of low charging cost. The first time period was between 9:00 a.m. and 11:00 a.m., and the second time period was at 1:00 p.m. The peak power consumption was about 192 kW at 10:15 a.m., which was lower than in scenario one.

Scenario Three: EVs, PV and ESS
Scenario three considers the cooperation among EVs, PV and ESS to reduce the building's power consumption. Compared to scenario one and scenario two, EVs were able to discharge part of their batteries in order to support the load demands of the building by providing power during peak periods. Figure 8 shows the simulation result considering 50 EVs, a PV system of 10 kWh and an ESS of 30 kWh. The proposed algorithm showed a reduction in the building's power consumption during the period between 11:00 a.m. and 7:00 p.m. During that time, the output power from PV panels was enough to support part of the EV charging during their parking time. We noticed that power consumption during the remaining periods was similar to the initial building power consumption.
periods. Figure 8 shows the simulation result considering 50 EVs, a PV system of 10 kWh and an ESS of 30 kWh. The proposed algorithm showed a reduction in the building's power consumption during the period between 11:00 a.m. and 7:00 p.m. During that time, the output power from PV panels was enough to support part of the EV charging during their parking time. We noticed that power consumption during the remaining periods was similar to the initial building power consumption.

Scenario Four
Scenario four was an extension to scenario three, considering a system configuration with 100 EVs, a PV system of 30 kWh and an ESS of 50 kWh. The output power from the PV system was enough to decrease the building's power consumption during the period between 11:00 a.m. and 8:00 p.m., as shown in Figure 9. As the number of EVs had been doubled compared to scenario three, there was an increase in the building's power consumption at 9:00 a.m. Peak power consumption periods. Figure 8 shows the simulation result considering 50 EVs, a PV system of 10 kWh and an ESS of 30 kWh. The proposed algorithm showed a reduction in the building's power consumption during the period between 11:00 a.m. and 7:00 p.m. During that time, the output power from PV panels was enough to support part of the EV charging during their parking time. We noticed that power consumption during the remaining periods was similar to the initial building power consumption.

Scenario Four
Scenario four was an extension to scenario three, considering a system configuration with 100 EVs, a PV system of 30 kWh and an ESS of 50 kWh. The output power from the PV system was enough to decrease the building's power consumption during the period between 11:00 a.m. and 8:00 p.m., as shown in Figure 9. As the number of EVs had been doubled compared to scenario three, there was an increase in the building's power consumption at 9:00 a.m. Peak power consumption

Scenario Four
Scenario four was an extension to scenario three, considering a system configuration with 100 EVs, a PV system of 30 kWh and an ESS of 50 kWh. The output power from the PV system was enough to decrease the building's power consumption during the period between 11:00 a.m. and 8:00 p.m., as shown in Figure 9. As the number of EVs had been doubled compared to scenario three, there was an increase in the building's power consumption at 9:00 a.m. Peak power consumption was about 132 kW. This increase was due to the low charging costs during the mid-peak from 9:00 a.m. to 10:00 a.m.
was about 132 kW. This increase was due to the low charging costs during the mid-peak from 9:00 a.m. to 10:00 a.m.

Scenairo Five
We also considered a future scenario for the university building with a PV system of 50 kWh, an ESS of 80 kWh and a smart parking lot to support 150 EVs. The simulation results showed a great reduction in building power consumption during the period from 11:00 a.m. to 6:00 p.m., as shown in Figure 10. However, there was a small reduction in the power consumption during the period between 9:00 a.m. and 11:00 a.m.  Table 7 shows a comparison between different scenarios with respect to peak power consumption, charging/discharging costs and the number of EVs. The initial peak demand of the educational building was about 152 kW. Considering an uncontrolled charging scenario, there was a

Scenairo Five
We also considered a future scenario for the university building with a PV system of 50 kWh, an ESS of 80 kWh and a smart parking lot to support 150 EVs. The simulation results showed a great reduction in building power consumption during the period from 11:00 a.m. to 6:00 p.m., as shown in Figure 10. However, there was a small reduction in the power consumption during the period between 9:00 a.m. and 11:00 a.m. was about 132 kW. This increase was due to the low charging costs during the mid-peak from 9:00 a.m. to 10:00 a.m.

Scenairo Five
We also considered a future scenario for the university building with a PV system of 50 kWh, an ESS of 80 kWh and a smart parking lot to support 150 EVs. The simulation results showed a great reduction in building power consumption during the period from 11:00 a.m. to 6:00 p.m., as shown in Figure 10. However, there was a small reduction in the power consumption during the period between 9:00 a.m. and 11:00 a.m.  Table 7 shows a comparison between different scenarios with respect to peak power consumption, charging/discharging costs and the number of EVs. The initial peak demand of the educational building was about 152 kW. Considering an uncontrolled charging scenario, there was a  Table 7 shows a comparison between different scenarios with respect to peak power consumption, charging/discharging costs and the number of EVs. The initial peak demand of the educational building was about 152 kW. Considering an uncontrolled charging scenario, there was a significant increase in the peak power consumption of about 26.92% (208 kW). However, scheduling EV charging with the help of the PV system and the ESS gave an opportunity to decrease the building's peak power. The simulation results showed that peak load decreased by about 14.47% and the charging cost of EVs reduced from 202,294 KRW in scenario one to 74,319 KRW in scenario five.

Conclusions
Based on the increasing penetration rate of EVs, the charging load of EVs will have a significant effect on the total power consumption of the power grid. In this work, we proposed an optimal energy management scheme to charge or discharge EVs efficiently by considering V2B with RES and ESS. To evaluate the performance of the proposed algorithm, we selected our university building as a case study. The system consisted of an educational building with laboratories, a smart parking lot with 100 charging/discharging stations, PV panels, and an ESS. The simulation results showed that immediate charging had a severe impact on the building's power consumption. However, scheduling EV charging with the help of the PV system and the ESS was able to minimize the EVs charging cost while decreasing the on-peak load of the building's power consumption. This implies that the proposed algorithm could be applied to an energy management system for a microgrid such as commercial buildings, campuses and parking lots. As a future work, our scheduling algorithm will be extended to include the predicted power from the solar power system. In addition, we will consider the real data for the building's power consumption over a long period.

Conflicts of Interest:
The authors declare no conflicts of interest.

P grid
Grid supply power P building Building demand power P EV Charging/discharging power of EV P ESS Charging/discharging power of ESS P PV