Distributed Settlement of Frequency Regulation Based on a Battery Energy Storage System

Battery energy storage systems (BESS) have wide applicability for frequency regulation services in power systems, owing to their fast response and flexibility. In this paper, a distributed method for frequency regulation based on the BESS is proposed, where the method includes two layers. The upper layer is a communication network composed of agents, which is used to transmit and process information, whilst the bottom layer comprises the power system with the BESS, which provides a frequency regulation service for the system. Furthermore, a set of fully distributed control laws for the BESS are derived from the proposed distributed method, where economic power dispatch and frequency recovery are simultaneously achieved. Finally, simulations were conducted to evaluate the effectiveness of the proposed method. The results show that the system frequency regulation and economic power dispatch are achieved after considering the limits of the battery state of charge and communication delays.


Introduction
Frequency stability and control are crucial issues in power systems, which often relate to a power system's balance between power generation and power demand.Currently, power systems can accommodate more renewable energy resources (RES), which results in a decline in system inertia [1].Moreover, fluctuations caused by RES may lead to a large frequency deviation.The decline of system inertia and the fluctuations caused by RES are inevitable issues in frequency control and regulation [2,3].
Generally, frequency regulation (FR) contains three parts: primary, secondary, and tertiary frequency regulation [4].Synchronous generators are adopted in primary frequency regulation to produce instantaneous power aimed at balancing the supply and demand of power within tens of seconds, which benefits from the drop characteristic of power-frequency [5].Secondary frequency regulation is often implemented by a centralized control center, which drives the system frequency back to the nominal value.Tertiary frequency regulation often serves as an economic power dispatch center aimed at economically adjusting the outputs of the generators [6].However, the task of FR becomes even more challenging due to the intermittence of RES [7].To address the challenge, several promising solutions have been proposed, such as battery energy storage systems (BESS) [8][9][10], wind power plants [11,12], load aggregators [13,14], and electric vehicles (EVs) [15][16][17], to provide frequency and voltage regulation services.
Moreover, demand-side resources are gaining more attention in FR problems, characterized by their flexibility, high efficiency, and large quantities [18][19][20][21].A distributed demand-side control strategy to coordinate multiple load aggregators was proposed in [18], where the frequency regulation objective was solved by a small fraction of load aggregators.Furthermore, an optimal model for load-side control was developed in [19] to fulfil primary and secondary frequency regulation while maintaining the line power flows constraint.Additionally, EVs, which can be viewed as mobile storage systems, have attracted enormous attention in frequency control and regulation [21].These studies focus on two key aspects: (1) stabilizing grid frequency by dispatching the charging or discharging power of EVs [15][16][17], while considering factors such as the state of charge (SOC) of the EV battery, the behavior of the EV owner, and the randomness and intermittency of renewable energy.(2) Maximizing the economic profits of EVs [22][23][24][25], including the EV owners' benefits and the EV aggregators' profits.
Additionally, BESS has been promoted as a promising solution in providing FR services due to its features of fast response and flexibility [26][27][28][29][30][31][32][33][34][35][36][37][38][39][40].Different results from aging tests on BESS were reported by Tan et al. [29], where different frequency regulation cycles for the BESS were utilized in frequency regulation.By adjusting the Frequency-Watt curve, Stein et al. [30] investigated the effects of grid frequency service and the cycling of a BESS with experimental data.In [31], an autoregressive model to estimate the battery lifetime was proposed, which considered the SOC control strategy.The effect on the lifespan of a lithium-ion battery energy storage system was studied in [32], where different strategies were adopted to re-establish the batteries' SOC after the achievement of frequency regulation.Aditya et al. [33] investigated the performance of both the power grids and a BESS, in cases where the BESS was employed for frequency regulation services.To achieve peak shaving and frequency regulation by a BESS, a joint optimization framework was proposed by Shi et al., which considered battery degradation, operational constraints, and uncertainties in the customer load and regulation signals [34].An optimal planning and control model for frequency regulation services with a BESS was proposed in [35], to minimize the operating cost of the BESS by keeping the SOC in an optimal range.Based on the control of the SOC, an optimal battery power adjusting method was proposed in [36] to minimize the tender price in the UK frequency regulation market, with respect to historical data.Kazemi et al. [37] focused on maximizing the profit from a BESS over a long period and designed an optimal operation scheduling model for a BESS participating in the frequency regulation market.To maximize the market profits, an optimal control policy and an optimal bidding policy for a BESS participating in the frequency regulation market were proposed in [38], where the cycle aging of the battery was considered.The automatic generation control (AGC) signal was shared proportionally across the energy storage system to enhance the frequency performance [39].Considering the available capability of the BESS at each interval, Diaz et al. [40] proposed a dynamic available AGC method for the BESS to participate in FR.Their results showed that the BESS had significant benefits to the system AGC performance.In summary, the applications of a BESS in frequency regulation can be classified into two main aspects: (1) enhancement of the system's frequency stability [26][27][28][29][30][31][32][33]39,40], and (2) reduction of the fluctuations due to RES and participation in the frequency regulation market [34][35][36][37][38].
Traditional centralized control methods must collect all necessary information, and they also require an extensive and reliable communication network [41] to achieve the control target.However, to protect the privacy of the BESS, owners of the systems may not be willing to upload their personal information.In this case, distributed coordination strategies based on a multi-agent system (MAS) are favorable [42,43].An agent can be regarded as an intelligent processor that can collect and process local information.These distributed control strategies are alternative methods to solve the same problems as centralized control strategies, which obviates the need for a central control center.Hu et al. [44] designed a decentralized multi-agent system based on the frequency control strategy for the microgrid, where each agent received global information by communicating with its neighboring agents.
In this paper, a distributed economic dispatch method for a BESS-based system was proposed to achieve frequency regulation.The proposed model was a two-layer structure, including an upper communication layer and a bottom battery energy storage layer.On the communication layer, agents that collect information from the BESS work as an information processer, while on the BESS layer, each BESS produces power according to the instructions delivered by its agent.Moreover, each BESS participates in FR according to its generation cost in a fully distributed way, where optimal power allocation and frequency recovery are simultaneously achieved.To summarize, the main contributions of this paper are as follows: (1) the proposed method is a fully distributed method, where only neighboring information is needed; (2) there is no leader agent or pinning agent in the communication network, which means that each agent plays a similar role in collecting, processing, and transmitting information; and (3) economic power dispatch amongst the BESS is achieved while regulating the system frequency.

Problem Formulation
In a power system, the system frequency will change due to the imbalance between power generation and consumption.Large frequency deviations have negative impacts on the power electronic equipment, such that the frequency deviation should be maintained within a feasible range.For example, in China, the frequency deviation is maintained within the ±0.2 Hz range, which is usually achieved through frequency regulation systems.
Figure 1 illustrates a dynamic model of a power grid system, which is partitioned into control areas.An equivalent thermal genset with a reheat turbine and governor, represented by a second-order dynamic system, was adopted to describe the dynamic behavior of a single control area.The dynamic behavior of the power system is represented by a first-order dynamic system.A proportional and integral (PI) controller, which is used as a load frequency controller (LFC), generates the area control error (ACE) signals that reflect a system's power mismatch.When a system power mismatch occurs, the output of the generators will be regulated by automatic generator control (AGC) units.However, the generators have some constraints, such as the maximum output power and power rate limit.
Facing the increasing penetration of RES in the power system, the distributed battery storage system is an effective tool to flatten the power fluctuations caused by the intermittence of renewable DGs.Moreover, the number of BESS is large compared with the number of AGC units.Therefore, the distributed battery energy storage system is a way to regulate system frequency when there are a large number of renewable DGs.There are two main reasons why the BESS is adopted as a frequency regulation candidate.First, the capacity and the number of AGC units are limited.Second, the BESS has a faster response speed than the AGC units.Different from the traditional centralized control method for AGC units, in this study, a distributed control method is proposed to adjust the outputs of the BESS to maintain system power frequency in a feasible range.This is because the number of BESS is increasing rapidly, and the locations of the BESS are geographically separated.In addition, the generation cost of the different BESS is considered when regulating the system frequency.As shown in Figure 1, the distributed frequency regulation (DFR) system for the BESS, which is designed to eliminate frequency deviations, is integrated into the frequency regulation structure.
In Figure 1 [3], the ∆P L and the ∆P BESS are the load disturbance and the power generated by the BESS, respectively.R is the frequency bias coefficient in the control area.B is the speed droop characteristic.PI is a PI controller.H is the area equivalent inertia.D is the area load frequency characteristic.T g and T t are the governor time constant and the turbine time, respectively.T h is the time constant of the re-heater.T r is fraction of the turbine power generated by the HP (High Pressure) unit.If a load disturbance occurs in a power system, and the system frequency deviation signal is detected by the ACE, the AGC unit will respond to eliminate the frequency deviation.However, each AGC unit has a capacity limit, and a sufficient spinning reserve capacity is generally needed in a power system.Therefore, the BESS is a potential system for the provision of frequency regulation services.As shown in Figure 1, if system power mismatch occurs, the system's frequency fluctuates, and then both the AGC unit and the BESS will respond to recover the system's frequency by producing enough power to diminish the power mismatch.
Energies 2019, 12, x FOR PEER REVIEW 4 of 17 fluctuates, and then both the AGC unit and the BESS will respond to recover the system's frequency by producing enough power to diminish the power mismatch.

Battery Energy Storage Systems for Distributed Frequency Regulation
In this section, a distributed frequency regulation model with BESS is proposed.Thereafter, a corresponding distributed algorithm is designed to regulate the system frequency and to minimize the generation costs amongst the BESS, after considering the battery lifetime degradation and the SOC limits.

Distributed Two-Layer Frequency Regulation Model
The proposed BESS-based frequency regulation system is composed of two layers, as shown in Figure 2, where the upper layer is a communication network consisting of an agent and the bottom layer is a power grid with the BESS.An agent on the communication network collects information from its BESS and transmits it to the neighboring agents through a communication network.Then, the agents compute set-points of the BESS according to the designed control laws to adjust the output of the BESS.After computation, these set-points are sent to the local controller to adjust the outputs of the BESS.On the bottom layer, the BESS will produce power in terms of these set-points to regulate the system frequency in a generation-cost-minimized way.
As shown in Figure 2, information is transmitted and processed on the communication network.Assume that the communication network is described by a graph G(V,E), where the nodes V = {1,2,…,n} in the network represent the set of agents and E is the set of edges.If there is an edge between agent i and agent j, information can be shared between agents i and j.Consequently, an adjacency matrix A = [aij]n×n is adopted to describe the topology of the communication network G.If aij = 1, then it shows that there is a communication link between agents i and j.If aij = 0, then there is no link between agents i and j.Furthermore, di is the out-going degree of agent i, such that if there are two out-going edges from agent i, then di = 2.With the received information, the agent will calculate the outputs of the BESS in terms of the proposed control laws to compensate for the system power mismatch and to weaken frequency deterioration.In the next subsection, a distributed frequency regulation algorithm is designed after considering the economic dispatch among the BESS.
In this section, a designed distributed economic dispatch control law for power system frequency regulation is introduced.Each BESS installed with frequency detection equipment can detect the system frequency and then make decisions based on real-time frequency.First, the system

Battery Energy Storage Systems for Distributed Frequency Regulation
In this section, a distributed frequency regulation model with BESS is proposed.Thereafter, a corresponding distributed algorithm is designed to regulate the system frequency and to minimize the generation costs amongst the BESS, after considering the battery lifetime degradation and the SOC limits.

Distributed Two-Layer Frequency Regulation Model
The proposed BESS-based frequency regulation system is composed of two layers, as shown in Figure 2, where the upper layer is a communication network consisting of an agent and the bottom layer is a power grid with the BESS.An agent on the communication network collects information from its BESS and transmits it to the neighboring agents through a communication network.Then, the agents compute set-points of the BESS according to the designed control laws to adjust the output of the BESS.After computation, these set-points are sent to the local controller to adjust the outputs of the BESS.On the bottom layer, the BESS will produce power in terms of these set-points to regulate the system frequency in a generation-cost-minimized way.
As shown in Figure 2, information is transmitted and processed on the communication network.Assume that the communication network is described by a graph G(V,E), where the nodes V = {1,2, . . .,n} in the network represent the set of agents and E is the set of edges.If there is an edge between agent i and agent j, information can be shared between agents i and j.Consequently, an adjacency matrix A = [a ij ] n×n is adopted to describe the topology of the communication network G.If a ij = 1, then it shows that there is a communication link between agents i and j.If a ij = 0, then there is no link between agents i and j.Furthermore, d i is the out-going degree of agent i, such that if there are two out-going edges from agent i, then d i = 2.With the received information, the agent will calculate the outputs of the BESS in terms of the proposed control laws to compensate for the system power mismatch and to weaken frequency deterioration.In the next subsection, a distributed frequency regulation algorithm is designed after considering the economic dispatch among the BESS.
In this section, a designed distributed economic dispatch control law for power system frequency regulation is introduced.Each BESS installed with frequency detection equipment can detect the system frequency and then make decisions based on real-time frequency.First, the system frequency is measured by the frequency detection equipment in real time.As presented in Reference [45], the system power mismatch is determined by the system's frequency deviation, i.e., the system's power demand is larger than the power generation when the system frequency decreases, and vice versa.Therefore, the following charging/discharging method for the BESS is proposed: where ∆f i (k) (Hz) and ∆P i (k) (MW) are the system's frequency deviation and the system's power mismatch measured and calculated by local controller i at time step k, while K i (MW/Hz) is a constant, and P Base is the baseline power.Equation ( 1) shows that the system power mismatch can be measured by a local controller in a distributed way by detecting the frequency deviation.If each BESS addresses frequency regulation as in Equation (1), the system frequency will be regulated, which is shown by the simulation results.Moreover, it can be found that the parameter K i has an influence on the frequency response, which will be discussed in detail later.
Energies 2019, 12, x FOR PEER REVIEW 5 of 17 frequency is measured by the frequency detection equipment in real time.As presented in Reference [45], the system power mismatch is determined by the system's frequency deviation, i.e., the system's power demand is larger than the power generation when the system frequency decreases,and vice versa.Therefore, the following charging/discharging method for the BESS is proposed: where Δfi(k) (Hz) and ΔPi(k) (MW) are the system's frequency deviation and the system's power mismatch measured and calculated by local controller i at time step k, while Ki (MW/Hz) is a constant, and PBase is the baseline power.Equation ( 1) shows that the system power mismatch can be measured by a local controller in a distributed way by detecting the frequency deviation.If each BESS addresses frequency regulation as in Equation (1), the system frequency will be regulated, which is shown by the simulation results.Moreover, it can be found that the parameter Ki has an influence on the frequency response, which will be discussed in detail later.In this work, the distributed control laws for the economic power dispatch among the BESS are modeled as follows: ( 1) ( ) argmin ( ) ( 1) ( ) ( 1) ( 1) ( ) ( ) In this work, the distributed control laws for the economic power dispatch among the BESS are modeled as follows: where, N i is the set of the neighbors of agent i. ξ and η are auxiliary variables.d j=1, . . .,n is the out-going degree of an agent.S i (k) ($) is the generation cost of BESS_i.α ($/MW), β ($/MW), and γ i ($/MW) are parameters, and c is a constant.P B,i (k + 1) (MW) is the output of BESS_i.∆P i (k) (MW) is the system power mismatch at the time step k. λ i (k + 1) ($/MW) is the incremental cost.The control laws in Equations ( 2)- (6) show that each agent only needs local information to calculate the set-point of the BESS, i.e., each agent i = 1, . . .,n only receives ξ i (k) ($/MW) from its neighbors to calculate P B,i (k + 1) ($/MW) at each iteration.In initialization, agent i sets the incremental price as β i ($/MW), and then sets the variable ξ i (0) = 0. Then the output of the BESS is computed by the control law in Equation ( 3), considering the outputs power constraints.In the iteration step, the control laws in Equations ( 2) and ( 5) guarantee that the system power mismatch can be eliminated when the incremental costs reach the consensus.The top layer is an important part of the proposed method, which is represented by the graph G(V,E).Correspondingly, the set-points of the BESS are obtained by the control laws in Equations ( 1)-( 6).To begin with, if a frequency deviation occurs, each local controller measures the power mismatch in terms of Equation (1).Then each local controller sends this information to its agent.Subsequently, each agent calculates the auxiliary variable ξ i (k) ($/MW) according to the control law in Equation (5).Later, the agents send the ξ i (k) ($/MW) to their neighbors according to the graph G(V,E).With the received information, each agent calculates the auxiliary variable η i (k + 1) ($/MW) according to the control law in Equation ( 2).Thereafter, each agent calculates the set-point of its BESS in terms of the control law in Equation ( 3), which is an optimization process.After this, the agent sends the calculated set-point P B,i (k + 1) ($/MW) to its BESS and then the output of the BESS is adjusted.When the outputs of the BESS are adjusted, the system power mismatch will be gradually diminished.Additionally, the generation costs of the BESS will be minimized.
The proposed frequency regulation method was selected citing two main points.One is that a distributed control method can avoid single-point failure, and enhance the flexibility of communication, which is widely discussed in the distributed control field.The other one is that the BESS has growing focus in power systems in order to mitigate the impacts of renewable resources.Owing to these two reasons, the mission of frequency regulation was assigned to the BESS, while considering the economic power dispatch and the battery lifetime degradation cost.

Adjusting the Control Laws of the BESS for the Degradation Cost and SOC Limits
As is known, the battery lifetime degradation, which is usually associated with the SOC of the BESS, is a non-negligible factor when the BESS is addressing system frequency regulation.Generally, taking the battery lifetime and deterioration mitigation into consideration, the battery is disconnected from the grid when the SOC reaches its upper or lower limits, which are set as 80% and 20%, respectively.Moreover, the outputs of the BESS are affected by the parameters α i and β i .Meanwhile, SOC_i of BESS_i has a connection with the output power P B,i (k) based on the work in Reference [46].Therefore, it is acceptable to modify the parameters α i and β i to adjust the SOC.First, α i is modified via: where, SOC min < SOC L < SOC H < SOC max , are the minimal, low, high, and maximal values of the SOC, and µ ($/MW)> 0 is a constant that affects the incremental costs of the BESS.If SOC min < SOC_i < SOC L , then α i increases, which reduces the discharging power of BESS_i.If SOC H < SOC_i < SOC max , α i decreases, which increases the discharging power of BESS_i.
Energies 2019, 12, 199 7 of 17 Similarly, β i is modified according to: where σ ($/MW) > 0 is a constant.When SOC max < SOC_i, β i is the smallest, which leads to the largest discharging output of BESS_i.If SOC_i < SOC min , β i is equal to η i (k + 1), which means that Equation (3) will find a minimal value for P B,i (k + 1) = 0.Under this condition, BESS_i will be disconnected from the grid.It can be found that the rules in Equations ( 7) and ( 8) can adjust the output power of the BESS in terms of the value of the SOC.When the BESS works in the charging mode, similar rules as those in Equations ( 7) and ( 8) can be designed.Furthermore, if all the BESS are disconnected from the grid, frequency recovery can be accomplished via load frequency regulation methods.A distributed load frequency regulation method combined with a BESS-based frequency regulation method will be explored in subsequent research.

System Architecture
A simulation was conducted in the MATLAB/Simulink environment to test the proposed control methods for the BESS-based frequency regulation setup shown in Figure 1, with twenty BESS devices.The agents for the BESS were built with MATLAB function block in MATLAB/Simulink.The BESS also worked in the permanent power control model.In addition, there were physical constraints for the BESS to produce power, so the maximal discharging P max B,i (i = 1, . . ., n) and charging power P min were considered in the model.The initial states of charge (SOC) of BESS_ i=1,2, . . .,20 were randomly initialized between 0.45 to 0.95, and the SOC min , SOC L , SOC H , and SOC max were set as 20, 30, 70, and 80%, respectively, which can be seen in Table 2. Furthermore, µ and σ were 0.01 and 0.1, respectively.The parameters used in the distributed frequency regulation (DFR) system are shown in Table 1.
And the topology of communication network is given in Figure 3.
where σ ($/MW) > 0 is a constant.When SOCmax < SOC_i, βi is the smallest, which leads to the largest discharging output of BESS_i.If SOC_i < SOCmin, βi is equal to ηi(k + 1), which means that Equation (3) will find a minimal value for PB,i(k + 1) = 0.Under this condition, BESS_i will be disconnected from the grid.It can be found that the rules in Equations ( 7) and ( 8) can adjust the output power of the BESS in terms of the value of the SOC.When the BESS works in the charging mode, similar rules as those in Equations ( 7) and ( 8) can be designed.Furthermore, if all the BESS are disconnected from the grid, frequency recovery can be accomplished via load frequency regulation methods.A distributed load frequency regulation method combined with a BESS-based frequency regulation method will be explored in subsequent research.

System Architecture
A simulation was conducted in the MATLAB/Simulink environment to test the proposed control methods for the BESS-based frequency regulation setup shown in Figure 1, with twenty BESS devices.The agents for the BESS were built with MATLAB function block in MATLAB/Simulink.The BESS also worked in the permanent power control model.In addition, there were physical constraints for the BESS to produce power, so the maximal discharging max , ( 1, , ) and charging power min , B i P were considered in the model.The initial states of charge (SOC) of BESS_i=1,2,…,20 were randomly initialized between 0.45 to 0.95, and the SOCmin, SOCL, SOCH, and SOCmax were set as 20, 30, 70, and 80%, respectively, which can be seen in Table 2. Furthermore, μ and σ were 0.01 and 0.1, respectively.The parameters used in the distributed frequency regulation (DFR) system are shown in Table 1.And the topology of communication network is given in Figure 3.

Simulation Results
In this section, five simulation cases are performed to test the effectiveness of the proposed control method.First, the dynamic behavior of the system frequency without the BESS is analyzed.Then, the performance of the system frequency with the BESS is investigated.Next, the impacts of the constraints, different K i , and the time delay are studied in cases 3, 4, and 5, respectively.Finally, all the results are discussed and explained in detail.

The System's Frequency Performance Without the BESS
In simulated system, the baseline power is P Base = 100 MW, while the system power mismatch, which occurs at t = 20 s, is set as ∆P = -60 MW, meaning that the load demand is larger than the system power generation.The maximum regulation power of the AGC units is P max G = 10 MW.If the BESS does not take part in the frequency regulation, then the system power mismatch is undertaken by the AGC units.Under these conditions, the additional spinning reserve capacity is diminished, and the AGC units find it difficult to rapidly respond to a large load disturbance.
A frequency regulation simulation case without the BESS was conducted on this system.The results are shown in Figure 4. Figure 4a shows that the system frequency gradually decreases and reaches a stable state at long times.Figure 4b shows that the regulation power of the AGC unit reaches its maximum point when the system frequency is at its stable state.However, the deviation of the system frequency is larger than 0.2 Hz, which is caused by the system power mismatch that still exists in the power system.

The System's Frequency Performance With the BESS
To increase the system's spinning reserve capacity and frequency stability, the BESS was adopted to regulate the system's frequency.In proposed model there are twenty BESS, with the parameters given in Table 2, and where Ki=1,…,n is 0.05.The communication network of the agents is shown in Figure 3. On the other hand, the performance of the control laws in Equation ( 2) is illustrated in Figure 5.In Figure 5, λi=1,…,20 is the incremental cost of BESS_i.ΔP is the load disturbance while PB is the total outputs of BESS. Figure 5 shows that the proposed control laws converged, and that the system power balance was guaranteed after about 500 iterations.

The System's Frequency Performance With the BESS
To increase the system's spinning reserve capacity and frequency stability, the BESS was adopted to regulate the system's frequency.In proposed model there are twenty BESS, with the parameters given in Table 2, and where K i=1, . . .,n is 0.05.The communication network of the agents is shown in Figure 3. On the other hand, the performance of the control laws in Equation ( 2) is illustrated in Figure 5.In Figure 5, λ i=1, . . .,20 is the incremental cost of BESS_i.∆P is the load disturbance while P B is the total outputs of BESS. Figure 5 shows that the proposed control laws converged, and that the system power balance was guaranteed after about 500 iterations.

The System's Frequency Performance With the BESS
To increase the system's spinning reserve capacity and frequency stability, the BESS was adopted to regulate the system's frequency.In proposed model there are twenty BESS, with the parameters given in Table 2, and where Ki=1,…,n is 0.05.The communication network of the agents is shown in Figure 3. On the other hand, the performance of the control laws in Equation ( 2) is illustrated in Figure 5.In Figure 5, λi=1,…,20 is the incremental cost of BESS_i.ΔP is the load disturbance while PB is the total outputs of BESS. Figure 5 shows that the proposed control laws converged, and that the system power balance was guaranteed after about 500 iterations.Figure 6 shows the results from the simulations with the BESS addressing the system's frequency regulation.The maximal power that the BESS could provide was 300 MW, which was bigger than the system's power mismatch.Therefore, the system frequency could be restored after injecting power to the grid power system from the BESS.For these simulations, at 20 s t = the system power mismatch is 60 MW, and at 200 t s = the system power mismatch is increased to 80 MW.Simulation results are shown in Figure 6.In Figure 6a, the green dashed line represents the system frequency without the BESS, and the red line shows the system frequency with the BESS.From Figure 6, the system frequency gradually recovers to 50 Hz after the BESS regulates the frequency.This is because each BESS produces power according to the proposed control laws in Equations ( 1)- (6).As shown in Figure 6b, the maximal output of the AGC unit is 10 MW, which means that the spinning reserve capacity of the power system is maintained.Moreover, the incremental costs of the BESS converged (Figure 6c), which indicates that the generation costs are minimized.Figure 6d shows that each BESS produces power smoothly except when load fluctuates drastically.Figure 6 shows the results from the simulations with the BESS addressing the system's frequency regulation.The maximal power that the BESS could provide was 300 MW, which was bigger than the system's power mismatch.Therefore, the system frequency could be restored after injecting power to the grid power system from the BESS.For these simulations, at t = 20 s the system power mismatch is 60 MW, and at t = 200 s the system power mismatch is increased to 80 MW.Simulation results are shown in Figure 6.In Figure 6a, the green dashed line represents the system frequency without the BESS, and the red line shows the system frequency with the BESS.From Figure 6, the system frequency gradually recovers to 50 Hz after the BESS regulates the frequency.This is because each BESS produces power according to the proposed control laws in Equations ( 1)- (6).As shown in Figure 6b, the maximal output of the AGC unit is 10 MW, which means that the spinning reserve capacity of the power system is maintained.Moreover, the incremental costs of the BESS converged (Figure 6c), which indicates that the generation costs are minimized.Figure 6d shows that each BESS produces power smoothly except when load fluctuates drastically.
Figure 6.The system's performance with a BESS-based frequency controller: (a) the performance of the system's frequency, (b) the output power of the AGC units, (c) the incremental costs of each BESS, and (d) the output power of each BESS.

System Performance When Considering Battery Lifetime Degradation Cost and the SOC Limits
In this case, battery lifetime degradation and the SOC limits were taken into account (Section 3.2).The simulation results are shown in Figure 7. From Figures 7(a) and 7(b), the outputs of the BESS smoothly change until the SOC reaches 20%, then the outputs of the BESS decrease to zero, which meets the expectations.For reference, the SOCs are shown in Figure 7d.When power mismatch is caused by the disconnection of a BESS, another BESS, with its SOC in the normal range, increases its output.The power is transferred to any BESS with an SOC in the normal range.As a result, the incremental costs of the BESS with the SOC in the normal range increases (Figure 7b).With large numbers of BESS disconnecting from the grid, it is easy to estimate that the system frequency would decrease to an unacceptable range (Figure 7c).Under these extreme conditions, other actions like the load frequency regulation method are needed.

Impact of Different Ki Parameter Values
As shown in Figure 1, the frequency deviation caused by the load disturbance can be eliminated by the AGC unit and the proposed BESS-based frequency regulation system.However, according to Equation (1), the parameter Ki affects the frequency response.The stability of the proposed frequency regulation system was analyzed under the condition that the control laws in Equations ( 2)-(5) had converged.Analyzing the control law in Equation ( 5), it can estimate that the total amount of power generated by the BESS, between time 0 and t is 0 ( ) ( ) The function of BESS in the control structure can be represented by nKi/s, which acts as an integrator.

System Performance When Considering Battery Lifetime Degradation Cost and the SOC Limits
In this case, battery lifetime degradation and the SOC limits were taken into account (Section 3.2).The simulation results are shown in Figure 7. From Figure 7a,b, the outputs of the BESS smoothly change until the SOC reaches 20%, then the outputs of the BESS decrease to zero, which meets the expectations.For reference, the SOCs are shown in Figure 7d.When power mismatch is caused by the disconnection of a BESS, another BESS, with its SOC in the normal range, increases its output.The power is transferred to any BESS with an SOC in the normal range.As a result, the incremental costs of the BESS with the SOC in the normal range increases (Figure 7b).With large numbers of BESS disconnecting from the grid, it is easy to estimate that the system frequency would decrease to an unacceptable range (Figure 7c).Under these extreme conditions, other actions like the load frequency regulation method are needed.

Impact of Different K i Parameter Values
As shown in Figure 1, the frequency deviation caused by the load disturbance can be eliminated by the AGC unit and the proposed BESS-based frequency regulation system.However, according to Equation (1), the parameter K i affects the frequency response.The stability of the proposed frequency regulation system was analyzed under the condition that the control laws in Equations ( 2)-(5) had converged.Analyzing the control law in Equation ( 5), it can estimate that the total amount of power generated by the BESS, between time 0 and t is P total (t The function of BESS in the control structure can be represented by nK i /s, which acts as an integrator.Therefore, the proposed frequency-based control structure with the BESS is shown in Figure 8, where R(s) and Y(s) are input signal and output signal in 's' domain.If Ki = 0, then the system frequency will only be recovered by the AGC unit.If Ki increases, the total amount of power produced by the BESS increases, and thus the frequency will be recovered by the BESS and the AGC unit.The larger the Ki, the faster the speed of the frequency response.However, the fluctuation of the frequency response will also increase with an increase in Ki.Therefore, the proposed frequency-based control structure with the BESS is shown in Figure 8, where R(s) and Y(s) are input signal and output signal in 's' domain.If K i = 0, then the system frequency will only be recovered by the AGC unit.If K i increases, the total amount of power produced by the BESS increases, and thus the frequency will be recovered by the BESS and the AGC unit.The larger the K i , the faster the speed of the frequency response.However, the fluctuation of the frequency response will also increase with an increase in K i .Therefore, the proposed frequency-based control structure with the BESS is shown in Figure 8, where R(s) and Y(s) are input signal and output signal in 's' domain.If Ki = 0, then the system frequency will only be recovered by the AGC unit.If Ki increases, the total amount of power produced by the BESS increases, and thus the frequency will be recovered by the BESS and the AGC unit.The larger the Ki, the faster the speed of the frequency response.However, the fluctuation of the frequency response will also increase with an increase in Ki.

( ) ,
According to Table 1, for the simulated system, Equation ( 9) can be simplified to: The root locus of the transfer function T(s), when Ki changes from 0 to 1, is shown in Figure 9, where Im is the imaginary axis, whilst Re is the real axis.From Figure 9, the proposed BESS-based frequency regulation system is stable when Ki is increasing.With an increase in Ki, the predominant poles represented by the red line and the green line in Figure 9, are distant from the equal damping ratio line, which means that the frequency oscillation is increasing.Oscillations will not occur when the predominant poles are located on the real axis.When Ki is increased, the frequency of oscillations also increases.Thereafter, the oscillations of frequency are eliminated because the predominant poles move close to the real axis again.
The impacts of Ki parameter values of 0.01 and 0.1 were investigated.The simulation results are shown in Figure 10.It can be seen from Figure 10, that fluctuations of the system's frequency lasted The impacts of K i parameter values of 0.01 and 0.1 were investigated.The simulation results are shown in Figure 10.It can be seen from Figure 10, that fluctuations of the system's frequency lasted longer when K i = 0.1 (Figure 10a,b), than when K i = 0.01 (Figure 10c,d).However, the system's still recovered to 50 Hz with the lower parameter K i .For a small K i , the system's power mismatch is slowly eliminated leading to a slow and smooth recovery of the system's frequency.Furthermore, the incremental costs of the BESS reaches a consensus, which indicates that the generation costs of the BESS could be minimized in a distributed way, with different parameter values, K i .
frequency still recovered to 50 Hz with the lower parameter Ki.For a small Ki, the system's power mismatch is slowly eliminated leading to a slow and smooth recovery of the system's frequency.Furthermore, the incremental costs of the BESS reaches a consensus, which indicates that the generation costs of the BESS could be minimized in a distributed way, with different parameter values, Ki.

Impacts of Time Delay on Frequency Regulation
In a real communication system, there may exist communication delays when information is transmitted from agent i to agent j.A simulation case of this delay was conducted under the condition that the communication delay τd was 100, 500, 700, and 1000 ms.The results are shown in Figure 11.From the results, the system frequency fluctuates longer when the communication delay is larger.This is because the agents cannot quickly receive or process information from neighbors, when communication delays occurred between the agents.Therefore, the system frequency cannot be adjusted instantaneously.

Impacts of Time Delay on Frequency Regulation
In a real communication system, there may exist communication delays when information is transmitted from agent i to agent j.A simulation case of this delay was conducted under the condition that the communication delay τ d was 100, 500, 700, and 1000 ms.The results are shown in Figure 11.From the results, the system frequency fluctuates longer when the communication delay is larger.This is because the agents cannot quickly receive or process information from neighbors, when communication delays occurred between the agents.Therefore, the system frequency cannot be adjusted instantaneously.
longer when Ki = 0.1 (Figure 10a,b), than when Ki = 0.01 (Figure 10c,d).However, the system's frequency still recovered to 50 Hz with the lower parameter Ki.For a small Ki, the system's power mismatch is slowly eliminated leading to a slow and smooth recovery of the system's frequency.Furthermore, the incremental costs of the BESS reaches a consensus, which indicates that the generation costs of the BESS could be minimized in a distributed way, with different parameter values, Ki.

Impacts of Time Delay on Frequency Regulation
In a real communication system, there may exist communication delays when information is transmitted from agent i to agent j.A simulation case of this delay was conducted under the condition that the communication delay τd was 100, 500, 700, and 1000 ms.The results are shown in Figure 11.From the results, the system frequency fluctuates longer when the communication delay is larger.This is because the agents cannot quickly receive or process information from neighbors, when communication delays occurred between the agents.Therefore, the system frequency cannot be adjusted instantaneously.

Conclusions
In this paper, a distributed BESS-based method was proposed for frequency regulation in a power system which had two layers, i.e., where the top layer was the communication network composed of agents and the bottom layer was the BESS-based frequency regulation system.In addition, a set of distributed control laws were designed to calculate the set-points of the BESS.If each BESS adjusted its output according to the control laws in Equations ( 1)-( 6), then the system frequency gradually recovered while the generation costs of the BESS were minimized.Moreover, considering the battery lifetime degradation and the SOC limits, deep charging and deep discharging were avoided based on the control laws in Equations ( 7) and (8).To analyze the sensibility of the system, the transfer function of entire system was also deduced and the impact of Ki to the root locus of the transfer function was analyzed in detail.
To evaluate the performance of the proposed control method, five simulation cases were studied.From the simulation results, there were three findings.First, with the aid of the BESS, the system's frequency was regulated to its normal value different Ki values.Second, the generation costs among the BESS were minimized, despite communication delays in the network.Third, when considering the battery lifetime degradation and SOC limits, the system's frequency recovered to its normal value.However, the system's frequency could not be regulated when several of the BESS were disconnected from the grid due to violation of the SOC limits.In future studies, the authors are planning to investigate a comprehensive frequency regulation method, including load-based, EV-based, and BESS-based frequency regulation.

Figure 1 .
Figure 1.Simplified frequency regulation structure of a power system using battery energy storage systems (BESS).

Figure 1 .
Figure 1.Simplified frequency regulation structure of a power system using battery energy storage systems (BESS).

Figure 2 .
Figure 2. The two-layer frequency regulation model, where the upper layer is a communication network composed of agents (green diamonds) and the bottom layer is a power distribution network with the BESS (yellow cylinders).The directed red dashed lines show the relationships between the agents and the BESS, namely, each agent collects information from and sends instructions to the corresponding BESS.The blue lines in the upper layer are communication lines while the grey lines in the bottom layer are power flows.

Figure 2 .
Figure 2. The two-layer frequency regulation model, where the upper layer is a communication network composed of agents (green diamonds) and the bottom layer is a power distribution network with the BESS (yellow cylinders).The directed red dashed lines show the relationships between the agents and the BESS, namely, each agent collects information from and sends instructions to the corresponding BESS.The blue lines in the upper layer are communication lines while the grey lines in the bottom layer are power flows.

Figure 3 .
Figure 3.The upper layer communication network for the agents.Simplified frequency regulation structure of the power system with the BESS.

Figure 3 .
Figure 3.The upper layer communication network for the agents.Simplified frequency regulation structure of the power system with the BESS.

Figure 4 .
Figure 4. Simulation results without the BESS: (a) the dynamic behavior of the system's frequency Δf, and (b) the regulation power of the automatic generator control (AGC) units.

Figure 4 .
Figure 4. Simulation results without the BESS: (a) the dynamic behavior of the system's frequency ∆f, and (b) the regulation power of the automatic generator control (AGC) units.

Figure 4 .
Figure 4. Simulation results without the BESS: (a) the dynamic behavior of the system's frequency Δf, and (b) the regulation power of the automatic generator control (AGC) units.

Figure 5 .
Figure 5.The performance of the proposed distributed control laws: (a) the convergence behavior shown via the incremental cost λ, and (b) the power balance behavior.

Figure 5 .
Figure 5.The performance of the proposed distributed control laws: (a) the convergence behavior shown via the incremental cost λ, and (b) the power balance behavior.

Figure 6 .
Figure 6.The system's performance with a BESS-based frequency controller: (a) the performance of the system's frequency, (b) the output power of the AGC units, (c) the incremental costs of each BESS, and (d) the output power of each BESS.

Figure 7 .
Figure 7.The system's performance when considering battery lifetime degradation cost and state of charge (SOC) limits: (a) the output powers of the BESS, (b) the incremental costs of BESS, (c) the performance of system's frequency, and (d) the SOCs of BESS.

Figure 8 .
Figure 8.The frequency-based control structure considering the BESS.

Figure 7 .
Figure 7.The system's performance when considering battery lifetime degradation cost and state of charge (SOC) limits: (a) the output powers of the BESS, (b) the incremental costs of BESS, (c) the performance of system's frequency, and (d) the SOCs of BESS.

Figure 7 .
Figure 7.The system's performance when considering battery lifetime degradation cost and state of charge (SOC) limits: (a) the output powers of the BESS, (b) the incremental costs of BESS, (c) the performance of system's frequency, and (d) the SOCs of BESS.

Figure 8 .
Figure 8.The frequency-based control structure considering the BESS.Figure 8.The frequency-based control structure considering the BESS.

Figure 8 .
Figure 8.The frequency-based control structure considering the BESS.Figure 8.The frequency-based control structure considering the BESS.

Figure 9 .
Figure 9.The root locus of the transfer function T(s), where the red and green lines are the locus of predominant poles, dark lines are the equal damping ratio line.

Figure 9 .
Figure 9.The root locus of the transfer function T(s), where the red and green lines are the locus of predominant poles, dark lines are the equal damping ratio line.

Figure 10 .
Figure 10.The impacts of different K values.The red line shows the regulated frequency with BESS while the green line shows the unregulated frequency.(a) The frequency performance and (b) the incremental costs of the BESS with when Ki = 0.01.(c) The frequency performance and (d) the incremental costs of the BESS when Ki = 0.1.

Figure 10 .
Figure 10.The impacts of different K values.The red line shows the regulated frequency with BESS while the green line shows the unregulated frequency.(a) The frequency performance and (b) the incremental costs of the BESS with when K i = 0.01.(c) The frequency performance and (d) the incremental costs of the BESS when K i = 0.1.

Figure 10 .
Figure 10.The impacts of different K values.The red line shows the regulated frequency with BESS while the green line shows the unregulated frequency.(a) The frequency performance and (b) the incremental costs of the BESS with when Ki = 0.01.(c) The frequency performance and (d) the incremental costs of the BESS when Ki = 0.1.

Table 1 .
The parameters used for the distributed frequency regulation system.
NOTE k i : integral parameter of the proportional and integral (PI) controller; k p : proportional parameter of the PI controller; R: frequency bias coefficient; B: the speed droop characteristic; T g : governor time constant; T t : turbine time constant; T h : re-heater time constant; T r : fraction coefficient of turbine power; H: equivalent inertia.D: load frequency characteristic.

Table 1 .
The parameters used for the distributed frequency regulation system.

Table 2 .
Parameters of the battery energy storage systems (BESS).SOC_i is the state of charge of BESS_i.α i , β i , and γ i are parameters of the generation cost of BESS_i.
NOTE P maxB,i and P min B,i are the maximal and minimal output of the BESS_i.