Software In-The-Loop Simulation of an Advanced SVM Technique for 2 ϕ -Inverter Control Fed a TPIM as Wind Turbine Emulator

: An appropriate modulation scheme selection ensures inverter performance. Thus, space vector modulation (SVM) is more efficient and has its own distinct advantages compared to other pulse width modulation (PWM) techniques. This work deals with the development of an advanced space vector pulse width modulation (SVM) technique for two-phase inverter control using an XSG library to ensure rapid prototyping of the controller FPGA implementation. The proposed architecture is applied digitally and in real time to drive a two-phase induction motor (TPIM) for small-scale wind turbine emulation (WTE) profiles in laboratories with minimum current ripple and torque oscillation. Four space voltage vectors generated for the used SVM technique do not contain a zero vector. Hence, for an adequate adjustment of these four vectors, a reference voltage vector located in the square locus is determined. Considering the asymmetry between the main and auxiliary windings, the TPIM behavior, which is fed through the advanced SVM controlled-two-phase inverter (2 ϕ -inverter), is studied, allowing us to control the speed and the torque under different conditions for wind turbine emulation. Several quantities, such as electromagnetic torque, rotor fluxes, stator currents and speed, are analyzed. To validate the obtained results using both Simulink and XSG interfaces, the static and dynamic characteristics of the WTE are satisfactorily reproduced. The collected speed and torque errors between the reference and actual waveforms show low rates, proving


Introduction
Electrical power systems based on renewable energy sources are dominated by power electronic converters and electrical machines, which are deployed for the integration of renewable power plants, responsive demand and different storage systems types [1][2][3]. The stability of these systems requires a robust control strategy applied to the power converters [4]. Therefore, laboratory-scale setups are becoming the key tools for prototyping and evaluating the performance and robustness of different system parts from the renewable source extraction to the system grid connection [5,6].
Among the renewable sources, recently, there has been a considerable amount of growth in the wind energy system field due to various technological advancements, since wind energy's efficiency depends directly on wind speed and frequency [7]. The wind's renewable nature and abundance make it a good candidate for providing energy on a large scale, although it is difficult to accurately predict it because of the many factors on which it depends. Hence, aerodynamic study for wind power capture [8], electric gener-ators and power converters design [9][10][11], system control and energy generation optimization [12][13][14] are just a few examples of the challenges that still face engineers and researchers.
Testing wind energy conversion systems under real operating conditions is unfordable for small wind generator manufacturers or academic researchers due to the magnitude of these installations and their costs [15,16]. A more economically viable solution is to implement a wind turbine emulation system. In a wind emulator, the turbine is replaced by an electromechanical actuator that is mechanically coupled to the electrical generator, which incorporates the wind profile model as a reference speed into the control board.
Some implementations of WTE have been developed in literature [17][18][19][20][21][22][23][24]. WTE's design can involve the use of different types of electrical motors such as DCM and PMSM [25][26][27][28]. DCM, used in [29], is the most commonly considered due to its design simplicity, easy torque or speed control through the armature current and cost-effectiveness, since it needs a simple buck converter control structure. However, this machine requires permanent maintenance. Moreover, the squirrel cage induction motor (SCIM) [30] and the doubly fed induction motor (DFIM) [31] are also used for wind turbine emulation study.
Numerous control strategies have been applied for WTE design. In case of DCM, PI controllers are the most basic and highly used approach [32]. Otherwise, for the induction motor (IM), field-oriented control is considered [29,30]. Generally, these motors are fed through power converters which perform as variable-speed drives for both AC and DC modes. Hence, their control techniques are included in the WTE study to generate the appropriate pulse signals for each corresponding case, namely, a chopper or an inverter [33].
For the purposes of AC motors drives, the conventional sinusoidal pulse width modulation (SPWM) control technique has been replaced by the SVM control technique due to its switching losses reduction and its key characteristics, such as better DC voltage utilization and easiness for digital implementation [34]. Moreover, it offers better output voltage and current qualities in order to improve inverter performance whatever the topology, such as two-level, three-level and five-level inverters [35]. Therefore, the switching states and triangle numbers become quite large, which causes complexities in on-time computations of switching periods by increasing the inverter level. Hence, the conventional SVM algorithms become impractical as the inverter's level increases. So far, numerous SVM algorithms have been presented in literature [36] to mitigate the problem associated with computational complexities which are considered an industrial standard for AC drives, since the multilevel inverter is widely used in transportation and industrial automation [37] for three-phase AC motors or servo systems vector control [38] but is weakly used for two-phase AC motor drives.
The two-phase induction motors, known as single-phase induction motors (SPIM), are used extensively in low-or middle-power level fields, especially in households, because a three-phase supply is not required [39]. Most of the equipment operates at constant speed and with a certain inertia due to the load applied to the rotor. Although they are simpler than three-phase induction motors and have lower production costs, twophase AC motors analysis is more complex. The operating principle of these machine types is based on capacitor use to create starting torque through auxiliary winding. Accordingly, they operate as asymmetrical two-phase induction motors at the start but as pure single-phase induction motors while running after a centrifugal switch is opened. Taking into account the asymmetry between the TPIM main and auxiliary stator windings, a consolidated study and a computational model are required to calculate the motor parameters under load variations and to make it suitable for adjustable speed control.
In this paper, the advanced SVM technique for the two-phase inverter-fed symmetrical induction motor for a laboratory-scale wind turbine emulation is proposed. The controller is designed through both Simulink and XSG interfaces for allowing software inthe-loop simulation and real-time visualization of the WTE characteristics under different operation modes. The main technical contributions compared to others' configurations are summarized in Table 1. This brief review is carried out based on six criteria, namely, the prime motor type; the associated converter topology; the control algorithm technique, if there is one; the use of an observer or the lack thereof; the digital platform for hardware implementation and the required type and number of measured parameters. This paper is organized as follows. Section 2 describes the proposed approach for the advanced SVM technique development without zero space vectors. Section 3 deals with the mathematical model for the TPIM as the electromechanical actuator part of the wind turbine conversion system based on the emulator. Section 4 presents the software in-theloop simulation results for the two-phase inverter controller associated with the WTE. A comparative study based on the recorded reference and actual speed and torque error rates is analyzed. Section 5 focuses on the XSG design of the advanced SVM technique for emulator digital controlling in real time. The obtained results are also discussed. Section 6 summarizes the most important points of the proposals developed in this paper.

Advanced Four Space Vectors Modulations Technique for 2ϕ-Inverter
Instead of the single-phase induction motor, the two-phase induction motor is chosen in this study as the model motor. It operates without negative torque and maintains high efficiency by supplying the balanced voltage source without harmonics to the symmetrical two-phase induction motor [43].
The typical structure of the two-phase half-bridge inverter for the two-phase induction motors is depicted in Figure 1. The output voltages Va and Vb of windings a and b, respectively, are expressed in the balanced equation system as: where m is the modulation index.
As shown in Figure 2, four switching states are formed in the two-phase inverter when four switches are adjusted. The four space voltage vectors originate based on the possible combinations of four individual switches signified by switching states labeled as [S1, S2, S3, S4].
( ) Four space vectors, which are uniformly distributed at with a length of √ , form an exact square in two-phase inverters, but zero vectors are not included, as presented in Figure 3. '0′ denotes connection to the negative dc link and '1′ denotes connection to the positive dc link. The complex representation of the four space voltage vectors is expressed as: where k = 1, 2, 3, 4.
The advanced SVM technique proposed in this section does not use zero vectors. Hence, an appropriate exploitation of each sector's vectors, which are used to locate the reference vector, is strongly requested. The time duration for the reference vector Vref is determined by adjusting four voltage space vectors. Figure 4 illustrates the model sectors where the reference vector is located in all sectors. Figure 3. Space vectors for 2ϕ-inverter. The sectors are divided into two voltage space vectors which are adjacent to the Vref in each case. Two associated time durations spent on the two voltage space vectors are used. However, the two time duration amounts do not satisfy the constant sampling interval Ts for allowing the reference vector to arrive at the maximum voltage locus. Accordingly, since there are no zero vectors, the sampling interval remainder should be spent in the main sector and the relevant diagonal sector. Considering the main sector, which is Sector 1, the time duration amount spent on the modified reference vector is defined as:

( )
The restraint vector in the diagonal sector (− ) is equal to the sampling time expressed as: 10 20 11 21 s T t t t t = + + + (4) where t10 = t1 + t11 and t20 = t2 + t21 and ΔV represents the difference vector between Vref and the maximum voltage locus.
In the main sector, t1 and t2 are the time duration spent respectively on V1 and V2, while t11 and t21 are those spent on V3 and V4, respectively, in the corresponding diagonal sector.
At ωt = θ, the absolute value of the maximum space vector to the square locus is computed as: where θ is the counterclockwise phase angle from V1 to Vref. It is between 0° and 90° in Sector 1. From (5) Based on Figure 4, the relations between the time durations t10 and t20 and the modified reference vector in the main sector are expressed as: : Similarly, the time durations t11 and t21 and the restraint reference vector in the diagonal sector are related by: : c os 2 2 : : By substituting Equation (6) in Equation (7) and Equation (8) In order to determine all the duty cycles d1, d2, d3 and d4, the time durations should be divided by Ts as follows: The last step consists of determining the switching sequence by the two-phase symmetrical modulation of the 2ϕ SVM when the main sector changes. When the reference vector sweeps any sector, the switching sequence is considered to make the suitable PWM waveform in the 2ϕ-inverter. In order to realize the reference vector, the four space vectors as well as the four time durations should be determined and adjusted by four switches during Ts. The switching sequence is expressed as: Hence, four sets of output voltages Va and Vb are generated, as presented in Figure 5. In the main sector, the reference vector begins at V1 and finishes at V4 in the diagonal sector with the time durations t10 and t21, respectively. This rule is applied on all sectors because the main vector can begin at another space vector such as V2, V3 or V4, reserving the symmetry during 2Ts. From Figure 5, it is noted that two inverter legs carry out either one switching for Va or two switching for Vb regularly during 2Ts to determine the suitable PWM output voltages. For the conventional SVM technique, these waveforms are difficult to implement on hardware platforms because, according to the sector number, the switching operations during 2Ts are changed irregularly, as illustrated in Figure 6. This leads to switching loss increase because the output voltage is discontinuous at the sector boundary. In addition, the significant surge is involved in the output current and therefore the ripples are significant. In order to eliminate the previously mentioned 2ϕ symmetrical modulation disadvantages, the advanced technique is applied in switching operations, ensuring that the output voltage becomes continuous at the boundary between sectors. In this case, the PWM voltage waveforms are uniform and easy to implement because the switching logic is regular. Hence, during Ts, the inverter leg of phase A is carried out with one switching at t = tA, while that of phase B proceeds with two switching, namely at t = tB1 and t = tB2, based on the specific calculating method, as summarized in Table 2.

Mathematical Model of the Proposed Wind Turbine Emulator
A fundamental aspect of WTE building is to acknowledge the relationship between the wind turbine mechanical torque or rotational speed and the power output with the physical quantities such as air density, wind speed profile, rotor swept area, etc. The basic study proposed in this paper consists of emulating the wind profile through a two-phase induction motor by introducing the wind turbine speed in the machine model as the reference speed.

Mathematical Model of the Proposed Wind Turbine Emulator
The TPIM equivalent circuit in terms of stationary frame, represented by the q-axis for the main winding and d-axis for auxiliary winding, is illustrated by Figure 7. Considering that core saturation and iron losses are neglected, the mathematical model of the two-phase induction motor in the d-q stationary reference frame, which defines its dynamic behavior, is represented by some equations. Equation (12) Equation (13) The electromagnetic torque and mechanical equation are given respectively by Equations (14) and (15) According to Equation (15), it is noted that the asymmetry appears in the model due to unequal main and auxiliary stator windings resistances and inductances. Hence, this asymmetry can be eliminated by using an appropriate variable changing as follows: where srd srq m A m = This assumption allows us to reduce the torque oscillation of the symmetrical TPIM model. Hence, by substituting the variables i s sd and i s sq for i s sd* and i s sq* into Equation (14), the torque expression is rewritten as: The symmetrical state model of the TPIM in the stationary reference frame is written in the following form: [ ] In which, These parameters represent the stator time constant according the d-q axes, the rotor time constant and the Blondel dispersion coefficients according to the d-q axes, respectively.

IRFOC for Symmetrical TPIM Operation
The indirect rotor field-oriented control method for symmetrical TPIM is derived from vector-controlled three phase AC electrical machine. It consists on directing the currents supplied to the machine in phase and quadrature for the rotor flux which leads to choose entirely with the rotor flux in d-axis as: where φr is the rated flux and the superscript (.) rf denotes the rotor flux reference frame.
The reference torque is expressed as: At feed-forward decoupling controller stage, for IRFOC, the rotor flux is setting to be equal to the rated flux (φrq = 0, φrd = φr) since the rotor flux vector is aligned with the daxis. According to the usual d-axis and q-axis components in a synchronously rotating reference frame and after rearrangement of the system Equation (19), the TPIM dynamic model can be represented as: This equation system presents a similar behavior with that of the DC machine, expressed as: In which, The main goal in using IRFOC is to ensure a good reference rotor speed tracking dynamic, ωr * , which is derived from the wind turbine (WT) model. Hence, a speed controller is designed in which the effects caused by sensor noise, model uncertainties and neglected nonlinear dynamics are considered: where kω and τω are the static gain and the time constant of the speed PI controller, respectively. Moreover, two current controllers are developed to provide the optimal stator voltage vsd and vsq. The TPIM d-q axis electrical current transfer functions are denoted by Hd(s) and Hq(s) and expressed as: These parameters are the static gains and the time constants of the current PI controllers, respectively, which will provide control voltages vd and vq. The latter are supplemented by decoupling the voltages ed and eq respectively to generate the control voltages.

Wind Turbine Mathematical Model
Generally, a wind turbine has static and dynamic characteristics that must be reproduced by the proposed system to ensure a good emulation. For the WT static characteristics, the relations can be found in details in [44][45][46][47]. The basic equations are: The coefficients (C1-C10) which depend on the turbine geometry and specification are defined in Table 3.

Parameters
Values Otherwise, in real cases, wind speed varies with change in altitude. Hence, the incident on the upper wind turbine blade is higher than that of the speed incident on the lower blades. This causes a shearing force on the turbine blades and thus is known as wind shear. The influence of wind shear on the power production capacity of a full-scale WT is analyzed and explained in detail in [48]. It affects the WT power performance and also causes wear and tear on the blades. Moreover, a phenomenon called turbine shadow also affects the turbine output torque. Detailed analysis of the tower shadow effects can be found in [49]. The major problem due to these effects leads to output torque oscillations over a complete cycle, and, hence, the system output power leads to voltage flickering on the consumer side.
These phenomena are related to WT dynamic characteristics that influence on system behavior and performance. Thus, it is necessary to consider them in theoretical and practical studies to emulate the wind turbine perfectly.
The common WTE mechanical model based on the simplified two-mass model, which is used to represent the forces applied to the wind power system transmission drive train, is illustrated by Figure 8. The low-and high-speed shaft dynamics are expressed by the following equation system [50]: Since the stiffness coefficients are generally weak, they are considered negligible [51]. Hence, low-and high-speed shaft torques on wind turbine and generator sides are rewritten as follows: (38) Given this, for an ideal gearbox, the transmission ratio is [24]: The WTE equivalent inertia is given by: The transmission system can be represented by a one-mass model with an inertia and friction coefficient equivalent to the assembly TPIM/generator. The fundamental mechanical equation of the emulator on the electrical generator side is: In this case, the equivalent inertia J applied on the low-speed shaft (wind turbine side) becomes: Considering both static and dynamic characteristics, the wind turbine model overview is generalized in Figure 9. Figure 9. Variable-speed WTE general overview.

Software in-the-Loop Simulation and Results
Two simulation modes are considered for WT emulation, namely, the open-loop mode and the closed-loop operation. The first mode is carried out to determine the system's basic static quantities and predict the two-phase asynchronous motor behavior for wind turbine emulation whatever the wind fluctuations. The software in-the-loop simulation is performed to investigate the advanced SVM technique, which controls the 2ϕinverter, for driving the TPIM to emulate real wind turbine characteristics in the laboratory. The challenge is to control motor speed in spite of wind fluctuations. In order to evaluate the variable-speed TPIM operation, both the ramp and the sinusoidal wind profiles have been selected, and afterward, the turbine torque is introduced as load to the machine, as illustrated in Figure 10.

First Test: Linear Constant WT Speed
As a first test, a linear constant wind turbine speed variation is applied to the TPIM model as a reference to observe WTE behavior and to validate the waveforms obtained from the whole system, taking into account the advanced SVM technique and the IRFOC strategy. Simulation results are illustrated in Figure 11. Figure 11a presents the speed waveforms, Figure 11b presents the flux waveforms, Figure 11c presents the torque waveforms, Figure 11d presents the d-axis current waveforms and Figure 11e presents the qaxis current waveforms.
The figures show a good tracking between the reference quantities and the actual quantities due to the PI controller's parameter sizing. It can be seen that speed, current, flux and torque are fairly appropriate.

Second Test: Sinusoidal WT Speed
At this stage, the wind speed reference is changed to get closer to the actual turbine including unbalanced transition. The system is operated in closed-loop mode. Hence, the symmetrical TPIM is fed by the two-phase inverter, which is controlled through the advanced SVM technique. Moreover, a load torque is applied at 2 s to discuss the system robustness to disturbances. Results are shown in Figure 12. Figure 12a presents the speed waveforms, Figure 12b presents the flux waveforms, Figure 12c presents the torque waveforms, Figure 12d presents the d-axis current waveforms, Figure 12e presents the q-axis current waveforms and Figure 12f presents the output voltages of the SVM controlled technique. The subscript * () means reference quantities in the Figure 12.  It is clearly noted that the proposed WTE is able to produce and simulate the nonlinear behavior of the studied wind turbine regardless of parametric variations. According to the obtained waveforms, prime motor speed accurately follows the wind turbine speed trajectory. The PI controller's response shows high robustness as the previous tests do, due to the correct computation of parameters. We also notice that the q-axis current isq has the same shape as the electromagnetic torque Te and the d-axis current isd is similar to that of the rotor flux. The output voltage obtained from the SVM controlled two-phase inverter is equal to 154 V. Consequently, the performance of the emulator for both IRFOC drive and advanced SVM control technique is proven.

Quantitative Study of the Speed and Torque Error Rates
Since in wind turbine emulation, either the speed or torque must be imitated in the laboratory, the quantitative error rates evaluation allows us to confirm the collected results' validity and effectiveness. Figure 13 shows the error rates recorded from the reference and actual speeds and torques for both constant and variable wind profiles.  From the obtained results, it is clearly noted that the speed and torque error rates (rd/s and N.m, respectively) under constant wind profile do not exceed 0.01 and they are lower than those recorded under variable wind profile. Even if wind variations are sudden and random, the system responds correctly and has a negligible error rate, less than 0.02 rd/s in speed and 0.02 N.m in torque. These promising results allow us to proceed with the hardware implementation of the WTE control strategies.

Advanced SVM Modeling with XSG for FPGA-Based WTE Digital Control
In this section, we describe the FPGA components modeling the proposed wind turbine emulator digital control in order to prepare it for implementation. It should be noted that WTE control in closed-loop mode consists of two main parts, namely, the advanced SVM strategy of the 2ϕ-inverter and the TPIM vector control. Hence, the control architecture is carried out through the high-level XSG tools, which are developed by Xilinx and integrated into Matlab/Simulink software to automatically generate the VHDL code without knowledge of the hardware description language. Moreover, this library allows us to verify the design functionality via digital simulation by comparing it with the reference model behavior shown in the Simulink interface. The proposed WTE controller XSG architecture is depicted in Figure 14. The XSG wind turbine model and the XSG PI controller design are described in [32,40]. By substituting the advanced SVM controller, the XSG architecture is detailed as illustrated in Figure 15.
Simulation results recovered from the TPIM, as the proposed WTE in this study, are shown in Figure 16.
In this state, digital simulation is performed to investigate the advanced SVM technique effectiveness. Hence, the performance of the proposed control strategy for WTE is analyzed under variable speed and sudden load torque variation. At first, the WTE response (i.e., TPIM speed) follows the turbine reference speed perfectly, regardless of slow wind fluctuations which vary between 4.2 m/s and 12.8 m/s. The slow sinusoidal shape transition allows us to observe and discuss WTE electromagnetic, mechanic and electric quantities. Due to the number bit accuracy applied to the PI speed controller XSG model, good speed tracking, which oscillates up to 175 rd.s −1 , is noted. The motor currents isα and isβ have quadrature sinusoidal shapes around 8A. The motor flux curves ϕsα and ϕsβ are sinusoidal and in quadrature form, equal to 0.65 Wb. Moreover, the motor torque tracks the reference torque with low error, which oscillates according to the wind profile. It can be claimed that the developed emulator reacts as a real turbine under both constant and variable atmospheric conditions.

Conclusions
This paper deals with the design and the digital simulation of a wind turbine emulator based on a TPIM as a prime motor of a wind energy conversion system chain which is fed by a 2ϕ-inverter controlled through an advanced SVM technique. Four space voltage vectors and no zero vectors are considered and adjusted in this case to determine the reference voltage vector. Two-phase symmetrical modulation is adopted to generate the switching sequences with low output current ripples used for the TPIM speed drive. The indirect rotor flux-oriented control is applied to the motor to ensure the closed-loop operation mode of the developed emulator. Hence, the vector control strategy validity for symmetrical TPIM is verified by simulations. The static and dynamic characteristics of the wind turbine have been analyzed under both steady-state and transient conditions. Results are similar to those of the reference waveforms. Numerous tests have led to confirm the performance of the proposed digital WTE controller to make a TPIM react as a real turbine. Hence, the recorded speed and torque error rates are low, proving the system's validity. This emulator is useful for low-power motor drives and experimental study in the research laboratory where only single-phase voltage is available.