Introduction

Parallel power supply of synchronous generator (SG) and inverter is widely used in various independent power systems1,2, such as island and remote mountain power supply system, ship power system and so on. Constant power control, constant voltage/frequency control, droop control, virtual synchronous generator (VSG) control are commonly used in inverters. Among them, constant power control does not participate in the voltage adjustment and frequency adjustment of the system, and is only suitable for the grid-connected operation of inverters3. Constant voltage/frequency inverter is usually used as the main control power supply of constant voltage and constant frequency in microgrid4, providing voltage reference and frequency support for independent microgrid. By simulating the primary frequency modulation and primary voltage regulation characteristics of SG, sag control can realize the active and reactive power equalization of multiple parallel inverters without interconnection lines5,6,7,8. VSG control is based on droop control, and the simulation of SG mechanical motion and electromagnetic relationship is added, which can solve the problem of insufficient inertia and damping of distributed generation. Since it was put forward, it has been widely concerned by scholars at home and abroad9,10,11.

In the parallel power supply system of synchronous generator and inverter, the inverter adopts VSG control strategy and is connected to the system in the form of voltage source, which can provide inertia for the system and participate in the power adjustment of the system according to the set droop characteristics. It can avoid the complicated switching process of traditional constant voltage/frequency control and constant power control and the problems of reverse power of generator caused by sudden reduction of load, this allows the inverter to plug and play and autonomously coordinate operation12. Aiming at the problem of steady-state power equalization between inverters based on droop control and VSG control, the research has been mature at present, and the control methods based on virtual impedance, virtual capacitance and line impedance identification have achieved good control results13,14,15. After appropriate improvement, these methods can also be applied to parallel systems between inverters and synchronous generators, but VSG and SG cannot achieve transient power equalization during sudden load increase and reduction, and VSG may have overcurrent faults due to taking most of the loads in transient process. In order to ensure the safe operation of the system, the inverter will reserve a certain amount of transient reserve capacity, which makes the inverter capacity can not be fully utilized.

In16, for isolated island microgrid with SG and VSG, transient virtual impedance is introduced to prevent VSG overcurrent when load suddenly increases, but the problem of uneven distribution of transient power is not solved. On the basis of analyzing the output impedance of synchronous generator, a transient power sharing control method based on improved dynamic virtual impedance is proposed in17, which has certain effect on improving transient power sharing. However, the influence of synchronous generator speed regulation and excitation dynamics on power uneven sharing is not considered, and transient power distribution is still different. In18, a dynamic sag coefficient control method based on proportional and high-pass filter term is proposed, which improves transient power averaging in parallel operation. However, the introduction of dynamic sag coefficient deteriorates the power supply quality and frequency and voltage regulation ability of inverter. In19, the mechanism of transient active power distribution between diesel generator and virtual synchronous generator in isolated island microgrid is analyzed. By introducing phase shift control and active power response delay into VSG control, the transient active power sharing effect is improved, but the transient reactive power sharing and the influence of voltage change caused by reactive power on transient active power sharing are not considered in the analysis process. In20, the causes of uneven transient power distribution between droop control inverter and synchronous generator is analyzed. By introducing Parker equation of synchronous generator and speed regulation and excitation links, a control strategy of inverter which precisely simulates synchronous generator is proposed. In21, a control method for simulating diesel generator is put forward, which makes the inverter consistent with the conventional diesel generator model, speed regulating system and voltage regulating system in terms of control order, logic, parameters and so on. However, the mechanism of uneven transient power distribution has not been studied in detail in20 and21, and the improved control strategy is based on the complex mathematical model of synchronous generator, which requires accurate physical parameters of synchronous generator. The control strategy is complex and the control flexibility is not high.

On the basis of revealing the mechanism of transient power unevenness between VSG and SG, this paper introduces virtual speed regulation, virtual excitation, dynamic virtual impedance into the traditional VSG control algorithm, which effectively solves the problem of transient power unevenness when VSG and SG run in parallel due to the difference of speed regulation characteristics and electromagnetic transient characteristics. In order to take into account the ability of fast frequency modulation and voltage regulation under independent operation mode, a mode switching control is designed to keep the traditional VSG control in independent operation mode, and virtual speed regulation, virtual excitation and dynamic virtual impedance are added in parallel operation mode, so that the independent and parallel operation modes can be smoothly switched and the requirements of independent operation and parallel operation can be met at the same time. Hardware in loop test based on RT-LAB controller verifies the effectiveness of the proposed control strategy.

Description of transient power inequality between VSG and SG

Introduction of VSG control principle

The VSG topology and control block diagram are shown in Fig. 1, where C, L and R are filter capacitor, bridge arm filter inductor and internal resistance respectively, L1 and R1 are the load side filter inductance and internal resistance, respectively.

Figure 1
figure 1

Traditional VSG topology and control system structure.

In Fig. 1, ignoring the filter capacitor, the frequency domain transfer function of the VSG main circuit can be expressed as:

$$ u_{{\text{o}}} = \frac{1}{{LCs^{2} + RCs + 1}}e{ - }\frac{Ls + R}{{LCs^{2} + RCs + 1}}i = G_{u} (s)e - G_{Z} (s)i $$
(1)

According to the design principle of filter circuit, the filter circuit parameters in VSG main circuit are selected as L = 0.6mH, C = 80μF and R = 6 mΩ. The Bird diagram of impedance gain Gz(s) and voltage gain Gu(s) is shown in Fig. 2. As shown in Fig. 2a, the output impedance of VSG shows inductive characteristics in the fundamental and low-order harmonic frequency bands. Near the resonant frequency, the output impedance amplitude is amplified. It shows capacitive characteristics in high frequency band. As shown in Fig. 2b, the voltage gain of VSG is 1 in fundamental and low harmonic frequency bands. Near the resonant frequency, the amplitude of harmonic voltage is seriously amplified. In high frequency band, the amplitude of harmonic voltage decays rapidly.

Figure 2
figure 2

Bird diagram of impedance gain Gz(s) and voltage gain Gu(s) of VSG.

Based on above analysis, the relationship between the fundamental component of VSG output voltage uo and its modulated signal e is described as follows:

$$ u_{{\text{o}}} = \left[ \begin{gathered} u_{a} \hfill \\ u_{b} \hfill \\ u_{c} \hfill \\ \end{gathered} \right] = \left[ \begin{gathered} e_{a} \hfill \\ e_{b} \hfill \\ e_{c} \hfill \\ \end{gathered} \right] - jX\left[ \begin{gathered} i_{a} \hfill \\ i_{b} \hfill \\ i_{c} \hfill \\ \end{gathered} \right] = E_{ref} \left[ \begin{gathered} \cos (\omega t) \hfill \\ \cos (\omega t - 120^{0} ) \hfill \\ \cos (\omega t + 120^{0} ) \hfill \\ \end{gathered} \right] - jX\left[ \begin{gathered} i_{a} \hfill \\ i_{b} \hfill \\ i_{c} \hfill \\ \end{gathered} \right] $$
(2)

where Eref is the amplitude of the modulated signal, and X is the equivalent reactance value of VSG output impedance Gz(s) in fundamental frequency band.

In summary, VSG equates the bridge arm voltage of grid-connected inverter to the excitation induced electromotive force of traditional synchronous generator stator winding. The impedance of filter circuit is equivalent to synchronous reactance of synchronous generator, and the filtered output voltage is equivalent to stator winding terminal voltage.

VSG control uses inverter to simulate the running characteristics of synchronous generator to provide the moment of inertia and damping needed for stable operation of the system, and has the functions of primary frequency modulation and voltage regulation, which is mainly composed of active power–frequency and reactive power-voltage control links. Active power–frequency link is used to simulate the primary frequency modulation and rotor motion equation of synchronous generator. In the standard value system, the rated capacity and rated voltage of inverter are taken as reference values, active power frequency droop characteristics and rotor motion equation are shown in (3).

$$ \left\{ {\begin{array}{*{20}l} {P_{{\text{m}}} = P_{{\text{n}}} + \frac{1}{{K_{{\text{P}}} }}(\omega - \omega_{{\text{n}}} )} \hfill \\ {2H\frac{{{\text{d}}\omega }}{{{\text{d}}t}} = P_{{\text{m}}} - P_{{\text{e}}} - D(\omega - \omega_{{\text{n}}} )} \hfill \\ {\frac{{{\text{d}}\theta }}{{{\text{d}}t}} = \omega \omega_{{\text{b}}} } \hfill \\ \end{array} } \right. $$
(3)

where Pn is the rated active power of VSG, Kp is the active-frequency sag coefficient, Pm and Pe are the virtual mechanical power and the output active power of the virtual synchronous generator. When the number of pole pairs is 1, the electrical angular velocity ω of synchronous generator is its mechanical angular velocity. ωn is the rated angular velocity, ωb is the reference value of angular velocity. θ is the virtual rotor angle, H is the time constant of virtual inertia, D is the virtual damping coefficient.

The reactive power-voltage control link mainly realizes reactive power-voltage sag control, and the output voltage amplitude command Eref is obtained according to the current output reactive power and the given sag relationship.

$$ E_{{{\text{ref}}}} = E_{{\text{n}}} + K_{{\text{q}}} (Q_{{\text{n}}} - Q_{{\text{e}}} ) $$
(4)

where En is the rated voltage, Kq is reactive power sag coefficient, Qn is the rated reactive power of VSG, Qe is the reactive power of the VSG output. The voltage amplitude Um feedback from the filter capacitor is introduced, and the internal potential E is obtained after PI link control, so that the VSG output voltage can quickly track the voltage command.

Synchronous generator control and characteristics

Generator control includes prime mover governor (GOV) and automatic voltage regulator (AVR). For the convenience of analysis, the GOV and AVR of synchronous generators are simplified by single closed-loop PI control, and the prime mover and its speed regulation characteristics and exciter dynamic characteristics are equivalent by first-order inertia links respectively. The control block diagram is shown in Fig. 3, Kps and Kqs are the active power–frequency and reactive power-voltage sag coefficients of synchronous generators respectively. Td is the time constant of the first order inertia link of the prime mover and its speed regulating mechanism. Te is the time constant of the first order inertia link of exciter. Ef is the generator excitation voltage. PM is the input mechanical power of prime mover.

Figure 3
figure 3

Speed control and exception control block diagram of synchronous generator.

Transient power unevenness between VSG and SG

The physical and control structures of the two kinds of power supply are different. When the load increase or decrease suddenly, VSG and SG can’t realize transient power sharing equally. Build the simulation model as shown in Fig. 4, and the system equipment parameters are shown in Table 1 and Table 2.

Figure 4
figure 4

Simulation system topology.

Table 1 Virtual synchronous generator electronic and control parameters.
Table 2 Synchronous generator electronic and control parameters.

Simulation conditions: initially, two VSG and two SG are put into operation at the same time with 600 + j450 kVA resistance inductance load; when t = 20 s, the resistive and inductive load of 600 + j450 kVA suddenly increases; when t = 30 s, the resistive and inductive load of 600 + j450 kVA is suddenly reduced. As shown in Fig. 5, the simulation results show that there is a large overshoot in the active and reactive power output of each VSG. This kind of current overshoot in transient process may lead to inverter overcurrent. If a part of inverter capacity is reserved to ensure that overcurrent hazard does not occur during transient loading, the inverter capacity will not be fully utilized.

Figure 5
figure 5

Simulation results of load mutation in parallel operation of traditional VSG and SG.

Mechanism of uneven distribution of transient power

In order to suppress the output active power oscillation in grid-connected VSG without affecting the steady-state output power, an improved VSG control strategy based on transient electromagnetic power compensation is proposed in this section.

Equivalent circuit model

The output voltage frequency and amplitude of synchronous generator are determined by prime mover governor and excitation controller, respectively. The equivalent output impedance of synchronous generator is the sum of q-axis reactance Xq and line impedance. During the transient process, q-axis is affected by the sub-transient process of damping winding, and the sub-transient reactance Xq of q-axis transients rapidly to synchronous reactance Xq.

In VSG control, voltage and current double closed-loop control has high bandwidth, and its output signal can track the given value quickly, so its influence is ignored in this paper. VSG is equivalent to a controlled voltage source with ideal AC power supply and impedance in series. Low-voltage transmission lines generally present resistivity, but inverter can make the output line present inductance by configuring isolation transformer and designing virtual impedance.

Establish the equivalent circuit of VSG and SG parallel power supply shown in Fig. 6. UVSG is the output phase voltage amplitude of reactive power-voltage control loop in VSG, θVSG is the phase generated by virtual rotor motion equation in VSG control algorithm, XVSG is the sum of load side filter reactance, transmission line reactance and virtual reactance. USG is the transient electric potential E 'q of the synchronous generator, θSG is determined by the rotation angle of the synchronous generator, and XSG is the sum of the generator output reactance and the transmission line reactance.

Figure 6
figure 6

Equivalent circuit of VSG and SG parallel system.

Difference analysis of active power–frequency control link

According to the equivalent circuit model shown in Fig. 6, the line impedance is purely inductive, ignoring the influence of voltage amplitude change, the output voltage of VSG and SG and the voltage amplitude of common point are considered to be constant. The expressions of VSG and SG output active power are derived and analyzed by small signal:

$$ \Delta P_{{\text{k}}} = \frac{3}{2}\frac{{U_{{\text{k}}} U_{{{\text{pcc}}}} }}{{X_{{\text{k}}} }}\cos \delta_{{{\text{k0}}}} \Delta \delta_{{\text{k}}} = \frac{{K_{{{\text{ck}}}} \omega_{{\text{n}}} }}{s}(\Delta \omega_{{\text{k}}} - \Delta \omega_{{{\text{pcc}}}} ) $$
(5)

where the subscript “k” represents VSG or SG, δk is the phase difference between the output voltage of VSG or SG and the voltage of the common connection point, δk = ∫(ωk-ωpcc)ωndt, Upcc and ωpcc are the phase voltage amplitude and angular frequency of the common connection point respectively, Kck = 3UkUpcccosδk0/2Xk.

According to the control block diagram and (5), the transfer function relationship between VSG output power and angular frequency of common connection point is represented as (6), the transfer function relationship between SG output power and angular frequency of common connection point is described as (7). KP2p and KP2i in (7) are the proportional and integral parameters of PI2 module in Fig. 2 respectively; HSG and DSG are inertia time constant and damping coefficient of generator respectively.

$$ \frac{{\Delta P_{{{\text{VSG}}}} }}{{\Delta \omega_{{{\text{pcc}}}} }} = - \frac{{(2Hs + 1/K_{{\text{p}}} + D)K_{{{\text{cVSG}}}} \omega_{{\text{n}}} }}{{2Hs^{2} + (1/K_{{\text{p}}} + D)s + K_{{{\text{cVSG}}}} \omega_{{\text{n}}} }} $$
(6)
$$ \frac{{\Delta P_{{{\text{SG}}}} }}{{\Delta \omega_{{{\text{pcc}}}} }} = - \frac{{K_{{{\text{cSG}}}} (2H_{{{\text{SG}}}} \omega_{{\text{n}}} T_{{\text{d}}} s^{3} + 2H_{{{\text{SG}}}} \omega_{{\text{n}}} s^{2} - K_{{{\text{P2p}}}} \omega_{{\text{n}}} s - K_{{{\text{P2i}}}} \omega_{{\text{n}}} )}}{{2H_{{{\text{SG}}}} T_{{\text{d}}} s^{4} + (2H_{{{\text{SG}}}} + D_{{{\text{SG}}}} T_{d} )s^{3} + As^{2} + Bs + C}} $$
(7)

where \(A = D_{{{\text{SG}}}} + K_{{{\text{P2p}}}} + K_{{{\text{cSG}}}} \omega_{{\text{n}}} T_{{\text{d}}}\), \(B = K_{{{\text{P2i}}}} + K_{{{\text{cSG}}}} \omega_{{\text{n}}} (K_{{{\text{pSG}}}} K_{{{\text{P2p}}}} + 1)\), \(C = K_{{{\text{cSG}}}} \omega_{{\text{n}}} K_{{{\text{pSG}}}} K_{{{\text{P2i}}}}\).

Set ΔPVSGωpcc = GVSG and ΔPSGωpcc = GSG, based on ΔPVSG + ΔPSG = ΔPload, the following relationship can be obtained.

$$ \Delta P_{{{\text{VSG}}}} (1 + \frac{{G_{{{\text{SG}}}} }}{{G_{{{\text{VSG}}}} }}) = \Delta P_{{{\text{load}}}} $$
(8)
$$ \Delta P_{{{\text{SG}}}} (1 + \frac{{G_{{{\text{VSG}}}} }}{{G_{{{\text{SG}}}} }}) = \Delta P_{{{\text{load}}}} $$
(9)

The transfer functions between VSG and SG output power and load power in parallel operation can be obtained from (8) and (9), respectively.

Considering the relevant parameters of VSG1 and SG1 in Fig. 4, the influence of the difference of active power–frequency control links on transient active power distribution is mainly analyzed here. Considering the influence of output impedance on power distribution in the initial stage of transient process, XSG = Xʺq + Xl_SG1. The step response of VSG and SG output power to load is shown in Fig. 7, VSG output power can respond to load changes quickly, resulting in VSG bearing most of the load during transient process.

Figure 7
figure 7

Step response of VSG and SG output power to active load.

Difference analysis of reactive power-voltage control link

According to the third-order mathematical model of synchronous generator, the following relation can be obtained.

$$ E_{{\text{q}}}{\prime} = (E_{{{\text{fd}}}} - (X_{{\text{d}}} - X_{{\text{d}}}{\prime} )I_{{\text{d}}} )\frac{1}{{T_{{{\text{d0}}}}{\prime} s + 1}} $$
(10)

where Td0 is the d-axis transient open-circuit time constant, Efd is the stator excitation electric potential, Eq is the q-axis transient electric potential, Xd is the d-axis synchronous reactance of synchronous generator, Xd is the d-axis transient reactance of synchronous generator.

Equation (10) shows that there is a first-order inertia link between SG transient electric potential Eq and excitation voltage, which makes the output voltage unable to respond to the change of reactive load immediately, and armature reaction will also have an impact on excitation voltage regulation. In VSG control algorithm, the output variable E of reactive power-voltage control link is the output port voltage of inverter, which is equivalent to the amplitude of internal electric potential of VSG, and does not involve the simulation of electromagnetic transient process of excitation winding. In the parallel power supply system of VSG and SG, VSG can quickly respond to the change of reactive load and bear most reactive load in transient process.

Output impedance difference analysis

During the transient process, the equivalent output impedance of the synchronous generator transients quickly from the sub-transient reactance Xʺq to the q-axis synchronous reactance Xq. In the per unit system of synchronous generator, the value range of Xq is 1.0 ~ 2.3, while the filter reactance of low-voltage inverter is generally 0.2 ~ 1, and the output impedance of VSG only needs to consider the filter reactance of load side. The output impedance of SG is much larger than that of VSG. The output impedance difference determines the power distribution in the initial power frequency periods of load mutation, and is approximately inversely proportional to the output impedance22, so VSG will bear more loads in the initial stage of load mutation.

Improved algorithm for transient power equalization

Improve control algorithm and process

To realize transient power equalization of VSG and SG parallel power supply system, virtual speed control, virtual excitation control and dynamic virtual impedance are introduced into the traditional VSG control algorithm during parallel operation. At the same time, in order to ensure the fast voltage regulation and frequency modulation ability of VSG when it runs independently, it switches to the traditional VSG algorithm when it runs independently. A mode switching control strategy based on state tracking is designed, which ensures that the input voltage reference values of frequency and voltage outer loop in the two modes are consistent at switching time, prevents the impact caused by sudden change of phase and voltage reference values during switching, and realizes smooth switching between independent and parallel operation modes.

The operation flow chart is shown in Fig. 8, and the improved control algorithm is shown in Fig. 9. When running independently, the switch S is set to “1”. When receiving the networking instruction, if ω2 = ω1 and Eq = E, all mode switching switches S are switched to “2”, and the pre-synchronization control switch S1 is closed at the same time, check whether the amplitude, phase and frequency of voltage on both sides of the grid meet the networking conditions, if the conditions are met, the closing operation is completed, and the pre-synchronization switch S1 is disconnected. When receiving the separation instruction, if ω2 = ω1 and Eq = E, all the switching switches S are switched to “1”, and then the separation is performed. The following is a detailed introduction to each improved control link.

Figure 8
figure 8

Operation process of improved control algorithm.

Figure 9
figure 9

Improved VSG control method.

Improvement of active power–frequency control link

The improved active power–frequency control link is shown in Fig. 9a. When running independently, S is set to “1”, and the active power–frequency control link keeps the traditional VSG control. When the network is running in parallel, S is set to “2”, the dynamic response of the speed control link of prime mover and the equivalent inertia link of the speed control mechanism can be simulated. In steady-state operation, the output frequency and power of the two modes meet the droop relationship, and the output frequency values of positions “1”and “2” are the same, which can ensure that the phase before and after switching does not change abruptly.

The design principle of related parameters is as follows: In traditional VSG control, the virtual damping coefficient D affects the droop characteristics of the control, and 1/Kp + D is the equivalent frequency-active droop coefficient. However, in the improved control method, the virtual damping coefficient D' no longer affects the droop control effect, and 1/K'p is the equivalent frequency-active droop coefficient, which determines the steady-state power sharing between VSG and SG, and should be matched with the active-frequency droop coefficient Kps in SG governor. Td is set with reference to the equivalent inertia time constant of synchronous generator speed regulating mechanism. The virtual inertia time constant H ' and virtual damping coefficient D ' are consistent with SG, so that the output power response characteristics of VSG are consistent with SG.

Improvement of reactive power–voltage control link

The improved reactive power-voltage link is shown in Fig. 9b, and the reactive power-voltage sagging link maintains the relationship of (4) when operating independently and in parallel. Switching control is introduced into the inverter output voltage tracking control link after droop link. When running independently, all switching switches S are set to “1”, keeping the traditional VSG control algorithm, and the output internal electrical potential amplitude instruction E is directly obtained by PI3 control link, and E is taken as the reference value of control variable Eq, and Eq virtual tracking E is realized by PI2 control link. During network operation, S is set to “2”, VSG introduces the electromagnetic transient process of synchronous generator excitation winding through (9), Eq is the output internal electrical potential amplitude of VSG in parallel operation mode, where Td0, Xd and Xd are set with reference to the standard value parameters of parallel SG, Eq is taken as the reference value of control variable E, and E virtual tracking Eq is realized through PI3 control link.

The Eq and E variable tracking control links ensure that the internal electrical potential is consistent during switching and reverse switching, and smooth switching can be realized between modes. The parameters of PI2 and PI3 control links in Fig. 9 are adjusted according to VSG operation characteristics. In order to make the control parameters shared with E and Eq tracking links, the proportional coefficients C1 and C2 are multiplied after Eq and E feedback links respectively to adapt to PI control parameters.

Dynamic virtual impedance design

Virtual impedance technology can change the output impedance characteristics of inverter and reduce the difference of output impedance characteristics between VSG and SG. In order to ensure that the voltage reference value does not change suddenly when the operation mode is switched, on the basis of the same phase and internal electrical potential amplitude, it is still necessary to ensure that the virtual impedance in the two modes is equal at the switching time. If the design of virtual impedance parameters matches the output impedance of SG, the larger virtual impedance will deteriorate the dynamic characteristics of VSG when it runs independently. Therefore, this paper proposes a dynamic virtual impedance algorithm, which can not only ensure that there is no impulse current at the time of mode switching, but also provide a larger virtual impedance during the load mutation process in the parallel operation mode of the network, and improve the problem of uneven distribution of transient power between VSG and SG caused by mismatch of output impedance. VSG virtual impedance is described as (11).

$$ \left\{ \begin{gathered} U_{{{\text{dr}}}} = 0 - R_{{\text{v}}} I_{{\text{d}}} + X_{{{\text{qv}}}} I_{{\text{q}}} \hfill \\ U_{{{\text{qr}}}} = E_{{\text{q}}}{\prime} - R_{{\text{v}}} I_{{\text{q}}} + X_{{{\text{dv}}}} I_{{\text{d}}} \hfill \\ \end{gathered} \right. $$
(11)

where Rv is the virtual resistance, Xdv and Xqv are d-axis and q-axis virtual reactance respectively.

The dynamic virtual impedance design method is shown in Fig. 9c, Rv is generally small, and the set values in the two modes are consistent. D-axis virtual reactance and q-axis virtual reactance consist of constant term and dynamic variation, respectively.

$$ \left\{ \begin{gathered} X_{{{\text{dv}}}} = X_{{{\text{ds}}}} + X_{{{\text{dt}}}} \hfill \\ X_{{{\text{qv}}}} = X_{{{\text{qs}}}} + X_{{{\text{qt}}}} \hfill \\ \end{gathered} \right. $$
(12)

Constant terms Xds and Xqs are virtual reactance in steady state, which are used to improve power distribution at load abrupt change time. The transient variations Xdt and Xqt are introduced under the load abrupt change condition, and the output current amplitude variation ΔIm of VSG is used to judge the load abrupt change condition. ΔIm is obtained by the difference between the output instantaneous current amplitude Im and the current amplitude after it passing through the first-order inertia link, the first-order inertia time constant T is set as the virtual inertia time constant H′. When ΔIm exceeds the set threshold ε, it is judged as a load abrupt change condition, and the absolute value of the part exceeding the threshold value is multiplied by the proportional coefficients Pd and Pq respectively to obtain the dynamic changes Xdt and Xqt of the virtual impedance. Taking Xqt as an example, the expression is represented as (13).

$$ X_{{{\text{qvt}}}} = \left\{ \begin{array}{ll} 0, &\quad \left| \Delta I_{{\text{m}}} \right| < \varepsilon \\ P_{{\text{q}}} (1 - \varepsilon )\left| \Delta I_{{\text{m}}} \right|,&\quad \left| \Delta I_{{\text{m}}} \right| > \varepsilon \end{array} \right. $$
(13)

If the value of ε is too small, the dynamic virtual impedance will intervene when the disturbance is small, which is not conducive to the stability of the system. If the value is too large, the load mutation condition cannot be effectively detected. In the standard value system, ε is generally 0.08. The proportional coefficients Pd and Pq are flexibly set with reference to the ratio of the equivalent output impedance of SG to the equivalent output impedance of VSG.

When heterogeneous power supply operating independently, the switch S is set to “1” and the virtual impedance is a constant. When heterogeneous power supply running in parallel, the switch S is set to “2”, and the dynamic virtual impedance is introduced to improve the transient power distribution. The dynamic change of the virtual impedance under steady-state conditions is 0, and the virtual impedance is the same as that under independent operation, which can ensure smooth switching between modes.

Experiment verification

Based on RT-LAB real-time simulator (HBUREP-100) and DSP controller (TMS320F28335), a hardware-in-loop test platform is constructed to verify the effectiveness of the proposed control strategy. As shown in Fig. 10, the platform consists of upper computer, HBUREP-100 real-time simulator, controller, oscilloscope and other parts. The model of VSG and SG parallel system is built in the upper computer. The C code compiled from the model is loaded into the HBUREP-100 simulator to run, and the analog electrical signal and switching digital signal needed by the inverter control algorithm are output, and the control signal input by the controller is received. The controller collects the analog signal and digital signal output by HBUREP-100 simulator and realizes the control algorithm.

Figure 10
figure 10

Hardware in loop experience system based on RT-LAB.

The VSG1 + SG1 parallel system in the power supply system shown in Fig. 4 is established. The experimental conditions are as follows: At the beginning, the synchronous generator is fully loaded and the inverter is empty; When t = 15 s, VSG networking instruction is issued, and the heterogeneous power supply network runs; When t = 30 s, the resistive and inductive load of 240 + j180 kVA suddenly increased; When t = 45 s, the resistive and inductive load of 240 + j180 kVA suddenly reduced; When t = 60 s, SG was cut off and the load was transferred to VSG.

The experimental results of parallel operation of traditional VSG and SG network are shown in Fig. 11, the output active power, reactive power and output current of VSG have large overshoot. When t = 30 s, the load surge makes the maximum active power overshoot per unit reach 0.15 and the maximum reactive power overshoot per unit reach 0.21.

Figure 11
figure 11

Experimental results of parallel operation of traditional VSG and SG.

After adopting the improved control algorithm, the experimental results are shown in Fig. 12. Compare with the experimental results of the traditional VSG control algorithm in Fig. 11, the shock current of the system is decreased significantly, VSG and SG can better share the load in transient process, and the output power overshoot of VSG and SG is very small. At t = 15 s and t = 60 s, smooth switching between parallel operation and independent operation of heterogeneous power supply network can be realized.

Figure 12
figure 12

Experimental results of parallel operation of improved VSG and SG.

If switching control is not designed and the algorithm with additional control link in parallel mode is still maintained when operating independently, the dynamic drop and rise of VSG frequency and the recovery time of frequency will be seriously affected. Figure 13 compares the frequency characteristics of VSG control algorithm with or without mode switching control under the conditions of sudden increase and sudden decrease of load in independent operation. The existence of additional links makes the dynamic overshoot of frequency reach 0.6Hz, and the frequency recovery time is about 2s. When switching to traditional VSG control, the frequency change has no overshoot, and the frequency recovery time is about 1.25s. It can be seen that the mode switching control not only ensure the fast dynamic response when VSG operates independently, but also realize transient power equalization between heterogeneous power sources when VSG operates in parallel with SG network.

Figure 13
figure 13

VSG independent running frequency dynamic feature with or without mode switching control.

Conclusion

Differences between traditional VSG and SG in speed regulation, excitation and output impedance result in uneven transient power distribution between VSG and SG in isolated island microgrid. Based on the analysis of uneven transient power distribution and considering the fast dynamic response characteristics of VSG in independent operation, an improved transient power equalization control method based on mode switching is proposed. By introducing virtual speed regulation, virtual excitation and dynamic virtual impedance algorithm, the transient power of VSG and SG can be equally distributed in heterogeneous power supply parallel operation mode. Maintain traditional VSG control in independent operation mode to provide fast voltage regulation and frequency modulation capability. Smooth switching control based on state tracking is designed between the two modes. Hardware-in-loop experiment results show that the improved control method can significantly improve the transient power distribution between virtual synchronous generator and synchronous generator, and can smoothly switch between independent and networked parallel operation modes.