**1. Introduction**

Electric vehicles (EVs) have gained popularity due to their emission free and fuel independence characteristics. Governments across the nations have established several schemes and organizations to facilitate the electrification process of roadway vehicles in terms of the technology, market, policy and finance. The efforts from numerous parties have successfully stimulated the deployment of the EV market. The recent Global EV Outlook report showed improved signs of EV adoption. In the

near future, the global EV stock is predicted to reach more than one hundred million by the year 2050 [1–5]. As a result, the anticipated large scale of EV charging will bring technical challenges to the power grid. Extensive studies on the harmful impacts of large scale EV charging on the power grid had been performed. The potential impacts include the overloading of power equipment, harmonics, voltage drop, voltage instability and power losses [6–16]. A review in [17] concluded that the main impact of EV integration into the power grid was the overloading issue, which further led to equipment overheating and rapid aging issues. Meanwhile, the grid power quality was assessed under various EV penetration and charging level scenarios in [18,19]. The results revealed that a large number of fast charging EVs would introduce serious voltage deviations and voltage instability problems.

EVs utilize relatively large capacity batteries as their energy source for the vehicle propulsion. Hence, the large scale of the grid-connected EVs can be considered as an enormous distributed energy storage in the power grid. Moreover, the potential of EVs to share energy with the power grid has created a new opportunity to improve the system reliability and sustainability. This concept, known as Vehicle-to-Grid (V2G) technology, was firstly introduced by Kempton and his research team in [20–24]. The authors proposed the adoption of V2G technology to improve the reliability of the power grid, as well as to facilitate the large scale integration of renewable energy [20]. The economic potential of EVs in providing energy support to the power grid was also studied by Kempton in [25]. The findings assured a significant revenue stream to the EV fleet for providing the V2G support. For a more accurate revenue estimation, the authors had developed a calculation model in [26] to evaluate the cost and profit in providing V2G support, mainly in the form of peak load shaving, spinning reserves and energy regulation services. Kempton and his research team also paid attention to the willingness of people to pay for EVs and their attributes in [27]. The research results suggested that EV cost needs to be reduced significantly in order to have higher EV adoption in the marketplace. Additionally, V2G management strategies and implementation steps were proposed in [28] to assist the transition of V2G technology.

The potential of the V2G concept has urged other research and development in the supporting technology for V2G application. The literature has presented many potential benefits for the power grid by adopting V2G technology. These benefits include peak load shaving, load levelling, grid voltage regulation, improvement in energy efficiency and mitigation of renewable energy intermittency [29–32]. For instance, a Vehicle-to-Home (V2H) concept was presented in [33], where EVs collaborated with the renewable energy in a smart home system to minimize the pollution, fossil fuel depletion and investment cost. In addition, a study in [34] utilized EVs to support the autonomous operation mode of microgrids. During the transition to separate from the power grid, the available EVs were used by the system frequency controller as a buffering feature to stabilize the microgrid operation.

Nevertheless, the V2G implementation requires frequent charging and discharging processes which can cause extra deterioration to the EV batteries [35]. This downside has created a strong social barrier that can prevent public support for the V2G concept. Hence, optimal V2G charging and discharging scheduling with compensated incentives given to the participating EV owners will be especially crucial for the realization of this technology. Research has been carried out to develop the optimal planning and scheduling for the proper V2G execution. The complexity in managing the large amount of energy exchange between the power grid and EVs represents a challenge for a power utility. The first logical step to implement the V2G technology was proposed in [36]. The proposed unidirectional spinning reserve V2G algorithm was able to modulate the EV charging rate according to a Preference Operating Point (POP), where the minimal preliminary investment and EV batteries degradation were achieved.

On the other hand, the bidirectional V2G technology has tremendous flexibility to accomplish the EV scheduling according to the preferences of the EV owners and power grid requirements. Many researchers have proposed EV scheduling that utilizes the Grid-to-Vehicle (G2V) and Vehicle-to-Grid (V2G) operations to help the power grid in achieving various benefits [37–39]. From the economic standpoint, the authors in [40,41] emphasized the maximization of power utility profit while

developing the V2G algorithm. Meanwhile, the minimization of power system losses is also a popular topic in the V2G application. In [42], EVs were used as reactive power resources to reduce the power grid energy losses. Furthermore, V2G technology was also utilized to maximize the renewable energy generation by solving the renewable energy intermittency issue [43,44]. Intelligent optimization algorithms were proposed by the authors in [45–47] to solve the renewable energy intermittency problem while maximizing the power grid energy efficiency.

Various optimal V2G scheduling strategies have been introduced in the literature to minimize the power grid load variance [48,49]. This concept is well known for its effectiveness in reducing power grid operation losses [50]. In general, this is achieved by enabling the grid-connected EVs to absorb the extra electricity during the power grid valley load period and feed the energy back to the power grid during the peak load period [51–54]. For instance, a V2G scheduling algorithm was proposed in [55] to perform power grid load shaving and valley filling operations using grid-connected EVs. The operation was achieved by regulating the power grid load at the target load pre-determined in the scheduling algorithm. A similar demand side management concept was adopted in [56], where considerable savings and emissions reduction were demonstrated by the results. Meanwhile, the authors in [57] proposed a peak shaving algorithm to reduce the peak demand of the power grid. The application of this algorithm has shown good potential in extending the lifespan of transformers, as well as maintaining a healthy grid operation voltage profile. Another peak shaving strategy was introduced in [58,59], which provided dynamic adjustments in EVs discharging rate without affecting the battery usage for EV traveling purpose. This strategy limited the maximum load demand by utilizing the extra energy in the grid-connected EVs for power grid support. In these literatures, many of the proposed V2G scheduling for power grid load variance minimization utilized a preset target loading in the scheduling algorithm. Nevertheless, most of the related studies have not discussed the methodology used in determining these targets. Inaccurate setting of this target loading will reduce the effectiveness of the V2G algorithm to achieve the minimization of load variance. The selection of this target loading can be a challenging task, as the power grid and grid-connected EVs are dynamic in nature. Thus, this paper will focus on the development of a V2G optimization algorithm, as well as analyzing the influence of different target load curves on the performance of the proposed algorithm.

This paper presents a G2V/V2G optimization algorithm, which is focused on the minimization of grid load variance by performing load levelling and peak load shaving using the available grid-connected EVs. During the event where the actual power grid loading is lower than the target loading, EVs are allowed to receive charging power from the power grid. This G2V operation falls under the load leveling scenario. Meanwhile, when the actual power grid loading is larger than the target loading, EVs are encouraged to discharge for power grid support. This V2G operation is called the peak load shaving scenario. In general, this paper will present the proposed algorithm, which consists of G2V and V2G operations as the V2G optimization algorithm. The V2G algorithm instructs EV charging and discharging operations according to the proposed objective function with the aim of minimizing the difference between the actual power grid loading and target loading. The V2G optimization algorithm includes thorough consideration of both power grid and EV constraints. The algorithm can also deliberate the V2G scheduling by considering the uncertain mobility characteristics of EVs, which have random initial State of Charge (SOC) and grid connection duration, as well as the dynamic grid connection probability. In addition, extensive analyses are conducted to investigate the effect of different target load curves and various average initial SOC of EV batteries on the performance of the proposed V2G optimization algorithm. A performance index was introduced to compare and evaluate the success rate of each optimized scenario. Then, a proper selection of the V2G target load curve based on the average initial SOC of the available grid-connected EV batteries is recommended. In summary, the contributions of this paper include: (i) the development of a V2G optimization algorithm to minimize grid load variance via peak load shaving and load levelling, and (ii) a performance analysis of the proposed V2G optimization under various target load and average initial SOC of EV batteries.

The rest of the paper is organized into sections. Section 2 describes the power grid model for the implementation of V2G optimization algorithm. In Section 3, the detailed formulation of the objective function, constraints and optimization algorithm are presented. The simulation results to validate the effectiveness of the proposed V2G optimization algorithm are discussed in Section 4. Section 5 concludes the paper.
