Synchronization of Inverters in Grid Forming Mode

This article compares two strategies for seamless (re)connection of grid-forming inverters to a microgrid powered by droop-controlled inverters. While an incoming inverter must be synced to the microgrid, seamless syncing and power-sharing are technical challenges for grid-forming inverters. In the first strategy, called the output-sync method, an incoming inverter is synced to the microgrid, and then the circuit breaker is closed for power-sharing. In the second strategy, called the controller-sync method, the inverter initially contributes at zero power following the microgrid frequency, and then the controller is transferred to the mode of power-sharing. Remarkably, the circuit breaker can be kept closed during the syncing process using the controller-sync method as the inverter starts from zero power contribution. In this novel strategy, two controller sets run in parallel, i.e., two parallel control paths are in place for obtaining the magnitude and the phase angle of the PWM reference signal. These parallel paths are synced for seamless transitions when only one of them is engaged to generate the PWM reference signal. The efficacy of these control strategies has been tested in a hardware setup of a microgrid fed by two 5kVA 208V droop-controlled inverters, and the results are presented in this article. This article is also accompanied by a video clip demonstrating the performance of the output-sync and controller-sync methods in the laboratory.


I. INTRODUCTION
Grid-forming inverters are expected to play a significant role in modern power grids in the near future. In recent years, gridforming inverters have been studied mainly in the context of microgrids, though they might be used even more as the structure of power grids moves toward networked microgrids. The grid-forming inverters are the primary power generation units in an islanded microgrid powered by distributed energy resources. In other words, inverters become responsible for the voltage and frequency regulations [1]- [5]. In low inertia microgrids, a lack of balance between the demand and supply can lead to a frequency deviation from its nominal value. Thus, power demand must be managed, for example, using hierarchical supervisory control schemes. Supervisory control strategies may need a communication network for The associate editor coordinating the review of this manuscript and approving it for publication was Pinjia Zhang . power-sharing. In contrast, the droop control method can make a decentralized control for power-sharing among the power sources [6], [7], where the frequency is the system variable utilized for developing the decentralized control. However, the most challenging problems for decentralized control schemes presently are the black-start and seamless reconnection of grid-forming inverters.
A number of investigations have been reported on dynamic modeling, stability analysis, and control schemes for microgrids powered by inverters, e.g., [8]- [15]. These studies mainly focus on the dynamics of microgrids following a perturbation to the system when the generators are operating in parallel. Synchronization and reconnection of grid-forming inverters received less attention and are mainly limited to utilizing phase-locked loops (PLLs) for grid-following inverters. PLLs are commonly used for inverters in (P-Q) control mode that are connected to a relatively stiff grid [16]. However, grid-forming inverters operate in (V-f) mode in VOLUME 10, 2022 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ which the inverter regulates voltage and frequency and thus, acts as a voltage source [1]- [3]. The concurrent syncing and power-sharing in (V-f) mode without any communication network make seamless (re)connection a technical challenge for inverters. To the best of the author's understanding, very little is reported on grid-forming inverter dynamics when an inverter needs to get (re)connected to a microgrid with all sources in droop-control mode. There are various methods of controlling grid-forming inverters. However, the typical control schemes are known as droop-based and virtual synchronous generator methods [1]- [3], [17]- [19]. The droop-based method is currently the most common technique for power-sharing between inverters. The challenge is that the microgrid voltage, frequency, and phase angle (at the connection point) are unknown to the incoming inverter. The frequency should vary for inverters to contribute to power-sharing in a decentralized droop-controlled structure. The incoming inverter must be synced with other sources and proportionally contribute to the power-sharing in (V-f) mode. This article presents two strategies that address the seamless syncing and power contributing of incoming inverters in gridforming mode. Synchronization is a well-established process for connecting an AC source to the power grid. However, the synchronization becomes a technical challenge if the incoming (plugged-in) inverter (source) also needs to contribute to the voltage and frequency regulations, as well as power-sharing in a low inertia microgrid. A seamless connection to the grid is required for both grid-forming and grid-following inverters. For example, in [20], a method of seamless transitions between stand-alone and grid-tied modes is reported by defining a new mode of operation, named coast mode. Some other examples can be found in the literature, e.g., [21]- [28]. These investigations mainly report the seamless connection methods for inverters in grid-following mode. If a stiff grid exists, the responsibility of maintaining the bus voltage and system frequency is with the grid, not with grid-following inverters that operate at the desired active and reactive power references. On the contrary, an incoming inverter in gridforming mode must contribute to power-sharing, regulate its bus voltage, and seamlessly synchronize with the rest of the system.
In summary, the following gaps can be identified in the state-of-the-art techniques: • Most techniques present the connection of an inverter to the utility grid, while the (re)connection of an inverter to an islanded microgrid has not been explored.
• Most techniques are for inverters that operate in (P-Q) control mode, while inverters in (V-f) control mode after a (re)connection has not been reported.
• Some techniques need communication infrastructure that makes the plug-and-play operation of inverters costly and may put them subject to cyberattacks.
• Most techniques consider all inverters connected to a common bus, i.e., measuring the same bus voltage, thereby not considering impedances of the tie lines between the inverters. This article focuses on a microgrid powered by inverterbased sources connected to different buses and controlled by droop-based controllers, where neither a communication network nor a stiff grid exists. This work addresses an inverter's seamless connection or reconnection to an islanded microgrid in grid-forming mode. This work suggests two philosophical approaches, and their performances are investigated through laboratory experiments.
The rest of this article is divided into five sections. Section II describes the system under study. Section III presents two strategies, namely output-sync and controllersync (re)connection methods, for grid-forming inverters. Stability analysis of the controller-sync method is studied in Section IV. Experimental results are discussed in Section V to demonstrate the efficacy of the seamless (re)connection methods. A summary of the findings and conclusion of this work is presented in Section VI.

II. SYSTEM CONFIGURATION
The single-line diagram of the hardware layout is shown in Fig. 1. Notice, only two inverters are considered in this work since the proposed methods are independent of the number of inverters. Also, these techniques are decentralized, and thus, can be employed for any droop-controlled autonomous system.
As shown in Fig. 1, Inv2 is the incoming source that needs to be connected through a circuit breaker (CB), when Inv1 is the base source of this islanded system operating in droop control mode. Each inverter is controlled using the droop control philosophy and building PWM reference signal from the desired voltage magnitude, and frequency, using (P-f) and (Q-V) droop equations, as shown in Fig. 2. For grid-interactive inverters, the common practice is to use inner current control loops, particularly for grid-following inverters [1]- [3], [29]. The control scheme shown in Fig. 2 is considered in this work since it requires fewer control parameters.
For the second inverter, Inv2, to be (re)connected to the system, the point of common coupling (PCC) voltage, phase angle, and the system frequency are unknown. Suppose the incoming inverter, Inv2, is synced at the PCC, see Fig. 1. In that case, the inverter is connected at zero active and reactive power and thus does not contribute to power-sharing between the energy sources until a complementary action is pursued. Two (re)connection methods are introduced in the following section for proper power-sharing between energy sources.

III. PROPOSED METHODS
The methods discussed in this section are inspired by the various techniques that present an inverter's transition between grid-forming and grid-following (or grid-feeding) modes of operation. The proposed methods for (re)connection of grid-forming inverters are elaborated in the following subsections:

A. OUTPUT-SYNC METHOD
In this method, the incoming inverter is operated in autonomous mode. The inverter's output voltage is first synced to the PCC voltage, and then CB is closed. In this method, the inverter must operate in voltage control mode even after the synchronization and connection to the PCC bus shown in Fig. 1. In this process, sudden changes in the voltage and current waveforms must be avoided to have seamless (re)connections. This approach is called the outputsync method. Notice that such a connection can lead to nearly zero power exchange at the PCC. Therefore, the control needs to be adjusted after synchronization to make the inverter participate in power-sharing, as shown in Fig. 3. The crucial difference between the state-of-the-art technologies and the present method is that in those methods, the controller is switched from (V-f) to (P-Q) mode after (re)connection to the PCC, and the inverter has no control over the output voltage magnitude and frequency. On the contrary, the inverter operates in (V-f) control mode in this method even after the synchronization.
In this method, to achieve the power-sharing after the syncing process, the active power-frequency droop relationship in Fig. 2 is modified as follows: where, ω n is the nominal angular frequency, and m P is the active power droop coefficient. The adjustment term, δ ω , is determined using the PI 1 controller, see Fig. 3, making the frequency, ω, and phase-angle, θ, of the incoming inverter the same as the frequency and phase angle of the voltage at PCC. In Fig. 3, PI 1 adjusts δ ω to match θ with the PCC voltage phase angle in Position 1. Since θ is used for PWM generation, the phase, and thus, frequency of the incoming inverter becomes the same as the voltage phase angle at PCC. Similarly, the reactive power-voltage droop relationship is modified as follows: where, V n is the nominal voltage, and m Q is the reactive power droop coefficients. The adjustment term, δ v , is determined using the PI 2 controller to enforce the inverter output voltage magnitude of the incoming inverter becomes the same as the voltage magnitude at PCC before closing the circuit breaker, CB, see Fig. 1. Hence, (1) and (2) are needed to find appropriate changes in droop characteristics so that the incoming inverter produces the same instantaneous output voltage as the PCC voltage waveform. However, when the connection is made, no current will flow because there will be no voltage difference across L c in Fig. 1. Therefore, the adjustment terms, i.e. δ ω and δ v , should slowly approach zero to bring the inverter in power-sharing mode. Notice, a sudden resetting to zero may lead to large currents. Therefore, feedback controllers, PI 1 and PI 2 , as shown in Fig. 3, can zero δ ω and δ v after changing S 1 and S 2 to position 2. As shown in Fig. 3, the frequency synchronization is made by adjusting δ ω , using PI 1 enforcing the d-axis component of the voltage at PCC to zero. Notice, the voltage is assumed to be aligned along the q-axis for the sake of maintaining uniformity with synchronous machine analysis, where the d-axis current builds the magnetic flux and the q-axis current controls the torque in electric machines, following the dq0 convention used in [30], [31].
Considering Fig. 3, the seamless (re)connection procedure can be summarized as follows: • Start inverter with all switches at Position 1. • Enable PI 1 and PI 2 to adjust ω * and V * by δ ω and δ v such that the inverter output is locked to the voltage at PCC.
• Close the circuit breaker, CB.
• Make δ ω and δ v zero gradually through PI 1 and PI 2 loops by changing all switches to Position 2 to supply the power demand in parallel with the other inverters in the microgrid.   Fig. 4, are implemented. First, the inverter regulates P using PI 3 and PI 4 , and Q using PI 1 and PI 2 , when the outputs are θ 1 and V 1 , respectively. Then, the control mode is switched to (V-f), when θ 2 and V 2 are determined from ω * and V * , respectively. In this method, the transition is made when the reference signal of the PWM generator obtained from both control paths becomes the same, i.e. V 1 = V 2 and θ 1 = θ 2 . Therefore, this approach is called the controller-sync method. Although ω * would be the same as ω PLL after achieving the desired power-sharing, the phase-angles can be different. This could be due to any delay or a difference between the frequencies in the synchronization process. Therefore, PI 5 in Fig. 4 is used to zero the difference between the phase angles slowly. A zero-order hold (ZOH) is used to sample once every cycle, avoiding fast variations in the angle. Considering Fig. 4, the seamless (re)connection procedure can be summarized as follows: • Close the circuit breaker, CB.
• Start the inverter with all switches at Position 1 to build θ 1 and V 1 , while in parallel, achieving the desired powersharing, making V 1 = V 2 using PI V , and θ 1 = θ 2 using PI 5 in Fig. 4.
• Switch the controller from (P-Q) control path to (V-f) control path once the controllers are synced by changing all switches to Position 2 to continue to operate as a grid-forming inverter in the microgrid. The proposed output-sync and controller-sync methods provide two philosophical approaches for seamless (re)connection of inverters in grid-forming mode. In particular, the controller-sync method requires two concurrent parallel control paths when only one feeds the PWM generator at any instant. Both output-sync and controller-sync methods can be built on any inverter controller, e.g., the ones that use the current control loops in the dq reference frame.

IV. STABILITY ANALYSIS OF CONTROLLER-SYNC METHOD
To analyze the stability of the controller-sync method, a statespace representation for the inverter in Fig. 4 is developed in this section. The controller has two paths, where each path is engaged at different switch positions, namely Position 1 and Position 2.
For Position 1, the controller equations can be expressed as where, y 3 and y 4 are assumed the outputs of the integrator blocks in PI 3 and PI 4 , respectively. Combining and linearizing these equations yields Also, the inputs of the integrator blocks in PI 3 and PI 4 ,ẏ 3 anḋ y 4 , can be written as Linearizing these equations yields The derivative of ω n and ω PLL are assumed zero, and those are not presented in (6). Similarly for V 1 where, y 1 and y 2 are assumed the outputs of the integrator blocks in PI 1 and PI 2 , respectively. Combining and linearizing these equations yields Also, the inputs of the integrator blocks in PI 1 and PI 2 ,ẏ 1 anḋ y 2 , can be written as Linearizing these equations yields The derivative of V n is assumed zero, and is not presented in (10). For Position 1, around an operating point, δP = (3/2) V qpcc0 δi q + (3/2) I q0 δv qpcc , and also δQ = (3/2) V qpcc0 δi d + (3/2) I d0 δv qpcc . Here, i q and i d represent the components of the inverter current, i inv ≈ i o , after abc to dq transformation. Similarly, v qpcc and v dpcc represent the component of v pcc . Here, v dpcc = 0, when the PCC voltage is considered as the reference. Hence, δV pcc = δv qpcc . Neglect the capacitor effect, and assuming the inverter phase voltage, v inv , expressed as v inv (t) = Vcos (θ), where the reference voltage amplitude, V , and the reference phaseangle, θ, are provided by the controller. The current flows from the inverter to the output circuit can be simply expressed as where v q and v d represent the components of the inverter voltage, v inv , in dq reference frame. For Position 1, the linearized voltage can be expressed as δv q = cos (θ 10 ) δV 1 − V 10 sin (θ 10 ) δθ 1 , and δv d = −sin (θ 10 ) δV 1 − V 10 cos (θ 10 ) δθ 1 . Herein, δθ 1 can be substituted from (4), and δV 1 can be substituted by (8). Now, combining (11), (10), and (5) lead to the state-space representation of the closed-loop inverter in Position 1 as follows: a 12 a 13 a 14 a 15 a 16  a 21 a 22 a 23 a 24 a 25 a 26  a 31 a 32 a 33 a 34 a 35 a 36  a 41 a 42 a 43 a 44 a 45 a 46  a 51 a 52 a 53 a 54 a 55 a 56  a 61 a 62 a 63 a 64 a 65   The matrix elements are provided in the appendix section. Similar steps can be performed for Position 2 as follows: Also, the inputs of the integrator blocks in PI V and the integrator,ẏ V andẏ θ , can be written as Linearizing (13) and (14), we can write δθ 2 = δy θ δV 2 = −k PV m Q δQ + δy V − k PV δV pcc (15) and also, The matrix elements in (17) are also provided in the appendix. To identify the starting point, the red crosses show the eigenvalues at the initial state. At Position 1, the inverter is connected to the system and increases its active power injection from 0kW to 5kW , see Fig. 5(a)-left. Notice, all the six eigenvalues, i.e., λ 1 1−6 , are on the left halfplane, indicating a stable system. At 5kW , the controller switches to Position 2 and then decreases the active power injection to 2.5kW . This state has four eigenvalues, i.e., λ 2 1−4 . Fig. 5(a)-right shows that all the eigenvalues are on the left plane. Fig. 5(b) shows the same scenario for position 1, while at position 2, the inverter increases active power injection to 10kW . The eigenvalues are on the left-half plane as before; see Fig. 5(b)-right. Notice the eigenvalues, λ 2 1,2 , at Position 2, start from the same vertical (imaginary axis) position of the eigenvalues, λ 1 1,2 , at Position 1, which also denotes the system frequency. At Position 2, an excessive increase of the active power injection can move these poles toward the imaginary axis, though they stay in the left half-plane.

V. RESULTS AND DISCUSSIONS
A three-phase system consisting of two 5kVA SiC-based inverters and one 10kVA Si-based inverter, three programable DC power supplies, three MicroLabBox controllers (including DSP, A/D, and D/A converters), one 30kVA grid emulator, and two 5kW switched-loads were developed to study various control schemes for smart inverters, see Fig. 6. In this work, part of this setup (one of the 5kVA SiC-based inverters and 10kVA Si-based inverter being individually fed by identical 6kW DC sources) was used to demonstrate the efficacy of the seamless (re)connection methods. Herein, Inv1 regularly feeds the controllable load and operates in droop mode, while  Inv 2 is the incoming source into the system. The inverters operate at m P = 0.005 and m Q = 0.001 droop coefficients. The system parameters are in Table 1, and the control parameters are in Table 2. In the following subsections, the collected experimental results are demonstrated for both methods, namely output-sync and controller-sync methods. This study captured all data from the hardware setup and then plotted using Matlab software.

A. EXPERIMENTAL RESULTS FOR OUTPUT-SYNC METHOD
The experimental results demonstrating the output-sync method are shown in Fig. 7 and Fig. 8. The CB is disconnected, Inv2 operates at no load, and the syncing is started at t = t 1 by enabling PI 1 and PI 2 . Fig. 7 shows the unsynced voltage before t 1 . The frequencies of the two sources are shown in Fig. 8(a). After the synchronization is started at t 1 , the adjustment terms, δ ω and δ v , make the voltages at both sides of the CB the same. The synced voltages are shown in Fig. 7. Once the synchronization of the inverter output is achieved, the CB is connected at t = t 2 . As the voltages across the CB before the switching are nearly the same, the switching transients are minimum, and the power exchange among the sources is minimal. The measured voltages before and after the CB connection show that the inverter follows the procedure correctly and those voltages become nearly the same before closing the CB. The active and reactive power produced by the two sources are also shown in Fig. 8(b) and Fig. 8(c), respectively. As the seamless transition is achieved, both the sources operate in grid-forming mode.
To make the incoming source share the load demand power with the existing sources, δ ω and δ v need to approach zero gradually. As these terms approach zero, the incoming inverter shares equal active power and the system settles to new operating values. After this, any load change, e.g., 1 kW at t = t 3 , is shared equally among all the sources. This illustrates how the output-sync method can effectively obtain syncing and power-sharing concurrently.
It should be emphasized that the changes in δ ω and δ v must be completed slowly by implementing the feedback loops with the k p coefficient, as shown in Fig. 3. If the process is done rapidly, it might lead to a sudden and significant change in the inverter output voltage and frequency. This can lead to instability and damage to the devices. Therefore, resetting  of PI 1 and PI 2 should be avoided, though it could be an option. On the contrary, if these terms are not enforced to be zero and kept constant at the values built at the end of the synchronization process, the system remains stable, but the incoming inverter contributes less power than the desired value to the system. This is shown in Fig. 9. In this test, the synchronization process was followed as described above, whereas δ ω and δ v were held constant at the values obtained at the end of the synchronization process. As can be seen in Fig. 9, a 1 kW load was added at t = t 3 when the power is unequally shared between the two inverters (sources).

B. EXPERIMENTAL RESULTS FOR CONTROLLER-SYNC METHOD
The experimental results for the controller-sync method are shown in Fig 10 and Fig. 11. Initially, Inv1 supplies 0.48 kW load, and the CB in Fig. 1 is open. The incoming inverter is connected to the rest of the system in (P-Q) mode, position 1 of S 1 through S 4 in Fig. 4. For demonstration purposes, in this test, PI 1 and PI 3 are disabled for t < t 1 to reset P r and Q r to zero, see Fig. 11. In this method, the objective is to make the outputs of the parallel control paths for both V and θ in Fig. 4 identical, i.e., V 1 = V 2 and θ 1 = θ 2 . Notice, one path is always running in the background and only one pair, either (V 1 , θ 1 ) or (V 2 , θ 2 ), get engaged to the PWM generator. The synchronization of the controller  gets started at t = t 1 when P r and Q r are adjusted to meet the desired frequency and voltage. From Fig. 10, one can observe that the phase-angles in the two parallel control paths are initially different, and then become the same as approaching t = t 2 . The voltage magnitude is also synced accordingly. At this point, the incoming inverter shares the load demand as per the droop settings, herein equally. Once the control paths are synced, the control mode is changed to (V-f) control mode at t = t 2 with the minimum transient. It can be seen from the results that as the output of the droop controller is precisely synced with the output of the (P-Q) controller and as the inverter is already at its required active and reactive power, there is an insignificant transient following the change, and the transition is seamless. A load change of 1 kW then occurs at t = t 3 . Both inverters respond to the load change and contribute to the power-sharing based on their droop coefficients; herein again, the power is shared equally, see Fig. 11. It can be concluded that the inverter's syncing and power-sharing are successfully achieved using both methods; however, there are some differences between the methods that are discussed in the following subsection.

C. A COMPARATIVE DISCUSSION ON PROPOSED METHODS
While both the techniques are effective, the differences between the two methods can be summarized as follows: • Number of sensors: Each inverter needs to measure its output voltages and currents after the LC or LCL filter. An additional set of sensors is needed in the output-sync method at the other side of the circuit breaker, whereas the controller-sync method requires only one set since the inverter initially operates in P-Q mode.
• Number of PI controllers: The controller-sync method requires six PIs, whereas the output-sync method needs only three PIs.
• Power-sharing: In the output-sync method, powersharing cannot be achieved until the state transformation is made and the resetting process is completed. However, the controller-sync method can continue to share the demand power (load) in (P-Q) control mode even if the transition to (V-f) mode has not been completed.
• Black-start ability: The controller-sync method starts the inverter initially using the microgrid frequency; therefore, an alternative reference signal is needed for a black-start functionality under blackout conditions. On the contrary, the output-sync method can operate as a black-start inverter with no additional modification.

VI. CONCLUSION
This work has introduced two (re)connection methods for grid-forming inverters; output-sync and controller-sync. Both methods provide a seamless transition for incoming inverters while ensuring power-sharing at the end of the process without communication between the power generation units (inverters). Thus, these methods provide decentralized power-sharing and avoid transients and undesired dynamics in the microgrid. The two techniques are differentiated by the following key characteristics. The output-sync method requires fewer PI controllers but needs two sets of sensors and does not deliver equal power until the state switches are transferred from Position 1 to Position 2. The controller-sync method requires only one set of sensors. In the controllersync method, the circuit breaker can always be kept closed, and the inverter can deliver equal power even before the state switches are transferred from Position 1 to Position 2. The efficacy of these control strategies has been tested in a hardware setup, as also demonstrated in the video clip accompanying this article.