A New Two-Stage Approach to Coordinate Electrical Vehicles for Satisfaction of Grid and Customer Requirements

Recently due to air pollution concerns, a large number of electric vehicles have been integrated into the electric distribution system. However, the uncoordinated charging of this technology can cause different voltage issues. This paper proposes a two-stage optimization approach with active and reactive power control to coordinate electric vehicles with both grid-to-vehicle and vehicle-to-grid capabilities to satisfy both grid requirements and electric vehicle prosumer requirements. The system requirements considered are voltage deviation and unbalance and the electric vehicle prosumer requirements considered are minimization of charging and battery degradation costs. The coordination problem is formulated as an optimization problem, where the first stage objectives are: minimization of voltage unbalance, customer charging and battery degradation costs. The first stage optimization problem is solved using the meta-heuristic optimization algorithm known as particle swarm optimization to obtain an optimized real power schedule for the electric vehicles. The second stage is then solved of which the objective is to minimize the bus voltage deviation and provides the reactive power schedule for electric vehicles. All the analyses were carried out on the IEEE 34 bus distribution system and the study results show that the proposed method allows prosumers to charge at a minimum cost without any grid voltage unbalance factors and under/over voltage problems under different scenarios. Thus, this work can be beneficial for system operators or electric vehicle aggregators to create a day-ahead schedule.


Introduction
Recently, CO 2 emission has been a major public concern due to its serious environmental impact, of which major sources are industries and the fossil fuel-dependent transportation sector. The electric vehicle (EV) is an empirically-proven technology that can alleviate dependency on the excessive use of oil and can help to decrease CO 2 intensity and gasoline consumption [1]. Consequently, there is a growing trend in many countries, especially in residential and commercial areas, for the use of EVs [2]. However, the increasing number of EVs cause a high demand for electricity, which can have detrimental impacts on existing power systems.
In the uncoordinated charging of EVs, customers arrive at their homes in the evening and start to charge their vehicles immediately, which may cause different issues, such as transformer ageing [3], load unbalance in the residential area due to use of single-phase AC charger [4][5][6], power quality, peak loading, frequency stability issues, etc.
There have been a number of studies that try to schedule/manage time charging/ discharging of EVs properly to avoid these problems and is commonly known as smart  [30] --- [31] ---- [32] --- [33] ---- [34] -- [35] --- [36] --- [37] --- [38] ----Proposed Method Thus, this paper tries to address the research gaps outlined in the paragraphs above. It proposes a two-stage strategy to mitigate different electrical issues, such as VUF, voltage deviation, and prosumer costs, using V2G technology. The two-stage problem is formulated as an optimization problem and is solved using a meta-heuristic optimization algorithm, particle swarm optimization (PSO). The first stage targets the problem of VUF and customer costs by scheduling EV charging and the second stage targets voltage deviation with the help of reactive power injection from EVs. Thus, the major contributions of this paper are as follows: 1.
The development of a framework to fulfill grid requirements, such as voltage unbalance factors, voltage deviations, and prosumer requirements, such as charging cost and battery health, using V2G technology.

2.
Consideration of different scenarios, such as a change in load profile, penetration level, and price changes, have also been considered. Furthermore, this study also conducts a detailed comparison of the proposed method with other recent approaches.

3.
Presentation of a method to solve the proposed method with real-time data exchange between DIgSILENT and MATLAB.
This paper is organized as follows: Section 2 provides a brief discussion of the proposed method, followed by the formulation of the optimization problem in Section 3. Section 4 discusses the application of PSO to solve the proposed optimization problem, followed by results and a discussion in Section 5. The conclusions of our study are presented in Section 6. Figure 1 shows a pictorial description of a possible application of the proposed method by both the aggregator and the distribution system operator (DSO). The DSO provides a day-ahead load forecast and grid requirements (voltage deviation, VUF in this paper) to the aggregator and the aggregator collects the possible arrival and departure times of EVs. The aggregator can then provide all this information to the proposed method, which will then provide an optimized schedule of EVs to satisfy both grid and customer benefits.  A plot of the proposed method to coordinate EVs is shown in Figure 2 and a brief description of this process is as follows:

Description of the Proposed Method
(i). The first step requires the preparation of the data of EV-user behaviors, e.g., plug-in time, plug-out time, daily distance, initial SOC, wear costs, information of the test systems, such as the residential baseload, dynamic price, and significant parameters of the PSO optimization algorithm. (ii). Stage 1 uses the input data from the previous step for further processing and formulates an optimization problem in which the objectives are to minimize VUF, EV charging costs, and battery degradation costs. This optimization problem is then solved using the PSO. The output from Stage 1 provides an optimized power schedule for charging (G2V)/discharging (V2G) as well as the best costs for customers. (iii). Once the electrical schedule for EVs is obtained, Stage 2 will use this information to formulate another optimization problem with the purpose of minimizing voltage deviation. The constraint to this optimization is the reactive power capability of V2Gs, which can be produced/absorbed by controlling the inverter [39,40]. Moreover, the reactive power compensation from EVs will not cause any degradation to the battery [41,42]. Thus, Stage 2 provides a reactive power schedule for EVs.

Optimization Problem Formulation
This section discusses the formulation of the optimization problem to mitigate different electrical problems, such as voltage unbalance factors and voltage deviations, minimization of customer charging, and battery degradation costs.

Objective Function
Voltage unbalance is given by Equation (1) and the goal is to minimize this quantity according to the IEEE standard [43] by controlling the active/reactive power from EVs.
The minimization of F 1 will reduce the VUF of the network.

Voltage Deviation
The second objective of the proposed approach is to minimize the voltage deviation between the actual and desired voltage values. This can also be controlled by charging/discharging of the active and reactive power from EVs.
The minimization of F 2 will help to keep the bus voltages closer to the desired values.

Customer Costs
A major objective from the customer perspective is to minimize charging costs and maximize discharging intervals. However, battery life will deteriorate if there is excessive discharging, and so this price (w p ) must be included in the optimization problem and is calculated using the method described in [44]. The objective functions for customers are given by Equations (3) and (4).
The minimization of F 3 will reduce the charging costs by managing charging/discharging in proper time.
The minimization of F 4 will help customers to decrease the battery degradation costs.

Constraints
All the objective functions given by Equations (1)-(4) are subject to several constraints. Equation (5) ensures that the number of EVs charging and discharging does not exceed the total number of EVs in the system. Equations (6) and (7) control EV charging and discharging, and Equations (8) and (9) ensure that EVs will not charge and discharge at the same time.
N Chg + N Dchg = N total (5) x Chg,i P ChgMin ≤ P Chg,i ≤ x Chg,i P ChgMax (6) x Dchg,i P DchgMin ≤ P Dchg,i ≤ x Dchg,i P DchgMax x Chg,i ∈ (0, 1) (8) x Dchg,i ∈ (0, 1) The constraints for the maximum efficiency of charging and discharging are presented in Equations (10) and (11), respectively. Equation (12) computes the maximum amount of available reactive power exchange from an EV, which is taken as 58% of the maximum rated power of EVs in this study [39,45]. Equation (13) defines the range of the reactive power discharge.
Equations (14)-(16) calculate the SOC values and helps them to be in the customer desired range.

Application of PSO to Solve the Proposed Optimization Problem
Meta-heuristic optimization algorithms are highly popular for solving complex, nonlinear, and non-convex optimization problems. Particle swarm optimization (PSO) is one such popular meta-heuristic optimization algorithm and is based on swarm-intelligence, which is popularly used to obtain a global solution for several problems [46]. PSO uses the position and velocity of swarms to find a global solution. Thus, it was chosen to solve the proposed optimization problem formulated in the previous section of this paper.
The proposed method is used for minimizing four objective functions (VUF, VD, CC, BC). A high penetration with different phase connections can cause voltage unbalance and voltage deviations. The proposed method is separated into two stages, where the first stage aims to minimize voltage unbalance, charging costs, and battery degradation costs by using active power as a decision variable. The second stage aims only to minimize voltage deviation by obtaining the optimal active power to calculate the proportional reactive power, which is the decision variable of the second stage. The advantage of dealing with voltage deviation in the second stage is to avoid overvoltage occurring in some time intervals if it is located in first stage, and it is able to improve positive sequence voltage, which reduces voltage deviation, as well as VUF, according to Equation (6). Another advantage is that decreasing the objectives in the first stage decreases complicated searching of global optimal solution.
The major steps of the proposed method are shown in Figure 3 and are as follows: Step 1: Specification of the total number of iterations, population size, and hours (h).
Step 2: Random initialization of the particle position according to the population size in each bus that connects to EVs.
Step 3: Find the position of P EV,i at j + 1 iteration P j+1 EV,i and velocity of the P j+1 EV,i at Step 4: Calculate the fitness values for the Stage I objective functions given by Equations (1), (3), and (4). The weight sum method is used to combine the multiple objectives into a single one.
This process utilizes DIgSILENT software to run the unbalance load flow and obtain the value of the fitness function.
Step 5: PSO will then compare the obtained fitness with the global best solution. The global best solution is changed if the local best solution is better.
Step 6: Continue until a maximum number of iterations is reached.
Step 7: Proceed to the second stage and initialize the constraints according to the population size for each bus, which has EVs, using Equation (23) when EVs are charging and discharging.
Step 8: Find the position of the particle at j + 1 iteration Q j+1 EV,i and velocity of the Step 9: Compute the fitness function by solving Equation (6). This step utilizes DIgSILENT software.
Step 10: Find the best current and global solution.
Step 11: Continue until a maximum number of iterations is reached.
Step 13: Increase the hours and stop when the maximum hour is reached.
Step 14: Generate the final schedule for the EVs.

Description of the Test System
This study uses the IEEE 34 distribution system as the test system. The EVs are added randomly at buses 816, 824, 854, 842, and 846, as shown in Figure 1. The residential load profile for this study is taken from [47] and the charging/discharging price is taken from [48]. This study assumes all EVs are a Nissan Leaf model, and the battery size and the range under full charge are 24 kWh and 170 km, respectively [49]. A Board Level II Type charger is assumed to be used in this study. This is a single-phase AC IEC 61851-1 standard charger that connects to AC with a rating of 240 V and 32 A [50]. The driving behavior is generated randomly for all EV users based on data from [51]. The arrival/departure times ( Figure 4) are randomly generated from [34]. Moreover, a daily distance of around 40-75 km a day is used to calculate the initial state of charge given by Equation (26) and is also shown in Figure 5. Different EV penetration levels have been used for this study, and the details are given in Table 2.   The proposed method is analyzed under three different scenarios: case study when EV penetration varies from 30% to 100% (Table 2), case study when there are different price signals according to seasons (Figure 6), and case study when there are different load profiles according to weekdays and weekends ( Figure 7). Furthermore, we also compared the performance of the proposed method to four other methods.
Uncontrolled Charging: EV charging when the users arrives (the arrival time is assigned randomly from 5:00 p.m. to 12:00 a.m., as shown in Figure 4).
Randomly as: Method 1: CC, VUF, VD with P-V2G (both system and customer objectives) [     The proposed method is analyzed under three different scenarios: case study when EV penetration varies from 30% to 100% (Table 2), case study when there are different price signals according to seasons (Figure 6), and case study when there are different load profiles according to weekdays and weekends ( Figure 7). Furthermore, we also compared the performance of the proposed method to four other methods.
Uncontrolled Charging: EV charging when the users arrives (the arrival time is assigned randomly from 5:00 p.m. to 12:00 a.m., as shown in Figure 4).
Randomly as: Method 1: CC, VUF, VD with P-V2G (both system and customer objectives) [29,30]   The proposed method is analyzed under three different scenarios: case study when EV penetration varies from 30% to 100% (Table 2), case study when there are different price signals according to seasons (Figure 6), and case study when there are different load profiles according to weekdays and weekends ( Figure 7). Furthermore, we also compared the performance of the proposed method to four other methods. lation parameters for the constraints and PSO used in this study, respectively.

Case Study under Different EV Penetration Levels
This case study analyzes the performance of different methods for different penetration levels. At 30% penetration, we can observe from Figure 8a that the proposed method activates the V2G mode during the peak period and starts charging during the off-peak period. Similarly, the reactive power discharge with the proposed method can be seen in Figure 8b. Figure 9a shows that there is a severe undervoltage problem with uncoordinated charging during peak load conditions, whereas the system voltage is close to the desired limit with the proposed method. We can observe from Figure 9b that the VUF lies under 2% for all methods except Method 1.   Tables 3 and 4 show the simulation parameters for the constraints and PSO used in this study, respectively.   Figure 8a that the proposed method activates the V2G mode during the peak period and starts charging during the off-peak period. Similarly, the reactive power discharge with the proposed method can be seen in Figure 8b. Figure 9a shows that there is a severe undervoltage problem with uncoordinated charging during peak load conditions, whereas the system voltage is close to the desired limit with the proposed method. We can observe from Figure 9b that the VUF lies under 2% for all methods except Method 1.   Figure 10a shows the result for 50% penetration; it can be seen that Methods 1 and 3 are unable to maintain the voltage level near the prescribed limit (±5%) for this case study. The other methods, however, can keep the bus voltage at the prescribed limits. The plot of VUF, as shown by Figure 10b, shows that the VUF also lies within the prescribed limit of the proposed method for this case study. At 75% penetration, the bus voltage profile is improved for most methods, but lies closest to the desired voltage with the proposed method, as shown by Figure 11a. The plot of VUF as given by Figure 11b shows that the VUF exceeds the 2% limit with other methods but it lies within the limits for the proposed method.  Figure 12a,b shows the plots of the bus voltage and VUF at a 100% penetration level. It can be seen from the figures that both the bus voltage and the VUF also lie within the prescribed limits using the proposed method compared to other methods. Figure 13 shows that the final SOC lies within the desired limits for customers with the application of the proposed method.

Case Study under Different Price Signals
This scenario considers analysis under different price signals. Three price signals corresponding to three different seasons (winter, summer, and spring on weekdays) have been considered for the analysis. An EV penetration of 100% is assumed for this scenario as it represents the worst-case scenario based on the results obtained in the previous section. Figure 14a,b shows the active and reactive power schedules obtained using different methods. The plot given in Figure 15a, shows that the bus voltage lies well below the prescribed limit with uncoordinated charging. However, the voltage profile improves with Method 1 and is nearest to the prescribed limit with the proposed method. The plot of VUF as shown by Figure 15b shows that the VUF is worse with Method 2 but lies within the limit for the other methods. A similar inference can also be made from Figures 16 and 17 regarding voltage and VUF for other seasonal price variations. Figure 18a-c shows that the total costs for the winter, summer, and spring seasons are lowest with the proposed method, but the battery degradation costs are a little bit expensive with the proposed method. However, the revenue savings from the charging costs and the reward from V2G far outweigh the battery degradation costs with the proposed method.     Figure 18a-c shows that the total costs for the winter, summer, and spring seasons are lowest with the proposed method, but the battery degradation costs are a little bit expensive with the proposed method. However, the revenue savings from the charging costs and the reward from V2G far outweigh the battery degradation costs with the proposed method.
We can observe from Table 5 that the total cost is lowest with the proposed method compared to the other methods and the VUF and voltage also lie within the prescribed limits for this scenario.  We can observe from Table 5 that the total cost is lowest with the proposed method compared to the other methods and the VUF and voltage also lie within the prescribed limits for this scenario.

Case Study under Weekend Load Profile
This scenario considers an analysis of the weekend load profile for domestic consumers (Figure 7). From the previous case study, it can be assumed that the proposed method is able to provide VUF, voltage in prescribed limits with the lowest total cost. Figure 19a,b shows the active and reactive power schedule obtained using different methods under this scenario, and it can be seen that the proposed method charges and discharges less under peak load hours. The plot of the bus voltage as given by Figure 20a shows that the bus voltage lies well below the prescribed limit with uncoordinated charging. However, the voltage profile is nearest to the prescribed limit with the proposed method for this case study as well. The VUF, as shown by Figure 20b, shows that the VUF lies within limits with the proposed method, for both weekdays and weekends.   Figure 21a shows that the proposed method is able to provide the lowest total cost for weekdays/weekends for different residential power demands, which can also be inferred from the results in Table 6. Figure 21b shows that the final SOC lies within the prescribed limits for weekends with the application of the proposed method.

Discussion
The results from the case study under different EV penetration levels show that the voltage deviation problem gets worse when EV penetration ranges from 30% to 100% in uncoordinated charging, and the voltage unbalance problem get worse when EV penetration ranges from 75% to 100% with uncoordinated charging. The results show that all of these problems are reduced with the proposed method and that the final desired SOC is maintained.
In the case study under different EV price signals, the impact of voltage deviation and the voltage unbalance problem is worst with uncoordinated charging. The proposed method schedules times for charging/discharging of both the active power and reactive power of EVs in such a manner that it largely improves voltage profile and reduces VUF with customer benefits compared to the uncoordinated charging.
In the case study under a weekend load profile, the voltage unbalance problem does not occur with uncoordinated charging but the bus voltage is below the desired limit. The proposed method is capable of scheduling EVs to improve both the system and customer requirements.
However, battery degradation costs with the proposed method, in all case studies, are a bit higher than with uncoordinated charging, Method 2, Method 3, and Method 4, but the benefits from the total costs are better with proposed method, which helps to outweigh this drawback.
Method 2 is exclusively designed to minimize the charging costs and battery degradation costs and thus the total cost is the second lowest after the proposed method. However, as the researchers do not control VUF, its value is high compared to other methods for all seasons. This shows that EVs with V2G have to consider VUF failure, which can lead to deterioration of the system. This study shows that battery degradation has little impact on voltage deviation. However, it is an important objective to consider as it directly affects battery lifetime.

Conclusions
This paper proposes a two-stage approach to schedule EV charging with both G2V and V2G capabilities to improve grid voltage, reduce VUF, and reduce prosumer charging costs.
Our study yielded the following findings: (i). The proposed method provides the lowest cost for customers to charge/discharge their EVs compared with other existing methods for all the scenarios considered in this study. For the summer season, the total cost using the proposed method is around 1.515 times lower than uncontrolled charging and 1.206 times lower than the result obtained using the method which provided the least cost next to the proposed method. A similar trend was seen for other scenarios considered in this study. (ii). The battery degradation costs with the proposed method are around 1.756 times lower than This study is limited to only main two grid requirements, namely VUF and voltage deviation; however, there are many other grid requirements, such as minimization of loss, maximization of reliability, stability improvement, reactive power pricing, etc. Thus, this work can be extended to consider these objectives. Thus, our future work will use multi-objective optimization, such as NSGA-III, to coordinate EVs while considering many objectives. Acknowledgments: The authors would like to express thanks for the Petchra Pra Jom Klao research scholarship, funded by the King Mongkut's University of Technology, Thonburi, for the support.

Conflicts of Interest:
The authors declare no conflict of interest. Local best for PSO P ChgMax , P DchgMax Maximum power charging/discharging (kW) P Chg,i , P Dchg,i Individual EVs charging/discharging (kW) P EV_Chg(n,t)

Nomenclature
Power charging at node n (kW) P EV_Dchg(n,t) Power discharging at node n (kW) P i,t , P d,i,t Active power supply and demand of bus i at time t (kW) Q DchgMax,i Maximum individual reactive power discharging (kVar) Q Dchg,i Individual reactive power discharging (kVar) Q i,t , Q d,i,t Reactive power supply and demand of bus i at time t (kVar) rand 1