Optimal Frequency Control for Inverter-Based Micro-Grids Using Distributed Finite-Time Consensus Algorithms

This paper addresses the distributed frequency control and economic dispatch problem of micro-grid systems. The optimal frequency control problem is formulated considering both frequency regulation and generation cost minimization, by establishing an equivalent nonlinear second-order dynamic model. A distributed finite-time consensus protocol is proposed to solve the optimal frequency regulation problem based on the equivalent model. Despite the nonlinear dynamics, the system frequency converges to the nominal value and the economic dispatch is achieved both in finite time. It is proved that the equilibrium point of the closed-loop system is the unique optimal solution to the associated economic dispatch problem. Simulation results verify the theoretical analysis and demonstrate the effectiveness of the proposed control method.


I. INTRODUCTION
Micro-grids are low-voltage electrical distribution networks, composed of distributed generation, storage, load and various electronic devices. With the increasing integrating of renewable energies, future micro-grids are engaged with more and more distributed resources such as micro-generators and flexible loads, which are typically connected via distributed convertors. Modeled after the hierarchical control architecture of power transmission systems, a layering of primary, secondary, and tertiary control has become the standard operation paradigm for islanded micro-grids [1], [2]. In the first layer, the inverters perform frequency regulation locally, using droop control for example, by emulating the synchronous generators' droop characteristics [2]- [4]. In order to compensate for the steady-state deviation caused by the droop control, a secondary frequency control strategy is applied to regulate system frequency to the nominal value. The economic dispatch (ED) operates on a slower time scale in the third layer of the hierarchical framework, responsible for establishing power allocation mechanism The associate editor coordinating the review of this manuscript and approving it for publication was Dongxiao Yu . to minimize generation and operation cost. Under the distributed hierarchical control structure framework, a large number of research in respect of frequency control and economic scheduling problems have emerged [5]- [14]. In [8], the nonlinear dynamic characteristics of distributed inverters are studied. A distributed input-output linear feedback control is proposed for secondary frequency control. Based on droop control, [11] and [12] investigate distributed secondary voltage and frequency regulation methods using finite-time consensus algorithm.
Greatly relying on the separation of the control tasks of each layer on the time scale, the above studies realize only one control objective in the hierarchical layers. However, with the increasing number of renewable resources integrating into the power system via converters, one of the challenges for inverter-based micro-grids is the decreasing of the overall inertia of the system. In conventional power system, the inertia mostly comes from the generators and turbines of conventional power plants that are synchronously connected to the system by the rotational speed. Whereas, renewable resource units are in general connected through a power electronic converter, which fully or partly decouples the generator from the grid. These generation units do not VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ inherently contribute to the total system inertia [15], [16]. The low-inertia characteristic requires a faster stabilization and operation for future micro-grid systems. To deal with these problems, control strategies are proposed that eliminate the traditional hierarchical structure and incorporate the control tasks on different time scales by implementing a single control process. For example, some literatures consider ensuring a reasonable allocation of active power while regulating system frequency at the same time [17]- [21]. The idea of breaking the hierarchy of a micro-grid control is proposed in [18], [19], merging the frequency stability condition into the economic optimization problem. The gradient iterative updating algorithm is designed to solve the optimization problem [22]. Reference [20] analyses the relationship between frequency dynamics and economic dispatching problems. The original-dual gradient algorithm is proposed to achieve optimal frequency control. Reference [21] addresses the distributed optimal frequency control and proves that the equilibrium of system power sharing and frequency attains the optimal solution to the associated economic dispatch problem (EDP).
On the other hand, most of the existing literatures based on distributed algorithm achieve asymptotic or exponential convergence of frequency control or EDP with unknown settling time. In addition, with the increase of intermittent and uncontrollable power generation units, system frequency and power supply bear more fluctuation and unknown disturbances. In this sense, finite-time convergence algorithm demonstrate faster convergence rate, better disturbance rejection properties and robustness against uncertainties [23], and thus is advantageous to the future micro-grid control. Finite time convergence algorithm is applied to solve the frequency control and economic scheduling problems of the power grid in several studies [24]- [29]. In [26], the second-order frequency control of micro-grid based on droop control is proposed by using finite time convergence algorithm. The algorithm does not require specific model parameters such as line impedance and is robust to external disturbances. In [27], a distributed secondary frequency control is designed under switching communication architecture. Finite time economic dispatching problem is studied in [28], but the algorithm requires global load information. Reference [29] proposes an economic scheduling algorithm within fixed iteration steps, but frequency control is not considered. These existing finitetime methods are usually based on traditional hierarchical control framework, and thus are carried out in each control layer separately. To our best knowledge, little work has been done to achieve finite-time convergence for both frequency regulation and EDP simultaneously.
Motivated by this, we explore a distributed finite-time control algorithm for optimal frequency regulation of microgrid system in this paper. The proposed frequency control scheme has the following appealing features. First of all, the approach does not rely on central controller and requires no prior knowledge of both communication network and power network topologies. Different from other distributed schemes, our controller achieves finite time convergence, which is favorable in practical application for micro-grid systems with small inertia. Secondly, the proposed scheme is such that the closed-loop equilibria of the power system are optimizers of the economic dispatch. During the whole regulation and optimizing process, both the power balance and generator capacity constraints are always enforced, so that the solutions are feasible even at transient. Moreover, the controller only utilizes the local frequencies and marginal prices. It does not require any model knowledge and is privacy preserving to some degree, that generators do not have to exchange their output power information. Last but not the least, due to the inherent relationship between the marginal cost dynamics and power flow network, the algorithm is not sensitive to communication topology change. It is robust to severe communication failures such as total information lost of one generator.
The rest of the paper is organized as follows. In Section II, the power system model is given based on droop control. Some useful preliminaries and lemmas are reviewed for further use. In Section III, the problem of optimal frequency control is formulated by introducing control objectives based on EDP. The dynamic model of equivalent second-order system is established. Finite-time consensus algorithm for optimal frequency control are proposed for EDP w/wo generator capacity constraints. In Section IV, the performance using the proposed control algorithm is illustrated and analysed. Finally, conclusion remarks are made in Section V.

II. POWER SYSTEM MODELS AND PRELIMINARIES
A. POWER NETWORK Consider a networked power system modeled as a graph G = (V, E) with the node V = {1, 2, . . . , n} and the edges E ⊆ V × V representing distributed generators (DG) and power links respectively. A = [a ij ] ∈ R n×n is the associated adjacency matrix. If (v j , v i ) ∈ E, then unit v j is a neighbor of unit v i and a ij = 1, otherwise, v j is not a neighbor of unit v i and a ij = 0. The set of neighbors of unit i is denoted as The Laplacian matrix is defined as L = (l ij ) ∈ R n×n , where l ii = n j=1 a ij and l ij = −a ij , i = j. Assume there is a virtual leader unit in the networked system. Let the diagonal matrix G = diag{g i } ∈ R n×n , with the diagonal entry g i > 0 if unit i is directly connected to the virtual leader, and g i = 0 otherwise. Assumption 1: In the networked system, there is at least one unit that have direct access to the virtual leader and the virtual leader is globally reachable [30].
Let Y ik = G ik + jB ik be the admittance of transmission line between the ith and kth DGs, where G ik ∈ R and B ik ∈ R are the conductance and susceptance respectively. We assume the power transmission lines of the micro-grid network are lossless, which leads to G ik = 0 for i, k ∈ V. According to the Kirchhoff laws, the injected power of the ith bus can be written as where E i , θ i are the voltage amplitude and phase angle of bus i and there isθ i = ω i with ω i being the frequency of bus i. Remark 1: In this paper, we assume the transmission line is lossless. Neither do we consider the power flow constraints on the transmission lines here. The total power flow is assumed feasible in the power network. In other words, n i=1 P ei = 0 always holds. Remark 2: The topologies of physical and communication graphs are not necessarily the same. In section III, the physical power flow of the system is represented using a Laplacian matrix L 1 . According to the Kirchhoff current laws, the graph by L 1 is bidirectional and always has a spanning tree, yet the communication network can be directed or switching for finite-time consensus.

B. DISTRIBUTED GENERATORS
The ith distributed generator consists of a prime dc source, a dc/ac inverter and is connected to the micro-grid bus through an RL output connector. Generally, droop control is used for frequency regulation in the primary layer.
where ω i , P m i and P * i are the frequency, measured output power and desired output power of generator i. m P i is the frequency droop coefficient.
The measured output power P m i is obtained though an RL output connector, modeled as a first-order low-pass filter [9].
where τ P i is the time constant of the low-pass filter. Substituting (2) into (3) yieldṡ One part of the output power P i is consumed by the local load, and the other part is injected into the power network. So P i can be presented as, where the P Li is the local load of bus i, which is a constant known to the local agent, satisfying n i=1 P Li = P L . Remark 3: Here P i can be viewed as the setting output power for the ith inverter device and is initialized at the moment when the local load changes, by using the event trigger technique for example. Assume that the system initially runs at the optimal frequency mode, then after the load changes, P i can be obtained without the prior knowledge of power flows, by P i = P i + P L i , where P Li is the change in the ith local load.

C. PRELIMINARIES ON FINITE-TIME CONVERGENCE
In the following section, some important definitions and lemmas are given for further analysis.
Consider the n-dimensional systeṁ System (6) is called homogeneous if its vector field is homogeneous. Furthermore, the systeṁ is said to be locally homogeneous of degree κ with respect to the dilation (r 1 , r 2 , . . . r n ), if f (x) is homogeneous of degree κ with respect to the dilation (r 1 , r 2 , . . . r n ),andf is a continuous vector field satisfying Lemma 1: The equilibrium of system (6) is finite-time stable if the origin is asymptotically stable, and κ < 0. If (9) holds, then the equilibrium of system (8) is locally finite-time stable. Moreover, if the equilibrium of system (8) is globally asymptotically stable, and locally finite-time stable, then the origin is globally finite-time stable [31].

III. FINITE TIME OPTIMAL FREQUENCY CONTROL
There are many options to schedule the controllable power injections to regulate the power system frequency. We are interested in a resource allocation problem which minimizes the aggregate operational cost while restoring frequency. The objective of the optimal frequency control is to minimize the total generation cost, subject to the generationdemand balance and the generation capacity constraints, which can be described by the following economic dispatch problem (EDP).
where P min i and P max i are the lower and upper generation limits of the ith units. Assume that the cost of generator i is described by the following quadratic function, where α Pi > 0, β Pi , γ Pi are the constant cost coefficients of the i-th generator. To ensure the feasibility of the optimization problem, we make the following assumption. VOLUME 8, 2020 Assumption 2: The total load power satisfies In this part, we will first analysis the EDP without generator capacity constraints, and propose a distributed control protocol for frequency regulation so that the generation cost is minimized at the same time. Consider the following reduced economic dispatch problem without generation constraints, The Lagrangian function associated with the EDP (13) can be written as where λ ∈ R is the Lagrangian multiplier associated with the equality constraint.
According to the necessary Karush-Kuhn-Tucker (KKT) conditions for optimality, we have where λ * is the reference value of λ.
In (14), λ is a global variable. In order to estimate the reference λ * in a distributed way, a natural intuition is to introduce an estimator for each agent, which can be used later for consensus algorithm design. Let λ i be the estimate variable of the ith generator for the global variable λ. From the KKT condition (15), λ i is calculated as, Combining (1) and (5), the derivative of (16) yields, Denote the actual output real power vector P = [P i ] T , the frequency vector ω = [ω i ] T and the design parameter vectors λ = [λ i ] T . The vector form of (17) can be written as, where the diagonal matrix A = diag{α Pi } ∈ R n×n and matrix L 1 ∈ R n×n is a Laplacian matrix written as, Here we propose the distributed finite time controller for the ith DG as follows, (20) where 0 < α 1 < 1, α 2 = 2α 1 /(1 + α 1 ) and c 1 , c 2 > 0.
Denote the corresponding states errors between the actual value and the reference asω i = ω i − ω * andλ i = λ i − λ * . Substituting (20) and (5) into (4), we havė For convenience, we introduce the following auxiliary variables Then we have the following vector form of the second order closedloop system dynamics.
wheref (λ,ω) = [f i (λ i ,ω i )] is the vector form. System (22) is equivalent to the following system denoted by the comprehensive error states, where Theorem 1: Suppose Assumption 1-2 hold. Without considering the generator capacity constraints, the distributed control protocol (20) solves the optimal frequency control problem in finite time. That is, the system frequency converge to the nominal value ω * , while minimizing the generation cost denoted by the EDP (13).
Proof: We will prove that system (22) is finite time stable, and the steady states of (λ, ω) associate with the optimal point of (13) and is unique. First, we will prove that the closed-loop system (23) is globally asymptotically stable. Then we will show that the system is globally finitetime stable by using Lemma 1. Finally, we will verify the uniqueness and optimality of the steady states of (λ, ω).
Choose the Lyapunov function V = V 1 + V p as follows, where matrix C 3 = diag{ m Pi 2τ P i α Pi } ∈ R n×n . With some slight abuse of notations, λ(s) is defined as a function vector where λ(s) = [λ i (s)] = 2α i P i (s) + β i , and P i (s) is defined according to (5) as P i (s) = j∈N i E i E i |Y ij |sin(s i − s j ) + P Li . It can be seen from (16) and (5) that λ i (θ) = λ i and P i (θ ) = P i , thus the scalar form λ(θ) = λ and P(θ) = P.
In order to show V p > 0, we need to make sure that for a small change of θ i , there is φ i θ i > 0, which is equivalent to From the definition of φ i (λ), it is obtained that (27) which yields ∂φ i ∂λ i > 0 Furthermore, according to (18) we have ∂λ ∂t = 2AL 1 ∂θ ∂t , which means ∂λ i ∂θ i = 2α i l 1ii > 0, where l 1ii is the ith diagonal entry of L 1 . Finally, it is obvious to show that for a small change of s (λ(s)) T s = n i=1 φ i (λ(s))s i > 0. Then we obtain that V p > 0, thus V > 0 for λ i = λ j andω i = 0, i, j = 1, 2, . . . , n.
Combining the fact that system (22) is globally asymptotically stable, by Lemma 1 we conclude that the equilibrium of system (22) is globally finite-time stable.
Moreover, the equilibrium point satisfies the KKT conditions (λ i = 0 and J i (P i ) = J j (P j ), i.e, λ i = λ j ) of the economic dispatch problem (10). In addition, the objective function is strictly convex. Thus λ i = λ * is unique and P * i = λ * −β i 2α i is the unique optimal solution of (10). This completes the proof.

Algorithm 1 Optimal Frequency Control Algorithm Without
Considering Generation Capacity Constraints 1: for each i ∈ N do 2: Set the initial value of λ i using (16) 3: while P Li not detected do 4: Calculate u i using (20) 5: Update ω i , λ i following the dynamics (22). 6: To further analyse the actual situations where each generator's output power is restricted by its generation capacity, we consider the dispatch problem presented in (10) with the generator capacity constraints in the following part. The Lagrangian function associated with (10) is written as, where γ − i , γ + i ∈ R are the Lagrangian multipliers associated with the inequality constraints.
The updating laws for γ − i , γ + i are designed aṡ where k γ i is a positive constant. The operator is defined as [x] + a = x if a > 0 or x > 0; and [x] + a = 0 otherwise. For the optimality conditions, we have are the corresponding reference values of γ − i , γ + i at equilibrium point. Similar to (16), λ i is calculated as, Combining (33) and (34), the derivative of (36) yields, The vector form of (37) can be written as, . By using the same controller (20), we have the following system dynamics.
. Theorem 2: Suppose Assumption 1-2 hold. The distributed control protocol (20) solves the optimal frequency control problem in finite time. That is, the system frequency converge to the nominal value ω * , while minimizing the generation cost denoted by the EDP (10).
Proof: We will prove that system (39) is finite time stable, and the steady states of (λ, ω) associate with the optimal point of (10) and is unique. First, we will prove that the closed-loop system (39) is globally asymptotically stable. Then we will show that the system is globally finitetime stable by using Lemma 1. Finally, we will verify the uniqueness and optimality of the steady states of (λ, ω).
Choose the Lyapunov function as In the above Lyapnov function, V 1 and V p are both in the same form as in III-A, while a little difference is made in the function λ i (s) in V p , where λ i (s) = 2α i P i (s)+β i −γ − i (P i (s))+ γ + i (P i (s)), so that the scalar form still satisfies λ(θ) = λ and λ(θ * ) = λ * 1 n . V γ − and V γ + are defined as follows, In the following part, we will prove that V > 0 for λ i = λ j andω i = 0, i, j = 1, 2, . . . , n.
By using the definition of λ(s), we have ≥ 0 are the time durations when the two operators in (33) and (34) are nonzero respectively.
Similar to the analysis in III-A, we have V p > 0, thus The next step is to proveV w ≤ 0. From (33), we known that 0 ≤γ − Similarly, we also obtain thatV γ + ≤ 0. Then combining (30), . . , n} is the largest invariant set for system (22), which implies that the equilibrium point is globally asymptotically stable.
Moreover, from (43) it is obvious that γ − i is finite time stable. The setting time for consensus satisfies T γ − ≤ The same analysis applies to γ + i as well. Then we have γ + i is finite time stable with setting time denoting as T γ + . So we further obtain thatγ − i = 0 andγ + i = 0, when t ≥ T γ = max i {T γ − , T γ + }. Then (39) becomes (22) after T γ , which means that the output power P i of all the generators are within the capacity constraints. Then the rest of the proof is the same with that in III-A.
The equilibrium point of (39) satisfies the KKT conditions denoted in (35) (λ i = 0 and J i ( i.e, λ i = λ j ) of the economic dispatch problem (10). Since the objective function is strictly convex, λ i = λ * is unique and P is the unique optimal solution of EDP (10). This ends the proof.
Remark 4: In the above analysis, we made tremendous effort in proofing V ≥ 0 andV ≤ 0. The pivotal lies in the fact that the dynamics of marginal cost λ is related to the power flow connection by the matrix L 1 , which induces an undirected connected network topology. Then we obtain that iλ i = 0 as long as there is no load change to reset the initial values of the marginal costs. However, it is also noticed from (17) that prior knowledge of the power network parameters Set the initial value of λ i using (36) 3: while P Li not detected do 4: Calculate u i using (20) 5: Update ω i , λ i , γ − i and γ + i following the dynamics (39) and (33) and (34). 6: Motivated by Remark 4, we present the following distributed pinning control protocol without using any system parameters, yet still working in strongly connected communication topologies.
Instead of updating λ i usingṖ ei , the following updating protocol is proposeḋ The rest of the proof is similar to that of Theorem 1, thus is omitted in this paper. Remark 5: Notice that the proposed distributed controller relies on the fact that frequencies should be converged to nominal value and marginal costs should be identical in an optimal steady state, which is similar to many existing works based on distributed averaging-based integral (DAI) controllers [32], [33]. However, a nontrivial issue of these DAI based algorithms is that a distributed unit can maximize its profit by cheating and manipulating the communication protocol. In contrast, our proposed controller incorporates the composed error of marginal cost into the control input signal in the dynamics of frequency, so that cheating over the communication protocol can be easily detected by the fluctuation or divergence of system frequency. Whereas, by using the pinning control technique, our method dose not require each unit to know the nominal frequency value, and is less conservative to communication topologies. According to [34], it works with network topology which may neither be strongly connected nor have a directed spanning tree.

IV. SIMULATION CASE STUDY
To test the proposed distributed finite-time controller, a power system with 4 generators and their local loads is built by using Matlab software. The power network and communication network connection topology is shown in Fig. 1, where the blue solid line represents the power line and the red dotted line represents the information communication line. The parameters of the whole test system are summarized in Tables 1.  The control coefficients are chosen as α 1 = 1 2 , c 1 = 2.5, c 2 = 1. The frequency and output power trajectories of the system using the proposed distributed finite-time convergence algorithm are shown in Fig. 2 and Fig. 3 respectively. In Fig. 2, we can see that the frequency of distributed generators converge rapidly in finite time less than 2s in Stage I, and can be regulated to the nominal value in finite time after the load changes in Stage II. Fig. 3 shows that the steady states of the generators' output power in each stage. We use the centralized analytical method to calculate optimal solutions, which are given in Table 2. As can be seen from Table 2,   in Stage I no generator reaches its capacity limit, while in Stage II generator 4 reaches its upper limit. The steady values of both Stages in Figure 3 are identical to the centralized equilibrium points given in Table 2. Moreover, the convergence trajectories of the marginal costs λ i are illustrated in Fig. 4. It can be seen that in both Stages, all the marginal costs reach to an identical value in steady states. The steady-state value of the marginal cost in Stage II is greater than that in Stage I, since the increase of total loads leads to the increase of the system marginal cost. These test results confirm the theoretical analysis, that the proposed controller is able to regulate the system frequency and deal with the ED problem at the same time.

B. PERFORMANCE UNDER COMMUNICATION FAILURES
In this case, the load change is the same as IV-A, while a communication failure happens to generator 3 at time 5s-15s. During this time, G3 has no communication access to its neighbors. After t=15s, the communication of G3 recovers, as is shown in Fig. 5. Fig. 6 shows the trajectories of generator frequencies. The first oscillation of frequencies happens at 10s, which is caused   by the load change during communication failure period. There is a another oscillation at 15s when the communication of G3 recovers. It can be seen that the system frequency keeps recovering to the nominal value, even with load change and total lost of communication of G3. This is because the dynamics of marginal cost λ is related to the power flow connection with L 1 . As long as G3 can exchange power with the rest of the power system, it is able to participate in the frequency regulation. Fig.7 and 8 illustrate the output power and marginal costs of distribute generators. As can be observed, the output powers change slightly when the communication failure occurs and recovers at 5s and 15s respectively. The marginal cost of G3 deviates from the other generators during the period of communication failure 5s-15s, which implies that the total generation cost may not be optimum. This example shows that when the communication failure causes a total loss of information of G3, the generator still keeps   contributing power sharing to the system and regulate frequency continuously.

C. PERFORMANCE OF AN 8-UNIT SYSTEM UNDER COMMUNICATION FAILURES
In this case, we testify the finite-time control protocol for a micro-grid with 8 distributed units, in which G 1 − G 4 are the same as in Part IV-B described in Table 1. The model parameters and power network related to G 5 − G 8 are shown in Table 3 The units are ring-connected from G 1 to G 8 9 shows the trajectories of generator frequencies. Fig.10 and 11 illustrate the output power and marginal costs of 8 distribute generators. As can be seen from the figures, the proposed method still works well with 8 generators. The system frequency converge to the nominal value even when G 3 is isolated from the communication graph. The marginal cost returns to the optimality when the communication topology recovers to a connected graph.

V. CONCLUSION
This paper investigates the distributed optimal frequency control scheme for micro-grid system. By merging the KKT conditions of EDP into the secondary frequency control, a second-order nonlinear model is established for optimal frequency control. Based on this model, a distributed finite-time consensus algorithm is designed for frequency and marginal cost convergence. The equilibrium of the closed-loop system is proved to be the unique optima of the convex problem, which implies that the controller solves frequency regulation and economic dispatch at the same time. The proposed algorithm is robust to certain communication failures, since the power flow network topology is considered to ensure the power flow balance in the nonlinear term of the model. Simulation results show that the proposed scheme is effective in both EDP w/wo generation constraints. The proposed scheme performances well under scenario with information loss caused by communication failure.