A Virtual Synchronous Generator Control Strategy for Microgrid Based on Harmonic Current Bypass Control

To improve the voltage and frequency stability and suppress the voltage harmonics of a microgrid, a virtual synchronous generator (VSG) control strategy based on the harmonic current bypass control is proposed in this paper. First, a robust voltage control link is added to the virtual excitation component of the traditional VSG control strategy to reduce the amplitude error of the inverter’s driving voltage caused by the reactive power-voltage droop coeﬃcient. A harmonic current bypass control link is then used to adjust the inverter’s voltage signal to reduce the total harmonic distortion of the microgrid. Finally, a simulation model of the microgrid is established using the MATLAB/Simulink software, and its stability is analyzed. In addition, the proposed control strategy is also compared with the traditional droop control and traditional VSG control strategies, focusing on the frequency instability and harmonic suppression performance of the microgrid. The numerical simulation results veriﬁed the eﬀectiveness and superiority of the improved VSG control strategy proposed in this paper.


Introduction
In recent years, the power load has increased rapidly year by year with the continuous development of the economy and society. However, the power generation centers are generally far from the user centers, and the disadvantages of traditional centralized large-scale power transmission are becoming increasingly evident. Such disadvantages include power losses in the transmission process and instability of the frequency and voltage of the power supply in remote areas [1,2]. To resolve these problems, distributed power generation, represented by renewable energy power generation, has developed rapidly and shows advantages over traditional centralized power supply methods, such as better renewability and recyclability, lower power transmission and distribution losses, and lower development costs [3]. e proportion of renewable energy power generation in the total power generation is increasing day by day, and renewable energy power generation will become the main power generation mode in the near future. However, the direct integration of distributed generation into the power grid will have a significant impact on the traditional power grid, so this distributed generation often operates in the form of microgrids. As a key component of a microgrid, the inverter has an important impact on the microgrid stability and security. Because the inverter in a microgrid has low damping and low inertia, it is difficult to automatically adjust the frequency and voltage when the microgrid is operating in islanded mode [4,5]. Meanwhile, high-order harmonics will be generated by the inverter, which will affect the power quality of the microgrid [6]. erefore, the choice of the inverter control strategy has an important influence on the stability of the microgrid and power grid.
To improve the stability of the voltage and frequency in a microgrid, many control strategies have been proposed, such as P-Q control, V-F control, droop control [7][8][9], and sliding-mode control [10,11]. In the droop control strategy, the primary frequency modulation and primary voltage regulation of a synchronous generator are simulated so that the distributed generation can automatically adjust its active power and reactive power according to the changes of the frequency and voltage of the microgrid, resulting in a reliable voltage and frequency [7][8][9]. Due to the lack of rotational inertia and the damping characteristics of synchronous generators, droop control still cannot suppress the rapid frequency fluctuations and prevent the frequency drop when there is an imbalance between the supply and demand of active power in a microgrid. Various researchers [12][13][14] have proposed several improved droop control strategies based on virtual impedance and achieved good performances. However, the equivalent impedance of a microgrid changes with the increase in the virtual impedance, which causes a larger voltage drop and is harmful to the power quality of the microgrid. e droop control strategy has limitations on the frequency modulation and voltage regulation of a microgrid. erefore, by combining the frequency-active power and reactive power-voltage droop characteristics of droop control and incorporating the rotational inertia and damping characteristics, the inverter can achieve external characteristics similar to those of a synchronous generator, which will improve the stability of the voltage and frequency in the microgrid. is kind of control strategy is called the virtual synchronous generator (VSG) control strategy [15][16][17]. Various researchers [18][19][20] have proposed several VSG models based on the electromagnetic transient equation and rotor equation of motion for synchronous generators. Reference [21] established an inverterinterfaced microgrid model that supplied different types of loads using a VSG and proposed a generalized small-signal stability analysis framework for an islanded microgrid. e proposed optimization platform enhanced the microgrid stability, and it minimized voltage drops on the buses, reactive power mismatches, and the frequency, simultaneously. Reference [22] investigated the impact of the VSG based on renewable energy sources (RESs) in power systems. e role of the power system stabilizers in the all-VSG grid was comprehensively evaluated. Reference [23] proposed a simple power system modeling method to analyze the grid integration effect of the VSG. Potential errors due to the topology simplification and the measures to avoid them were also discussed. However, these models are overly complex and are significantly affected by the transient process of the microgrid, which is not beneficial for the actual microgrid operation. Reference [2] proposed a VSG control strategy based on the impedance harmonic current distortion suppression to suppress the voltage harmonics of a microgrid. Reference [24] proposed an adaptive virtual impendence control strategy to accelerate the active power adjustment process of a virtual synchronous generator system, which helped complete the first frequency modulation and improve the inertia adjustment ability. Reference [25] proposed an adaptive virtual impedance-based VSG control approach for grid-connected and islanded microgrids to alleviate the impedance difference at the inverter output and improve the proportional reactive power-sharing between DGs. However, the impedance characteristics of the microgrid are significantly influenced in this control strategy, which is likely to cause a larger voltage drop. Reference [26] conducted small-signal modeling of multiple VSGs in parallel, and a multiple-VSG cooperative control strategy based on adjacent information was also proposed. e stability of the proposed control strategy was studied by Lyapunov stability theory, and the effectiveness of the proposed control strategy was verified by simulations. Reference [27] developed an adaptive fuzzy-neural-network-imitating sliding-mode control (AFNNISMC) for a parallel-inverter system in an islanded microgrid via a master-slave current sharing strategy. Numerical simulations and experimental results were given to demonstrate the feasibility and effectiveness of the proposed AFNNISMC scheme.
In summary, previous studies had shortcomings in terms of improving the stability of the voltage and frequency and suppressing the voltage harmonics. To overcome these shortcomings, this paper proposes a novel VSG control strategy based on harmonic current bypass control. e contributions of this work are summarized as follows: (1) We propose a novel VSG control strategy based on improved virtual excitation control and harmonic current bypass control to improve the stability of the voltage and frequency and suppress the harmonics of the microgrid. (2) A three-phase inverter was considered as an example, and a simulation model of a microgrid was established using the MATLAB/Simulink software. e stability of the microgrid was analyzed using this novel control strategy.
(3) We compared the proposed control strategy with the traditional droop control strategy, traditional VSG control strategy, and virtual impedance VSG control strategy, focusing on frequency fluctuations and the harmonic suppression performance of the microgrid. (4) e research results verified the effectiveness and superiority of the novel VSG control strategy proposed in this paper, which will provide a theoretical basis for the practical application of microgrid integration technology. e rest of the paper is organized as follows. Section 2 describes the mathematical model. In Section 3, a control system of the VSG is designed. Section 4 demonstrates the simulation results of this novel VSG control strategy. In Section 5, important discussions are presented. Lastly, the conclusions and the future work of the research are presented in Section 6 [28][29][30].

Working Principle of the Synchronous Generator.
Under ideal conditions, three-phase stator windings can be assumed to be symmetrically distributed. e magnetic field of the air gap is assumed to have a uniform distribution, and phenomena such as eddy current loss and magnetic saturation are not considered.
Under the above assumptions, the rotor equation of motion of the synchronous generator can be expressed as follows: 2 International Transactions on Electrical Energy Systems where J′ and D′ represent the moment of inertia and damping coefficient of the synchronous generator (unit: kg·m 2 ), respectively; ω′ is the mechanical angular velocity, which is equal to the electrical angular velocity when the number of pole pairs of the synchronous generator is 1 (unit: rad/s); ω 0 ′ is the synchronous angular velocity of the power grid (unit: rad/s); T m ′ , T e ′ , and T d ′ represent the mechanical torque, electromagnetic torque, and damping torque, respectively (unit: N·m); and P m ′ and P e ′ represent the mechanical power and electromagnetic power of the synchronous generator, respectively (unit: W).
Equation (1) shows that the rotor equation of motion of a synchronous generator contains the variables J′ and D′, so it incorporates frequency modulation and voltage regulation. e rotor equation of motion is the core equation of a synchronous generator, which is also the key factor to design the control system of a VSG.

Working Principle of the Virtual Synchronous Generator (VSG).
According to the rotor equation of motion of a synchronous generator, the moment of inertia and damping coefficient are established for the inverter of the microgrid.
is allowed the inverter to have similar frequency modulation and voltage regulation characteristics as those of the synchronous generator.
As shown in Figure 1, the direct current (DC) power supply was converted into a three-phase alternating current (AC) voltage after the three-phase inverter and is then filtered by an LC (inductor-capacitor) filter to obtain a stable, three-phase, sinusoidal AC voltage. e detailed process is as follows: Step 1. Measure the output voltage (U) and current (I) of a microgrid and obtain the active power (P) and reactive power (Q) by power calculations Step 5. Input the voltage amplitude (E) and mechanical power (P m ) into the VSG control link and obtain the driving voltage signal (U abc ) Step 6. Control the parameters of the inverter using the driving voltage signal (U abc ) rough a comparison with the working principle of the synchronous generator presented in Section 2.1, the rotor equation of motion of the VSG can be expressed as follows: where J and D represent the moment of inertia and damping coefficient of the VSG, respectively (no units); ω 0 and ω represent the rated angular frequency and actual angular frequency of the microgrid, respectively (unit: rad/s); P m and P e represent the mechanical power and electromagnetic power of the VSG, respectively (unit: W); and θ is the power angle (unit:°). e equations above describe the mathematical model and working principle of the VSG.

Control System Design of VSG
e control system design of the VSG mainly includes virtual speed control, virtual excitation control, and harmonic current bypass control. In this paper, we improve the traditional virtual excitation control link and first apply harmonic current bypass control to the VSG control system.

Design of Virtual Speed Control.
e active power-frequency characteristic is the theoretical foundation for the synchronous generator to respond to the frequency changes of a microgrid in real time and make corresponding adjustments, which can be expressed as follows: where K f is the frequency adjustment coefficient; f ref and f represent the rated frequency and the output frequency of the power grid, respectively (unit: Hz); and P n and P m represent the reference value of the given active power and mechanical power, respectively (unit: W). Based on the speed regulation principle of the synchronous generator and equation (3), the virtual speed control link of the VSG is designed, as shown in Figure 2. e specific implementation process is as follows: Step 1: measure the output frequency (f ) of the microgrid and then calculate the frequency difference with the reference frequency (f ref ) Step 2: after passing through the active power-frequency droop gain link (D P ), sum the obtained frequency difference with the reference value for a given active power (P n ) Step 3: obtain the input mechanical power (P m ) of the VSG In this process, D p is the active power-frequency droop coefficient, which is defined as the ratio of the frequency change to the active power change, which can be expressed as follows: International Transactions on Electrical Energy Systems e value of D p will affect the active power of the VSG caused by the frequency fluctuations. According to China's national standard (GB/T15945-2008), the frequency deviation should be less than ±0.2 Hz, and the active power change of the VSG should be ±100% of the rated reference value. e relevant parameters are determined in Section 4.1.

Design of Virtual Excitation Control.
e active powerfrequency characteristic is the theoretical foundation for synchronous generators to respond to voltage changes of a microgrid in real time and to control the output reactive power, which can be expressed as follows: where K q is the reactive power adjustment coefficient; U and U 0 are the output voltage and rated voltage, respectively (unit: V); and Q set and Q are the given reactive power and output reactive power, respectively (unit: Var). Based on the excitation principle of synchronous generators and equation (5), a robust droop control link is added to the traditional control link (red dashed box in Figure 3), and the virtual excitation control link of the VSG is designed, as shown in Figure 3.
e specific implementation process is as follows: Step 1: calculate the difference between the measured reactive power (Q) and the reference value of the reactive power (Q set ) and obtain the reactive power difference (Q 1 ) Step 2: after passing through the reactive power-voltage droop gain link (D q ), the obtained reactive power difference is summed with the rated voltage (U 0 ), and the reference voltage (U ref ) is obtained Step 3: calculate the root mean square of the output voltage (U n ) of the microgrid Step 4: calculate the difference between the root mean square of the output voltage and the reference voltage (U ref ) and then obtain the voltage amplitude (E 0 ) Step 5: obtain the voltage amplitude (E) of the VSG modulation signal after the voltage amplitude (E 0 ) is amplified by a proportional-integral (PI) controller In this process, D q is the reactive power-voltage droop coefficient, which is defined as the ratio of the reactive power's change to the voltage change and can be expressed as follows:  control in the excitation control in this paper. erefore, it can reduce the influence of calculation errors and other disturbances and is robust to parameter drift and disturbances. e value of D q can affect the reference voltage of the VSG caused by reactive power fluctuations. According to China's national standard (GB/T12325-2008), the voltage deviation should be less than ±7% of the nominal voltage. e output reactive power change of the VSG was ±100% of the rated reference value, and the relevant parameters are determined in Section 4.1.
e virtual synchronous generator (VSG) ontology control is designed, as shown in Figure 4.
e specific implementation process is as follows: Step 1: calculate the difference between the mechanical power (P m ) obtained in Section 3.1 and the measured value of actual active power (P).
Step 2: divide the above difference by the reference angular velocity (ω ref ).
Step 3: perform feedback adjustment using the damping coefficient (D) and integrate the moment of inertia (J).
Step 4: sum the integrated values and the reference angular velocity (ω ref ) and then obtain the angular velocity (ω).
Step 5: integrate the angular velocity (ω) and obtain the phase angle of the modulation voltage.
Step 6: based on the modulation voltage amplitude and the phase angle, calculate the initial modulation signal of the VSG by vector superposition. is can be expressed as follows: In the design of VSG ontology control, J and D have an important influence on the stability of the microgrid. e initial value of D is generally selected as follows: where ΔP max and Δω max represent the maximum change of the power and angular velocity, respectively, and f set is the set value of the frequency.
However, the set values of the active power and frequency are different in the actual design. erefore, different values of D should be selected to analyze its influence on the stability of the microgrid and verify the effectiveness of this control strategy. In this paper, the reference value of D was 25.33, and the values used for comparison were 30 and 40.
At the same time, the value of J must be greater than zero to provide the microgrid with inertial characteristics. However, the time for the microgrid to return to a stable status after being disturbed will increase if the value is J is too large. In addition, the value of J is also affected by the first-order inertial time constant. In actual design, the influence of J on the microgrid is typically analyzed with J � 0.5, 1, and 2.

Design of Harmonic Current Bypass Control.
Since many other high-order harmonics will be generated after the inverter, it is necessary to take measures to suppress the harmonics to reduce the total harmonic distortion (THD) of the microgrid. In the existing design, the THD is partially suppressed by reducing the filter inductance of the main circuit. However, the filtering effect is not evident if the filter inductance is too small. To resolve this contradiction, a harmonic current bypass control is first adopted in the VSG control strategy in this paper. e basic principle of this novel control strategy is that the harmonic components of the load current are eliminated through the bypass circuit, without changing the value of the filter inductance. It not only achieves a good filtering effect but also improves the power quality. e transfer function can be obtained by analyzing the control process shown in Figure 5: us, the relationship between the output and input can be obtained as follows: where When the real part of K R is positive, the output impedance and inductive reactance of the inverter are reduced, which can improve the output voltage THD. e main factor affecting the voltage THD is the size of the output impedance, which has little to do with the type of output impedance. erefore, the voltage THD can be reduced to a very low value only if the output impedance is calibrated properly. us, the selection of K R is crucial, and the harmonic compensator approach is chosen in this paper, where the transfer function of the harmonic compensator is as follows: International Transactions on Electrical Energy Systems where the gain at the frequency hω is K h , the damping factor ξ was set to 0.001 to reflect the frequency fluctuation, and h represents the 3rd, 5th, and 7th harmonics, and its value was 314 rad/s. By increasing the voltage feedback, the voltage change of the microgrid can be well reflected and adjusted quickly. Moreover, the real part of K R is selected as positive, and the resistive and inductive characteristics of the inverter's output impedance are reduced. us, the THD of the output voltage is reduced. Moreover, the current (i) contains harmonic current components through pulse-width modulation (PWM). When the current (i) passes through the load, it will generate a corresponding harmonic voltage to offset THD partially, thus improving the harmonic characteristics.
e specific implementation process is as follows: Step 1: take the initial modulation voltage (e abc ) obtained in Section 3.3 as the modulation reference input voltage (V r ), compare it with the output voltage of the microgrid (V 0 ), and then calculate the voltage difference (V 1 ) Step 2: after passing through the voltage gain link (K R ), sum the obtained voltage difference with the reference voltage (V r ) and then obtain the voltage (V 2 ) Step 3: after passing through the current gain link (K i ), convert the current to a voltage and sum it with V 2 and then obtain the modulation voltage signal (V) of the VSG Step 4: control the inverter through PWM based on the modulation voltage signal (V)

Results
To verify the effectiveness and superiority of the improved VSG control strategy proposed in this paper and to compare with the traditional droop control strategy and the traditional VSG control strategy, a microgrid simulation model was established using the MATLAB/Simulink software, as shown in Figure 6. As shown in Figure 6, this model contained distributed generation (DG), a three-phase inverter module, an LC filter module, a control system module, a PWM control module, and a resistance load. Of these, the control system module is the most important part of the simulation model. e control system module included various components, including a speed controller, excitation controller, VSG controller, and bypass harmonic controller. e detailed structures of these controllers are shown in Figures 2-5, respectively. Due to figure size limitations, the internal structures of the individual controllers are not shown in detail here, and only the overall diagram is presented.

Initial Parameters.
In our simulation, the relevant parameters were set as follows. e voltage of the DG was V dc � 800 V. e filtering parameters were R f � 0.01 Ω, L f � 1.8 mH, and C f � 10 μF. e active power, reactive power, and frequency of the control module were P set � 10 kW, Q set � 8 kVar, and f set � 50 Hz, respectively. e amplitude of the output voltage was U o � 311 V; the switching frequency of the PWM was f PWM � 10 kHz; and the resistance load was 24 Ω.
Using equations (4), (6), and (8), the active-frequency droop coefficient (D p ), the reactive-voltage droop coefficient (D q ), and the reference damping coefficient (D) were calculated to be D p � 1.26 × 10 −4 , D q � 3.89 × 10 −4 , and D � 25.33, respectively. In addition, according to the selection principle of J in Section 3.2, the reference value was taken as 0.5.

Stability Analysis of the Microgrid.
In this simulation process, it was assumed that the microgrid operated in islanded mode. In the range of 0-0.7 s, the microgrid was operating stably, a resistance load (72 Ω) was connected to the microgrid at � 0.7 s, and a resistance load (36 Ω) was removed from the microgrid at t � 1.2 s.
As shown in Figure 7, the frequency range of the microgrid was 49.87-50.02 Hz, and the maximum deviation was only 0.13 Hz.
In Figure 8(a), the voltage waveform was stable over five cycles. As shown in Figure 8(b), the fluctuations of the output voltage were small when the load changed. e locations of the load changes are marked as (1) and (2), and the maximal abrupt voltage change was 55 V at point (3). To display the abrupt voltage change more clearly, we have amplified the 10-cycle waveform near the maximal abrupt voltage change, as shown in Figure 8(c). e voltage deviation can be expressed as follows: where U b (%) is the voltage deviation, U m is the average value of the effective voltage value over 10 cycles, and U s is the nominal value of the voltage. By substituting the values of U m (316.5 V) and U s (311 V) into equation (13), the voltage deviation can be calculated as U b (%) � 1.77%.

Influence of J and D on Microgrid Frequency.
As shown in Figure 9, the transient process of the frequency was smoother when the value of J was larger, but the time to Figure 5: Schematic diagram of harmonic current bypass control. 6 International Transactions on Electrical Energy Systems reach stability correspondingly increased. e effect of suppressing the frequency mutation was not evident when the value of J was smaller. erefore, it is necessary to select the value of J based on the actual inertial capacity of the microgrid.
As shown in Figure 10, the value of D mainly affected the static characteristics of the frequency but had no effect on the dynamic characteristics. e larger the value of D was, the smaller the value of the static frequency change became. With D � 25.33 as a reference value, the steady-state frequency change of the microgrid decreased by about 0.03 Hz when D � 30, and it decreased by about 0.06 Hz when D � 40. erefore, it is necessary to select the value of D based on equation (8) and the actual requirements for the static frequency drop of the microgrid.

Comparison with ree Other Control Strategies.
To verify the effectiveness and superiority of the improved VSG control strategy proposed in this paper, a comparative analysis with the traditional droop control, traditional VSG control, and virtual impedance VSG control strategies is presented in this section.
In this simulation process, the parameter values of the improved VSG control strategy were D � 25.33, J � 0.5, D p � 1.26 × 10 −4 , and D q � 3.89 × 10 −4 , while the droop International Transactions on Electrical Energy Systems coefficients in the droop control were D p � 1.26 × 10 −4 and D q � 3.89 × 10 −4 . As shown in Figure 11, the VSG control strategy had similar characteristics with those of the traditional droop control strategy in essence, but the transient process was more stable due to the addition of two adjusting parameters (J and D). Moreover, the frequency ranges of the microgrid using the traditional droop control strategy, traditional VSG control strategy, and virtual impedance VSG control strategy were 49.78-50.22, 49.86-50.04, and 49.87-50.03 Hz, respectively. e frequency range of the microgrid using the improved VSG control strategy was 49.87-50.02 Hz, which meant that the proposed improved VSG control strategy had almost the same ability to restrain the frequency drop as the      International Transactions on Electrical Energy Systems traditional VSG control strategy and the VSG strategy of virtual impedance control, but the frequency was about 0.2 Hz less than that of the droop control strategy. As shown in Table 1, the improved VSG control strategy proposed in this paper had the best harmonic suppression performance, and the THD was only 1.72%.

Discussion
In Section 4, several numerical simulations were examined, and important results were presented. We now further analyze and discuss these results and compare the performances obtained using the improved VSG control strategy with the IEEE standard and China's national standard: (1) According to the IEEE standard (IEEE1549-2003), the voltage deviation of the microgrid should be less than ±10% of the nominal voltage. As shown in Figure 8, the voltage deviation of the microgrid was only 1.77% when using the improved VSG control strategy proposed in this paper, which meets the corresponding national standard requirement. (2) According to China's national standard (GB/T 15945-2008), the frequency range of the microgrid should be located within 49.8-50.2 Hz. As shown in Figure 11, the frequency range of the microgrid was located in the frequency range of 49.87-50.02 Hz when using the improved VSG control strategy. e maximum deviation was only 0.13 Hz, which was better than those of the traditional droop control strategy, the traditional VSG control strategy, and the virtual impedance VSG control strategy and met the national standard requirement. (3) According to the IEEE standard (IEEE1549-2003), the THD of the microgrid's output voltage should be less than 5%. As shown in Table 1, the THD using the improved VSG control strategy was only 1.72%, which was better than that of the traditional droop control strategy and the traditional VSG control strategy, and it met the corresponding national standard requirement.

Conclusions
In this paper, a novel VSG control strategy based on harmonic current bypass control is proposed to improve the stability of the voltage and frequency and to suppress the harmonics of the microgrid. e numerical simulation results showed that the proposed control strategy could reduce the frequency range to 49.87-50.02 Hz, and the voltage deviation was reduced to 1.77% of the nominal voltage. Meanwhile, the THD of the output voltage was reduced to 1.72%. e research results verified the effectiveness and superiority of the novel VSG control strategy proposed in this paper and provide a theoretical basis for the practical application of microgrid integration technology. However, the distributed generation on the DC side is replaced by an ideal voltage source in the model, and only the island operation of a small microgrid was simulated in this study. Before this strategy is used in practical applications, there are still many problems worthy of study, such as further   International Transactions on Electrical Energy Systems consideration of the impact of seamless switching between grid-connected and off-grid modes on this VSG control strategy, further consideration of the impact of intermittency and randomness of distributed generation on this VSG control strategy, and use of the VSG control strategy proposed in this paper to actual applications in small microgrids. ese issues will be the focus of future research.

Data Availability
All the data supporting the findings of this study are included within the article.

Conflicts of Interest
e authors declare no conflicts of interest.