The Detailed Doubly Fed Induction Wind Generator for Electromagnetic Transients Calculations and its Initialization in ATP

The Alternative Transients Program (ATP) is one of the most used electromagnetic transient programs due to its powerful modeling capability and versatility. However, it has limitations as regards the automatic initialization of power electronics devices and control systems. To overcome this drawback, a simple methodology is presented in this paper to initialize a detailed model of a doubly fed induction wind generator implemented in ATP. The methodology is based on the automatic initialization of this device and it is divided into two stages. The rst one consists of oine calculations to obtain initial steady-state values of certain model variables and, in the second one, these results are used as ATP model parameters. The simulation is started by means of auxiliary switches also included in the model. To validate the methodology, the transient and steady-state behavior of 4 case studies was evaluated. The analysis of these results shows that the steady-state values calculated by ATP for t = 0 are the desired ones and the oscillograms present a steady-state condition. The proposed methodology makes it possible to accurately initialize a detailed DFIG-type generator model in ATP, without the need to sacrice simulation time to wait for variables to reach a steady state.


Introduction
The concern for the environment preservation has led to seek for alternatives to replace conventional nonrenewable and polluting energy sources (which use hydrocarbons, coal, etc.) by others of renewable and clean type. At present, the most developed renewable energy sources worldwide are wind and solar energies [1]. In the speci c case of wind generators, the variability of the wind makes it necessary to have sophisticated control devices to allow synchronization with the electrical network. These control systems are designed to control the power electronics which synchronizes the generator with the network in realtime, in order to maximize the power ow transfer at every moment and to achieve an acceptable power quality. Due to the complexity of wind generators, it is necessary to have mathematical models suitable for electromagnetic transient studies to determine the impact they will have on the power system before being commissioned. There is an extensive bibliography related to detailed models of wind turbines for electromagnetic transient calculations. These models include power electronics components and control systems, which represent an additional complication when trying to start the simulations considering the previous steady state. This is a critical issue, for which clear guidelines have not been yet established.
The ATP [2] is one of the most popular computer programs for calculating electromagnetic transients. It is widely used due to its powerful modeling capability, versatility and also because its free license.
However, it is not user friendly and there is a lack of detailed information about the models and their applications, which requires considerable effort to become familiar with its use. This raises the need to provide the necessary details for the use of the program for certain objectives, as a result of the experience of using it.
In order to de ne the initial conditions required for transient simulations, ATP calculates the previous steady-state condition (SSC) for t = 0. To this end, ATP must solve steady-state equations obtaining a phasor solution, taking from it the starting point to simulate the transient.
In the case of complex systems including power electronics components and control systems, ATP cannot calculate the steady-state conditions automatically. A brute-force alternative is to start the calculation with zero initial conditions and to wait the time necessary for the SSC to be reached. This solution requires additional simulation time, slowing down the electromagnetic transient calculations.
This can be critical in some cases which consist of a large number of simulations of the modeled electrical system in order to check its performance against different faults and switching transients taking various topological states of the network into consideration. Additionally, it is also possible that the used starting data violate program restrictions, and in that case, ATP will not be able to start the simulation.
Therefore, it is very important to be able to pre-calculate the appropriate initial conditions for the models to be used, so that ATP starts the simulations with reliable steady-state values, avoiding unnecessary delays.
In this context, this paper presents a detailed ATP model of a doubly fed induction wind generator including a methodology to initialize it under subsynchronous speed conditions.
To avoid ambiguities, the acronym DFIM (Doubly Fed Induction Machine) is used to refer to the doubly fed induction machine only (UM_4 component in ATP). On the other hand, the acronym DFIG (Doubly Fed Induction Generator) is used for the entire wind turbine model which includes the DFIM [3]. This paper is structured as follows. Section 2 gives a brief introduction to the ATP program. In Sect. 3, the main components of a DFIG wind turbine model are introduced. The methodology for initializing the ATP model is explained in Sect. 4. In Sect. 5, the cases for validation of the methodology are presented. Section 6 presents the analysis of these results. Finally, the conclusions are given in Sect. 7. Further details of the UM_4 component of ATP and the correct way in which it should be implemented into a model have been included is the appendix.
2 Basic Concepts About Atp ATP input les are text les, written following a speci c format. To build complex models in a simple and intuitive way, the interface program ATPDraw [4] is used, which is a graphic pre-processor. This software allows de ning the components and circuits to be analyzed graphically and then automatically generates the ATP input le.
ATP includes standard libraries for modeling electrical components and control systems [5,6]. The rst group is dedicated to certain types of elements such as the sources, transmission lines, transformers, and rotating electrical machines. It also has models of basic components such as resistors, inductors and capacitors. From all these components, it is possible the exact modeling (or also called "detailed") of any of the types of renewable generation, as well as conventional types. The sources library contains alternate, continuous, impulse and ramp source types. The one most commonly used is the "type 14" source, which is an alternating source with a grounded neutral. This can be used as a current or voltage source, single-phase or three-phase.
The rotating electrical machine library contains models of synchronous, asynchronous and DC motors and generators. In particular, the Universal Machine Type 4 (UM_4) is an asynchronous machine model with a wound rotor (or also called DFIM). This model requires as input data the stator and rotor winding voltages and the mechanical torque in addition to the machine parameters. From this data the model calculates the electromagnetic torque, the angular speed and the rotor angle, and other internal variables such as the magnetic ux and currents of all windings. Regarding the use of electrical machines in ATP, they can be initialized in two ways: manual and automatic. If the second method is used for the particular case of the UM_4 component, the initial slip value expressed as a percentage and a voltage source at the rotor terminals are required. This is the procedure used in the methodology that will be presented later. A more detailed explanation of this component can be seen in Appendix A.1.
Finally, it is worth mentioning that ATP calculates two different states. It rst calculates the "initial steady state conditions" and then the "transient state". The rst is a phasor calculation for t = 0, in which the voltages in all nodes, the currents in all branches, and the initialization values of rotating electrical machines are determined. The second takes these values into account as a starting point to calculate the system variables for each instant of time from zero to the maximum simulation time. The number of total time steps to be calculated depends on the chosen integration step Δt. The initial conditions calculated rst make possible a steady-state behavior of the variables (time periodic) until some change is made in the system, such as opening or closing a switch, which will cause the system to reach another state after a transient process. Without the calculation of initial conditions, all variables would start with a zero value and the simulation would start directly with a transient until they are stationary, after a period of time. ATP cannot initialize or calculate initial conditions for control systems and power converters. For the case of the asynchronous machine model (UM_4), it is essential to calculate the initial voltage in the rotor so that it starts at a desired operating point.
These two problems are addressed in this work, presenting a methodology to start the transient simulation in ATP with stationary variables for a detailed DFIG model, including power converters with their control systems and the DFIM.

General Description Of The D g Model
A general diagram of a DFIG is shown in Fig. 1 [7]. It can be seen that the DFIM has the mechanical power input in the rotor shaft and the stator is connected to a step-up transformer to transmit the generated power to the electrical network. The rotor winding is connected to the Rotor Side Converter (RSC) by means of another step-up transformer. The purpose of the RSC is to apply in the rotor winding a voltage which is variable in frequency and magnitude, so that dq0 currents ow in the rotor according to the required power. The magnitude of this voltage depends on the rotor speed and the power to be generated. The frequency depends only on the rotor speed. The RSC is connected to the Grid Side Converter (GSC) through a DC bus that has a capacitor between its terminals. The function of the GSC is to keep the capacitor voltage constant, charging or discharging it according to the situation. When the rotor speed is subsynchronous, the GSC transfers active stator energy to the capacitor, which reaches the rotor winding through the RSC. When the speed is supersynchronous, the RSC charges the capacitor and the GSC does the inverse process, i.e., it allows the ow of active power from the capacitor to the network. The GSC is connected to the stator by means of an RL lter for current smoothing. There is also an RC lter connected to the stator bus whose purpose is to soften the shape of the voltage.
Among the blocks of the control system we can highlight: RSC control system (RSCC) whose function is to generate the RSC trigger pulses depending mainly on the power reference to be generated, the currents owing through the rotor and its speed or slip.
GSC control system (GSCC), whose function is to generate the GSC trigger pulses, having as inputs the DC bus capacitor voltage and the currents through the RL lter.
Phase-Locked Loop (PLL), that calculates the stator voltage angle necessary to synchronize the DFIG with the network at any time.
abc/dq0 transformation blocks, which perform a Park transform of the measured phase voltage and current variables.

Methodology
The explanation of the initialization methodology of the DFIG is to be made based on the detailed model implemented in ATPDraw shown in Fig. 2, which can be derived from the diagram in Fig. 1. By implementing the model of Fig. 1 in ATP, the wind model and the turbine has been eliminated, leaving the mechanical torque on the rotor shaft as input. This is possible because the electromagnetic transient analysis times are very short compared to the mechanical time constants of the turbine.
The procedure for initializing the model is divided into two stages. The rst one consists of a series of o ine calculations to determine the initial values of steady state of ve variables, the most critical being the value of the rotor EMF (Electromagnetic Force). The second stage consists of introducing the results obtained in the rst stage into the model and of using auxiliary switches to perform a series of complementary switching operations within the detailed ATP model at the start of the transient simulation, that is, at t = 0. These stages are detailed in the next two subsections.

Stage I: Initial values calculation
The proposed methodology is based on the automatic initialization of electric machines included in ATP [6], which only allows initializing a DFIM at subsynchronous speeds. Therefore, the methodology is applicable to this condition (0 < slip < 1). In order for ATP to initialize the DFIM when performing the SSC calculation, an EMF (type 14 AC voltage source) [5] (see Appendix A.1) must be connected to the rotor winding terminals with suitable values of magnitude and phase, depending on the required initial operation point. A methodology to calculate the value of this EMF is presented in this section. The result of the SSC calculation performed by ATP depends on its value. Therefore, it is very important to determine it accurately.
This procedure is summarized in the diagram shown in Fig. 3.
The methodology requires two groups of input data. The rst one contains the data of the DFIG initial operating point (for t = 0): slip, terminal voltage and generated power. These can change according to the scenario to be studied. The second one consists of the DFIM parameters. With all these data, the Rotor Current Calculation Algorithm, calculates the current that must ow into the rotor (I r ) to produce the initial operation point.
Next, the Rotor Voltage Calculation Algorithm calculates the voltage at rotor winding terminals (V r ') when the previously calculated current is owing. This calculation is based on the DFIM equivalent circuit at rated frequency. Finally, the algorithm modi es the value of the calculated voltage according to the initial slip (s 0 ) and calculates the value of the EMF to be used by ATP for the SSC calculation.
The calculations to be performed in Stage I are detailed in the next two subsections.
where: s 0 Initial DFIM slip in (p.u.). |V s |, θ Vs Voltage magnitude and phase (rms, line-to-line) at stator terminals for t = 0. P 0 , Q 0 Active and reactive net power delivered by the DFIG to the network for t = 0. |I r |, θ Ir Magnitude (peak) and phase of the DFIM rotor current for t = 0. The purpose of this algorithm is to calculate the rotor peak currents required to produce the powers P 0 and Q 0 . Considering that the power coming out of the stator is positive, the active power generated by the stator and consumed by the rotor are calculated using equations (1) and (2) [3,8].
Considering that the reactive power generated by the wind turbine is the same as the one generated by the stator (the GSC having unit power factor), the equation Q s =Q 0 holds, where Q s is the reactive power generated by the DFIM stator.
Considering a reference frame in which the d axis is aligned with the magnetic ux of the DFIM stator, the rotor currents necessary to generate P 0 and Q 0 are calculated in dq0 coordinates at the axes d and q using (3), (4) and (5) [3,9]  Using I rd *, I rq * and the voltage phase at stator terminals, Park's inverse transform is performed by means of (6), (7), (8) and (9), and the instantaneous rotor current vector Ir abc is calculated for t = 0. Ir dq0 Initial vector of dq0 rotor currents.
θ Vs Voltage phase at stator terminals for t = 0.

11
Finally, the RCCA calculates the value of two auxiliary resistances. These are: R r ′ = R r /s 0 12 R aux = | Vs | 2 /P r

13
The rst one is the rotor resistance referred to the stator side for slip s 0 . This will then be used by the Rotor Voltage Calculation Algorithm.
The second one is an auxiliary resistance connected to the stator node in order to compensate the power injected by the rotor EMF in the absence of the power converters of the detailed model of the DFIG-type wind turbine when ATP calculates the SSC. More details will be given in subsection 4.2.3.

Rotor Voltage Calculation Algorithm (RVCA):
This algorithm uses the DFIM equivalent model for steady state. Its purpose is to determine the rotor voltage by injecting the Ir abc currents calculated by the RCCA into the rotor.

√
The equivalent DFIM steady state model referred to the stator side [10] is shown in Fig. 4a. It shows that the terminal voltage and the rotor resistance referred to the stator side are affected by the slip. The case of the rotor current is different, because it is the same current as in the detailed model. Therefore, the voltage in the rotor node necessary to initialize the DFIM can be determined by injecting Ir abc in the rotor winding, thus producing P 0 and Q 0 . Figure 4b shows a simpli ed single-phase auxiliary circuit used for this purpose. The gure depicts a voltage source V sa , whose magnitude and phase values are |Vs|/ √ 3 /2 and θ Vs . This voltage is the stator line-to-ground peak voltage phasor of phase A for t = 0 and is the initial operating voltage at stator terminals. A current source → I ra (phase A rotor peak current phasor for t = 0) has been connected to the rotor node.
It should be noted that in the circuits of Figs. 4a and 4b, the phase shift between the rotor and the stator must be taken into account, which depends on the type of connection of the DFIM windings.
By solving the circuit of Fig. 4b Fig. 2, which are labeled as S1, S2, and S3. The steady state variables to be updated in the auxiliary model obtained in Stage I have been highlighted with red ellipses. In order to set a new initial operation point of the DFIG (same parameters but with another initial operation point), the Stage I must be rst applied and then updated the model variables highlighted in Fig. 2. Figure 2 also shows 1E-6 Ohm resistors, which are necessary for ATP to calculate the initial steady state. The different parts of the DFIG model and its initialization will be explained next.

Grid Side Converter (GSC):
The GSC has been modeled in ATP with TACS (Transients Analysis of Control Systems) controlled switches (type 13 controlled switch) [11], which act when receiving trigger pulses from the GSC control system. These controlled switches close or open depending on whether the control signal is 1 or 0.

GSC Control System (GSCC)
A general diagram of the GSC control system is shown in Fig. 5a. The complete details of this system can be found in [12]. It has two main control loops associated with the dq0 currents I ld and I lq owing through the RL lter. In turn, the rst one controls the DC bus voltage, so that the reference signal is its rated | | ( ) voltage. On the other hand, the second one controls the reactive power generated by the GSC. Since it has been set to zero, the reference is also zero.
The DC bus capacitor is modeled in ATP using a capacitor with initial conditions. When the simulation is started, the capacitor is charged in advance to achieve the DC bus rated voltage, therefore the RSCC starts operating from t = 0 with a zero-error signal, thus avoiding a transient.
The GSCC has been modeled with TACS control blocks and routines programed in ATP MODELS language [13].

DFIM (UM_4 Component)
The DFIM is initialized through several steps. The rst one is to set the initial slip value in the UM_4 component block since, as already mentioned, ATP needs this value to perform the automatic initialization of electric machines. The second one consists of connecting to the rotor winding an EMF having the values |EMFr| and θ EMFr calculated in Stage I (see Appendix A.1). This EMF is combined with the power switches S1 and S2 whose purpose is to disconnect the EMF and to connect the RSC to the rotor winding at t = 0. In other words, during the SSC calculation carried out by ATP, the EMF in the DFIM is taken into account to calculate all internal variables (stator and rotor currents, mechanical and electromechanical torque, rotor speed, etc.). When the simulation starts, the EMF is disconnected from the rotor winding (by S1) and the RSC is connected to it (by S2), as in [9]. Likewise, the RSCC begins the simulation by applying a voltage through the RSC (modulated by the PWM), equivalent in magnitude and phase to that of the EMF, so there is only a slight transient in the rotor current due to this change of sources in the rotor winding.
Since an EMF is connected to the rotor instead of the RSC, it provides additional active power to the system, producing a power unbalance in the SSC calculation performed by ATP. To compensate it, a resistor R aux is connected to the stator node by means of switch S3 to absorb the active power delivered by the initialization EMF. This resistance is present only during the SSC calculation. Once the transient simulation starts, it is switched off at t = 0. It is star connected and its value must be calculated using (13).
Finally, the node W of the DFIM is connected to an electrical circuit that is used to model its mechanical behavior, as is explained in Appendix A.1.

Rotor Side Converter (RSC)
The RSC is disconnected from the rotor winding during the ATP calculation of the SSC and it is connected at the beginning of the simulation, i.e., at t = 0, by means of switch S2. The RSC has been modeled in the same way as the GSC.

RSC Control System (RSCC)
A general scheme of this controller is shown in Fig. 5b. The complete details of this system can be found in [12]. There are two main loops corresponding to the dq0 rotor currents I rd and I rq . As explained above, the power generated by the DFIM is controlled by means of these currents. Before starting the simulation, the values of both reference currents (I rd * and I rq *) must be updated, according to the results of Stage I.
The RSCC has been modeled with TACS control blocks and routines programed in ATP MODELS language.

Phase-Locked Loop (PLL) Block
A basic scheme of this block is shown in Fig. 5c. The input signals are the stator line-to-ground voltages.
It has a main feedback loop corresponding to the stator voltage angle of phase A. The value of the initial phase angle of this variable, which is θ Vs used in Stage I, must be updated before starting the simulation.
It should be noticed that the phase angle of the calculated stator voltage is used in another block to

Methodology Validation
The system shown in Fig. 2 was used as a case study for the validation of the methodology. The electrical network was simulated with an EMF and an equivalent impedance of 2500 MVA, to which the DFIG is connected by means of a 30 km transmission line modeled using the ATP PI model and a 25/120 kV step-up transformer. Table 1 show the main parameters of the DFIG. The complete details of the electrical and control systems can be found in [12].
To validate the methodology, 4 cases with different operating points have been used. The data corresponding to these cases are shown in Table 2. These data were processed by the Stage I algorithm and the results obtained are shown in Table 3. These data were then used in Stage II to build 4 ATP models.
The validation has been divided into two parts: steady state (for t = 0) and transient state.
For the rst one, the steady-state values for t = 0 that are achieved for the ATP models are compared. These values are extracted by selecting the "steady-state" option in the ATPDraw voltage and current meters and are shown in Table 4. These are compared with the values in Table 2, calculating the relative error between the desired theoretical initial value (Table 2) and the value nally obtained by ATP (Table 4). These errors are presented in Table 5.
On the other hand, to validate the transient state and the subsequent steady state of the variables nally obtained, 50ms simulations were carried out for each case. From these simulations, the oscillograms of the following variables are shown: (v: PCC) = voltages at the stator terminals.     6. Discussion To appreciate the performance of the methodology in steady state, the data in Table 5 must be analyzed.
It is observed there that the relative errors are less than 0.5% for 4 of the 5 variables analyzed. The reactive power variable is the one with the highest relative error. Despite this, the absolute errors are small, since the values of this variable are also small compared to the active power. This is best observed in Case 4, which has the highest relative error in Q 0 (30.99%), with the value of this variable close to zero (0.029 MVar) and much smaller than the variable P 0 (1,583 MW). Therefore, it is concluded that the steady state calculations obtained in ATP applying the proposed methodology are very precise, since it is effectively possible to obtain the initial theoretical values in ATP.
To evaluate the transient behavior of the model, the oscillograms of Figs. 6 to 9 are analyzed. It can be seen in all of them that the oscillograms start at t = 0, that is, no stabilization time was necessary and additionally the variables show a very natural subsequent behavior. For Case 1, it can be seen in the rotor current ( Fig. 6-c) a small distortion of the wave in the rst 10 ms. The other 3 variables are practically stationary. For Case 2, this occurs in the generator terminal voltage ( Fig. 7-a) and in the stator currents ( Fig. 7-b), but after 5 ms these distortions disappear. In Case 3 practically all four oscillograms are stationary without any distortion. Case 4 presents a similar behavior to Case 2, consisting of a small distortion in the waveform of the voltages at the generator terminals ( Fig. 9-a), in the stator current ( Fig. 9b), which disappear after 5 ms. A very slight distortion is also observed in the rotor currents ( Fig. 9-c), which disappear before 5 ms.
In general, it can be concluded that in the worst case it is necessary to wait 10 ms for all variables to be perfectly stationary, practically half a cycle of the network frequency (60Hz), a time more than acceptable. From this analysis follows that the methodology is very suitable to initialize the detailed DFIG model.
Regarding Case 1-mod, as the rotor initialization FEM values are incorrect, the DFIM is initialized at an operating point that is not the desired one. This is con rmed by seeing the results in Table 4, showing that the DFIM is initialized as a motor and not as a generator, since the active power is negative.
If the oscillograms of Case 1-mod (Fig. 10) are compared with those of the cases already analyzed, the distortion of the oscillograms and the non-stationary behavior of the variables shown are very noticeable, denoting that the system begins in a transient state and not in a steady state. In order to determine if giving more time to the simulation a steady state is reached, a simulation of one second for this case is performed. Figure 11 shows the values of Phase A, where large oscillations are appreciated, which are most notable in the stator and rotor currents, showing that the system is not capable of reaching a steady state.

Conclusions
A detailed ATP model of the DFIG wind generator and the corresponding methodology for its initialization for subsynchronous condition have been presented. The methodology has been divided into two stages.
The initial data of the DFIG operation point are processed in the rst stage to obtain steady state condition (SSC) values to be used in the ATP model. The second stage consists in the application of the initial values obtained in the model, and to use some auxiliary switching operations to commutate from EMF to the RSC and to disconnect an auxiliary resistance at the beginning of the simulation.
The methodology has been satisfactorily validated by showing its high precision in several case studies. On the one hand, the correct theoretical values have been obtained for t = 0 for the steady state, and on the other hand, stationary oscillograms have been obtained in less than half a cycle of the rated frequency for the transient state. The great advantage is that it is not necessary to spend simulation time to wait for all the variables reach the steady state before performing any switching operation of interest.
Furthermore, Case 1-mod has shown the importance of correctly calculating the rotor initialization EMF values since otherwise the simulation starts directly in a transient state and becomes unstable.
It should be emphasized that the proposed methodology represents an important contribution to the ATP program, which lacks a methodology to initialize control systems and power electronics models, enhancing its capabilities for calculating electromagnetic transients.
An additional contribution is an appendix showing how to implement the UM_4 component (DFIM model) in ATP in a simple and concrete way. This is important since the ATP user manuals are not entirely userfriendly and many times prior experience is required to make the models work properly. General diagram of a DFIG.

Figure 2
Power ATP circuit of the implemented model and control blocks.