Presynchronous Grid-Connection Strategy of Virtual Synchronous Generator Based on Virtual Impedance

,e virtual synchronous generator (VSG) technology of inverter is widely used to provide the inertia and damping support for power system. However, an additional measurement device PLL (phase-locked loop) is required in the virtual synchronous generator grid connection to track the voltage phase, amplitude, and frequency, which restricts the flexible output of the distributed power generation system. To tackle this challenge, a method for grid-connected control of virtual synchronous generator based on virtual impedance is proposed. It is assumed that there is a virtual power exchange between the synchronous machine and the power grid when the virtual synchronous generator is off-grid, the virtual impedance is developed to calculate the virtual current, and when the virtual current is zero, the output voltage of the VSG can be synchronized with the voltage of the power grid, thereby seamlessly switching between off-grid and grid-connected VSG. A semiphysical simulation platform is built based on RT-LAB; simulation and experimental results show that the proposed grid synchronization control strategy of the VSG can achieve seamless transform between different VSG modes, which is simpler than the conventional synchronization control, while having a good active and reactive power tracing performance.


Introduction
With the rapid economic development, the problems of energy crisis and environmental pollution have become increasingly prominent. Traditional fossil energy is supplemented or replaced by clean energy, which is an important means to ensure sustainable development in the energy field. Distributed power generation has gradually become a new mode of electricity production and renewable energy consumption due to its efficient, flexible, and friendly grid connection characteristics. However, a large number of intermittent and random distributed power sources are connected to the grid, which greatly increases the complexity and difficulty of management and control of the grid and has a major impact on the safe, reliable, and economic operation of the grid. e existing distributed power generation system uses power electronic devices to be integrated into the grid, which is more flexible than traditional power generation systems.
However, the conventional grid-connected inverter has a fast response speed, almost no moment of inertia, and is difficult to participate in grid regulation. Distributed power generation systems cannot provide the necessary voltage and frequency support for the distribution network with distributed power sources, nor can it provide the necessary damping effect for the relatively poorly stable microgrid. e lack of a mechanism to effectively "synchronize" with the distribution network and microgrid affects the friendly compatibility of the distributed power generation system with the existing power grid. If the grid-connected inverter has the external characteristics of a synchronous generator, it will inevitably improve the operating performance of the distributed generation system and the microgrid with the grid-connected inverter. Based on this idea, researchers have proposed the virtual synchronous generator (VSG) technology [1]. By changing the external characteristics of the grid-connected inverter and absorbing the advantages of the synchronous generator, which ensures the stable operation of the system. In 2007, the concept of virtual synchronization was first proposed by the European VCYNC project. e synchronverter algorithm was first proposed to realize the modeling of virtual synchronous generator [2]. In recent years, China has also made outstanding contributions in improving the stability of distributed generation systems with virtual synchronous generators [3].
At present, the technology of virtual synchronous generator has entered the practical stage. In 2016, the State Grid Corporation of China transformed the inverter of wind power generator and photovoltaic power generation system in the Zhangbei Wind-Solar Storage and Transmission Demonstration Project to become the largest virtual synchronous generator demonstration project in the world [4]. In the same year, the photovoltaic virtual synchronous generator developed by the China Electric Power Research Institute Power Distribution Institute was officially launched in the Sino-Singapore Tianjin Eco-City. e technical functions of the virtual synchronous generator are basically realized, and it has entered the optimization phase from preliminary development stage, but there is still room for further research at the system-level grid-connected transient control and application level. A control strategy of VSG self-synchronous inverter is proposed to realize VSG no-load self-synchronization grid connection [5]. e microgrid frequency adjustment method based on virtual synchronous generator is studied to realize different operation modes of off-grid and gridconnected [6,7]. Photovoltaics and energy storage are integrated based on virtual synchronous generator technology, realizing photovoltaic power generation friendly dissipation [8,9]. e charge and discharge control method for DC unit of virtual synchronous generator was studied, and the optimized control method of the state of charge was given [10,11]. Wind power grid-connected system based on virtual synchronous generator was proposed, which realized the goal of friendly grid connection with frequency response capability [12]. e abovementioned literatures all researched the application technology of the virtual synchronous generator in the existing distributed power generation system. In addition, the application of virtual synchronous generator technology for frequency modulation, voltage regulation, and fault was discussed in the context of microgrid operation [13,14]. An electric vehicle charging method has been proposed based on virtual synchronous generator technology in [15]. A new seamless transfer method based on the second-order generalized integrator is proposed in [16], realizing switch from islanded mode to grid-connected mode smoothly. Single-PLL-and multi-PLL-based approaches are presented, and through the PLL presynchronization strategy, the voltage amplitude and phase angle before VSG grid connection are the same. However, PLL's participation in grid voltage lock-in not only makes the control structure more complex, but also makes it difficult to guarantee its accuracy and reliability in the weak grid environment [17][18][19][20].
ese research results have the same basic principles at the level of the inverter-synchronous generator control strategy, the difference lies in the application. It can operate stably in both off-grid and grid-connected operation modes, and switch of operation mode can be realized without changing the controller structure. However, the synchronization time of off-grid seamless switch is long and lacks experimental verification.
In summary, an improved virtual synchronous generator grid-connection method is proposed to solve the problem that the extra measuring device in the traditional gridconnection restricts the flexible output of the distributed generation system, avoid the problems such as nonlinear, slow response and difficult parameter design of the PLL, and realize the more concise and effective VSG smooth grid connection; meanwhile, a semiphysical verification method is given.
is article is organized as follows. e equivalent model of virtual synchronous generator on-grid is given, the principle and the equations are illustrated and deduced in Section 2. e proposed synchronization control strategy of virtual synchronous generator based virtual inertia control is presented in Section 3. Simulations are carried out in MATLAB/Simulink to verify the validity of the proposed method in Section 4. In Section 5, RT-LAB hardware-in-theloop simulation platform was built to verify the effectiveness of the control strategy mentioned in this paper. Various operating conditions with islanded mode, seamless switching, and grid-connected are presented. Finally, the conclusion is given in Section 6.

Equivalent Model of Virtual Synchronous Generator On-Grid
If the virtual synchronous generator is equivalent to a voltage source, the equivalent circuit of single-phase virtual synchronous generator grid connection system is shown in Figure 1, where e is the excitation voltage of a virtual synchronous generator, E is the virtual synchronous generator excitation voltage amplitude, i is the output current of virtual synchronous generator, X S is the line impedance, u g is the grid voltage, U g is the amplitude of grid voltage, α g is the phase angle of the grid voltage, and α is the phase angle of the excitation voltage of VSG. e active power transmitted by the virtual synchronous generator is shown in the following equation: where δ is the virtual power angle. e transmission of reactive power by the virtual synchronous generator is shown by When the virtual synchronous generator is connected to the grid, the frequency, phase, and amplitude of the output voltage should be close to the grid voltage, which is expressed by where f, E, and α are the voltage frequency, amplitude, and phase of the virtual synchronous generator, respectively, g subscript is the grid side variable, min subscript is the set safety threshold, and the safety thresholds f min , U min , and α min in the optimal grid-connected case are zero. From equations (1) and (2), it can be seen that the power transmission equation of virtual synchronous generator grid-connected mainly depends on the voltage amplitude and phase angle; that is, to meet the requirements of smooth grid-connected, the safety threshold should meet the requirements of the following equation: Substituting equations (3) and (4) into equations (1) and (2), the following equation is obtained: It can be seen that the synchronization of the virtual synchronous generator to the grid can be understood as that the active power and reactive power transmitted by the virtual synchronous generator to the grid are zero. e output power of the virtual synchronous generator is deduced under the assumption that the virtual synchronous generator is connected to the grid, but the actual situation is that the virtual generator is off-grid and has no output power under the no-load state. In order to give the control strategy of virtual synchronous generator with zero output power, a virtual power exchange between a virtual synchronous generator and the grid is needed.

Synchronization Control Strategy of Virtual
Synchronous Generator e virtual synchronous generator is composed of DC power supply, DC/AC inverter, and filter circuit. e DC power supply can be regarded as the prime mover to provide the power required by the virtual synchronous generator. e control system of inverter is the core of VSG, which mainly includes VSG ontology model and control algorithm. e former mainly simulates electromagnetic relationship and mechanical motion of synchronous generator from mechanism, while the latter simulates active frequency modulation and reactive voltage regulation and other characteristics of synchronous generator from external characteristics. e basic equation of virtual synchronous generator is shown in the following equation: where T m is the virtual mechanical torque, D p is the virtual damping coefficient, J is the virtual moment of inertia, M f is the mutual inductance coefficient, u and i are the measured voltage and current, T e is the virtual electromagnetic torque, i f is the virtual excitation current, θ is the electrical angle, e is the excitation voltage, ω is the angular velocity, ω � dθ/dt, and ω ref is grid synchronization angular velocity. sin θ and cos θ are defined as follows: e control part mainly includes power-frequency regulator, excitation regulator, and presynchronization unit, as shown in Figure 2. e output active power P of VSG is composed of the active power reference value P ref and the frequency change difference ΔP as follows: e coefficient D p is also commonly called the P-f droop control coefficient and is a set value that reflects the active Similarly, D q is the reactive power-voltage droop control coefficient, which reflects the reactive power-voltage droop control characteristics (Q − U characteristics). Due to the existence of reactive voltage droop control, the VSG can participate in the primary voltage regulation of large power grid; when the voltage amplitude of the power grid is lower than (higher than) the rated voltage U ref , the reactive power Q of VSG output is higher than (lower than) the fixed value of reactive power rate Q ref .
e basic control of virtual synchronous generator includes virtual speed regulation control and virtual excitation control. Based on the aforementioned mathematical model of virtual synchronous generator and typical active frequency drooping characteristic, virtual speed regulation control adopts the double-loop structure of power outer loop frequency inner loop to simulate the active powerfrequency characteristic, inertia, and damping link of the synchronous generator. Virtual excitation control does not involve the abovementioned mathematical model, but mainly considers the external characteristics of virtual synchronous generator, so the traditional reactive powervoltage droop control structure is adopted [21].
In order to connect the virtual synchronous generator to the power grid smoothly, the traditional control method needs the special PLL to provide the voltage, frequency, and phase angle of the power grid to realize the synchronization, but the PLL is a nonlinear element and it takes time to adjust the parameters of the PLL. When there are multiple PLL in a system, these PLL will attempt to interlock, reducing the performance and stability of the system and increasing the complexity of the system. erefore, in the virtual synchronous generator island/ grid switching process, this paper proposes a virtual synchronous generator presynchronization method based on virtual impedance; the virtual impedance designed by this method is to virtualize a power exchange between virtual synchronous generator and the grid.
Assuming that there is a virtual impedance X V between the VSG terminal and the power grid, and α g � 0, the output virtual active power P V of the VSG is where the virtual impedance X V and the virtual impedance angle φ V satisfy e virtual current can be obtained by dividing the deviation between e and the grid voltage u g by the virtual synchronous reactance: where i V is the virtual current, L 1 and R 1 constitute the virtual impedance, R 1 is the virtual resistance, and L 1 is the virtual inductance. In theory, the smaller the L 1 is, the faster the system synchronizes. However, when L 1 is too small, the synchronous control process will be shaken, so L 1 is generally slightly smaller than the filter inductance L S . It can be seen from equation (10) that when the amplitude and phase of the VSG output voltage and the grid voltage are exactly the same, the virtual power P V is equal to 0, so PI closed-loop control of the virtual power is needed to synchronize the VSG output voltage with the grid voltage. However, the premise of this method is that the amplitude and frequency of E and U g are the same. erefore, the presynchronization control unit based on virtual impedance and voltage frequency control is designed as shown in Figure 2, assuming a virtual impedance exists between virtual synchronous generator output voltage and the grid voltage, the virtual current can be calculated as shown in equation (12).
In off-grid state, switch S a and switch S c are closed to make the voltage amplitude and frequency of VSG consistent with the grid, the VSG, and load form a microgrid, which runs in the V/F mode. en switch B 1 is closed to realize the synchronization of the VSG output voltage and the grid voltage. After the synchronization is completed, while closing the grid-connected switch, turn off the switch S a and S c , and then VSG is pulled into synchronization by the grid.
If VSG is running in VF state, S a and S c are already closed, the switch B 1 can be closed directly to synchronize the VSG output voltage with the grid voltage.
In the grid-connected state, the switch B 2 is closed, the real current i g is routed into the controller for normal operation, and the virtual synchronous generator runs in grid-connected mode.

Simulation Analysis
Based on the above research, this paper uses MATLAB/ Simulink software for simulation verification; the simulations are based on the microgrid configuration in Figure 3, which operates in islanded mode before t � 0.04 seconds. e values of relevant parameters in equations and block diagrams of this paper are shown in Table 1.
Comparing the grid connection control method proposed in this paper with the direct interconnection method of virtual synchronous generator, the simulation results are in Figure 4.
When the virtual synchronous generator is running with load, the voltage amplitude and frequency are consistent with the power grid, and there is a phase difference between the output voltage of the virtual synchronous generator and the power grid voltage, as shown in Figure 4. When t � 0.04 s, direct interconnection will generate a large inrush current. It adversely affects the stable operation of the virtual synchronous generator and cannot meet the requirements for smooth grid connection.
Adopting the presynchronization control method based on virtual impedance, the virtual synchronous generator tracks the voltage phase of the power grid through continuous adjustment, as shown in Figure 5, the output voltage of the virtual synchronous generator is kept in synchronization with the grid voltage, and there is no inrush current after the grid connection operation; the island/grid connection is realized seamlessly.

Experimental Verification
RT-LAB hardware-in-the-loop simulation platform was built to verify the effectiveness of the control strategy mentioned in this paper [22,23], which includes a controllable load, a 10 kW·h lithium battery energy storage system, a 10 kW converter, RT-LAB, and a simulated power grid, as shown in Figure 6. Among them, RT-LAB is designed as a virtual synchronous generator controller, which simultaneously collects the voltage, current, frequency, etc., of the converter and the simulated power grid and sends out control pulses to form a closed loop. e lithium battery is used as a DC power source, and the lithium battery plus converter system is a virtual synchronous generator, which is directly connected to the controllable load and supplies power to the controllable load. First, the energy storage virtual synchronous generator and the controllable load form an isolated microgrid, which runs in the V/F mode with a frequency of 50 Hz. e controllable load suddenly increases by 0.5 kW at t � 6 seconds; then the virtual impedance strategy is started at t � 9 seconds. e isolated microgrid is connected to the simulated power grid through a control switch a t � 10 seconds and switches from off-grid to grid-connected mode. e experimental results of the VSG off-grid process are shown in Figures 7-12.   According to the test waveforms of the virtual synchronization machine during the off-grid connection, the control strategy proposed in this paper can achieve synchronization with the power grid before closing. When the virtual synchronous generator is running in island mode, the frequency is stable at 50 Hz, and the load power is suddenly increased, causing the frequency to drop at t � 6 s and quickly recover to 50 Hz, effectively reducing frequency fluctuations  Mathematical Problems in Engineering during the switching process at t � 10 s, as shown in Figure 7. Figures 8-11 show that there is no obvious impact on active and reactive power of virtual synchronous generator and the grid when closing at 10 s. e control strategy based on virtual impedance can achieve synchronization with the grid voltage in 0.25 s as shown in Figure 12, and the circuit breaker is turned on at t � 10 s, the frequency changes smoothly and then recovers. Actually, we can close the circuit breaker at any time after t � 9.25 s without obvious impact.
In the process of grid connection, the impact of active power and reactive power is significantly reduced, and the output power is smoothly transitioned to achieve a flexible grid connection of the distributed power generation system. At the same time, this paper builds a semiphysical simulation platform through RT-LAB, forms a hardware-in-theloop real-time simulation system, completes the inspection of the controller algorithm strategy, and provides a reference for the control of the converter's virtual synchronous generator.

Conclusion
In this paper, a grid synchronization control strategy for virtual synchronous generator based on virtual impedance is proposed, which enables the grid-connected inverter to participate in the voltage amplitude and frequency adjustment of the large grid when it is connected to the grid, and can operate in V/F mode to supply power to the local load when off-grid. e power tracking and seamless switching capability of the control strategy are verified by RT-LAB semiphysical simulation platform. e voltage of the virtual synchronous generator can be synchronized with the power grid by using the controller itself without the need of PLL, which is simpler and more effective than the traditional virtual synchronous generator grid connection method, which avoids the problems of nonlinearity, slow response, and difficult parameter design of the phase-locked loop.
As this controller solves the problem that the additional measurement devices restrict the flexible output of the   distributed power in the traditional grid connection, this improves the power grid's ability to accept distributed power generation units.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest regarding the publication of this paper.