A Tutorial on Dynamics and Control of Power Systems with Distributed and Renewable Energy Sources Based on the DQ0 Transformation

Yoash Levron 1,* , Juri Belikov 2 and Dmitry Baimel 3 1 The Andrew and Erna Viterbi Faculty of Electrical Engineering, Technion—Israel Institute of Technology, 3200003 Haifa, Israel 2 Department of Computer Systems, Tallinn University of Technology, Akadeemia tee 15a, 12618 Tallinn, Estonia; juri.belikov@ttu.ee 3 Shamoon College of Engineering, 84100 Beer-Sheva, Israel; dmitrba@sce.ac.il * Correspondence: yoashl@ee.technion.ac.il; Tel.: +972-4-829-5923


Introduction
Power system dynamics is an important part of power system theory in general, and a subject that must be well understood to support the world growing energy demands [1].Recently, due to increasing integration of fast renewable and distributed energy sources, power systems are undergoing significant changes.One of the main barriers for integrating renewable sources today is that the impact of these sources on the system dynamics and stability is not yet fully understood, where several systematic issues are power balancing, low system inertia, and stability [2][3][4][5].
Traditionally, the system dynamics is largely governed by the response of synchronous generators with high rotational inertia, and as a result, dynamic processes are analyzed based on the approximation of time-varying phasors [4,[6][7][8].A key assumption in time-varying phasor models is that transients are relatively slow in comparison to the system frequency.However, this assumption may not hold if a significant amount of power is being generated by renewable and/or distributed energy sources with low inertia.In this case, the system cannot be modeled using time varying phasors, and alternative models should be used [9,10].
In light of these developments, this paper is a tutorial to power system dynamics, based on the dq0 transformation.We recall basic concepts of this transformation, and explain how to model essential components such as passive networks, generators, and inverters, and how to systematically construct dq0-based models of complex systems.We also discuss the relations between dq0-based models and classic time-varying phasor models.Specifically, we highlight the idea that dq0 models may be viewed as a natural extension of time-varying phasor models, and discuss the correct use and validity of each approach.The material presented in this paper summarizes the results of several recent works, for instance [11,20,[22][23][24][25], and rearranged to be accessible at the undergraduate level.

Basic Concepts of DQ0-Based Models
What type of model is most suitable for studying the dynamics of a specific system?First, the model must be chosen according to the time-scale of the phenomena studied.An established practice in the power systems field is that time-varying phasor models are sufficiently accurate as long as phasors are slowly changing in comparison to the system frequency [10,26].However, when analyzing fast dynamic phenomena, the assumption of quasi-static phasors may be inaccurate [23,27].In such cases the system should be studied by means of transient models, which may be based on either abc or dq0 quantities [28].
As we shall see in this section, the dq0 transformation leads to both an accurate representation of transient phenomena, and static signals at steady state.Similar to time-varying phasors, the dq0 transformation maps sinusoidal signals to constants.However, unlike time-varying phasors, this mapping is accurate, and does not rely on the assumption of a quasi-static network.Moreover, the resulting model typically has well-defined equilibrium points.Due to these properties, dq0 models are useful for modeling fast dynamic phenomena, and enable analysis of complex transients.The relations between different types of dynamic models are presented in Table 1.
Table 1.Comparison of approaches for dynamic modeling.

Model
Operating Point Small-Signal High Frequencies Non-Symmetric Networks time-varying X X phasors abc X X dq0 X

Basic Definitions
The dq0 transformation and its inverse are defined as in [28] T θ = 2 3 sections.Direct multiplication of these matrices reveals that T θ T −1 θ = T −1 θ T θ = I 3×3 .Other useful identities are provided in Appendix A.
The dq0 transformation maps three-phase signals in the abc reference frame to new quantities in a rotating dq0 reference frame.Denote x abc = [x a , x b , x c ] T and x dq0 = [x d , x q , x 0 ] T , then x dq0 = T θ x abc and x abc = T −1 θ x dq0 , where the subscripts d, q, and 0 represent the direct, quadrature, and zero components.A fundamental property of the dq0 transformation is that it maps symmetric AC signals to constants.For instance, consider a three-phase voltage source modeled as Using the inverse transformation T −1 θ with θ = ω s t, it is easy to see that and therefore v d = A, v q = 0, v 0 = B.The sinusoidal signals in the abc reference frame are mapped to constant signals in the dq0 reference frame (see Figure 1).

Modeling Resistors, Inductors, and Capacitors
We will now develop the basic dq0 models of linear passive components.These will help us understand the models of more complex units [30][31][32].To begin, we need the following definitions:

•
Recall that balanced three-phase signals are sinusoidal signals with equal magnitudes, phase shifts of ±120 • , and a sum of zero.

•
We say that a power network is balanced or symmetrically configured if balanced three-phase voltages at its ports result in balanced three-phase currents, and vice versa.Two examples are shown in Figure 2.
In this paper we use the term balanced when referring to signals, and symmetrically configured when referring to networks and systems.The following discussion focuses on networks that are symmetrically configured.Networks which are not symmetrically configured will be discussed next.Assume a symmetrically configured three-phase resistor R, which is modeled as Multiply both sides of the equation by the dq0 transformation T θ (from the left) to obtain This is the dq0 model of a symmetrically configured three-phase resistor.Now assume a symmetrically configured three-phase inductor L, which is modeled as The relation [i a , i b , Using the derivative product rule yields By direct computation, it can be verified that the derivative of the inverse dq0 transformation is with Substitute these expressions in (9) to obtain Now multiply from the left by T θ and rearrange terms to get This is the dq0 model of a symmetrically configured inductor.The explicit expressions are Note that the quadrature component affects the direct component, and vice versa.Similarly, the dynamic model of a symmetrically configured capacitor C is 2.1.2.Power in Terms of DQ0 Quantities Assume a general three-phase unit, as described in Figure 3.The instantaneous power flowing from the unit into the network at time t is Rewrite this equation as By direct computations, it can be verified that and therefore This expression defines the total instantaneous power in terms of dq0 quantities.

Energy in Terms of DQ0 Quantities
Assume a symmetrically configured three-phase inductor, with currents i a , i b , i c , as shown in Figure 4.The total energy stored in the inductor is Rewrite this expression as Again we use the identity (18) to obtain or equivalently, Similarly, the energy stored in a symmetrically configured three-phase capacitor C is In addition, we will now show that the derivative of energy is power, as expected.Referring to the circuit in Figure 4, the product rule yields Now, using the dynamic model of the inductor in (14), or more simply, which is identical to The change in stored energy is equal to the sum of powers flowing into the inductor.

Modeling General Linear Networks
This section presents a relatively simple method to develop dq0 models based on prior knowledge of the system dynamics in the abc reference frame [23].Let x represent the state vector of the system in the abc reference frame, and use the compact notation and the composite dq0 transformation and its inverse as such that x dq0 = Λ θ x abc , x abc = Λ −1 θ x dq0 .Substitute these definitions into (29) to get Derivative of the inverse dq0 transformation is given by d , where Substituting this expression into (31) results in This equation describes the dynamics of the system based on dq0 quantities.Note that in general this model depends on θ(t), and is not time-invariant.However, for the special case of symmetrically configured networks, it is typically true that Λ θ A = AΛ θ , and therefore Equation (33) takes the form which often results in a linear and time-invariant model.As an example, consider the circuit in Figure 5.The network dynamics in the abc reference frame is In this example Λ θ = T θ .As a result, the dynamic model in the dq0 reference frame is which yields or This last equation can be written as and choosing the reference frame such that d dt θ = ω s leads to The resulting model is linear and time-invariant.What happens if the network is not symmetrically configured?Assume now that the network is changed, such that the inductances are L, L, and 2L.In this case the equality Λ θ A = AΛ θ no longer holds, and the resulting model is nonlinear and time-varying, since the term Λ θ AΛ −1 θ changes with θ(t).
As another example, consider the circuit in Figure 6.The voltage sources on the left represent the secondary side of a transformer, and the sources on the right represent the primary side of another transformer.The objective is to study the effect of the resistors R g,1 and R g,2 .The model in the abc reference frame is Direct computations yield Assuming dθ/dt = ω s , and using (33), the dq0 model becomes Note that in this case Λ θ A = AΛ θ , nevertheless the resulting dq0 model is linear and time-invariant.
The expressions for i d , i q are identical to the expressions in (40), and are unaffected by the mutual resistors R g,1 and R g,2 .These resistors affect only the zero component, which according to (1) represents the average current i → ∞, the average current i 0 tends to zero, but i d , i q are unaffected.
This example may explain how a transformer with isolation between the primary and secondary coils helps to balance the system, by attenuating the current zero component.

Comparison of Time-Varying Phasors and DQ0 Models
This section shows that dq0 models are a natural extension of time-varying phasor models, and explains the underlying link between these two approaches [11].
To present the quasi-static model and dq0-based model using similar terminology, we first need to establish the relationships between dq0 signals and time-varying phasors.Assume a unit with balanced three-phase AC voltages given by Assuming that variations in the magnitude A(t) and phase ψ(t) are slow in comparison to the nominal system frequency ω s , these voltages may be represented by the time-varying phasor In addition, based on (2) with θ(t) = ω s t, and using trigonometric identity cos(α and therefore Note that in this paper quasi-static systems are assumed to be balanced, and therefore v 0 (t) = 0. Following (45) and (47), if the system is quasi-static, time-varying phasors relate to dq0 quantities by or alternatively, Using this result, in a quasi-static system, the powers, amplitude and phase relates to dq quantities by Assume now a symmetrically configured linear network with N buses.The network is described by the admittance matrix Y(s).In a quasi-static system, the network equations are given by This can be rewritten as or equivalently This expression applies only to a quasi-static network.Note that the admittance matrix is constant, and is evaluated at a single frequency s = jω s .
We will now generalize this result, and obtain an equivalent expression for a network that is not quasi-static.Define the dq signals v d,n , v q,n to be the voltages on bus n, and i d,n , i q,n to be the injected currents into bus n.In addition, define the vectors Using a reference angle θ(t) = ω s t, the network is described by where A proof for these equalities is provided [24].This model applies to any symmetrically configured linear network.At low frequencies, assuming s → 0, it may be verified that and therefore the dq0 model in (54) and the quasi-static model in (53) are equivalent.This result explains why dq0 models may be viewed as an extension of quasi-static models.
In other words, quasi-static models use time-varying phasors, and are therefore accurate only at frequencies much lower than ω s .In comparison, dq models are accurate over a wider frequency range.For s → 0, both models are equivalent [11].As an example, consider again the symmetrically configured three-phase inductor, which dynamic model is given in (14).Assuming θ = ω s t and v 0 = 0, This is the accurate model of a symmetrically configured 3-phase inductor.In addition, the admittance matrix describing the inductor is Y = 1/(jω s L), and the quasi-static model is I = 1 jω s L V. By taking the real and imaginary parts of the equation, and using the relations between dq signals and phasors in (49), equivalent expressions for the quasi-static model are Direct comparison of (57) and (58) reveals that both models are similar, except for the additional time derivative terms in the dq model, which describes high frequency effects.At low frequencies, when these time-derivatives are negligible, the two models are identical.
Remark 1 (Equilibrium points).For balanced systems, since quasi-static models and dq models are equivalent for s → 0, the equilibrium points of both models are the same, and may be computed by solving the system's power flow equations.

Summary of Power Definitions
We will briefly recall the power expressions obtained so far.The (total) three-phase power of a unit is given by where v a i a , v b i b , and v c i c are the instantaneous single-phase powers, and P 3φ is the instantaneous three-phase power.These equalities are mathematical identities (not approximations).In addition, if the system is quasi-static, then the active power is the average power over a line cycle (of a single phase): where T is the period of the AC signals.
The active and reactive powers relate to dq0 quantities by Moreover, since we assume that quasi-static systems are balanced, the instantaneous (three-phase) power is constant over a line cycle: This last equality is one of the greatest advantages of three-phase systems.While a single-phase system provides alternating power, a balanced three-phase system provides constant power over a line cycle.As a result, three-phase devices with constant power output do not need to store significant energy, and can be made small and efficient.This idea is illustrated in Figure 7.
. While a single-phase system provides alternating power, a balanced three-phase system provides constant power over a line cycle.

Example-Modeling a Network Based on DQ0 Quantities
In this example we consider a linear network containing an ideal power source connected to an infinite bus (voltage source with a constant amplitude and frequency), as described in Figure 8.We will show that the quasi-static model describing this system has no dynamic states, and therefore provides no information regarding the system stability.In addition, with no resistor and no capacitor (R = 0, C = 0), an accurate dq0 model shows that the system is unstable.We also provide an explicit value for C for which the system is stable.Consider the following system data: The network is symmetrically configured.

•
Based on (61), the power source is defined by meaning that under a quasi-static approximation the active power is P, and the reactive power is zero.

•
The infinite bus has an RMS voltage of V g , and a frequency of ω s .

•
We use a dq0 transformation with a reference angle θ(t) = ω s t.
The quasi-static model has no dynamic states.The voltages, currents and powers may be found by solving the power flow equations, where bus 1 is a PQ bus (P, Q known, |V|, δ unknown), and bus 2 is the reference bus (|V|, δ = 0 known, P, Q unknown).Since the quasi-static model does not describe the system dynamics, it provides no information regarding the system stability.Even if the power flow equations has a solution, the system may be either stable or unstable.
We will now describe the accurate system dynamics based on dq signals.The following analysis shows that if R = 0 and C = 0, then the system is unstable.The infinite bus is described by Using ( 14) with θ = ω s t, the inductor is described by (remember that R = 0) The power source is modeled as in (63).We choose to view it as a controlled voltage source.To this end, solving (63) with respect to the voltages yields Combination of ( 64)-(66) provides the (nonlinear) state-space model The Jacobian of this model at an equilibrium point ( īd , īq ) is The poles of the system are found by computing the roots of the characteristic polynomial, which is given for a second-order system by where Tr(A) is the trace of A, and det(A) is the determinant of A. It is easy to verify that Tr(A) = 0, and therefore, the poles are s 1,2 = ± det(A).
• If det(A) > 0, there is a pole in the right half of the complex plane, and the system is unstable.

•
If det(A) ≤ 0, there is a complex conjugate pair of poles on the imaginary axis, and additional analysis in simulation reveals that the system is unstable.
Why is the system unstable with zero resistance and capacitance?One explanation is that the power source on the right has no local energy storage device.In this example, if the capacitor C is present and is sufficiently large, then the system is stable.The conditions for stability are fully analyzed in [33].For instance, assuming 0 < P < R|V| 2 2|Z| 2 the condition for stability is (70)

The Synchronous Machine
This section explains how to model synchronous machines based on dq0 quantities.We focus on synchronous generators, since they are an important source of power in large commercial power systems [2,13,28].A basic diagram of the machine is shown in Figure 9.The key mechanical components of the machine are the rotor and stator.There are also two key electric parts: the field winding on the rotor, and the three-phase armature winding on the stator.The field winding is typically connected to a DC source, which creates a magnetic field, with alternating north and south polarities.As an example, Figure 9 shows a machine with two magnetic poles.As the rotor rotates, AC voltages are induced in the armature windings.In addition, the interaction between magnetic fields in the machine produces a torque that acts to decelerate the rotor.These two processes result in energy conversion, from mechanical energy to electric energy as a generator, or vice versa as a motor.The machine is named "synchronous" since at steady state the rotor speed is proportional to the frequency of currents and voltages in the stator.This is not necessarily the case in other machines.For example, in an induction machine, the rotor must rotate slightly slower than the AC current frequency.Note that the machine model includes many different symbols.Appendix B.1 summarizes the most important symbols and definitions.Appendix B.2 shows several default values, which may be used in a basic simulation.

Mechanical and Electrical Angles
Many machines have more than two magnetic poles on the rotor.If this is the case, it is convenient to concentrate on the electric and magnetic quantities of a single pair of poles, and to recognize that quantities associated with other pole pairs are identical.For this reason, it is convenient to express the rotor angle in electrical degrees or electrical radians rather than in mechanical units.
One pair of poles is mapped to 360 electrical degrees or 2π electrical radians.Since there are poles/2 electric cycles in one mechanical cycle, it follows that • θ is the rotor electrical angle, with respect to a fixed point on the stator.• θ m is the rotor mechanical angle, with respect to a fixed point on the stator.• "poles" is the number of magnetic poles on the rotor (must be even).
In addition, ω = dθ/dt is the rotor electrical frequency, and ω m = dθ m /dt is the rotor mechanical frequency.Following (71), Both frequencies are measured in rad/s.We also define ω s to be the nominal grid frequency.For instance, ω s = 2π50 or 2π60 rad/s.

Basic Mechanical Equations
The angular acceleration of the rotor relates to the net torque as where J is the rotor moment of inertia, T m is the mechanical torque, and T e is the electric torque.
In addition, the relations between torques and powers are given by where p m is the mechanical power accelerating the rotor, p e is the electric power decelerating the rotor.Equations ( 72) and (73) yield and combination of ( 74) and ( 75) results in where Jω s .Under the approximation ω ≈ ω s , this is the classic swing equation.However, in this section we do not use this approximation, and work directly with the exact expression in (75).In addition, we assume that the mechanical torque is governed by a droop mechanism, where P re f is the reference power (defined with respect to a single phase), and D is the droop control damping factor.Note that this equation assumes a simplified linear relation between frequency and torque, and ignores the dynamics of the mechanical system.Substituting (77) into (75) results in This equation defines the dynamics of the frequency ω, with respect to the electric torque T e .

Electrical Equations
In this section we present a dq0 model of the machine.This model is more elaborated than the machine's quasi-static model, and may be used to describe fast transients, and high frequency effects.However, as all models, the model presented here is an approximation.Specifically, it is assumed that:

•
The machine is a magneto-quasi-static device.

•
Saturation of the magnetic materials and other sources of imbalance and harmonic distortion are ignored.

•
Self-and mutual inductances are composed of a constant term, in addition to a sinusoidal term varying with 2θ.
Although these assumptions may seem restrictive, they form the basis of the classic dq0 model, and have been found to give excellent results in a wide variety of applications.
The machine is described as a system of coupled inductors • λ a , λ b , λ c are stator flux linkages.• i a , i b , i c are the stator currents (generator output currents).The negative signs have been added since currents are positive when flowing out of the generator.
In addition, voltages are defined by where The self-and mutual inductances in (79) depend on the rotor position.The stator self-inductances are given by and the stator-to-stator mutual inductances are where L aa is a positive constant, and L ab is a negative constant.These inductances are composed of a constant term, in addition to a sinusoidal term varying with 2θ.This additional term is required in case the rotor is not perfectly round (causing "saliency effects").In addition, the stator-to-rotor mutual inductances are and the field winding self-inductance is The model defined by the above equations does not have an equilibrium point, since the inductances depend on the rotor angle θ, which is time dependent.To this end, we convert the equations to the dq0 domain.Omitting the algebraic details, this yields and where L q is called the quadrature-axis synchronous inductance.• L 0 is called the zero-sequence inductance. Notes: 1.The reference angle for the dq0 transformation is the rotor electrical angle θ.
2. The dq0 variables do not depend directly on θ, and define a time-invariant model.
The inductances in (86) are given by Throughout this section we use the inductances L d , L q , L 0 directly, and do not use the original machine inductances L aa , L ab , L g2 .We also define the synchronous inductance as For a perfectly round rotor with L g2 = 0, we have L s = L d = L q .To complete the basic model, the machine output power (three-phase power flowing out of the stator and into the grid) is and the electric power decelerating the rotor is Following (90), the electric torque is given by A complete state-space model of the synchronous machine is obtained by merging the equations above.Using Equations ( 78), (85), ( 86) and (91), and again omitting the algebraic details, yields where the inputs are v d , v q , v 0 , v f , P re f , and the constants are defined as a f .Several optional outputs (in addition to the state variables) are Following are two examples demonstrating how to use the model above in simulation.Consider first a synchronous generator feeding a symmetrically configured resistive load R L .We wish to simulate the transient that follows a sudden 3-phase short circuit at the armature terminals.A signal flow diagram of the simulation is shown in Figure 10.Using the state-space description in (92), the currents i d , i q , i 0 are inputs to the machine's model, and the voltages v d , v q , v 0 are its outputs.Under normal operating conditions, the ratio between the voltages and currents is R L .When the short occurs, the voltages v d , v q , v 0 are zeroed, and a transient takes place.Basic default parameters may be found in Appendix B.2.As a second example, consider the system shown in Figure 11.A signal flow diagram is shown in Figure 12.The capacitors, inductor, and resistor are modeled as The right capacitor is modeled as and the model of the R-L components is Note that these equations depend on ω, which is an output of the machine's model.It is also possible to approximate ω ≈ ω s , to eliminate this dependency.

Simplified Machine Model
This section presents a simplified dynamic model of the machine.We assume that
We will now show that: • The machine may be described as an EMF source behind a series impedance.

•
The EMF is proportional to the frequency ω.

•
The electric torque is proportional to the current i q .
Using (85), (86) with L d = L q = L s , i f = I f , v 0 = 0, and i 0 = 0 results in and Substitution of (97) in (98) yields Note that v f does not affect the other quantities, and may be considered an output of the model.We now define the constant voltage Using this constant, the resulting equations are which may be rearranged as voltage drop on series inductance (102) Using these expressions, the machine can be modeled as a source of induced EMF behind a series impedance, as shown in Figure 13.The induced EMF is given by e d = 0, e q = ω ω s V E , e d = 0, where [e d , e q , e 0 ] T is the dq0 transformation of [e a , e b , e c ] T .
Figure 13.The simplified machine model is equivalent to a voltage source behind a series inductance and resistance. Notes: 1.The induced EMF is proportional to the frequency, where at steady-state and at nominal frequency the induced EMF (peak value) is V E = ω s L a f I f .2. The induced EMF is equal to the machine's open-circuit voltage.This can be seen in Figure 13, assuming that the stator currents are zero.
In addition, using (91), (97), and (100), the electric torque acting on the rotor is We see that the electric torque is proportional to the stator current i q .
Based on these results, a simplified model of the machine may be obtained by separating the dynamics of the induced EMF from the dynamics of the series impedance (R a and L s ).This series impedance, although physically a part of the machine, can be modeled as if it is a part of the transmission network.The machine is then described by the simple dynamics of the induced EMF.Using (78) and (103), Direct substitution of T e provides the simplified state equations where the inputs are P re f and i q .Several optional outputs (in addition to the state variables) are All dq0 quantities here are defined in the rotor reference frame, with respect to the angle θ.

Energy Conversion in the Machine
In this section we use the simplified model presented above to demonstrate energy conversion processes in the machine.The total energy stored in the machine is composed of two parts:

•
The kinetic energy of the rotor:

•
The magnetic energy, represented by the energy stored in the synchronous inductance: The kinetic energy derivative is and using dω m dt = 1 J (T m − T e ), yields This is an intuitive result: the change in kinetic energy is equal to the difference between the mechanical and electric powers.In addition, the magnetic energy derivative is Using (102), The change of energy stored in the inductor is equal to • +p e is the electric power decelerating the rotor.This is also the power generated by the EMF source, as shown below.• −p s is the machine's output power.
is the ohmic power loss on the armature resistance.
The flow of power is summarized in Figure 14.
The heart of the energy conversion process is achieved by the EMF source, which converts mechanical energy to electrical energy (or vice versa).From a mechanical perspective: p e = T e ω m .From an electrical perspective: This is, by definition, the power generated by the EMF source.

Transformation from One Reference Frame to Another
Recall that the dynamic models discussed so far are defined in the rotor reference frame, with respect to the angle θ.A typical question is how to construct a dynamic model of a system that has more than one natural reference frame.Such a need arises when the system includes more than one machine, or when a machine is connected to an infinite bus.
The typical solution is to transform the dq0 variables from one reference frame to another.Assume a system with two sets of signals: x dq0 are defined with respect to a reference angle θ r , and xdq0 are defined with respect to a reference angle θ.The relations between these signals can be found by transforming the signals to the abc reference frame and back, which may be written as Consider now a general unit, which model is given with respect to the angle θ.This model can be linked to a system with a reference angle θ r , as described in Figure 15.As a special important case, consider the EMF source ẽd = 0, ẽq = ω ω s V E , ẽ0 = 0, with a reference angle θ.What is the model of this source with respect to θ r ?Direct transformation yields where e d , e q , e 0 are defined with respect to θ r .The reader may recognize δ as the power angle of the machine.Therefore, at low frequencies, the simplified machine model is identical to the quasi-static (time-varying phasors) model.To see this, the phasor describing the induced EMF is This is the induced EMF (RMS value) at steady state, and at the rotor frequency ω.Substitute (117) in (116) to get E = |E|∠δ.This phasor describes the induced EMF of the quasi-static model.Note that |E| depends on ω; however, in a quasi-static model we typically assume that ω ≈ ω s and |E| is constant.Also recall that in a time-varying phasor model p e = 3P.This is true since For example, consider a synchronous machine connected to an infinite bus.The machine is described by the simplified model presented above, and the infinite bus voltage is v d,∞ = √ 2V g = const, v q,∞ = 0, v 0,∞ = 0 with a reference frame ω s t.We now wish to construct a state-space model of the system, with respect to the reference angle θ r .A signal flow diagram is shown in Figure 16.The explicit state-space model is shown next.Using the result above, the induced EMF is described in the reference frame ω s t by    with δ = θ − θ r + π 2 .In addition, using (105), the machine is modeled by where in this last equation ĩq is referenced to θ.Using (113), this variable may be expressed in terms of the reference angle ω s t as and using δ = θ − ω s t + π 2 yields ĩq = cos(δ)i d + sin(δ)i q .Moreover, the machine's series impedance is modeled (with respect to ω s t) as Combining these equations, the resulting state-space model becomes Note that δ is used instead of θ as a state variable.
As another example, consider two synchronous machines connected to each other, and feeding a resistive load R L .The machines are described using the detailed model (not the simplified one), as given in (92).The reference angle of the first machine is θ 1 , and the reference angle of the second machine is θ 2 .A signal flow diagram is shown in Figure 17.

Three-Phase Inverters
This section outlines the design principles of three-phase inverters, focusing on their control.We introduce the concepts of grid forming, grid feeding, and grid supporting inverters, and explain how they are used in specific applications, such as renewable energy systems and microgrids [16,20,34,35].We also present a basic control scheme for Permanent Magnet Synchronous Motors (PMSM).
Note that the objective of this section is only to review the main approaches used in typical designs.Many practical details are omitted in order to clearly present the main ideas.

Basic Definitions
Inverters convert DC power to AC power, as shown in Figure 18.The voltage and current on the DC side are v dc and i dc , the AC voltages are v a , v b , v c , and the AC currents are i a , i b , i c .Throughout this section we assume that the AC voltages and currents are balanced.In steady state, inverters are characterized by five quantities:

•
The (single-phase) active power P, such that P ac = 3P.
An ideal inverter operates with zero loss, and stores negligible energy.Thus, in steady state, As a result, assuming that the power and DC voltage are constant, then the DC current is also constant.

Modes of Operation
Three typical modes of operation of grid-connected inverters are grid forming, grid feeding, and grid supporting.The selected mode of operation determines the inverter dynamics, and its steady-state characteristics.

Grid Forming Inverters
Grid forming inverters are typically used in small isolated networks, and their main objective is to regulate the network voltage and frequency [29,[36][37][38][39][40][41][42][43].To this end, grid forming inverters are controlled as voltage sources, with fixed voltage amplitude |E| and frequency ω.The active power P and reactive power Q are not directly controlled, and are determined by the interaction of the inverter with the network.Typical applications are standby UPS systems, and islanded microgrids.Since the frequency ω is set, the inverter usually cannot operate in parallel to other grid forming inverters, unless an additional mechanism is used to match the frequencies.In power flow studies, a grid forming inverter may be viewed as an infinite bus, and is represented as a reference bus, with a constant voltage amplitude |E| and angle δ = 0. Grid forming inverters are also called Voltage Source Inverters (VSI).

Grid Feeding Inverters
Grid feeding inverters are operated as power sources, and are mainly designed to deliver power to an energized grid [34,42,[44][45][46][47][48][49][50].The active power P and reactive power Q are directly controlled, while the frequency ω and voltage amplitude |E| are not directly controlled, and are determined by the interaction of the inverter with the grid.Typical applications are renewable energy systems and small grid-connected generators, which operate with specific active and reactive powers.As an example, in photovoltaic systems the active power is typically set by the source, and the reactive power is often set to zero.Grid feeding inverters are designed to operate in parallel to other inverters and generators.They cannot operate in isolation, and require additional units to set the voltage magnitude and frequency.In power flow studies, a grid feeding inverter is represented as a P-Q bus, with constant active power P and constant reactive power Q.Grid feeding inverter are also called Grid Following Inverters, or inverters with P-Q control.

Grid Supporting Inverters
Grid supporting inverters operate somewhat similarly to synchronous generators: they deliver power to the grid, while contributing to the stability and reliability of the system [34,35,51,52].The frequency and voltage magnitude are controlled by a droop mechanism, such that there is a linear relationship between ω and P, and between |E| and Q.
This type of control promotes fair sharing of the active and reactive powers among generators, while regulating the frequency and voltage.Grid supporting inverters may be connected in parallel to other generators, and can operate in isolation.In power flow studies, such an inverter cannot be represented as a standard bus.However, if the frequency ω is known, and the voltage droop mechanism can be ignored, then the inverter is represented as a P-V bus with constant active power P and voltage amplitude |E|, similarly to a synchronous machine.Typical applications are energy storage systems, online UPS systems, and distributed generators that operate in isolated or weak grids.
Several properties of the different operation modes are summarized in Table 2.

•
The inverter operates as a voltage source.The voltage amplitude |E| and the frequency ω are directly controlled.

•
The active power P and reactive power Q are determined by the interaction of the inverter with the grid.

•
The inverter usually cannot operate in parallel to other grid forming inverters, since the frequency ω is constant.

•
Typical applications are standby UPS systems and isolated small networks.

•
In power flow studies: represented as a reference bus (slack bus), with a constant voltage amplitude |E| and angle δ = 0.
Grid Feeding • Also called Grid Following Inverters, or inverters with P-Q control.

•
The inverter operates as a power source.The active power P and reactive power Q are directly controlled.

•
The frequency ω and voltage amplitude |E| are determined by the interaction of the inverter with the grid.

•
Suitable for parallel operation.

•
Cannot operate in isolation.The system must include other generators (e.g., other inverters, synchronous machines) that control the voltage amplitude and frequency.

•
Typical applications are renewable energy systems, and distributed generation systems.

•
In power flow studies: represented as a P-Q bus, with constant active power P and reactive power Q.
Grid Supporting • Delivers power to the grid, while promoting stability and reliability.Regulates the frequency and voltage, and balances the active and reactive power generation.

•
Implements a linear relationship between P and ω, and between Q and |E|.

•
Suitable for parallel operation.

•
Suitable for isolated operation.

•
Combines well with energy storage systems, and online UPS systems.

•
In power flow studies: in general, cannot be represented as a standard bus.However, if the frequency ω is known, and the voltage droop mechanism can be ignored, then the inverter is represented as a P-V bus with constant active power and voltage amplitude |E|, similarly to a synchronous machine.

Grid Forming Inverters
A basic control scheme for grid forming inverters is shown Figure 19.The main inverter stage often consists of three Buck converters connected in parallel to a DC source, as shown in Figure 20.Assuming these converters are lossless and store no energy, the average voltages u a (t), u b (t), u c (t) are given by u a (t) = V dc d a (t), Note that the duty cycles are defined in the range [−1, 1] such that −V dc ≤ u x (t) ≤ +V dc .The LC filter at the output removes the switching harmonics, and delivers sinusoidal voltages and currents to the grid.Grid forming inverters are controlled as voltage sources with a constant frequency.A possible control law is where u * d is the desired voltage amplitude.In addition, the reference angle for the dq0 transformation is θ(t) = ω * t, where ω * is the desired frequency.The resulting output voltage is with a reference angle ω * t.Therefore, the grid forming inverter implements a voltage source with constant frequency and amplitude.In practical designs, the inverter currents should be controlled to improve the dynamic performance and efficiency, and to avoid over currents.In addition, often there is a need to precisely control the output voltage.An improved design with additional current and voltage loops is shown in Figure 21.The objective of the system is to regulate the output voltages such that v d = v * d , v q = 0, v 0 = 0.This is achieved by two loops: an inner loop that controls the currents, and an outer loop that controls the voltages.
The inner loop regulates the currents such that i d (t) = i * d (t) and i q (t) = i * q (t), by adjusting the inverter duty cycles.This loop is typically modeled as follows.The average voltages u d (t), u q (t), and the inductor equations in the dq reference frame are The cross terms ω * i q and −ω * i d that appear in these equations complicate the controller design, since i d depends on i q , and i q depends on i d .A typical solution is to eliminate the cross terms, using the following control law where i * d (t) and i * q (t) are the target currents, and k p , k i are parameters of a PI controller.This control law is illustrated in Figure 22.Substitution of (128) and (130) into (129) yields Since the cross terms are eliminated, the currents are governed by two single-input single-output systems, as shown in Figure 23.This enables straightforward tuning of the loop parameters.
The inner current loop: a typical control scheme that eliminates the cross terms ω * i q and −ω * i d .
. By eliminating the cross terms, the current loop is modeled by two single-input single-output systems.
The outer voltage loop operates based on similar principles.As an example, assuming a balanced resistive load, the capacitor equations may be approximated as and a possible control law that eliminates the cross terms is where v * d and v * q are the target voltages, and k p,v , k i,v are the parameters of a PI controller.

Grid Feeding Inverters
Grid feeding inverters are operated as power sources, and are mainly designed to deliver power to an energized grid.They are also called Grid Following Inverters, or inverters with P-Q control.This mode of operation is used often, since the tightly regulated output power enables robust and economical designs.Grid feeding inverters are also used with renewable power sources, in which the active power must by equal to the power produced by the source.In many applications the reactive power is set to zero, and the inverter operates with a power factor of unity.In this case the output current is minimal, but the inverter does not provide the reactive power that may be needed to support the grid.A basic control scheme for grid feeding inverters is shown in Figure 24.The design consists of an inner control loop, and an additional "current calculations" block that generates the target currents.These are given by where P * , Q * are the target active and reactive powers (for a single phase).As a result, the powers at steady state are given by This calculation is based on the assumption that i d = i * d and i q = i * q at steady state.The reference frame for the dq0 transformation is defined by the grid voltages.Since these voltages are not directly controlled, there is a need to extract the reference angle θ and the frequency ω from the voltage measurements.This is usually accomplished by a Phase Locked Loop (PLL), as illustrated in Figure 25.The PLL operates by controlling the reference angle θ in closed loop, such that the quadrature-axis component v q is zeroed.If the loop is stable, then θ must be matched to the angle of the AC voltages v a , v b , v c .A grid feeding inverter connected to a photovoltaic (PV) source is shown in Figure 26.The challenge here is that the active power is determined by the renewable source, and is not known in advance.This design is similar to the one in Figure 24, expect that there is an additional loop that regulates the active power, in order to match it to the source.The feedback is provided by the bus-capacitor voltage.If v dc (t) > V set dc then P * increases to discharge the bus capacitor, and if v dc (t) < V set dc then P * is decreased to charge the bus capacitor.At steady state, P pv ≈ 3P * and v dc (t) ≈ V set dc .

Droop Control
As an introduction to the topic of grid supporting inverters, this section reviews basic principles of the droop control method.Droop controllers are implemented locally in each generator, and form a distributed control system that stabilizes the grid.The communication between the controllers is minimal, and information is shared by means of the grid frequency and voltage.Droop controllers are used in power systems in order to:

•
Regulate the frequency and active power.
• Regulate the voltage and reactive power.

•
Promote fair sharing of active power among generators.

•
Promote fair sharing of reactive power among generators.

•
Allow generators of different sizes to operate in parallel.
In essence, this is achieved by implementing an inverse relationship between active power and frequency, and between reactive power and voltage, as explained next.

Frequency Droop Control
Consider a lossless generator with a single-phase active power P and a frequency ω.At steady state, the droop control law is where P re f is the reference power, D is the damping constant, and ω s is the nominal grid frequency (a constant).A primary objective of the frequency droop controller is to stabilize the grid frequency, by regulating the active power.Consider first a synchronous generator, in which the mechanical power is As the frequency increases, the mechanical power decreases, and vice versa.This behavior regulates the generated power, and matches it to the actual load, as described in Figure 27.As an example, assume that a single synchronous generator is feeding a load with active power P L (t).The angular acceleration of the rotor is given by where K is the swing equation constant.
With no droop control (D = ∞), and since in general P re f = P L (t), the frequency ω is unstable.On the other hand, when the droop control mechanism is active (finite D), the resulting dynamics equation is The term −(K/D)ω provides negative feedback, and the frequency ω is stabilized.
The relationship between the active power and frequency at steady state is illustrated in Figure 28.The controller operates as follows: In case D → 0:

•
The frequency ω is constant such that ω ≈ ω s .The generator provides active power as needed to stabilize the frequency.

•
The active power varies.

•
The generator operates like a grid forming inverter, or an infinite bus.
In case D → ∞: • The active power is constant, P ≈ P re f .

•
The generator operates as a power source, like a grid feeding inverter.
Middle values of D: • Combine the properties of these two extreme cases.

•
The active power is regulated, but is not constant.The generator provides variable active power to adjust the frequency.

•
The frequency ω is regulated, but is not constant.

•
As we shall see, the generator operates like a grid supporting inverter.
An additional objective of the controller is to share the active power among the generators.Assume a system with N generators, such that in steady state, 3P i = 3P re f ,i − 1 D i (ω − ω s ).Also assume that the total load in the system is P L , such that ∑ N i=1 P i = P L .These equations may be written as and the solution is P re f ,i , As an example, for two generators in steady state: If the generators are synchronous machines, and the damping constant of each machine is inversely proportional the rotor moment of inertia, such that J i D i = const, then where J tot = ∑ N i=1 J i .Here, deviations of the load power from the reference power are shared among the generators, according to their size, such that larger generators provide more power.For this reason, we say that the droop control method promotes fair sharing of active power among the generators.

Voltage Droop Control
A primary objective of the voltage droop controller is to regulate the reactive power and voltage.To see this, consider a generator that is represented in steady state as a voltage source behind a series reactance, as described in Figure 29.The voltage droop control law is where E re f is the reference voltage, Q re f is the reference reactive power, and k q is a constant.In a synchronous machine this control law is implemented in practice by adjusting the current in the field winding.The generator reactive power Q may be computed from the circuit in Figure 29, and is given by and if δ → 0 and |E| ≈ |V|, then This relationship between the reactive power and voltage is plotted in Figure 30.If the voltage |E| is fixed, variations in |V| may result in high and unpredictable reactive power flow.This is potentially dangerous, since high reactive power causes loss, and may lead to stability problems.To solve this, the droop mechanism regulates the reactive power by adjusting |E| in inverse proportion to Q. Substitution of (145) in (147) yields which may be written as This equation is illustrated in Figure 31.In steady state, the controller operates as follows: In case k q = 0 (no droop control):

•
The voltage |V| varies in a small range.The generator provides reactive power as needed to maintain a certain voltage amplitude.As |V| decreases, the reactive power increases to compensate.

•
The reactive power varies.

•
The generator operates as a voltage source, or like a grid forming inverter.
In case k q → ∞: • The reactive power is regulated, Q ≈ Q re f .

•
The generator operates as a power source, or like a grid feeding inverter.
Middle values of k q : • Combine the properties of these two extreme cases.

•
The reactive power is regulated, but is not constant.

•
The voltage |V| is somewhat regulated.The generator provides reactive power to maintain a stable voltage.

•
As we shall see, the generator operates like a grid supporting inverter.
An additional objective of the voltage droop controller is to share the reactive power among the generators.As an example, consider the system in Figure 32, which is described by the following set of equations: Assume first that there is no droop control (k q,1 = k q,2 = 0), and Q L = 0.The resulting reactive powers in this case are Here, even though Q L = 0, there may be significant reactive power flow between the two generators.Now assume that the droop controller is active, and The controller prevents circulation of reactive power, and shares the reactive power evenly between the two generators.

Grid Supporting Inverters
Grid supporting inverters deliver power to the grid, while contributing to the stability and reliability of the system, similarly to synchronous generators.This is achieved by means of a droop control mechanism, that maintains an inverse relationship between ω and P, and between |E| and Q.A basic design is shown in Figure 33.Grid supporting inverters may be described as grid forming inverters with an additional droop control mechanism: where ω s is the nominal grid frequency, ω s = 2π50 rad/s or ω s = 2π60 rad/s.Such inverters may be viewed as a combination of grid forming and grid feeding inverters, and the exact balance between these two modes of operation depends on the droop parameters D and k q .For instance:

•
If D = 0, then the frequency is constant ω * = ω s , as in grid forming inverters.

•
If D → ∞, then the active power is constant P = P re f , as in grid feeding inverters.

•
If k q = 0, then the voltage amplitude is constant |E| = E re f , as in grid forming inverters.

•
If k q → ∞, then the reactive power is constant Q = Q re f , as in grid feeding inverters.

•
Middle values: the inverter supports the grid by regulating the active power, reactive power, frequency and voltage.
As an example, consider a grid supporting inverter connected to an infinite bus with a frequency ω g , where ω g = ω s .We will use this example to demonstrate the typical dynamics of grid supporting inverters, and specifically to explain how the inverter synchronizes to the grid.To simplify, it is assumed that k q = 0 (no voltage droop), and that the infinite bus voltage is |E| = E re f (RMS).
Intuitively, if ω * > ω g the voltage angle at the inverter output gradually increases, which increases the active power P, and decreases ω * .On the other hand, if ω * < ω g the voltage angle gradually decreases, which decreases the active power P, and increases ω * .If this dynamic process is stable, then in steady state ω * = ω g , and the inverter is synchronized to the grid.This dynamic process is modeled as follows.The voltages at the output of the inverter stage are given by ũd = √ 2|E|, ũq = 0, ũ0 = 0, where the reference angle of these dq0 signals is θ(t).In addition, the voltages of the infinite bus are v d = √ 2|E|, v q = 0, v 0 = 0 with a reference angle ω g t.To represent the signals in the same reference frame, the voltages ũd , ũq , ũ0 are transformed to the reference frame of the infinite bus.The result is where the angle δ is defined as δ = θ − ω g t.
To simplify the dynamic equations, we represent the system using time-varying phasors, and estimate the active power P based on the DC power flow approximation.The two phasors are and based on the DC power flow approximation, the active power is P = |E| 2 ω g L δ.The resulting dynamic model is and several substitutions yield the differential equation Due to the negative feedback, this differential equation is stable for any D > 0. The steady state is computed by solving d dt δ = 0, which yields In addition, according to (155), So in the steady state ω * = ω g , and the inverter is synchronized to the grid.Note that the system is not stable if D = 0, since in this case the inverter operates as a grid forming inverter, and cannot be connected in parallel to an infinite bus.

Control of PMSM
This section presents a typical control scheme for Permanent Magnet Synchronous Motors (PMSM).These motors are synchronous machines, in which permanent magnets are embedded in the rotor to create a constant magnetic field.As in all synchronous machines, at steady state the rotor speed is proportional to the frequency of currents and voltages in the stator.For this reason, such motors are especially useful in applications that require precise speed or position control.This section focuses on three-phase PMSM that have sinusoidal EMF (as opposed to motors with trapezoidal EMF).
Permanent magnet synchronous motors (with sinusoidal EMF) are modeled like synchronous generators, with three modifications:

•
The stator currents are defined positive when flowing into the machine.

•
The term L a f i f is replaced with λ, which is the amplitude of the flux induced in the stator phases by the permanent magnets on the rotor.

•
The electromagnetic torque accelerates the rotor, and the mechanical torque decelerates the rotor.The angular acceleration is defined as d dt ω m = 1 J (T e − T m ).The resulting model is The inputs of the model are v d , v q , v 0 and T m , and several additional outputs are The reference angle for the dq0 transformation is the electrical angle θ.The symbols appearing in these equations are: • θ is the rotor electrical angle, measured with respect to a fixed point on the stator; • p = poles/2 is the number of pole pairs; • L d , L q , L 0 are the direct-axis, quadrature-axis, and zero-sequence inductances; • R is the resistance of the stator windings; • i d , i q , i 0 are the stator currents (positive when flowing into the machine); • v d , v q , v 0 are the stator voltages; • ω m is the angular velocity of the rotor; • λ is the amplitude of the flux induced in the stator phases by the permanent magnets on the rotor; • J is the rotor moment of inertia; • T m , T e are the mechanical and electromagnetic torques; • p m , p e are the mechanical and electromagnetic powers.
Similarly to synchronous generators, the model may be simplified by assuming a round rotor (no saliency effects), such that L d = L q = L s .In this case, the motor may be described by the equivalent circuit in Figure 34.
The induced EMF is given by e d = 0, e q = λpω m , e 0 = 0, where [e d , e q , e 0 ] T is the dq0 transformation of [e a , e b , e c ] T .In addition, for L d = L q = L s , the electromagnetic torque is given by Therefore, the induced EMF is proportional to the angular velocity, while the electric torque is proportional to the quadrature-axis current.
The heart of the energy conversion process is described by the induced EMF source, which converts electrical energy to mechanical energy.
From a mechanical perspective, the electromagnetic power is and from an electrical perspective, Both expressions are identical.
A basic control scheme is shown in Figure 35.The design consists of two loops: an inner current loop, and an outer speed loop.The inner loop regulates the currents such that i d ≈ i * d and i q ≈ i * q , by adjusting the inverter duty cycles.The objective of the outer loop is to regulate the speed, such that in steady state ω m ≈ ω * m .This is implemented by controlling i * q , based on the approximated relation between torque and current T e = 3 2 pλi q .If the speed ω m is too low, then i * q increases to produce more torque, and to accelerate the rotor.If ω m is too high, then i * q decreases to produce less torque, and to decelerate the rotor.Two sensors are placed on the motor to measure the speed ω m and the electrical angle θ.The latter is used as a reference angle for the dq0 transformation.

Conclusions
Due to the continuing integration of renewable energy sources and power electronics-based devices, a central challenge in understanding the power systems of today is that the system under study is frequently not quasi-static, and cannot be accurately described by means of time-varying phasors.In such systems the classic power flow equations do not apply, and alternative models should be used instead.In light of this challenge, this paper explains how to analyze complex dynamic phenomena in power systems based on dq0 signals.
The paper opens by recalling basic concepts of the dq0 transformation and dq0-based models.We then explain how to model essential components such as passive components, passive networks, synchronous machines, and inverters, and how to systematically construct dq0-based models of complex systems.We also discuss the relations between dq0-based models and classic time-varying phasor models.Specifically, we highlight the idea that dq0 models may be viewed as a natural extension of time-varying phasor models, and discuss the correct use and validity of each approach.The theoretical analysis is supported by several examples.

Figure 1 .
Figure 1.Mapping of sinusoidal abc signals to constant dq0 signals.

Figure 2 .
Figure 2. Example of symmetric and non-symmetric configurations.(a) Symmetrically configured network; (b) Network with a non-symmetric configuration.

Figure 3 .
Figure 3. Three-phase unit connected to the network.

Figure 8 .
Figure 8. Ideal power source connected to an infinite bus (single-phase diagram).

Figure 9 .
Figure 9. Schematic diagram of a three-phase synchronous machine with 2 poles.

Figure 10 .
Figure 10.Simulating a sudden 3-phase short circuit at the armature terminals.

Figure 11 .Figure 12 .
Figure 11.Example: synchronous machine connected to a medium length transmission line and load.(a) One-line diagram; (b) Single-phase diagram.

Figure 14 .
Figure 14.Energy conversion in the machine, based on the simplified model.

Figure 15 .
Figure 15.Transformation from one reference frame to another.

Figure 16 .
Figure 16.Signal-flow diagram: synchronous machine connected to an infinite bus.

Figure 17 .
Figure 17.Signal-flow diagram: two machines connected to each other, and feeding a resistive load.

Figure 19 .
Figure 19.A basic control scheme for grid forming inverters.

Figure 21 .
Figure 21.Grid forming inverter, with additional current and voltage control loops. i

Figure 24 .
Figure 24.A basic control scheme for grid feeding inverters.

Figure 25 .
Figure 25.A basic implementation of a Phase Locked Loop (PLL).

Figure 27 .
Figure 27.Conceptual operation of the frequency droop mechanism.

Figure 28 .
Figure 28.Droop characteristics in steady state: active power as a function of frequency.

Figure 29 .
Figure 29.The generator is modeled in steady state as a voltage source behind a series reactance.

2 X 1 Figure 30 .
Figure 30.Reactive power as a function of voltage.Variations in |V| may result in high and unpredictable reactive power flow.

Figure 31 .
Figure 31.Droop characteristics in steady state: reactive power as a function of voltage.

Figure 32 .
Figure 32.Example: Reactive power sharing between two generators.

Figure 33 .
Figure 33.Grid supporting inverter operating as a voltage source (conceptual control scheme).

Figure 34 .
Figure34.Equivalent circuit for a permanent magnet synchronous motor with a round rotor (assumingL d = L q = L s ).

Figure 35 .
Figure 35.A basic control scheme for a permanent magnet synchronous motor.

Table 2 .
Typical operation modes of grid-connected inverters.