Modeling and Emulation of a Synchronous Generator Considering Unbalanced Load Conditions

Power electronics converters can be applied as emulators to mimic different grid components used for system behavior analyses and control validation. Synchronous generators (SGs) are the major sources of electric grids. Converter-based SG emulators have been developed for system stability analysis, fault analysis, and frequency support. However, existing SG emulators have not considered the impacts of load unbalance, which is a common phenomenon in distribution grids and will lead to system-level issues. In this article, a SG emulator considering an actual SG's negative sequence (NS) performance is developed for system analyses under unbalanced load conditions. With different simplifications, a SG can have different orders of electrical models. By deriving the NS performances of different SG electrical models, an appropriate SG electrical model in unbalanced load conditions is selected. Then a novel control diagram is proposed to ensure that the NS performances of the selected model can be fully realized. The derived NS models and the proposed control diagram are verified through simulation first and then validated with a converter-based hardware testbed.


I. INTRODUCTION
Power electronic converters have been applied to emulate certain grid components, such as load [1] and energy storage systems [2], by mimicking their electrical characteristics.Converter-based emulators are developed for system-level hardware simulation and control algorithm validation, which have better flexibility and reconfigurability compared with real grid components [3], [4], [5].An example of such emulators is shown in Fig. 1, containing a component model for reference generation and a control loop to realize the references [6].
In power grids, due to the frequency support capability, high fault current rating, and reliability, synchronous generators (SGs) are widely adopted as sources to establish system voltage and frequency [7], [8].In the existing literature, SG emulators have been proposed for stability analyses [9] and fault analyses [10].Furthermore, converter-emulated SGs have also been applied in real grids to provide frequency support [11].
However, the impacts of unbalanced loads have not been fully considered in the existing SG emulators.In distributionlevel grids like microgrids, load unbalance is common.The unbalanced load current flowing into SGs will result in voltage unbalance of SGs, affecting the voltage quality of the whole grid [12], [13].In the distribution grids formed by grid-forming inverters and SGs simultaneously [14], [15], unbalanced loads will lead to more issues, one of which is the inaccurate unbalanced power sharing among SGs and IBRs [16].
To investigate all the potential system-level issues from the unbalanced load, an SG emulator considering unbalanced performances, specifically negative sequence (NS) performances of an actual generator, is needed.The SG emulator requires an appropriate SG model, which usually consists of an excitation model, a mechanical model for frequency response characteristics, and an electrical model for electromagnetic performances [10].The actual NS characteristics of a SG are related to its sub-transient reactance and resistance of stator and rotor [17], which are represented by the electrical model.With different simplifications, SG's electrical model can be from second order (2nd-order) to ninth order (9th-order) [18].
Different electrical models have been implemented on power converters [9], [11], [19], [20], [21], [22], [23], [24], [25], [26].However, the NS characteristics of SGs, have not been fully considered in the existing implementations.In the literature 2nd-order, fourth-order (4th-order), and sixthorder (6th-order) models are commonly implemented, where the 2nd-order model is the most applied converter-emulated generators [19], [20], [21], [22], [23], [24].This is because converter-emulated generators are usually developed for frequency support, which focuses on the mechanical model implementation, and the simplest electrical model is used to reduce the implementation complexity.The 4th-order model contains transient performances of SGs.Refs.[9], [25] realize converter-emulated generators with the 4th-order model for the stability analysis.Besides the transient performances, the 6th-order model also describes the sub-transient performance of the SG, which can be used for fault analysis in [11], [26].The NS performances of these models have not been clearly explained.This lack of clarity implies that there may be potential issues if these converter-emulated SGs are deployed as sources in an unbalanced system.
Moreover, some converter-emulated SGs directly control the NS voltage/current of the emulator [27], [28], [29].Ref. [27] regulates the NS current of the converter-emulated generator to zero to achieve balanced current output.Ref. [28] compares three different NS voltage regulation strategies.Ref. [29] regulates the NS current to limit the peak current of a converter-emulated generator.However, the NS control targets of these emulators are different from the actual SG's NS performance and these models do not consider the electromagnetic characteristics of actual SGs.
Apart from the SG model, the control loop can also impact the emulation performance.Existing converter-emulated generators usually realize the control target in dq coordinates with proportional-integral (PI) controllers.Nevertheless, if the positive and negative sequences are not decoupled, the NS components will be transformed into 2nd-order frequency components [30].The regulation of the PI controller cannot achieve zero static error on double-line frequency components.As a result, the control loop may also impact the NS emulation accuracy.
To solve all the aforementioned issues, this article first provides detailed theoretical NS model derivations of different SG models to select the appropriate one that can represent the NS characteristic of an SG.With the appropriate SG model, a sequence-decoupled control loop is proposed to compensate for the control loop impacts on the NS performance emulation and keep the positive sequence (PS) performance emulation of the SG.The contribution of this article can be summarized as follows: r Derivation of the NS performances for commonly ap- plied SG models.
r Selection of the appropriate SG model for the SG emu- lator in unbalanced load conditions.
r Proposition of a reference-decoupled control diagram to realize the NS performance emulation of the SG.The rest of the article is organized as follows: Section II derives NS models of different SG models; Section III proposes the control loops for the SG emulator; simulation verifications are covered in Section IV; experimental demonstrations are provided in Section V; Section VI draws the conclusion.

II. NS PERFORMANCE DERIVATIONS OF SG MODELS
In this section, the steady-state NS model of the actual SG is introduced first to serve as the baseline.Then the NS performances of four typical SG models are derived to select the appropriate one for unbalanced load conditions.Note that the SG is usually three-wire, so the zero-sequence performance of the SG is not discussed in this article.

A. NS MODEL OF SG
From [17], the NS model of a SG is shown in Fig. 2, where the impedance can be written as: where X d and X q are the sub-transient reactance of the generator; R a is the stator resistance.According to (1), the NS model of the SG can be viewed as a resistor in series with an inductor.According to [17], the reactance of the SG is usually much larger than the resistance.The impacts of the resistance part are usually small.are the voltage references for the control loop.R v and L v are the virtual impedance parameters.The parameter definitions of generator models can be found in [6] and [26].The 2nd-order model can be viewed as a virtual impedance.The 4th-order model includes the transient characteristics.The conventional 6th-order model describes the sub-transient characteristics.
Compared with the conventional 6th-order model, the updated 6th-order model in [31] considers the derivation terms of the flux linkage.
According to (1), the actual NS model of SG contains the sub-transient reactance.Therefore, the detailed NS characteristic derivation will focus on the 6th-order model and updated 6th-order model.Note that since the 2nd-order and 4th-order models do not contain sub-transient reactance terms, they should not be considered as the potential models to represent the actual SG's NS performance.However, obtaining their NS performances is still necessary because 2nd-order and 4th-order models are commonly applied in existing converter-emulated SGs that may be adopted in real grids with unbalanced load conditions.
The 6th-order model and updated 6th-order model are both in dq coordinates.The transformation matrix is: (2) The converter-emulated generator's output voltage and current with NS components can be written as: where V 1 , I 1 , V 2 , I 2 are the amplitudes of PS and NS voltages and currents.θ v1 , θ i1 , θ v2 , θ i2 are the phase angles of PS and NS voltages and currents.After the dq transformation, the voltage and current can be expressed as: where V d , V q , I d I q are the voltage and current in dq coordinates, and the NS components will become double-line frequency.According to the model in Table 1, the output current will generate the output voltage references.In the steady state, the relationships between voltage references and output currents in positive and negative sequences can be derived separately for the model selection.

1) CONVENTIONAL 6TH-ORDER MODEL
For the 6th-order model, after the Laplace transformation, the model can be written as s is the output of the excitor model.After the Laplace transformation, the currents in dq coordinates are: To obtain the models of positive and negative sequences, the derivations of positive and negative sequences are conducted separately.For the PS model, after simplification, ) where E d1 (t ) and E q1 (t ) is the PS components in E d (t ) and E q (t ).After the inverse Laplace transformation, the exponent terms in E d1 (t ) and E q1 (t ) will approach zero in the steady state.The model can be simplified to According to (10) and the model in Table 1, the steady-state PS model matches the theoretical SG PS model in [17].The detailed derivations are summarized in Appendix I.
For the NS model, similarly, E d2 (s) and E q2 (s) are: (11) After the inverse Laplace transformation, E d2 (t ) and E q2 (t ) are very small in the NS model.It is omitted for the model derivation.The detailed derivations and impact analyses of E d2 (t ) and E q2 (t ) are also summarized in Appendix I. Combining with (6) and the model in Table 1, the NS model becomes: After inverse dq transformation, the NS voltage drops on the sub-transient reactance (X d and X q ) and stator resistance of the in abc coordinates can be obtained: where the third-order components in (14) will only result in harmonic currents in four-wire inverters.In this article, only the fundamental frequency part will be focused on.Since −sin(ωt + θ i2 ) = cos(ωt + θ i2 + π 2 ), only consider the fundamental frequency part, ( 14) can be written as With the voltage and current direction in Fig. 2, the NS model of the 6th-order model is: Therefore, although the conventional 6th-order model considers the sub-transient reactance, the NS model can be viewed as a resistor in series with a capacitor, which is different from the actual SG model.

2) UPDATED 6TH-ORDER MODEL
For the updated 6th-order model, a similar derivation process can be applied.The sub-transient voltages E d2 (t ) and E q2 (t ) are omitted in the NS model derivation because they are very small after the inverse Laplace transformation.Their impacts are also analyzed in Appendix I. Compared with the conventional 6th-order model, the differential terms of flux linkages are considered.For the PS model, since the PS current in dq coordinates are dc components, the PS model is the same as the model in (10).For the NS model, according to (6), the model can be written as Therefore, after inverse dq transformation, only considering the fundamental frequency components, output voltage references generated by the resistance part will be the same as (14), and the reactance (X d and X q ) part in abc coordinates will be: The NS model of the updated 6th-order model is: Therefore, the NS model ( 17) can match the actual SG NS model in (1).

3) OTHER SG MODELS
Using a similar derivation approach, the NS models for the 2nd-order and 4th-order SG models can also be obtained, which are summarized in Table 2. From the derivation results, the NS models of 2nd-order and 4th-order models can be both viewed as a resistor in series with a capacitor.Therefore, to realize the SG NS characteristic emulation, the updated 6th-order model should be used.

III. PROPOSED CONTROL DIAGRAMS FOR THE SG EMULATOR
In the literature, the dual-loop control in dq coordinates has been widely applied in SG emulation [11].PI controllers are applied to regulate the output voltage/current to follow the references.However, according to ( 5), (6), and ( 17), both the NS references and NS components in the feedback will become double-line frequency components.A PI controller only has an infinite gain at dc components.When they are applied for the regulation of double-line frequency components, static errors will occur to affect the emulation accuracy.
To achieve accurate PS and NS characteristic emulation, the updated 6th-order model should be realized by the control loop with no static error.Therefore, the emulation control loop is proposed in Fig. 3.In the control diagram, the updated SG model is integrated.The excitation and mechanical models can be found in [9], which contains the turbine emulation, governor emulation, and inertia emulation.The excitation model will generate the field winding voltage e fd .The mechanical model will generate frequency references.
Meanwhile, based on the model derivation, the output of the electrical model is composed of dc components for PS voltage references and double-line frequency components for NS voltage references.In the proposed diagram, the generated voltage references conduct an inverse dq transformation to abc coordinates.The voltage references in abc coordinates will contain PS and NS components.The voltage references are decomposed into positive and negative sequences in αβ coordinates and then transformed into PS and NS dq coordinates.After the decomposition and transformation, the PS and NS components will all become dc components in corresponding dq coordinates.The detailed sequence decomposition approach can be found in [32].
The measured voltage and current will also be decomposed and transformed into PS and NS dq coordinates.The

TABLE 3. Simulation Parameters
dual-loop control is conducted for both positive and negative sequences with PI controllers.Compared with the conventional control loops, the proposed control loop will not affect the SG model to keep the PS emulation accuracy.Meanwhile it will not have static error for both PS and NS regulation so that better emulation performance can be achieved.

IV. SIMULATION VERIFICATION
In the simulation, the control loop impacts are verified first.Then derived NS performances of different SG models are also verified.Simulation is conducted on the system setup in Fig. 4, where an inverter is applied to emulate a SG.The inverter is three-wire, and the neutral line is provided by the grounding transformer.The detailed system parameters are shown in Table 3.In the simulation, the location of the voltage and current measurements is the emulator output (right side of filter inductor and left side of grounding transformer).The measured current only contains PS and NS components.

A. CONTROL LOOP IMPACTS
To verify the control loop impacts, two simulation cases are conducted.First, the SG emulator uses the updated 6th-order model and a typical control loop, which is a dual-loop control with an outer voltage loop and an inner current loop [31]   measured by the NS voltage magnitude over the measured NS current magnitude.The phase angle of the NS impedance is measured by the NS voltage angle subtracting the measured NS current angle.In the second case, the SG emulator implements the proposed control loop, and simulation results are shown in Fig. 6.
The results in Fig. 6 can match the theoretical NS impedance of the SG in (1).However, according to Fig. 5, the measured impedance is different from the theoretical values in both magnitude and phase angle, meaning that the control  loop in [31] will affect both the magnitude and phase angle of the SG emulator's NS impedance.Therefore, the proposed control loop should be applied for the SG emulation.

B. MODEL VERIFICATIONS
In this section, all the derived models are verified through simulations.In order to avoid the impacts of the control loop, the proposed control loop is applied to all the SG emulators in the testing.The voltage references generated by the 2nd-order, 4th-order, and 6th-order models in dq coordinates will be transformed into abc coordinates first.Then the references will be decomposed into PS dq coordinates, and NS dq coordinates.
Simulation results of the 6th-order, 4th-order, and 2ndorder models are shown in Fig. 7(a), (b), and (c), respectively.All the measured NS impedances are summarized in Table 4.The NS impedance's phase angles of 6th-order, 4th-order, and 2nd-order models are close to −90 • , meaning that the NS impedance for these models is a resistor in series with a capacitor and the capacitance values can well match the derivations.Therefore, the simulation results verify the derivations for all the models.From Table 4, only the updated 6th-order model can match the theoretical analyses, which should be used in the NS emulation of SGs.

V. EXPERIMENTAL DEMONSTRATIONS A. SYSTEM SETUP
The derivation results and proposed control loop are demonstrated on a converter-based hardware testbed (HTB), where power converters are applied to emulate the generator and unbalanced loads.The inverter hardware is the VACON drive, which is a three-phase, two-level inverter.The oscilloscope model is LeCroy MDA810.In HTB a power circulating structure is applied so that the dc power supply only provides the losses of the whole system [33].As shown in Fig. 8, a threephase inverter (#2) is controlled to emulate an unbalanced load.The control strategy of the load emulator is to directly regulate its PS and NS currents, of which the control diagram is in [34].The PS current is 12 A, and the NS current is 18 A. Inverter #1 serves as the SG emulator and different SG models are implemented.The generator parameters are the same as in Table 3 and other system parameters are summarized in Table 5.

B. TESTING RESULTS
In the testing, the phase-to-phase voltages and phase currents of the SG emulator are measured.The resistance and reactance parts of the NS impedance are shown in Fig. 9(a) and (b), respectively.The voltage and current waveforms are shown in Fig. 10.Using the measured voltages and currents, the NS impedance of the SG emulator is calculated.All the measured NS impedances are also summarized in Table 6 According to the measured impedances, the reactance parts of 2nd-order, 4th-order, and conventional 6th-order models are all capacitive and the updated 6th-order model has inductive reactance.For the resistance part, when the proposed control loop is applied, only the 2nd-order model's resistance is greater than 0.05 pu (0.094 ).This is because the virtual resistance in the 2nd-order model is much higher than the resistances in other models.For the updated 6th-order model, when the references are not decomposed into PS and NS components, the control loop will highly affect the impedance value.When the proposed control loop is applied, the model can achieve the best accuracy compared to the theoretical NS impedance of the SG.
Moreover, since the data of voltages and currents are obtained from the oscilloscope, the measurement resolution is not high, which may lead to measurement error.However, even with the measurement errors, the proposed emulation (updated 6th-order model with proposed control loop) can achieve the best emulation accuracy compared with other models.Therefore, the proposed model can be used for SG emulation under unbalanced load conditions.

VI. CONCLUSION
Existing SG emulators have not fully considered the NS characteristics of SGs for unbalanced load support.In this article, the NS behaviors of different SGs models are derived: r The NS performance of the 2nd-order model is repre- sented by the SG's stator resistance plus a capacitive reactance with value of its steady-state reactance.
r The NS performance of the 4th-order model is repre- sented by the SG's stator resistance plus a capacitive reactance with the average value of its transient reactance.
r The NS performance of the 6th-order model is repre- sented by the SG's stator resistance plus a capacitive reactance with the average value of its sub-transient reactance.
r The NS performance of the updated 6th-order model is represented by the SG's stator resistance plus an inductive reactance with the average value of its sub-transient reactance.
Compared with the NS performance of the actual SG, the updated 6th-order model is appropriate for the unbalanced load support.The reason is that this model considers the subtransient reactance and does not omit the derivative terms of the flux linkage.The derived NS models will also benefit the analysis and operation control of unbalanced systems where converter-emulated SGs are implemented.
Moreover, a control diagram is proposed to realize a nostatic-error regulation of the NS references generated by the updated 6th-order model.The proposed control diagram decomposes the references into PS and NS components, then regulates them separately in PS and NS dq coordinates.In the proposed control diagram, the NS components will become dc components instead of double-line frequency components so that the impacts of the inadequate gain of PI controller at double-line frequency components can be eliminated.Simulations and experimental demonstrations are conducted to verify the derived NS models and validate the proposed control strategies.The proposed SG emulator can be used to represent SGs for systemlevel analysis when unbalanced load conditions need to be considered.

APPENDIX I A. PS MODEL DERIVATION
After the inverse Laplace transformation, the E d (t ) and E q (t ) in the PS model will become: where , M e f (t ) = cosh , and In the steady state, the convergence of ( 20) is determined by the sign of the exponent terms.Since the sub-transient reactance is usually smaller than the transient reactance, it is easy to obtain: In the steady state, the exponent terms in E d1 (t ) and E q1 (t ) will approach zero and the model in (10) can be obtained.

B. NS MODEL DERIVATION
After the inverse Laplace transformation, the E d2 (t ) and E q2 (t ) in the NS model will become: where ( 28)- (33) shown at the bottom of next page In the steady state, the exponent terms in E d2 (t ) and E q2 (t ) will also approach zero.For the trigonometric items in E d2 (t ) and E q2 (t ), considering the typical range of generator transient and sub-transient time constants, the maximum value of the trigonometric items will be very small.Therefore, in the NS model, E d2 (t ) and E q2 (t ) can be viewed as zero and the model in ( 12) can be obtained.For the completeness, we will also analyze the impacts of the trigonometric items on the NS impedance of the conventional 6th-order model and the updated 6th-order model.

1) CONVENTIONAL 6TH-ORDER MODEL
In the conventional 6th-order model, after the exponent terms approach zero, the E d2 (t ) and E q2 (t ) will only contain the trigonometric items, which can be written as: After the inverse dq transformation, omitting the 3rd-order components, the trigonometric items will become: where . According to (35), considering the current direction, the sub-transient voltages will introduce an impedance: With the values in Table 3, the introduced NS impedance is 0.005∠ − 181.72 • .This impedance is very small compared to the values in Table 4.

2) UPDATED 6TH-ORDER MODEL
For the updated 6th-order model, after the exponent terms approach zero, the trigonometric items in E d2 (t ) and E q2 (t ) will lead to NS impedances.The first one is the same as (38).The second one is introduced by the differential terms of flux linkages.With similar derivation process, the impedance can be written as: where

FIGURE 1 .
FIGURE 1.Control diagram of a converter emulator.

FIGURE 2 .
FIGURE 2. NS model of a SG.

FIGURE 3 .
FIGURE 3. Proposed control diagram for SG emulator considering unbalanced load support.
. The terminal voltage and current of the SG emulator are shown in Fig. 5(a) and the measured NS impedance (normalized value) is shown in Fig. 5(b).The magnitude of the NS impedance is

FIGURE 5 .
FIGURE 5. Simulation results of the VSG with updated 6th-order model and dual-loop dq control: (a) voltage and current waveforms; (b) NS impedance measurement.

FIGURE 6 .
FIGURE 6. Simulation results of the VSG with updated 6th-order model and proposed control loop: (a) voltage and current waveforms; (b) NS impedance measurement.