Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 11, No. 1, 2024 125 VSG Sequence Impedance Modeling and Stability Analysis of Dead‐Beat Control Shida Sun*, Mingtao Wu, Zhengbin Chen School of Electrical Engineering and Automation, Henan Polytechnic University, Jiaozuo, China * Corresponding author: Shida Sun (Email: 1946554916@qq.com) Abstract: Virtual Synchronous Generator uses dead-beat predictive control in the voltage and current loop to improve the dynamic response speed of the system, but the presence of zero-order hold and computation time can lead to system instability. To address this issue, this paper adopts an improved dead-beat predictive control strategy for VSG. This is achieved by linear interpolation to forward predict voltage-current reference values to reduce the impact of delay, while introducing error compensation coefficients to enhance the stability of the voltage-current inner loop of VSG. The selection of error compensation coefficients is based on closed-loop impulse response functions. A harmonic linearization method is used to construct a complete sequence impedance model of VSG, and it's stability is analyzed. The results indicate that VSG's negative sequence impedance exhibits instability in the low-frequency range. To address this, a method of introducing a virtual resistor into VSG is proposed to improve stability. By constructing a sequence impedance model of VSG that includes virtual resistance, the variations in system stability under different virtual resistances and grid impedances are analyzed. The effectiveness of the proposed method is verified by building a VSG model. Keywords: Virtual synchronous generator, dead-beat predictive control, virtual resistance; sequence impedance model, stability analysis. 1. Introduction With the widespread application of clean energy such as solar and wind power, a large number of distributed power sources are integrated into the grid through power electronic inverters. Compared with traditional synchronous generators, inverters can not provide inertia and damping to the system. The grid exhibits characteristics of "low inertia, weak damping," which can lead to complex transient processes when disturbed. The proposal of Virtual Synchronous Generator (VSG)[1-4] technology can effectively improve the grid's absorption capacity of new energy power generation. The VSG refers to the electromechanical transient characteristics of synchronous generators, enabling the simulation of the rotor inertia and damping properties of synchronous generators. It autonomously participates in primary frequency and voltage regulation of the system, without the need for phase-locked loop, thus ensuring synchronous operation with the grid. This approach reduces construction costs and has become a recent research hotspot[5-7]. The traditional VSG voltage and current loops typically employ PI or PR control, requiring a complex parameter tuning process. However, there is no unified consensus on the parameter tuning method, and the response speed is relatively slow. When the output of new energy sources suddenly increases or decreases, the grid needs to rapidly adjust voltage and current to prevent problems such as voltage being too high or too low, current overload, thus ensuring the safe operation of the system. Dead-beat predictive control can track reference signals within one cycle, with small transient errors and transition times. It does not require complex parameter tuning and is widely used in grid-connected inverter control. References [8-10] proposed using PI control for the voltage loop and dead-beat predictive control for the current loop, enhancing the system's dynamic response speed. Compared to traditional voltage and current dual-loop control, this approach not only increases the system's bandwidth but also improves it's accuracy. In reference [11], both the voltage and current loops employed predictive control, resulting in smaller steady-state errors compared to when only the current loop utilized predictive control. This fundamentally improves the system's steady-state and dynamic performance. Reference [12] employed dead-beat predictive current control, setting the target current error as a linear combination of the control errors from the previous two cycles, to achieve the purpose of reducing delay, enhancing the dynamic performance of the system. Furthermore, dead-beat predictive control also exhibits strong robustness. In references [13-14], under islanded mode, VSG control was utilized for the power loop, while predictive control is employed for the voltage and current loops, enhancing the system's dynamic response speed. However, there is no literature available on the grid stability analysis of VSG using dead-beat predictive control. Distributed power sources are often far from the main grid, and the line impedance can not be ignored. They interact with the output impedance of inverters, leading to oscillations and decreasing system stability. Currently, there are two main methods for analyzing the stability of inverter-grid interconnected systems. One is the time-domain-based state- space method, which obtains the entire system state by solving eigenvalues and eigenvectors. References [15-16] established a full-order state-space model for VSG and employed a participation analysis method to quantitatively assess the influence of different control parameters on various frequency bands. However, this method requires knowledge of all state variables, and once parameters change, remodelling is necessary. Another method is based on frequency domain impedance analysis, which derives the output impedance of the inverter by formulating frequency- domain transfer functions. It's characteristics include clear physical concepts and convenient measurement verification. 126 Reference [17] proposed modeling inverters using harmonic linearization methods and combines them with the Nyquist stability criterion to analyze the stability of inverter grid connection. References [18-19] established sequence impedance models for voltage-type and current-type virtual synchronous generators. From a stability perspective, it is concluded that voltage-type virtual synchronous generators exhibit inductive characteristics in the mid-low frequency range compared to current-type virtual synchronous generators, making them less prone to oscillations with inductive grids, thus more suitable for renewable energy generation. However, only the power loop is considered, while the voltage and current loops are neglected. References [20-21] established a sequence impedance model for VSG considering the voltage-current inner loop and found that the inner loop has a negative impact on dynamic performance in the low-frequency range, which can not be ignored during modeling. Therefore, the output impedance characteristics of VSG vary when different control schemes are adopted for the voltage-current loop. In this paper, dead-beat predictive control is used to replace traditional PI control in VSG's double closed loop of voltage and current. Linear interpolation method is used to predict the reference value forward to reduce the influence of delay, and error compensation is added to dead-beat predictive control to improve it's stability. The complete sequence impedance model of VSG is established and the interaction stability between VSG and power grid is analyzed with Nyquist stability criterion. In view of the lack of stability of VSG in low frequency band, virtual resistance is used to improve the interactive stability of the grid-connected system. 2. Basic Principles of VSG 2.1. The overall topology of VSG The main circuit topology and control structure of VSG are shown in Figure 1, including power loop, virtual resistor and dead-beat predictive voltage and current control. Where Udc is the DC side voltage of the VSG, generally considered constant; uabc is the internal potential of the VSG; uoabc is the output voltage of the VSG; iLabc is the current flowing through the filtering inductance of the VSG; ioabc is the three-phase grid current of the VSG; L1 and C1 jointly constitute an LC filter; Zg is the equivalent line impedance of the grid; eabc is the grid voltage. Udc 1/s ua ub uc L1 L1 L1 iLa iLb iLc C1 uoa uob uoc ioa iob ioc Zg Grid uoabc ioabc abc/αꞵ Pe Qe ioαꞵ uoαꞵ   ωn  ω  kp Pref Pm Pm Pe 1/ωn 1/Js θ  D ωn  Qref Qe kq UN Emabc/αꞵ uoαꞵ ioꞵ ioα Rv Rv Uoα Uoꞵ abc/αꞵ C1 C1 ea eb ec PWM Zg Zg iLabc Eαꞵ iLαꞵ Formula (5) Form ula (4) dead-beat predictive control voltage and current double closed loop (29)、(30) Figure 1. Topology and control scheme of the VSG 2.2. VSG power loop control policy The active power loop of the VSG simulates the function of a synchronous generator governor, enabling the inverter to achieve primary frequency control, known as active- frequency droop characteristic. The control equations for the active power loop are given by equations (1) and (2):  m p nrefP P k     (1)     e m e n ref p n n n n / d J T T D dt P P D k d dt                              (2) Where kp represents the active-frequency droop coefficient; ω and ωn are the output angular frequency of VSG and the rated angular frequency of the system respectively; Pref, Pm and Pe are command power, mechanical power and electromagnetic power respectively; J is the moment of inertia. By combining D and kp into one link, let Dp=D+kp/ωn. Thus, adjusting Dp enables frequency regulation and power damping functionality. The reactive power loop of the VSG simulates the excitation characteristics of a synchronous generator, thereby achieving voltage regulation functionality. The reactive power droop control is represented by equation (3): m N q ref e( )E U k Q Q   (3) Where kq represents the reactive power-voltage droop coefficient of the VSG, Em is the reference value of t he VSG output voltage magnitude, and UN is the rated voltage magnitude of the system. 127 The phase output of the active power loop and the voltage amplitude output of the reactive power loop together constitute the reference voltage as shown in equation (4): a m b m c m cos cos( 120 ) cos( 120 ) E E E E E E              (4) Where Ea , Eb , and Ec represent the reference voltages output by the VSG power loop. The active and reactive power outputs of the system can be represented as equation (5): e f oα oα oβ oβ e f oβ oα oα oβ 1.5 ( ) 1.5 ( ) P G u i u i Q G u i u i      (5) Where Gf represents the filtering component, which filters out the high-frequency harmonic components in the system. uoα and uoβ are the components of the VSG output voltage in the αβ coordinate system, while ioα and ioβ are the components of the VSG output current in the αβ coordinate system. 2.3. VSG voltage and current loop control strategy 2.3.1. Dead-beat control based on error compensation coefficient Ideally, the sampling, computation, and modulation of the controller should be completed simultaneously without any delay in the system. However, in reality, due to the zero-order hold sampling and the presence of PWM sections, a one-cycle delay is introduced to the system, which can easily lead to system instability. Based on the reference directions of various variables in Figure 1, write KCL and KVL equations for the system. Lα Cα oα Lα α oα i i i di u L u dt       (6) Equation (7) is obtained by discretization of equation (6), where Ts is the sampling period. s oα Lα oα oα 1 s Lα α oα Lα 1 ( 1) [( ( ) ( )] ( ) ( 1) [( ( ) ( )] ( ) T u k i k i k u k C T i k u k u k i k L             (7) According to the principle of dead-beat predictive control, the output voltage and output current value at k+1 moment should follow the reference voltage value and the reference current value provided by the voltage outer loop. Considering the influence of delay, the linear interpolation method is used to predict the voltage and current reference value at k+1 moment: * o o * * * o o o ( 1) ( 1) ( 1) 1.5 ( ) 0.5 ( 1) u k u k u k u k u k           (8) * L L * * * L L L ( 1) ( 1) ( 1) 1.5 ( ) 0.5 ( 1) i k i k i k i k i k           (9) Considering that there is a large overshoot in one beat follow, the error is defined as: * o o 1 * L L 2 ( ) ( ) ( ) ( ) ( ) ( ) u k u k e k i k i k e k        (10) According to the Lyapunov's second law, the Lyapunov function L constructed must satisfy the following conditions[22]: (1) L(e(k)) has a first-order continuous partial derivative with respect to e(k). (2)L(e(k)) is positive definite, with L(e(k))=0 when e(k)=0; and L(e(k))>0 when e(k)>0. (3) The derivative of L(e(k)) is negative definite, ( ( ) )L e k  is less than 0. Let 2 1 1( ) ( )L k e k ; 2 1 1( 1) ( 1)L k e k   ; 2 2 2( ) ( )L k e k ; 2 2 2( 1) ( 1)L k e k   ; Thus 2 2 1 1 1( 1) ( )L e k e k    ; 2 2 2 2 2( 1) ( )L e k e k    . According to reference [11], the error compensation coefficient can be used to link the error at time k to the error at time k+1, so that: * * o o o o * * L L L L ( 1) ( 1) ( ( ) ( )) ( 1) ( 1) ( ( ) ( )) u k u k u k u k i k i k i k i k                (11) Combining Lyapunov's second law, we have: -1<η<1, - 1<λ<1. Therefore, the reference current value with error compensation term for voltage generation should be: s* *1 Lα oα oα oα s ( ) [ ( 1)(1 ) (1 ) ( )] ( )sTC i k u k e u k i k T        (12) The generated modulated signal containing an error compensation term is: * *1 α Lα Lα Lα oα s [ ( 1) ( ) (1 ) ( )] ( ) L M i k i k i k u k T        (13) Using Mα as the modulation signal input to the PWM module, when both η and λ are zero, it represents the traditional dead-beat predictive control without considering the error compensation term. 128 1-λz-1 C1/Ts io 1-λ ηL1/Ts L1/Ts z-1 (1-η)L1/Ts GL(z) GC(z) io iL uo(k)uo*(k+1) z Figure 2. Improved dual closed-loop predictive control block diagram 2.3.2. Stability analysis When both voltage and current loops adopt dead-beat predictive control and the influence of delay is considered, the system becomes unstable, and the one-beat tracking system exhibits a significant overshoot. Based on Figure 2, the pulse transfer function of the improved dead-beat predictive control system is derived. 2 o 1 1 1 1 1 1 * 4 3 2 o 1 1 1 1 3 4 ( ) ( ) ( ) ( 1) ( ) 2 u k C L z C L z C L u k C L z C L z m z m z             (14) The zero-pole plot of the system is plotted based on equation (14) as shown in Figure 3. From Figure 3, it is evident that in traditional predictive control (when λ=η=0), two out of the four poles are located outside the unit circle. -1.5 -1 -0.5 0 0.5 1 1.5 -1.5 -1 -0.5 0 0.5 1 1.5 λ=η=0 η=0.1 η=0.9 Figure 3. Zero pole diagram of closed-loop pulse function According to reference [23], all the poles of the closed-loop pulse transfer function of the system must be located inside the unit circle for stability, which means the modulus of the characteristic roots must be less than or equal to 1. The root locus plot of equation (14) is depicted in Figure 3, with λ fixed and η ranging from 0.1 to 0.9. It can be observed from the plot that as η increases, the poles move from outside the unit circle towards the inside, simultaneously moving towards the real axis, increasing the damping ratio, and enhancing system stability. Similarly, by fixing the value of η and varying λ within the range of 0.1 to 0.9, the system's stability can be increased. Therefore, the proposed improved dead-beat predictive control is superior to traditional dead-beat predictive control. At this point, the range of error coefficient values is: 0.5 < λ < 1, 0.5 < η < 1. 2.3.3. Selection of error compensation coefficients To study the influence of λ and η on the system, the Bode plot of the closed-loop transfer function is plotted as shown in Figure 4. 1)The influence of system steady-state and dynamic performance. It can be observed from equation (14) that λ and η have the same effect in the formula. Here, η is taken as an example to analyze the bode plot and zero-pole plot of the closed-loop pulse function. 20 0 -10 0 -180 -360 -90 -270 10 101 102 103 104 η=0.7 η=0.9 η=0.8 η=0.6 η=0.5 2.72e3 2.57e3 2.43e3 2.32e3 2.28e3 M ag n it u de (d B ) P h as e/ ( °) f/Hz Figure 4 Bode diagram of closed loop pulse transfer function From Figure 4, it can be observed that when η increases, the resonance peak decreases, and the resonance frequency also decreases, leading to an increase in bandwidth. This indicates that a larger value of η within the range contributes to system stability, and similarly, a larger value of λ also contributes to system stability. 2)The impact on dynamic response speed. The convergence speeds w1 and w2 can be defined as[24]: 21 1 1 ( ) 1 / ( 1) L k w L k    , 22 2 2 ( ) 1/ ( 1) L k w L k    It can be observed that the convergence speed is inversely proportional to the square of η and λ. Smaller values of η and λ result in faster convergence speed. Therefore, considering the dynamic performance and response speed of the system, η and λ can be selected within the range of 0.6 < η < 0.8 and 0.6 < λ < 0.8. 3. Modeling and Analysis of Positive and Negative Sequence Impedances of VSG. 3.1. Main circuit modeling The small-signal model of the VSG positive and negative sequences is derived using harmonic linearization and symmetrical component methods. In this paper, the DC-side voltage is considered as a constant value. As depicted in 129 Figure 1, the relationship between the internal voltage, output voltage, and output current of the VSG can be expressed as equation (15), where the subscript k represents the phases abc: 2 k 1 1 ok 1 ok(1 )u s L C u sL i   (15) Firstly, positive and negative sequence small-signal disturbances are added to the output voltage of the VSG. After adding the disturbances, taking phase A as an example, the output voltage, output current, and inductor current of the VSG can be expressed as: oa 1 1 p p vp n n vn ( ) cos(2 ) cos(2 ) cos(2 ) u t V f t V f t V f t           (16) oa 1 1 i1 p p ip n n in ( ) cos(2 ) cos(2 ) cos(2 ) i t I f t I f t I f t             (17) La L1 1 iL1 Lp p iLp Ln n iLn ( ) cos(2 ) cos(2 ) cos(2 ) i t I f t I f t I f t             (18) Where V1, I1, IL1 and f1 are respectively the fundamental frequency voltage amplitude, the fundamental frequency output current amplitude, the inductor current fundamental frequency amplitude and the fundamental frequency. Vp, Ip, ILp and fp are respectively positive sequence voltage disturbance amplitude, positive sequence current response amplitude, positive sequence inductor current response amplitude and positive sequence disturbance frequency. Vn, In , ILn , fn are respectively negative sequence voltage disturbance amplitude, negative sequence current response amplitude, negative sequence inductor current response amplitude and negative sequence disturbance frequency. 3.2. Power control loop modeling Equations (16) and (17) are transformed by Clark to obtain the expression of output voltage and output current in the αβ coordinate system, as shown in equations (19) and (20).     1 1 p poα n n 1 1 p poβ n n , , , , , , f f f fU f f f j f f j f fU f j f f                        V V V V V V   (19)     1 1 p poα n n 1 1 p p n n , , , , , , o f f f fI f f f j f f j f fI f j f f                         I I I I I I   (20)     L1 1 Lp p Ln n L1 1 Lp p Ln n , , , , , , L L f f f fI f f f j f f j f fI f j f f                          I I I I I I   (21) Where: 1 1 / 2VV , vp p p( / 2) jV e V , vn n n( / 2) jV e V , i1jφ 1 1( / 2)I eI , ipjφ p p( / 2)I eI , injφ n n( / 2)I eI , iL1jφ L1 L1( / 2)I eI , Lpjφ Lp Lp( / 2)I eI ; Lnjφ Ln Ln( / 2)I eI . Substituting them into equation (5), the expressions of the active power and reactive power output of the VSG are obtained. Utilizing the frequency-domain convolution theorem and neglecting high-order nonlinear small signals, the frequency-domain expressions of the active power and reactive power output are obtained:   * * * f 1 1 1 1 p p * * * p p n n n n e * * f 1 p p 1 p 1 f 1 n n 1 n 1 3 ( ) 0 3 ( ) ( ) 3 ( ) ( ) G f P f G f f f G f f f                    V I V I V I V I V I V I V I V I V I V I , , , (22)   * * * f 1 1 1 1 p p * * * p p n n n n e * * f 1 p p 1 p 1 f 1 n n 1 n 1 3 ( ) 0 3 ( ) ( ) 3 ( ) ( ) jG f Q f jG f f f jG f f f                    V I V I V I V I V I V I V I V I V I V I , , , (23) According to equation (1), (2), (22), and (23), the expression for the phase angle of the active power loop output of the VSG is: ref e n p n n (s)( ) P P N D       (24) The expression of voltage amplitude and voltage phase angle can be obtained by using the frequency domain convolution theorem as follows: * * N q ref f 1 1 1 1 * * f q p 1 p 1 p 1 f q n 1 n 1 n 1 [ 3 ( )], 0 [ ] j3 ( ), ( ) j3 ( ), ( ) U k Q j G f E f G k f f f G k f f f                 V I V I I V V I I V V I (25) * * ref 1 1 1 1 f n p n n * * f p 1 1 p p 1 n f 1 n n 1 n 1 n 3( ) ( ) [ ], 0 3 [ ] ( ) ( ), ( ) 3 ( ) ( ), ( ) P N s G D f f N s G f f f N s G f f f                       V I V I V I V I V I V I (26) 130 By combining formula (25) and (26), the voltage reference value provided by VSG in the α axis coordinate system is as follows: * * 1 p 2 p p αref 3 1 * * 1 p 1 1 n n 1 4 1 n n n 1 p 1) ) ) ( ( ,[ ] ( ( ,) k k f fE f k k f f             V I V I V V I V I I V I I VV I (27) Where j 1 1 f 1 n1 ( ) ( )3 4/k e s s G s sV N     , 1j 2 q f 1 4(j ) /3k k e G s s   , k3 and k4 are the conjugates of k1 and k2, respectively. 1 n g m 1arcsin[ / ]eP L E V  , 1 / 2    , 1 12s j f , 2 p( ) 1/ ( )N s Js D s  . 3.3. Modeling of voltage-current loop with virtual resistance This paper adopts the method of using virtual resistance to improve the phase margin of VSG, as shown in Figure 5. Virtual resistance Grid impedance Rv Uref=U*-Rv*io Rg inverter Grid Figure 5 VSG equivalent diagram with virtual resistors Figure 5 presents the impedance model for establishing the voltage-current dual closed-loop system. The reference voltage U* of the power loop output, the product of the inverter output current io and the virtual resistance Rv are combined to create a new reference voltage. The frequency domain expression for this is given as: αrefp αrefp v p i p αrefn αrefn v n i n [ ] [ ] ( ), [ ] [ ] ( ), U f E f R I G s f f U f E f R I G s f f        (28) Substituting equation (27) into equations (12) and (13), the modulation wave signal on the α-axis is obtained as: s s *1 o op v s * op i p r *1 o on v s on i n [ ( 1)(1 ) (1 ) ( ) ( )] ( ) ( ), ( )[ ] [ ( 1)(1 ) (1 ) ( ) ( )] ( ) ( ), sT sT C u k e u k G s T i k G s f f i k f C u k e u k G s T i k G s f f                       (29) * *1 r r i Lp s o v p tα * *1 r r i Ln s o v n [ ( 1) ( ) (1 ) ( ) ( )] ( ) ( ), [ ] [ ( 1) ( ) (1 ) ( ) ( )] ( ) ( ), L i k i k G s i k T V k G s f f U f L i k i k G s i k T V k G s f f                   (30) Assuming the direction of current flowing into VSG from the inverter is positive, based on equations (15), (27), (29), and (30), the positive and negative sequence impedances of VSG with virtual resistance can be obtained as shown in equations (31) and (32):       p d 1 3 2 2 1 1 i d d d s s s s 2 1 1 d1 1 1 1 1 1 1 1 1 d 2 s s s c ss 1 0.75 ( ) 1 3 0.5 1.5 1 4 2 13 1 1 2 2 G L p p p sL C G s G G G T T T T LC p GL C p C L p L C s G T Z T T g TT                                                     (31)         d 1 3 2 2 1 1 i d d d s s s s 12 1 1 d1 1 1 1 1 1 1 1 d 2 s s s c s n s 1 ( ) 1 3 0.5 1. 1 0. 5 1 4 2 3 1 1 7 2 5 2 Z G L q q q sL C G s G G G T T T T LC q GL C q C L q L C s G T T T g TT                                                  (32) Where s d sTG e ; i1 1( )iG G s s  ; v1 v 1( )G G s s  ; 1 1 1 1 21 0.5 ( 1)( )( 3)i v d dp G G I G k k G       ; 3 1 1 1 1 2 1v v vp G k V R G k V   ; 2 1 3( 1)( 3)i d dp C G G G p   ; 131 q1, q2, and n3 are the conjugates of p1, p2, and p3 respectively, and Rv represents the virtual resistance. 3.4. Analysis of VSG sequence impedance without virtual resistance Without considering the virtual resistance, according to the expressions for the output impedance (31) and (32), where Rv equals 0, plot the magnitude and phase characteristics of the system's output impedance as shown in Figure 6, with the grid impedance Lg being 4mH. -50 0 50 -200 -100 0 100 200 100 M ag ni tu de /d B Ph as e/ ° 100 101 102 103 104 PM=-6.4° Zvsg,p Zvsg,n Zgrid Figure 6. Output impedance of VSG without virtual resistance The positive sequence output impedance of VSG is located in the inductive dissipation region at low frequencies, and the grid impedance is also inductive. However, there is a large phase jump at the fundamental frequency. Meanwhile, from the magnitude-frequency characteristic curve at the fundamental frequency, an upward spike can be observed. The negative sequence output impedance of VSG is located in the capacitive dissipation region at low frequencies, and there is no phase jump at the fundamental frequency. Correspondingly, the magnitude-frequency characteristic curve also does not exhibit spikes. In the high-frequency range, both the positive and negative sequence output impedance characteristics exhibit LC filtering characteristics consistently. Let PM(ƒ) be the phase margin, the phase margin of the negative sequence impedance at the intersection point in the low-frequency range is PM(ƒ)=180°-|Zg(ƒ)-Zo(ƒ)|=-6.4°, which does not satisfy the stability requirements. When the system is subjected to low-frequency disturbances, oscillations will occur, affecting the stable operation of the system. 3.5. Analysis of VSG sequence impedance considering virtual resistance From the above analysis, it can be seen that when the reference value generated by the power loop is directly used as the reference value for the output voltage of the voltage loop, the phase margin at low frequencies does not satisfy the stability conditions. Therefore, it is necessary to correct the output impedance of the VSG. Considering that resistance mainly affects the magnitude and phase characteristic curve in the low-frequency range[25-29], The method of introducing a virtual resistance as shown in Figure 5 can be used for correction. From Figure 7, it can be seen that when the inverter is connected to the grid, there is sufficient phase margin in the sub-synchronous frequency range, meeting the stability requirements. PM=90.5° -50 0 50 -200 -100 0 100 200 100 100 101 102 103 104 f/Hz M ag ni tu de (d B ) Ph as e( °) Zvsg,n Zgrid Zvsg,p Figure 7. Output impedance of VSG considering virtual resistance As can be seen from Figure 7, the introduction of virtual resistance changes the positive and negative sequence output impedance of VSG. In the low-frequency range, the positive sequence impedance is no longer in the dissipative region and becomes inductive. However, due to the asymmetry of the power loop, there is a phase transition at the fundamental frequency, resulting in a small spike in the magnitude- frequency characteristic curve. However, compared to Figure 6 without virtual resistance, there is a significant improvement. The negative sequence output impedance of VSG becomes capacitive after the introduction of resistance, no longer in the dissipative region, and the magnitude-phase characteristic curve shifts upward. Taking the negative sequence impedance as an example, when the grid impedance is 4mH and the Short Circuit Ratio (SCR) is 23, they intersect at 10.2Hz. At this intersection point, the phase margin is 90.5. From the figure, it can be seen that the stability margin of the positive sequence impedance also meets the requirements. In addition, it can be seen from the Figure 7 that VSG using dead beat predictive control has a lower output impedance and a stronger load-carrying capacity. 4. Analysis of Stability Related Influencing Factors Using Thevenin's equivalence theorem, VSG and the grid are equivalent to the series of ideal voltage source and output impedance, the grid-connected equivalent circuit of the voltage-type VSG is obtained as shown in Figure 8. Zo Zg Vs Vg Figure 8 Voltage type VSG grid connection diagram From Figure 8, it can be observed that Vs represents the potential voltage within the VSG, Vg and Zg are grid voltage and grid impedance respectively. Since the resistive component of the grid impedance can enhance system stability margin, this paper considers using purely inductive reactance to simulate the worst-case scenario. The expression of grid-connected current is: 132 (33) The stability of the grid-connected inverter system can be analyzed from the expression of the grid-connected current. From equation (33), it is evident that for the grid system to be stable when the VSG and the grid are stable, the following two conditions must be met: (1)The VSG system is stable when the grid impedance is 0. (2)The stability is ensured when the right-hand side of the equation, the second term is stable. The system can only be stable when the ratio of the positive and negative sequence output impedances of the VSG to the grid impedance satisfies the Nyquist stability criterion. Alternatively, the stability of the system can be determined by the phase margin at the intersection point of the positive and negative sequence output impedances of the VSG with the grid impedance. 4.1. Influence of error coefficients λ and η on system stability By varying the values of λ and η according to equations (31) and (32), the effect of error compensation coefficients on the system is studied. 50 0 -50 0 -100 -200 100 200 f/Hz 100 101 102 103 104 M ag ni tu de /d B Ph as e/ ° Improved Zvsg,n Improved Zvsg,p Zvsg,n Zvsg,p Figure 9. Impact of virtual resistance changes on stability As shown in Figure 9, introducing error compensation coefficients eliminates significant phase discontinuities in the high-frequency range, resulting in the system's phase being within the range of [-90, 90] in the high-frequency regime. This improves stability in the high-frequency range. 4.2. The effect of grid impedance Rv on the stability of the system Change the resistance value of the virtual resistor according to equations (31) and (32), and observe the output impedance characteristics of the VSG. It can be observed from Figure 10 that as the value of the virtual resistor increases from 0.1Ω to 0.3Ω, the phase characteristics of the positive-sequence impedance of the inverter output gradually approach 90°, and the negative- sequence impedance gradually approach -90°. This increases the stability margin of the system. However, an excessively large virtual resistor can cause a decrease in the output voltage. 100 101 102 103 104 50 0 -50 100 0 -100 -200 M ag ni tu de /d B Ph as e/ ° f/Hz 0.3ΩZvsg,p 0.3ΩZvsg,n 0.1ΩZvsg,p 0.1ΩZvsg,n Figure 10. Impact of virtual resistance changes on stability 4.3. The effect of grid impedance Lg on the stability of the system Figure 11 shows the amplitude-phase characteristic curve of VSG's positive and negative sequence output impedance and grid impedance after adding virtual resistance. When the grid impedance is increased from 4mH to 30mH, the phase- frequency characteristics of the output impedance of the inverter does not change, but the amplitude-frequency characteristic curve shifts to the left at the intersection of the grid impedance. The system phase margin meets the requirements, indicating that the system is stable. M ag ni tu de (d B ) 电网阻抗增大 VSG正序阻抗 VSG负序阻抗 101 102 103 104100 50 0 -50 100 0 -100 -200 Ph as e( °) Zgrid Zvsg,p Zvsg,n The grid impedance becomes larger Figure 11. VSG and grid impedance Lg characteristic curve 5. Simulation Verification 5.1. VSG positive and negative sequence impedance model verification Plot the Bode diagram of the positive and negative sequence impedances based on equations (31) and (32). Using the data from Table 1, construct a simulation model of VSG containing a virtual resistor in MATLAB/Simulink, and verify the correctness of the modeling of positive and negative sequence impedances. s g g g o g 1 1 / V V I Z Z Z    o g 1 1 /Z Z 133 Table 1. System parameters of VSG symbol value Pref/w 5000 Qref/var 0 Dp 15 kq 0.0001 fsw/ kHz 10 f1/Hz 50 Udc/V 700 V1/V 311 C1/μF 40 L1/mH 2.2 J/(kg.m2) 0.7 Rv/Ω 0.3 fs/kHz 20 Gf(s) 1/(800πs+1) Gv(s) 1/(8000πs+1) Gi(s) 1/(8000πs+1) As shown in Figure 12, small signal voltage perturbations of different frequencies are injected at PCC points to obtain the current at corresponding frequencies, and the positive and negative sequence impedance is obtained by using the ratio of voltage and current signals. As can be seen from Figure. 12, the solid line is the positive and negative sequence impedance characteristic curve, and the cross and hollow circle are the results of the simulation model's frequency sweep. The two have a high degree of consistency, which verifies the accuracy of the established model. 50 0 -50 100 0 -100 -200 101 102 103100 M ag ni tu de (d B ) Ph as e( °) 104 f/Hz (a)VSG output impedance positive sequence sweep frequency verification 101 102 103100 104 50 0 -50 100 0 -100 -200 M ag ni tu de (d B ) Ph as e( °) f/Hz (b)VSG output impedance negative sequence sweep frequency verification Figure 12. Positive and negative sequence sweep frequency verification 5.2. VSG grid-connected current verification 5.2.1. Impact on the system when virtual resistors are added When virtual resistance is not considered, the waveform of grid-connected current and output active power at this time is shown in Figure 13. 134 0.5 0.6 20 0.55 10 0 -10 -20 t/s C ur re nt (A ) (a) grid-connected current waveform diagram VS G 正 序 阻 抗 VS G 负 序 阻 抗 电 网 阻 抗 8000 4000 0 -4000 12000 0.2 0.4 0.6 0.8 1.00 t/s A ct iv e po w er ( W ) (b) active power waveform diagram Figure 13. Grid connected current and output active power waveform diagram without virtual resistor From Figure 6, it can be observed that the grid impedance Lg intersects with the output impedance of VSG at 0Hz when Lg is 4mH. At this point, the phase margin is -6.4°, indicating system instability. From Figure 13(a), it can be observed that when Lg is 4mH, the three-phase grid-connected currents exhibit distortion, with a Total Harmonic Distortion (THD) of 6.62%, which does not meet the national requirement of THD being less than 5%. Additionally, as shown in Figure 13(b), there are low-frequency oscillations present in the active power output, confirming the correctness of the VSG model. Add a virtual resistor and make the active power instruction step from 5000w to 7000w at 1s. At this time, the grid- connected current and output active power waveform are shown in Figure 14. C ur re nt (A ) 15 10 5 0 -5 -10 -15 0.8 0.85 0.9 t/s (a)grid-connected current waveform diagram 4000 0 - 4000 8000 0.4 0.8 1.2 1.6 2.00 t/s A ct iv e po w er ( W ) (b)active power waveform diagram Figure 14. Grid connection current and output active power when virtual resistor is added Figure 14(a) shows the three-phase grid-connected currents of the VSG after adding a virtual resistor, with a Total Harmonic Distortion (THD) of 0.46%, meeting grid standards. At this point, the active power waveform of the VSG output is well-behaved, indicating that the proposed virtual resistor strategy can increase stability margin in the low-frequency range and suppress low-frequency oscillations. 5.2.2. Influence of power grid inductance change on the system As the grid impedance Lg increases, the phase margin of the system becomes smaller. Considering the grid impedance when the weak grid SCR=3, it can be seen from equation (33) that Lg is 30mH at this time. 135 (33) Figure 15 depicts the current waveform of the voltage- controlled VSG when the virtual resistor is added, with SCR=3. At this point, the waveform is satisfactory, validating that when Lg is 30mH, the phase margin meets the requirements. Therefore, the voltage-controlled VSG can still operate stably. 10 5 0 -5 -10 -15 1.8 1.91.85 t/s C ur re nt (A ) Figure 15. Waveforms of grid connected current when grid impedance changes 6. Conclusion This paper adopts an improved dead-beat predictive control for the voltage-current loop of VSG, and the sequence impedance model of VSG is established by harmonic linearization method to analyze the stability of the grid- connected system, and the following conclusions are obtained: 1) Compared with PR and PI control, adopting dead-beat predictive control for the voltage-current loop of VSG eliminates the need for parameter tuning. Due to system delay and significant overshoot in one beat, instability may occur. By employing Lyapunov's second law to construct error compensation terms and using linear interpolation to predict the reference values of voltage and current at k+1 moment. By adjusting the values of η and λ in the closed-loop pulse transfer function, the poles outside the unit circle are moved to the unit circle, and the VSG system is stabilized. 2) The harmonic linearization method is used to establish the complete sequence impedance model of VSG with power loop, dead-beat predictive control voltage and current loop and delay link. Through the analysis of sequence impedance, it is found that: The phase of the negative sequence impedance in the low frequency band is lower than -90°, and the phase margin in the low frequency band is insufficient under the condition of weak power grid, which will cause the system to oscillate, and the system will lose stability in severe cases. The virtual resistor is proposed to increase the phase margin of the system and improve the stability of the system. References [1] Zhang Jiaxiang, Pan Qiuping. Power Quality Control of Microgrid Based on Virtual Synchronous Generator[J]. Power Electronics , 2023, 57(02): 92-94+116. [2] Cheng Xuekun, Liu Hui, Tian Yunfeng, et al. Review of Transient Power Angle Stability of Doubly-fed Induction Generator with Virtual Synchronous Generator Technology Integration System [J]. Power System Technology, 2021, 45(02): 518-525. [3] Wang Lina, Wang Yichao, Tan Liping, et al. Variable Parameter VSG Control Based on Adaptive Exponential Function [J]. Journal of Electric Power Science and Technology,2023,38(03):124-131. [4] Zheng Tianwen, Chen Laijun, Chen Tianyi, et al. Technology and Prospect of Virtual Synchronous Generator[J]. Automation of Electric Power Systems, 2015, 39(21): 165-175. [5] Lv Zhipeng, Sheng Wanxing, Liu Haitao, et al. Application and Challenge of Virtual Synchronous Machine Technology in Power System [J]. Proceedings of the CSEE, 2017, 37(02): 349-360. [6] Li Hao, Wang Jie. Modified Droop Control Based on Virtual Synchronous Generator[J]. Journal of Electric Power Science and Technology,2018,33(02):11-19. [7] Vasudevan K R, Ramachandaramurthy V K, Babu T S, et al. Synchronverter: A Comprehensive Review of Modifications, Stability Assessment, Applications and Future Perspectives [J].IEEE Access, 2020, 8:131565-131589. [8] Song Zhanfeng, Xia Changliang, Gu Xin. Stationary Frame Current Regulation of PWM Rectifiers Based on Predictive Control[J]. Transactions of China Electrotechnical Society, 2013, 28 (03): 234-240. [9] Liu Yumei, Zhao Qiaoe, Gao Ge, et al. Current Optimal Control of Grid-connected System of LCLCL Type Parallel Inverter under Weak Grid [J]. Electrical Measurement and Instrumentation, 2019, 56 (24): 122-127+132. [10] Wang Xiaoxiao, Li Tianze. Research on Photovoltaic Grid Connected Inverter Control Method Based on Quasi- proportional Resonance Integral and Deadbeat Compound control [J]. Modern Electronics Technique, 2018, 41(22): 117- 121. [11] Du Guiping, Li Jiajian, Liu Zhifei. A double-loop predictive control method with control error compensation [P]. Guangdong Province :CN201710614651.3,2021-05-14. [12] Yu Rongrong, Wei Xuexue, Wu Xiaojin, et al. An Improved Predictive Current Control Algorithm [J]. Transactions of China Electrotechnical Society,2010,25(07):100-107. [13] Zheng X, Shi X, Li H, et al. VSG Control Strategy Based on Model Predictive for Islanded Microgrid Inverter[C]//IECON 2021–47th Annual Conference of the IEEE Industrial Electronics Society. IEEE, 2021: 1-7. [14] Zhang Bao-qun, Ma Long-fei, Jiao Ran, et al. Harmonic Suppression Strategy of Virtual Synchronous Machine Based on Model Prediction Control[J]. Power Electronics , 2020, 54(01): 14-19. [15] Liu Zhijian, Luo Jun, Liang Ning, et al. Analysis of Influence of Virtual Synchronous Control on Subsynchronous Oscillation Damping for Grid-connected Wind Power System [J]. Automation of Electric Power Systems, 2023, 47(01): 135- 142. [16] Hou Changmao, Lan Zheng, Zou Bin, et al. VSG Whole System State Space Modeling and Stability Analysis [J]. Electrotechnics Electric, 2022(04): 1-6. [17] Sun Jian, Liu Hanchao, Sequence Impedance Modeling of Modular Multilevel Converters [J]. IEEE Journal of Emerging and Selected Topics in Power Electronics, 2017, 5(4): 1427- 1443. [18] Wu Wenhua, Chen Yandong, Zhou LMing, et al. Sequence Impedance Modeling and Stability Analysis for Virtual Synchronous Generator Connected to the Weak Power Grid[J]. Proceedings of the CSEE, 2019, 39 (06): 1560-1571+1853. [19] Jia Yaoqin, He Qiaohui, Wang Xingguo. Dynamic Modeling and Stability Analysis of Voltage Source VSG[J]. Power Electronics , 2019, 53(02): 12-15. [20] Yang Peng,Yue Wang, Liu Yonghui, et al. Sequence- Impedance-Based Stability Comparison Between VSGs with and without inner loops control[C]// 2020 IEEE Energy 2 g N g U SCR S Z  136 Conversion Congress and Exposition (ECCE). IEEE, 2020:2108-2112. [21] Yu Yanxue, Guan Wanlin, Chen Xiaoguang, et al. Synchronous Frequency Resonance in Virtual Synchronous Generator Based on Sequence-impedance[J]. Transactions of China Electrotechnical Society, 2022, 37(10): 2584-2595. [22] Akter M P, Mekhilef S, Tan N M L, et al. Modified Model Predictive Control of a Bidirectional AC–DC Converter Based on Lyapunov Function for Energy Storage Systems[J]. IEEE Transactions on Industrial Electronics, 2016, 63(2): 704-715. [23] Lu jingchao. Principle of Automatic Control[M]. Beijing: Tsinghua University Press, 2013.3. [24] Liu Zhifei. Research and Application of Predictive Control in Voltage Source PWM rectifier [D]. South China University of Technology,2018. [25] Qi Fujun, Niu Qingsong, Liao Yuxiang, et al. Full Frequency Domain Impedance Analysis and Stabilization Strategy of LCL Grid-Connected Inverter[J]. Power Electronics , 2002, 56(07): 21-25. [26] Yang Dongsheng, Ruan Xinbo, Wu Heng. A Virtual Impedance Method to Improve the Performance of LCL-type Grid-connected Inverters Under Weak Grid Conditions [J]. Proceedings of the CSEE, 2014, 34 (15): 2327-2335. [27] Wang S , Liu Z , Liu J .Modeling of D-Q Small-Signal Impedance of Virtual Synchronous Generator[C]//2018 IEEE International Power Electronics and Application Conference and Exposition (PEAC).IEEE, 2018:1-6. [28] Wang Yang, Zhang Xing, Guo Zixuan, et al. Suppression Strategy of Subsynchronous Oscillation of Virtual Synchronous Generator[J]. Power Electronics , 2021, 55(04): 20-25. [29] Chen Zhe, Zhu Miao, Hou Chuanchuan, et al. Compound Power Synchronous Inverters: Sequence Impedance Modeling and Grid Integration Characteristics[J]. Proceedings of the CSEE, 2023, 43 (05): 1927-1940.