Distributed Secondary Control for State of Charge Balancing with Virtual Impedance Adjustment in a DC Microgrid

For the purpose of accurate power sharing and the state of charge (SOC) balancing of each energy storage unit (ESU), a novel secondary control scheme which regulates the virtual impedance is proposed herein. However, there is a coupling relationship between the power sharing and voltage restoration process. In this study, the secondary control scheme could eliminate that effect so that the virtual impedance was only influenced by the system distribution and no longer affected by system initialization and noise. The proposed secondary strategy contains four controllers, including the current sharing controller, the SOC balancing controller, the virtual impedance correction controller, and the local reference voltage controller. Through the proposed scheme, the ESU with a higher SOC will give more power, whereas the lower one will give less power. The steady-state analysis for the uniqueness of the droop coefficient is given. Besides, the small-signal analysis of the ESU was thereby performed to ensure stability. Finally, the effectiveness of the proposed strategy was verified through MATLAB/Simulink.


Introduction
The microgrid (MG) is the development trend of the modern electric power system, since the renewable energy power generation is one of the available means to solve the global energy crisis and decrease environmental pollution [1][2][3]. The conception of microgrid has been defined as a small controlled power system composed of generators, loads, an energy storage system, and control units. The microgird can be operated in two modes: grid-connected and island-connected to serve in the specified area to facilitate the supply of power to user's premises and improve the quality of power [4,5]. According to the form of electricity, the microgrid is mainly divided into AC and DC microgrids [6]. The DC microgrid can reduce energy conversion, improve system efficiency and reliability, and it is much easier to connect different kinds of energy sources and loads to DC microgrid when compared with the AC power grid [7,8].
To ensure the stable operation of DC microgrid, it is necessary to comprehensively consider the operation status of each unit in the microgrid and formulate an effective energy management strategy to meet different system requirements. Conventional centralized control and decentralized control strategies are used for the energy management system. The centralized approach relies heavily on communication; i.e., one single point of failure can influence the entire system [9]. At the same time, decentralized control has limitations of poor voltage regulation and control accuracy, which affect effectiveness and reliability [10].
The distributed control is an effective approach to solve the disadvantages of centralized and decentralized control, which requires only neighbor-to-neighbor information on a sparse

Problem Formulation for System
In a DC microgrid, the distributed droop-controlled method is adopted to achieve the SOC balance of each ESU. Under this control mode, the steady-state equation can be expressed as: where V i is the output voltage of the DC/DC converter, V re f i is the reference voltage of DC microgrid, is the droop coefficient (virtual impedance), and P i is the output power of the ESU. The Kron reduction is applied in building the system in order to lower the dimension of load nodes [27]. Consider the DC microgrid of n generator nodes and n l load nodes. Define voltage vectors V α ∈ R n×1 , V β ∈ R n l ×1 and current vectors I α ∈ R n×1 , I β ∈ R n l ×1 , respectively. Then, the DC microgrid current-voltage equation is given by where the Y ∈ R (n+n l )×(n+n l ) is the conductance matrix and Y αα , Y αβ , Y βα , and Y ββ are corresponding block matrixes. From the Schur complement [28], it can be derived that the injection current of the load, can be considered zero in this DC microgird, the conductance matrix Y satisfies where voltage vector V = [V 1 , V 2 . . . , V N ] T , current vector I = [I 1 , I 2 . . . , I N ] T , and the feature of Y are as follows: Y = (Y ij ) (N×N) is the admittance matrix after Kron reduction and the main diagonal elements Y ii > 0, Y ij < 0, i = j, and Y = Y T . When the above assumptions are satisfied, we consider that there are two steady-state points in the system, and satisfy the following conditions at the same time: Here, let us suppose P u 2 > P u 1 ; then it is obtained that because Therefore, there can be positive and negative elements in ∆V, which means the voltage of some nodes will increase or decrease. So, we have N i satisfying min ( ∆V i V 1i ), which is with the largest proportion of voltage drop. For this node, the output power is where y ij > 0, y ij < 0, i = j, and ∑ N j=1 y ij > 0. Let Let us consider (8) again, which can be deduced as follows: As h i < 1, it can be proven that so the output power should decrease; however, that is in contradiction with the assumption that P u 2 > P u 1 . Therefore, there is no second steady-state point in this system at the same time, which means the voltage of the node is unique.
Therefore, we can draw the conclusion from the analysis that the output power and voltage of energy storage units are only related to load distribution but not to the droop coefficient and voltage reference, which means V i and P i are known quantities.

System Structure
The proposed topology of this paper is shown in Figure 1. There are two networks in it. One is the physical and the other is the communication network. As we can see, there are four ESUs and four resistive loads, connected to the microgrid by RL lines. The DC/DC converter is controlled by an inner controller, a droop controller, and a secondary controller, which can coordinate with other ESUs. The communication network between four ESUs can be expressed by a graph g(ν, ε), with node ν = {1, · · · , N} and edge ε[]. Each node is deemed an energy storage system in DC microgrid, and the edge represents communication links for information exchange. (i, j) ∈ ε. If node i and node j have a connection, (i, j) and (j, i) belongs to edge ε and the neighbors of node i are given by N i , where j ∈ N i , (i, j) ∈ ε. In this paper, the topology of the graph can be described by a graph adjacency matrix as follows.
and the Laplacian matrix is given by L = D − A, where D = diag {d i }, and d i = ∑ N j=1 a ij is the in-degree of the communication network. The proposed topology shows that each ESU consists of a local load and a common load.

Proposed Secondary Control Scheme
In this section, the control method designed for droop-controlled DC MGs is introduced by using a slope-adjusting method. The control scheme consists of four controllers. The distributed SOC balancing controller guarantees that the SOC of the ESUs are balanced so that the ESU with higher SOC should supply more power, while the unit with lower SOC supplies less. The purpose of the distributed current sharing controller in this paper is to achieve proportional accurate current sharing. However, if only the current and SOC compensation controllers are used, the droop coefficient can have multiple combinations, which means that the droop coefficient can be very different from the initial value. Hence, an additional compensating controller, i.e., the average droop coefficient controller, is designed in the control method. Through the average estimator controller, the uncertain droop coefficients could be avoided. Also, the information of droop coefficients is only exchanged among the interface of converters through the communication network, and is restored to a rated value. Then, the local voltage controller adjusts the reference value of the voltage through the feedback of the output current. Three compensation controllers are employed in the secondary control scheme to improve the dynamic load sharing performance of the system.
The boost converters are used as DC-DC interfaces to avoid loss of generality and the control strategy is consists of inner loops, a DC droop, and a secondary adjustment. The inner loops contain the current loop and voltage loop to control the output voltage of converters. The voltage produced by the droop controller is the reference value of the inner-loop control. The detailed diagram is shown in Figure 2.
The improved control method can be rewritten as follows: where d * i is the given reference value of the droop coefficient, V * re f is the rated value of the microgrid, and ∆V re f i and ∆d i are the correction terms of the reference voltage and droop coefficient, respectively.
The secondary controller produces three correction terms to modify the droop coefficient. The adjustment of each droop coefficient in the proposed strategy can be expressed as follows: where δ di , δ dsoc , and δ dvr are the current correction term, SOC correction term, and the droop coefficient correction term, respectively.

Distributed Current Sharing Controller and SOC Balancing Controller
Before the implementation of the distributed current sharing controller, the accurate current sharing is difficult to achieve, and the currents will be unequal due to the different line impedances. The consensus protocol accumulates the difference between its current and its neighboring current; the difference will multiply a communication weight a ij and a Proportional-Integral controller will produce the correction term. After starting the distributed current consensus protocol, the converter will adjust the currents of ESUs to the same value. And the transfer function of the current consensus controller can be derived as where k PC and k IC are the proportional and integral gains, respectively. The current correction term produced is given by where k i and k j are the current sharing ratios of each ESU, and a ij is the communication weight. For SOC balancing, the initial value of each one may not be the same and a dynamic consensus controller will generate a correction term by exchanging the information with the neighbor node. Use a PI controller to regulate a SOC correction term and finally realize SOC balancing. The transfer function of SOC balancing controller is where k PS and k IS are the proportional and integral gains, respectively. The deviation of SOC between neighborhood node i and j is generated by the PI controller to produce a correction term for modifying the droop coefficient, which can be written as

Distributed Virtual Impedance Restoration Controller
The current sharing controller regulates the output current by adjusting the virtual impedance in an ESU, and it may vary over a wide range because of the influence of line resistance. As explained in [29], the virtual impedance could affect the dynamic current sharing and system stability. In this section, a controller is used to compensate the weighted average droop coefficient to a reference value, which can be expressed asd where ω i is the weight coefficient,d i is the average droop coefficient, and d i = d * i + ∆d i . Before using the virtual impedance restoration controller, the global average estimator needs to be designed, which was first proposed in [30]. Its calculation formula is as follows (22) wherex i andx j are the estimated average values of all nodes for nodes i and j, and x i is the real-time sampling value of the node i. When the average estimator works, on the one hand, it needs to keep the estimated values of each node consistent. On the other hand, each node needs to feedback on the local state of each node to the average estimation distributed controller in real-time to ensure that the estimated average value can track the dynamic change of the system.
From the above analysis, the estimated weighted average value of droop coefficientsd i can be written asd where the d drp i is the i-th droop coefficient value.d i andd j are the estimated average droop coefficients at the nodes i and j, respectively.
According to the graph Laplacian matrix L = D − A discussed above, the global observer dynamic can be given byḋ where Since the average droop coefficient is same as the real-time droop coefficient at the beginning, we can obtain d avg (0) = d drp (0); Equation (24) can be expressed in the frequency domain as where Q is the N × N average matrix with all the elements equal to 1/N. So, in the steady-state, all the average droop coefficientsd i converge to the real-time average droop coefficient.
After the average droop coefficient controller is adopted, the uncertain values are avoided by exchanging the values of each node and using additional constraints. The average droop coefficients must be restored to a reference value. The average droop coefficientd i and the reference value d * i is regulated by a PI controller to produce a correction term. The transfer function is defined as where k PR and k IR are the proportional and integral gains, respectively. The mismatch betweend i andd j are processed through a PI controller, whose transfer function is defined as where k PD and k ID are the proportional and integral gains, respectively. Therefore, the average droop coefficient is restored to the reference value. The droop coefficient term can be calculated as follows:

Reference Voltage Controller
The reference voltage controller is involved in the proposed secondary controller method to ensure each the reference voltage of each ESU is the same. The droop control method for DC microgrid can be expressed as In order to solve the coupling relationship between the reference voltage and the droop coefficient, and to keep the reference voltage values consistent, the proposed reference voltage controller is designed as where the ∆V re f i is the voltage correction term. The complete control scheme is consists of (17), (20), (29), and (31).

Steady-State Analysis
Based on the analysis from Section 2.1, it is known that the output powers P i and output voltages V i are regarded as known quantities. The relationship between them can be expressed as where the number of droop coefficients d drp i and reference voltages V re f i is 2N. After using the proposed voltage controller, it will be reduced to N + 1. The weighted average droop coefficient value is defined as (21). Therefore, considering the Equations (21) and (33) together, the following relationship can be employed where Based on the uniqueness of the solution of Equation (34), whose necessary and sufficient condition is rank(U) = N + 1, the matrix U is post-multiplication of a full rank matrix Q, which can be written as Therefore, the result of product Q and U is given as To obtain the uniqueness of the solution of (34), the rank of the matrix (40) should have a full rank, which is Here, the weight coefficient is ω i usually equal to k i , which satisfies the condition (41).

Small-Signal Stability Analysis
The small-signal model for the control strategy of the ESU is derived to investigate the impact on system stability in this section. Then, the eigenvalues are calculated and the root locus is drawn when control parameter changes.
The two switches of the boost converter enable bidirectional power flowing. The averaged model of the boost converter is given in where L f is the inductance, C f is the output filter capacitor, i L is the inductor current, i out is the output current, v in is the input voltage, and v out is the output voltage. Note that i L equals to I L , and v out equals the output voltage V out in steady state; then, we can build the following small-signal model: where D is the DC component of the duty cycle of switches and V out is the DC component of the output voltage. Two PI controllers control the voltage and inner current loops utilized in this paper. The voltage loop has a slower dynamic response stabilizing the DC bus voltage through the PI compensator. The controlled strategy is given as follows: where k IV , k I I , k PV , and k PI are the integral term and proportional terms of voltage and current loops, and x 1 and x 2 are two state variables that are assumed. The relationship between the inductance current i L (current of battery i bat ) and the actual DC-bus voltage of the converter V * i can be derived as According to the system topology, the virtual impedance d vi is restored by utilizing the additional PI controllers. It is given by where d * vi is the reference value of virtual impedance. Linearizing (46) yieldṡ d vr =δ di +δ dsoc +δ dvr .
The current correction term δ di and SOC correction term δ dsoc introduced by the current sharing controller and SOC balancing controller are defined as (17) and (20). Linearizing yields In order to simplify the calculation, we assume two state variables x 3 and x 4 , and the small-signal model can be derived as At the steady-state, from (29), the droop coefficient correction term is a constant value and can be omitted in small-signal analysis. Therefore, after substituting (48)-(51) into (47), the small-signal model of virtual impedance can be rewritten aṡ The complete small-signal model of the energy storage unit can be derived by combining (42)-(47), including the DC/DC converters and the droop controllers and the secondary controllers. The vector of corresponding state variables is [î L ,v out ,x 1 ,x 2 ,v re f ,x 3 ,x 4 ,δ di ,δ dsoc ] T . The detailed parameters of the circuit and controllers are shown in Table 1. Table 1. System parameters of DC microgrid.

Parameter
Value Parameter Value Then, the equation of state-space models can be calculated and the linear differential equations of the whole system can be obtained as follows. where vi , a 42 = −k I I k PV , a 43 = k I I , a 46 = k I I k PV I L , a 47 = k I I k PV I L , Furthermore, stability analysis can be derived through eigenvalues methods. Eigenvalues can indicate the dynamic performance of the system simulated using MATLAB/SIMULINK with different virtual impedance. Figure 3 shows the root locus by varying virtual impedance d * vi . It can be seen that the characteristic roots of matrix A are all on the left half complex plane, hence, system can run steadily under the reasonable virtual impedance.

Simulation and Results
The simulation results using Matlab/Simulink were to verify the proposed secondary control strategy of the DC microgrid system, which are shown in Figure 2. The system structure is described in Section 2.1. The simulation parameters are listed in Table 2. The system is comprised of four boost converters, four DC power sources, and DC loads, including a common load and local loads (10 Ω, 20 Ω, 30 Ω, 40 Ω , respectively). Load 5 is the common load connected to four ESUs whose load fluctuations performance is shown in Figure 4. During the period of 50-6000 s, the Load 5 is connected and disconnected periodically. In this simulation, the current sharing ratios k i in (18) were set 1, 1, 2, and 2 for ESU1-4, respectively.
Each ESU can communicate with the neighbor via a low band communication network. Simulation results are presented in Figures 5-8. Figure 5 represents the simulation result of the SOC level of four ESUs. Figure 6 represents the simulation result of the output current using a current sharing controller. Figure 7 represents the results of output voltages with conventional (a) and proposed (b)controller, respectively. And Figure 8 represents the results of virtual impedances with conventional (a) and proposed (b)controller. The simulation time is 6000 s, which is divided into three timing phases, i.e., 0-1000 s, 1000-5000 s, and 5000-6000 s. The result of SOC with the proposed method is presented in Figure 5. It can be seen the initial values of SOC1, SOC2, SOC3, SOC4 were 80%, 78%, 75%, and 72%, respectively. When the simulation began, the ESUs with higher SOC gave more power, while the lower one gave less. So the difference between SOCs of every ESU gradually became smaller, and eventually trended toward balance (at about 2000 s), thereby equalizing the state of charge of each ESU. This strategy is effective in cases where the initial SOC is different.  Before the implementation of secondary control, the output currents of four units are different. When proposed controllers are activated, the voltage deviation is gradually decreased, and the output current of each ESU can be accurately shared. From Figure 6, the output currents of ESU 1 and 2 change from 53.56 to 80.56 A, and ESU 3 and 4 change from 106.74 to 160.16 A. Therefore, the proportional current sharing can be achieved, and the simulation results correspond to the current sharing ratio k i 1:1:2:2 for ESU 1-4.
The output voltages can be ensured to operate at the reference value because of the proposed control strategies, which show in Figure 7b. At 3000 s, the output voltages are 785.4, 792.6 V, 807.9, and 815.1 V with the proposed method. Without the local voltage controller, the voltages cannot be restored to the reference value compares with Figure 7b.
The differences between Figure 8a,b have shown the droop coefficient with the conventional controller, and the proposed controller performs differently at the steady-state. From Figure 8a we can see that the virtual impedances of four ESUs change a lot with the conventional controller. At 250 s, the virtual impedances were 2.18 Ω, 2.05 Ω, 1.96 Ω, and 1.92 Ω; they changed to 2.60 Ω, 2.36 Ω , 2.34 Ω, and 2.12 Ω. The upward trend was continuing at the end of Figure 8a, and it could not reach a steady state. However, from Figure 8b, the virtual impedances with the proposed controller operate stably, the values of which at the steady state were 2.14 Ω, 2.06 Ω, 1.92 Ω, and 1.87 Ω.
The simulation results between the conventional way and proposed method including the theoretical and the measured values, verify the improved control method performs better than the conventional one.
In order to further validate the reliability of the proposed model, we also adopted a large distribution network with eight ESUs and DC loads, including a common load and local loads using neighbor-to-neighbor communication, as shown in Figure 9. Simulation results are presented in Figures 10-13 which are the results of SOC, output current, output voltage, and virtual impedances for each ESU. In this simulation, the output current sharing ratio k i was set to 1 for each ESU. The simulation time was 6000 s, which was divided into three timing phases; i.e., 0-1000 s, 1000-5000 s, and 5000-6000 s. From the simulation results, it can be seen that SOC balancing and output current sharing can be achieved, the output voltages can be ensured to operate at the reference value, and the virtual impedances can operate stably with the proposed strategy. Hence, the effectiveness of the proposed method is proven.

Conclusions
In this paper, a distributed secondary control method is proposed. In addition, to realize the power sharing and SOC balancing, the main contribution of the proposed control strategy is to achieve the stability of virtual impedance, so that the virtual impedance is only influenced by the system distribution and no longer affected by system initialization and noise. To achieve that purpose, we first found that the output voltage and output power in a DC microgrid are only affected by the load distribution in steady-state. Second, we designed the proposed control method, which consists of four controllers to correct the droop coefficient and restore the reference voltage. Then, the steady-state analysis was given to illustrate the sufficient condition for the uniqueness of the virtual impedance. A small signal analysis was applied and system stability was demonstrated through the eigenvalues method. At last, simulation results compared the conventional control method with the proposed one, and the validity of the proposed method was proven. In future work, the proposed method can be further studied in AC microgrids.