Cost Consensus Algorithm Applications for EV Charging Station Participating in AGC of Interconnected Power Grid

: In order to more e ﬀ ectively reduce the regulation costs of power grids and to improve the automatic generation control (AGC) performance, an optimization mathematical model of generation command dispatch for AGC with an electric vehicle (EV) charging station is proposed in this paper, in which a cost consensus algorithm for AGC is adopted. Particularly, virtual consensus variables are applied to exchange information among di ﬀ erent AGC units. At the same time, the actual consensus variables are utilized to determine the generation command, upon which the ﬂexibility of the proposed algorithm can be signiﬁcantly enhanced. Furthermore, the implement feasibility of such an algorithm is veriﬁed through a series simulation experiments on the Hainan power grid in southern China, where the results demonstrate that the proposed algorithm can e ﬀ ectively realize an autonomous frequency regulation of EVs participating in AGC.


Introduction
Power system frequency stability is an important indicator of the power system quality and safety [1,2], upon which power system frequency regulation is mainly achieved by automatic generation control (AGC), which can guarantee satisfactory frequency quality and safe operation of the electric power system by maintaining the real-time balance between power generation and loads of the electric power system. Besides, with large-scale intermittent energy such as wind energy [3] being connected to the power grid, higher requirements for frequency regulation [4] and spinning reserve capacity are in urgent need to balance the unexpected power disturbance [5] to alleviate power quality problems [6] and ensure the power systems can operate under a safe and economical condition [7]. Hence, the intermittent energy can be operated at their maximum power point [8] most of the time by various control techniques [9]. In particular, when numerous electric vehicles (EVs) are connected to the power grid, that is, vehicle to grid (V2G), the utilization of EVs to provide auxiliary services such as frequency regulation for power system will be a popular research topic.
With the decrease of battery equipment costs, the advancement of charging and discharging technology, the gradual improvement of charging infrastructure, and the successive issuance of government supporting policies, the growth of EVs has become an inevitable trend that has aroused widespread attention [10]. Moreover, when numerous EVs are connected to the power grid, they are algorithm [30] was proposed. Hence, the decentralized autonomous problem of AGC power allocation in interconnected power grid can be effectively solved, while EV is not involved as distributed generators to participate in the system frequency regulation. Particularly, a consensus algorithm can make the variables to reach a consensus through the cooperation between agents and adjacent agents in a multi-agent network, which has been widely used in formation control, unmanned aerial vehicle (UAV) control [31], cluster [32], robot swarm navigation [33], and stable flocking [34]. Hence, this paper applies the consensus algorithm to the AGC power allocation for each EV charging station. In order to avoid battery over-charging or over-discharging and to prolong the lifespan of the battery, a proportional allocation method based on SOC [21] is adopted to solve the AGC power redistribution. Finally, the model of the Hainan power grid in south China is utilized to evaluate the specific performance of the proposed method. Compared with the previous works, the main novelty of this paper can be summarized as follows: Appl. Sci. 2019, 9, x FOR PEER REVIEW 3 of 19 allocation in interconnected power grid can be effectively solved, while EV is not involved as distributed generators to participate in the system frequency regulation. Particularly, a consensus algorithm can make the variables to reach a consensus through the cooperation between agents and adjacent agents in a multi-agent network, which has been widely used in formation control, unmanned aerial vehicle (UAV) control [31], cluster [32], robot swarm navigation [33], and stable flocking [34]. Hence, this paper applies the consensus algorithm to the AGC power allocation for each EV charging station. In order to avoid battery over-charging or over-discharging and to prolong the lifespan of the battery, a proportional allocation method based on SOC [21] is adopted to solve the AGC power redistribution. Finally, the model of the Hainan power grid in south China is utilized to evaluate the specific performance of the proposed method. Compared with the previous works, the main novelty of this paper can be summarized as follows:  The traditional AGC power allocation is implemented among the thermal and hydro power plants in a centralized manner. In contrast, this paper provides a framework of AGC power allocation with EV, while the control command of each EV charging station can be calculated in a decentralized way.
 The cost consensus algorithm is designed for the distributed AGC power allocation among multiple EV charging stations, which can effectively reduce the total adjustment cost via a deep collaboration between local adjacent EV charging stations.
The rest of this paper is organized as follows. The framework and mathematical modelling of AGC power dynamic allocation with EV charging stations are introduced in Section 2. The AGC power allocation strategy of charging stations based on consensus algorithm is developed and analyzed in Section 3. Comprehensive case studies and simulation results are demonstrated in Section 4. Lastly, the conclusions are illustrated in Section 5.

Auxiliary Frequency Regulation Architecture of EV Charging Station
In general, various operations are undertaken in the power grid to balance the dynamic power disturbance, such as the load-damping and generator inertia, primary frequency control, and secondary frequency control. Particularly, the first two operations generally execute within a second, while AGC usually refers to the secondary frequency control with the time cycle from 1 to 16 seconds [35]. Besides, the load frequency control (LFC) consists of the primary frequency control and the secondary frequency control. The framework of AGC power dynamic allocation with EV charging stations is demonstrated in Figure 1, which mainly consists of a dispatching center, EV centralized control center, EV charging station, and EV batteries.
The traditional AGC power allocation is implemented among the thermal and hydro power plants in a centralized manner. In contrast, this paper provides a framework of AGC power allocation with EV, while the control command of each EV charging station can be calculated in a decentralized way.
Appl. Sci. 2019, 9, x FOR PEER REVIEW 3 of 19 allocation in interconnected power grid can be effectively solved, while EV is not involved as distributed generators to participate in the system frequency regulation. Particularly, a consensus algorithm can make the variables to reach a consensus through the cooperation between agents and adjacent agents in a multi-agent network, which has been widely used in formation control, unmanned aerial vehicle (UAV) control [31], cluster [32], robot swarm navigation [33], and stable flocking [34]. Hence, this paper applies the consensus algorithm to the AGC power allocation for each EV charging station. In order to avoid battery over-charging or over-discharging and to prolong the lifespan of the battery, a proportional allocation method based on SOC [21] is adopted to solve the AGC power redistribution. Finally, the model of the Hainan power grid in south China is utilized to evaluate the specific performance of the proposed method. Compared with the previous works, the main novelty of this paper can be summarized as follows:  The traditional AGC power allocation is implemented among the thermal and hydro power plants in a centralized manner. In contrast, this paper provides a framework of AGC power allocation with EV, while the control command of each EV charging station can be calculated in a decentralized way.  The cost consensus algorithm is designed for the distributed AGC power allocation among multiple EV charging stations, which can effectively reduce the total adjustment cost via a deep collaboration between local adjacent EV charging stations. The rest of this paper is organized as follows. The framework and mathematical modelling of AGC power dynamic allocation with EV charging stations are introduced in Section 2. The AGC power allocation strategy of charging stations based on consensus algorithm is developed and analyzed in Section 3. Comprehensive case studies and simulation results are demonstrated in Section 4. Lastly, the conclusions are illustrated in Section 5.

Auxiliary Frequency Regulation Architecture of EV Charging Station
In general, various operations are undertaken in the power grid to balance the dynamic power disturbance, such as the load-damping and generator inertia, primary frequency control, and secondary frequency control. Particularly, the first two operations generally execute within a second, while AGC usually refers to the secondary frequency control with the time cycle from 1 to 16 seconds [35]. Besides, the load frequency control (LFC) consists of the primary frequency control and the secondary frequency control. The framework of AGC power dynamic allocation with EV charging stations is demonstrated in Figure 1, which mainly consists of a dispatching center, EV centralized control center, EV charging station, and EV batteries.
The cost consensus algorithm is designed for the distributed AGC power allocation among multiple EV charging stations, which can effectively reduce the total adjustment cost via a deep collaboration between local adjacent EV charging stations.
The rest of this paper is organized as follows. The framework and mathematical modelling of AGC power dynamic allocation with EV charging stations are introduced in Section 2. The AGC power allocation strategy of charging stations based on consensus algorithm is developed and analyzed in Section 3. Comprehensive case studies and simulation results are demonstrated in Section 4. Lastly, the conclusions are illustrated in Section 5.

Auxiliary Frequency Regulation Architecture of EV Charging Station
In general, various operations are undertaken in the power grid to balance the dynamic power disturbance, such as the load-damping and generator inertia, primary frequency control, and secondary frequency control. Particularly, the first two operations generally execute within a second, while AGC usually refers to the secondary frequency control with the time cycle from 1 to 16 seconds [35]. Besides, the load frequency control (LFC) consists of the primary frequency control and the secondary frequency control. The framework of AGC power dynamic allocation with EV charging stations is demonstrated in Figure 1, which mainly consists of a dispatching center, EV centralized control center, EV charging station, and EV batteries.
The main responsibilities of the dispatching center are to collect the frequency deviation and tie-line power deviation of power systems, calculate the total power generation command ∆P , and assign ∆P to AGC power supply units and EV centralized control centers via some certain algorithms.
The centralized EV control center acts as the interaction bridge, which ensures the two-way energy flow between EVs and the power grid [36]. Basically, it uploads the information of each EV charging station, for example, the price of unit-adjusted electricity and real-time adjustable capacity of each EV charging station, to the dispatching center. Besides, it assigns the total power instruction ∆P EV issued by the dispatching center to each EV charging power station. However, consider that the EV charging stations under the electricity market belong to different agents, and the price of unit-adjusted electricity is different when participating in the power system frequency regulation. Hence, on the basis of power grid company benefits, some AGC power allocation strategies should be adopted among different EV charging stations to minimize the regulation costs of the power grid company.
An EV charging station can be regarded as an EV agent, which can implement cluster dispatching to large-scale EV batteries to meet the demand of power grid frequency regulation capacity. Under such circumstances, an EV will be preferable to participate in AGC ancillary service if its charging demand can be completely satisfied after the ancillary service period [32]. Hence, each EV should upload its maximum charging power, initial battery state of charge (SOC), expected SOC, connecting time, expected exit time, charging efficiency, and energy capability to the control center of EV charging stations. On the other hand, the control center of the EV charging station allocates the power instructions issued by the centralized control center of EV to each EV battery based on the information of EV batteries such as the charged state and adjustable capacity. The main responsibilities of the dispatching center are to collect the frequency deviation and tieline power deviation of power systems, calculate the total power generation command ∆ ∑ , and assign ∆ ∑ to AGC power supply units and EV centralized control centers via some certain algorithms.
The centralized EV control center acts as the interaction bridge, which ensures the two-way energy flow between EVs and the power grid [36]. Basically, it uploads the information of each EV charging station, for example, the price of unit-adjusted electricity and real-time adjustable capacity of each EV charging station, to the dispatching center. Besides, it assigns the total power instruction ΔPEV issued by the dispatching center to each EV charging power station. However, consider that the EV charging stations under the electricity market belong to different agents, and the price of unitadjusted electricity is different when participating in the power system frequency regulation. Hence, on the basis of power grid company benefits, some AGC power allocation strategies should be adopted among different EV charging stations to minimize the regulation costs of the power grid company.
An EV charging station can be regarded as an EV agent, which can implement cluster dispatching to large-scale EV batteries to meet the demand of power grid frequency regulation capacity. Under such circumstances, an EV will be preferable to participate in AGC ancillary service if its charging demand can be completely satisfied after the ancillary service period [32]. Hence, each EV should upload its maximum charging power, initial battery state of charge (SOC), expected SOC, connecting time, expected exit time, charging efficiency, and energy capability to the control center

The Mathematical Model of AGC Power Dynamic Allocation with EV Charging Stations
Under the framework of auxiliary frequency regulation of EV charging stations, the regulation cost target is considered in AGC power allocation with EV charging stations. Particularly, it aims to distribute the total generation command of the EV centralized control center among all the EV charging stations. Moreover, the dynamic regulation features of all EVs are similar for AGC, as they can regulate their power outputs with a much faster response speed than the traditional thermal or hydro units. Hence, the objective function only regards the cost as the cost coefficient is the main difference between different EVs, which can be expressed as follows: where f represents the total regulation cost target of the EV participating the frequency regulation; C iw means the regulation cost coefficient of the wth battery of the ith EV charging station, which is the main parameter of each station; ∆P iw is the power generation instruction assigned to the wth EV battery of the ith EV charging station, which is also the decision variable; i represents the number of EV charging stations; W i represents the total number of EV batteries of the ith EV charging station; and n is the number of charging stations.
To minimize the total regulation cost, the AGC power dynamic allocation should simultaneously satisfy various operation constraints, as follows: (1) Power balance constraint: the total generation command should be balanced by all the charging stations, while the generation commands of each charging station should be equal to the sum of generation command of its controlled individual EVs, as follows: where ∆P EV denotes the general power generation instruction issued by the power grid dispatching center sent to the EV centralized control center; and ∆P i represents the power generation instruction of the ith EV charging station, which is also the decision variable.
(2) Regulation direction constraint: the regulation direction of each charging station should be consistent with the total generation command, as follows: (3) Capacity constraint: both the regulation power and the SOC of each EV should be limited within their lower and upper bounds, and the direction of each charging station should be consistent with the total generation command, as follows: where ∆P max iw and ∆P min iw denote the upper and lower limit, respectively, of the regulating capacity of the wth EV battery in the ith EV charging station, which are the known parameters; SOC max iw and SOC min iw are the upper and lower limit constraints, respectively, of the wth EV battery in the ith EV charging station allowed to participate the frequency regulation, which are the known parameters.
Under the framework of real-time dispatching of a power system that involves EV charging stations, the charging stations participate in power system frequency regulation with the expectation of obtaining certain benefits. Basically, according to the expected income and related costs of EV participation in power system frequency regulation, the open trading platform will be used to declare the price of unit adjustment electricity when the EV load participates in power system frequency regulation, which will be used to negotiate with the power grid dispatching center [37]. Under such circumstances, the power station acts as the seller of the frequency regulation service, while the dispatching center is regarded as the buyer. The buyer and seller are consentaneous to determine the transaction price and quantity via a one-to-one negotiation or one-to-many negotiation. After a successful negotiation, the buyer and seller need to sign the frequency regulation contract, in which the price of frequency regulation in the contract is the adjustment cost coefficient of the charging station, which is influenced by the frequency regulation capacity income, reverse discharge energy income, charging cost, and battery loss cost of charging stations. Moreover, the adjustment cost coefficient reduces with the increasing of frequency regulation capacity and reverse discharge energy income of charging stations, while the adjustment cost coefficient decreases with the decreasing of charging cost and battery loss cost of charging stations.
When a load disturbance occurs, in order to make the EV charging stations with lower regulation cost receive more active power insufficiency or surplus, the regulation cost is selected as the consensus state variable among EV charging stations. Besides, the power allocation algorithm with no leader and power deviation sharing mode is adopted. In order to avoid battery over-charging or over-discharging to reduce the influence on the lifespan of batteries, the SOC proportional allocation method is used to allocate the total power command of the EV charging station to each EV battery.

Consensus Algorithm
A consensus algorithm is a decentralized control method that is mainly applied on multi-agents, which can cause the consensus state variables of the network to tend to be consentaneous through information interaction among intelligent agents. Particularly, considering that the communication among the agents needs a certain amount of time, the first order discrete consensus algorithm is adopted in this paper, while its iteration formula can be obtained as follows: where x i represents the information state of the ith agent; k denotes a discrete time series; and d ij [k] means the (i, j) element of row random matrix D = [d ij ] ∈ R n×n at discrete time k, which can be defined by the following: where l ij is the element of Laplace matrix L of multi-agent network topology G, which can be expressed as follows: where a ij represents the element of the adjacency matrix of G.

Charging Power Station AGC Power Allocation Based on Cost Consensus Algorithm
In order to make the charging station with lower adjustment cost bear with more power disturbance, the cost is selected as the consentaneous state variable. Hence, the adjustment cost r i of the ith charging station can be written as follows: where C i represents the adjustment cost coefficient of the ith charging station. For the purpose of ensuring the power balance and guaranteeing that all the EV charging stations can share the power deviation, the cost consensus variable r i need to be updated as follows: where γ denotes the error adjustment factor, with γ > 0; and ∆P error is the deviation between the total power instruction of EV centralized control center and the total power instruction of all EV charging stations, which can be defined by the following: During the update of the consensus state variable, in order to gradually reduce the absolute value of power deviation, the adjustment cost consensus variable r i should increase gradually if ∆P EV is positive. On the contrary, if ∆P EV is negative, the adjustment cost consensus variable r i should decrease gradually.
After several iterations of Equation (9), the adjustment cost of each EV charging station tends to be consentaneous, while the convergence criteria can be given as follows: During the optimization process, the power instruction assigned to an EV charging station may exceeds its reserve capacity limit. To guarantee that the generation command of each charging station can be limited within their lower and upper bounds, the following operation is designed into the optimization process: where ∆P max i and ∆P min i represent the maximum and minimum standby capacity of the ith EV charging station, respectively.
Under such circumstances, the adjustment cost of the EV charging station also reaches the limits, as follows:

Virtual Consensus Variable and Actual Consensus Variable
When the power instruction of an EV charging station exceeds its reserve capacity limit, for the sake of avoiding updating the elements of a random matrix, the concepts of the virtual consensus variable and actual consensus variable are proposed in literature [38]. The virtual consensus variable is the information that the agent interacts with the neighboring agents in the multi-agent network, which is updated directly according to Equation (9) and Equation (10), without considering the capacity constraint of EV charging stations. Moreover, the actual consensus variable can reflect the real state of EV charging stations, which is obtained by Equation (12) and Equation (8), that is, the product of the actual assigned power instruction of the EV charging station and the corresponding adjustment cost coefficients, while the corresponding constraints are given by the following:

Overall Design Flowchart
As shown in Figure 2, the AGC power allocation with EV mainly consists of two steps; that is, (a) the EV control center allocates the total power instruction ∆P EV to each charging station based on the cost consensus algorithm; and (b) it allocates the power instruction to each EV battery based on the SOC proportional allocation method.

Overall Design Flowchart
As shown in Figure 2, the AGC power allocation with EV mainly consists of two steps; that is, (a) the EV control center allocates the total power instruction ∆ EV∑ to each charging station based on the cost consensus algorithm; and (b) it allocates the power instruction to each EV battery based on the SOC proportional allocation method.
Input the total power instruction ΔPEV Start Calculating the power of electric vehicle charging station ΔPi by (8) Judging whether the power of the electric vehicle charging station ΔPi is beyond the limit Recalculating ΔPi according to system (12) Calculating power deviation ΔPerror based on system (11)

System Model
According to the literature [39], from 2015 to 2020, China will give priority to the construction of more than 12,000 centralized charging stations for public transportation, sanitation, and logistics. Besides, more than 4.8 million decentralized charging piles will be established to meet the charging demand of public vehicles and private vehicles. In particular, EVs in the public services own the priority of changing electricity mode. On the basis of the load frequency control model of the Hainan power grid in southern China, the parameters of eight AGC units are tabulated in Table 1. According to the gross domestic product (GDP) ranking of each city and county in Hainan province in 2015, it is assumed that the top ten cities and counties (Haikou, Sanya, Chengmai, Danzhou, Qionghai, Wanning, Wenchang, Dongfang, Lingao, Lingshui) possess a large bus charging station, denoted by CS1~CS10, respectively. Each bus charging station can charge 120 bus batteries at the same time, and

System Model
According to the literature [39], from 2015 to 2020, China will give priority to the construction of more than 12,000 centralized charging stations for public transportation, sanitation, and logistics. Besides, more than 4.8 million decentralized charging piles will be established to meet the charging demand of public vehicles and private vehicles. In particular, EVs in the public services own the priority of changing electricity mode. On the basis of the load frequency control model of the Hainan power grid in southern China, the parameters of eight AGC units are tabulated in Table 1. According to the gross domestic product (GDP) ranking of each city and county in Hainan province in 2015, it is assumed that the top ten cities and counties (Haikou, Sanya, Chengmai, Danzhou, Qionghai, Wanning, Wenchang, Dongfang, Lingao, Lingshui) possess a large bus charging station, denoted by CS1~CS10, respectively. Each bus charging station can charge 120 bus batteries at the same time, and the models and parameters of all bus batteries are identical, with a battery capacity of 96 kWh. The communication topology of CS1~CS10 is demonstrated in Figure 3, and the adjustment cost coefficient is reasonably set according to the unit electricity price range [λ bid,min , λ bid,max ] corresponding to the lowest and highest expected income of EV agents, as given in Table 2. Besides, considering the influence of time-of-use electricity price, buses are charged twice a day. During the daytime, buses are charged for supplementary charging, while the charging period is 10:00-16:30 with a rated charging power of 135 kW. In addition, night charging is for unified centralized charging, while the charging period is 23:00-05:30 with a rated charging power of 21 kW. Therefore, it can be assumed that the total adjustable capacity of CS1~CS10 changes every 15 min [40] when participating in AGC power allocation, such that 96 periods are formed in a day, as illustrated in Figure 4. The maximum and minimum regulation capacity of CS1~CS10 under one period is shown in Table 2.

Discrete Consensus
On the basis of the above model and information topology, while taking the maximum and minimum adjustable capacity constraints of each charging station provided in Table 2 into consideration, the adjustment cost is considered as a consentaneous variable. Meanwhile, the convergence condition is |∆P error | ≤ 0.01 and the error adjustment factor γ is set to 0.5. When ∆P EV = 10 MW, the convergence process of AGC power allocation for 10 charging stations based on the cost consensus algorithm is shown in Figure 5. As demonstrated in Figure 5, one can readily observe that when the iteration number is 500, the regulation cost consensus variables of all charging power stations become identical, while the generation power of each charging power station converges at the same time, which is lower than 1.5 MW. Clearly, under the condition ∆ EV∑ = 10 MW, the generation power of all charging stations does not reach the upper limit of regulation capacity. Under such circumstances, the convergence process of the actual consensus variables is identical to that of the virtual consensus variables, as demonstrated in Figure 5a. Figure 6 depicts the convergence process of adjusting the cost consensus algorithm when As demonstrated in Figure 5, one can readily observe that when the iteration number is 500, the regulation cost consensus variables of all charging power stations become identical, while the generation power of each charging power station converges at the same time, which is lower than 1.5 MW. Clearly, under the condition ∆P EV = 10 MW, the generation power of all charging stations does not reach the upper limit of regulation capacity. Under such circumstances, the convergence process of the actual consensus variables is identical to that of the virtual consensus variables, as demonstrated in Figure 5a. Figure 6 depicts the convergence process of adjusting the cost consensus algorithm when ∆P EV = 25 MW, upon which one can readily observe that, with the increase of iteration numbers, the virtual regulation cost consensus variables of all rechargeable power stations tend to be consentaneous, while the generation power of each charging station also converges to a certain value. Owing to the restriction of maximum regulation capacity, the generation power of some charging stations has reached the limit, such as CS6, CS8, and CS9 shown in Figure 6c. Meanwhile, the actual consensus variables of these three charging stations also reach the limit, as shown in Figure 6b. Hence, this indicates that, because the concepts of the virtual consensus variable and actual consensus variable are introduced, even when the actual consensus variable reaches the limit value, the virtual consensus variable of all charging stations can still reach a consensus. More specifically, as the interactive information between different charging stations, the virtual consensus variable is not limited by the capacity constraint and is only used for cost consensus calculation by Equation (9). Through enough interactions, all the charging stations can reach a consensus on the virtual cost, while the power balance constraint can be satisfied. Therefore, the convergence of such an algorithm can be guaranteed by the interaction of virtual consensus variables among agents.
Appl. Sci. 2019, 9, x FOR PEER REVIEW 12 of 19 this indicates that, because the concepts of the virtual consensus variable and actual consensus variable are introduced, even when the actual consensus variable reaches the limit value, the virtual consensus variable of all charging stations can still reach a consensus. More specifically, as the interactive information between different charging stations, the virtual consensus variable is not limited by the capacity constraint and is only used for cost consensus calculation by Equation (9). Through enough interactions, all the charging stations can reach a consensus on the virtual cost, while the power balance constraint can be satisfied. Therefore, the convergence of such an algorithm can be guaranteed by the interaction of virtual consensus variables among agents.

Random Disturbances
In order to further analyze the dynamic performance of the cost consensus algorithm for AGC power allocation with EV in practical applications, a random square wave load disturbance simulation is applied on the Hainan power grid while the wave period is 1000 s and the amplitude is no more than 150 MW (corresponding to 10% of the daily maximum load in Hainan province). Meanwhile, the simulation time is set to be 24 hours. Besides, genetic algorithm (GA) [41,42], particle swarm optimization (PSO) [43,44], group search optimizer (GSO) [45], linear programming (LP) [46], and allocation algorithm based on the same adjustable capacity proportion are used for a fair and thorough performance comparison. In addition, the control period of AGC is nine seconds, while the total power command ∆ EV∑ of EV centralized control center is obtained by offline static optimization based on GA, which aims to achieve a linear weighted minimization of the adjustment cost and a maximization of the climbing time of all AGC units in the whole control area. In order to further investigate the influence of the EV's participation in power system frequency regulation, coalfired unit G3 and hydropower unit G6 are used to replace EV for further comparison, that is, the total power instruction ∆ EV∑ of the EV centralized control center is all borne by coal-fired unit G3 or hydropower unit G6. Table 3 demonstrates the control performance standard (CPS) index and adjustment cost when EVs participate in frequency regulation of the Hainan power grid under different algorithms, in which |∆ | , |ACE| (automatic control error), CPS1, CPS2, and CPS are the average of the corresponding indicators within 24 hours, while the cost is the total adjustment cost of all units in 24 hours. From Table 3, one can readily find that the CPS index of the cost consensus algorithm is close to that of centralized algorithms such as GA, PSO, GSO, LP, and PROP, which further shows that the cost consensus algorithm is a feasible method for the decentralized control of AGC power allocation with EV in the power grid. In fact, the solved problem given in Equations (1)-(4) is linear, and its global optimum can be obtained by LP. In contrast, the proposed cost consensus algorithm is a distributed optimization method, for which it is difficult to obtain the global optimum, as it optimizes locally with the limited information. Although the heuristic algorithms (GA, PSO, and GSO) only search an approximate global optimum, they are still the good choice to be introduced for testing the performance of the proposed algorithm. In essence, the comparative algorithms, including GA, PSO, and GSO, are the meta-heuristic algorithm with various stochastic searching operations in nature. In

Random Disturbances
In order to further analyze the dynamic performance of the cost consensus algorithm for AGC power allocation with EV in practical applications, a random square wave load disturbance simulation is applied on the Hainan power grid while the wave period is 1000 s and the amplitude is no more than 150 MW (corresponding to 10% of the daily maximum load in Hainan province). Meanwhile, the simulation time is set to be 24 h. Besides, genetic algorithm (GA) [41,42], particle swarm optimization (PSO) [43,44], group search optimizer (GSO) [45], linear programming (LP) [46], and allocation algorithm based on the same adjustable capacity proportion are used for a fair and thorough performance comparison. In addition, the control period of AGC is nine seconds, while the total power command ∆P EV of EV centralized control center is obtained by offline static optimization based on GA, which aims to achieve a linear weighted minimization of the adjustment cost and a maximization of the climbing time of all AGC units in the whole control area. In order to further investigate the influence of the EV's participation in power system frequency regulation, coal-fired unit G3 and hydropower unit G6 are used to replace EV for further comparison, that is, the total power instruction ∆P EV of the EV centralized control center is all borne by coal-fired unit G3 or hydropower unit G6. Table 3 demonstrates the control performance standard (CPS) index and adjustment cost when EVs participate in frequency regulation of the Hainan power grid under different algorithms, in which ∆ f , |ACE| (automatic control error), CPS1, CPS2, and CPS are the average of the corresponding indicators within 24 h, while the cost is the total adjustment cost of all units in 24 h. From Table 3, one can readily find that the CPS index of the cost consensus algorithm is close to that of centralized algorithms such as GA, PSO, GSO, LP, and PROP, which further shows that the cost consensus algorithm is a feasible method for the decentralized control of AGC power allocation with EV in the power grid. In fact, the solved problem given in Equations (1)-(4) is linear, and its global optimum can be obtained by LP. In contrast, the proposed cost consensus algorithm is a distributed optimization method, for which it is difficult to obtain the global optimum, as it optimizes locally with the limited information. Although the heuristic algorithms (GA, PSO, and GSO) only search an approximate global optimum, they are still the good choice to be introduced for testing the performance of the proposed algorithm. In essence, the comparative algorithms, including GA, PSO, and GSO, are the meta-heuristic algorithm with various stochastic searching operations in nature. In order to reduce the optimization randomness and rapidly obtain a high-quality optimum, the local search weights of these algorithms are increased via setting their optimization parameters. Particularly, the crossover and mutation rates of GA are set to 0.9 and 0.05, respectively; the velocity weight of PSO is set to a dynamic value decreasing from 0.7 to 0.3; and the percentage of rangers is set to 10% for GSO. In addition, because the cost consensus algorithm uses the local information interaction of the agents to cause the consensus variables to tend to be consentaneous, it strongly depends on the optimization model. Hence, compared with centralized algorithms such as GA, PSO, GSO, and LP, its total adjustment cost is slightly higher. However, when the scale of the charging station increases, the centralized algorithms mentioned above have some distinct drawbacks, such as low calculation speed and weak optimum searching ability; thus, the 4-16 seconds' time-scale requirement of AGC real-time control is hard to satisfy. However, the cost consensus algorithm still has the advantages of high convergence speed and stable optimization outcome, which represents higher practicability on engineering problems. Compared with other intelligence algorithms, the LP algorithm is a traditional optimization algorithm that can find the only definite optimal solution in the feasible domain, thus the total adjustment cost is the lowest. Besides, PROP adopts the fixed proportional allocation strategy based on the adjustable capacity, which lacks optimization objectives, such that its total adjustment cost is the highest among all the algorithms. Table 4 shows the control performance standard index and total adjustment cost of the Hainan power grid without the participation of EV. The comparison between Tables 3 and 4 shows that, as the batteries of EV have a fast response speed, no climbing constraints, and low frequency regulation delay, the simulation results with EV participating in frequency regulation are better than those without EV. Hence, the participation of EV in AGC power allocation can effectively reduce the regional control deviation and restrain the load fluctuation. Meanwhile, as the time delay of the hydro-power unit is smaller than that of the thermal power unit and the climbing speed is higher, the simulation results are more desirable when the total power instruction ∆P EV of EV centralized control center is all borne by the hydro-power unit G6 rather than coal-fired unit G3. Besides, this also highlights that the participation of hydro-power in power system frequency regulation is beneficial to improve the CPS index and the economic performance index of the power grid.  Figure 7 demonstrates the power tracking and frequency deviation curves (0-3 h) obtained by the cost consensus algorithm under random square wave load disturbance in the Hainan power grid. One can readily find that the total power instruction ∆P EV issued by the proportional-integral (PI) controller can effectively track the load disturbance, while the actual total output of the unit basically matches the load disturbance. Meanwhile, the frequency deviation of grid caused by the load disturbances can be maintained within a reasonable range, which can also quickly recover to the ideal value. The above results verify the feasibility of the cost consensus algorithm in the allocation of different charging stations.
One can readily find that the total power instruction ∆ EV∑ issued by the proportional-integral (PI) controller can effectively track the load disturbance, while the actual total output of the unit basically matches the load disturbance. Meanwhile, the frequency deviation of grid caused by the load disturbances can be maintained within a reasonable range, which can also quickly recover to the ideal value. The above results verify the feasibility of the cost consensus algorithm in the allocation of different charging stations.

Conclusions
This paper proposes a mathematical optimization model of AGC power allocation with EV charging stations. Besides, an AGC power allocation with EV based on the cost consensus algorithm is also developed, in which the main findings/contributions can be summarized as follows:

1)
A feasible method for decentralized control is presented for AGC power allocation with EVs. After the virtual consensus variables and actual consensus variables are introduced, the cost consensus algorithm can be flexibly applied on the AGC power allocation of EV. Meanwhile, because such an algorithm possesses the superiorities of distributed calculation and simple updating rules, self-regulation of EV charging and discharging can be efficiently and effectively achieved.
2) The adjustment cost is regarded as the consentaneous state variable in the cost consensus algorithm, which means the charging stations with less adjustment cost receive more power disturbances. Particularly, such a strategy can effectively reduce the power grid frequency regulation cost and improve the control performance standard of a regional power grid.