Implementation and Validation of Hybrid Control for a DFIG Wind Turbine Using an FPGA Controller Board

: In this study, a novel control approach for a doubly-fed induction generator (DFIG) is developed and applied to improve the system’s dynamic response and performance for providing high energy quality while avoiding harmonic accumulations. Because of its ease of implementation, ﬁeld-oriented control (FOC) is frequently used. This control has great sensitivity to the machine’s parametric variations. For this reason, adaptive Backstepping control (ABC) is capable of preserving almost all of the performance and robustness properties. However, its analytical formulation has a problem. To overcome these disadvantages, the hybrid control (HC) is developed and veriﬁed to enable rapid response, complete reference tracking, and appropriate dynamic behavior with a low ripple level. This control is a combination of FOC’s and ABC’s control laws. The prepared control is explored by simulation testing using Matlab/Simulink and practical implementation using an FPGA board with actual turbine settings and a real wind proﬁle of Dakhla City, Morocco. The results of hardware simulation show the efﬁcacy of the HC in terms of speed and robustness, with a total harmonic distortion THD = 0.95, a value of THD that reveals the quality of the energy injected into the grid.


Introduction
Nowadays, significant effort is being made to find a source of production of renewable energy as an alternative resource to secure fossil fuels while protecting the environment [1]. Wind energy technology has received considerable attention in recent years in this context, owing to its many benefits, such as low cost, ease of deployment, and maintenance [2,3].
Despite the advantages of the wind energy conversion system, it suffers from instability and nonlinearity, resulting from the fluctuating nature of the wind, which can create some problems in the grid, such as a shock. To overcome these problems, the system requires robust controllers that can enable it to face the internal parametric changes and external disturbances and also achieve adequate performance under different operation conditions. For these reasons, several studies and algorithms have been applied to enhance the performance of WECS [4][5][6]. The vector control strategy based on the classic PI controller is considered one of the well-known controls of (WECS) that are used to solve the current-voltage coupling problem in the system. However, this control is sensitive to the parametric changes of the machine.
For this reason, other controls have been proposed in the literature. According to [7], sliding mode control (SMC) is a suitable approach for controlling the DFIG because of its durability. However, it suffers from chattering phenomena. Alami et al. [8] proposed direct power control (DPC), which is characterized by its detachment from the internal parameters of the machine, but the hysteresis comparators remain the major drawback of this control. To overcome all deficiencies discussed previously, the nonlinear Backstepping approach is chosen based on its performances, simple implementation, and robustness. A good tracking response is also ensured, and the system's stability is obtained by employing the Lyapunov function [9,10].
Backstepping operates using a switching-table-based algorithm to regulate the active and reactive power. Although it provides better control over the decoupling between the active and reactive power and simple algorithm implementation, it suffers from high power ripples, which can reduce the signal's quality distributed to the grid [11]. To avoid all these problems, several scientific researchers have proposed a series of nonlinear control methods to improve the robustness of the studied system [12].
This article discusses the control design of DFIG. The particularity of this study is that it presents a novel controller structure that is distinct from the majority of sliding-modecontrol-based PMSG wind turbine systems. The controller can sustain steady transient performance in the presence of external disturbances, handle any change in the wind speed rapidly and smoothly, and enhance the quality of the electrical energy delivered. Additionally, the validation of the proposed control was analyzed according to the stability, robustness, rapidity, and efficiency of the system, as well as the signal quality sent to the grid.
As a result, the hybrid drive is developed in this article to improve the dynamic power response of the DFI generator and minimize the ripples of its currents when injected into the grid. Furthermore, the planned control diagram is built in real-time using the Nexys 2 FPGA board to verify the experimental model.
The primary contributions of this work include developing the Backstepping control rule, which is based on Lyapunov's theorem; ensuring decoupling between the DFIG command variables; and improving system efficiency and robustness. Experimental validation of the approach proposed using the real-time interface connected to the Nexys 2 FPGA board is also included. For this purpose, this article is divided as follows: presentation of the model of the wind turbine system conversion chain; modeling and design of the adaptive Backstepping control technique; validation of the model proposed on Matlab/Simulink and also by a co-simulation with an implementation on the FPGA target; and finally, analysis and interpretation of the results.

Wind Turbine
A wind turbine's principal purpose is to convert kinetic energy from the wind into mechanical energy. The wind's mechanical power (P mec ) is employed to express it. In addition, this power is dependent on a variety of parameters, including the wind speed V (m/s), the density of air ρ, the surface S (m 2 ), and the power coefficient C p . Moreover, the torque T mec (Nm) is expressed by dividing the mechanical power by the turbine speed Ω t (rad/s). They may be mathematically represented as [13] The power coefficient C p (λ,β) is: [14]: with c 1 = 0.5872, c 2 = 116, c 3 = 0.4, c 4 = 5, c 5 = 21, c 6 = 0.0085, and β = 0.

DFIG
In the dq reference frame of the DFIG machine, the stator and rotor voltage space vector equations, currents equations, and magnetic equations are expressed, respectively, as follows [15]: The expressions of stator and rotor active: The Torque equation is expressed as a function of magnetic components: where R s and R r are the stator resistance and the rotor resistance, respectively, and L s , L r , and M are the stator, rotor, and mutual inductance, respectively. Additionally, d and q denote the d-q axes frame, while s and r denote stator and rotor, respectively.

Hybrid Control
The primary goal of our adaptative Backstepping approach is to run the wind turbine at full mechanical power. This requires checking the stator's active powers P s and reactive powers Q s (Equation (6)) according to [16,17]: Because of the coupling between the active and reactive power, it is evident that the dynamic model Equation (8) is strongly nonlinear. For a study of this equation, use the Lyapunov function [18,19], which is divided into two steps: Control of the speed [20]: Electronics 2021, 10, 3154 4 of 13 Control of the powers: To ensure the stability of the system, it is necessary to guarantee the negativity of the derivative of the Lyapunov (V 1 and V 2 ) function. For this, we define a positive constant "k" in the derivative of Equations (9) and (10), such that After the mathematical calculation, we consider the active and reactive powers as virtual inputs: We also consider the control's laws of the real machine: where K Ω > 0, K Ps > 0, and K Qs > 0. We get the negativity of the derivative V 1 and V 2 : where K Ω > 0, K Ps > 0, and K Qs > 0. We get the negativity of the derivative V 1 and V 2 : .
This equation shows the asymptotic stability of the origin in the equations of the system of the DFI generator.

FPGA Implementation
To adjust the functionality of the nonlinear control algorithm, we created a functional model for the adaptive Backstepping control using the Xilinx "SYSTEM*GENERATOR" environment, which is compatible with Matlab and Simulink [13,14]. This is loaded into the FPGA memory. Control structures are designed using computer-aided design (CAD) tools. The entry is done visually or using a high-level hardware description language, such as Hardware Description Language (HDL), Very High-Speed Integrated Hardware Description Language (VHDL), or Verilog. These two languages are standardized and provide the designer alternative degrees of description, as well as the benefit of being compatible with all previously introduced FPGA technologies [20,21]. Figure 1 depicts the many processes of programming an FPGA.

FPGA Implementation
To adjust the functionality of the nonlinear control algorithm, we created tional model for the adaptive Backstepping control using the Xilinx TEM*GENERATOR" environment, which is compatible with Matlab and S [13,14]. This is loaded into the FPGA memory. Control structures are designe computer-aided design (CAD) tools. The entry is done visually or using a hi hardware description language, such as Hardware Description Language (HDL High-Speed Integrated Hardware Description Language (VHDL), or Verilog. Th languages are standardized and provide the designer alternative degrees of desc as well as the benefit of being compatible with all previously introduced FPGA ogies [20,21]. Figure 1 depicts the many processes of programming an FPGA. The generator system allows you to configure the type of FPGA board used, as the type of programming language (VHDL or Verilog), and then it generates t necessary for it to be implemented in the FPGA board. Figure 2 illustrates the generator system, which is composed of several block • Backstepping cοntrοl blοcks: The first blοck is fοr cοntrοlling the active and pοwer οf the statοr and the second fοr the cοntrοl laws Vrd and Vrq.

•
Calculatiοn blοck: This blοck is used tο calculate frοm the measured curre vοltages: the active pοwer, the reactive pοwer, the magnetic fluxes οf the sta rοtοr pulsatiοn, and the statοr pulsatiοn. The generator system allows you to configure the type of FPGA board used, as well as the type of programming language (VHDL or Verilog), and then it generates the code necessary for it to be implemented in the FPGA board. Figure 2 illustrates the generator system, which is composed of several blocks: • Backstepping control blocks: The first block is for controlling the active and reactive power of the stator and the second for the control laws V rd and V rq . • Calculation block: This block is used to calculate from the measured currents and voltages: the active power, the reactive power, the magnetic fluxes of the stator, the rotor pulsation, and the stator pulsation.

•
Measuring block: This block contains ADC interfaces that allow the connection between the FPGA and the analog-to-digital converter, which allows the currents to be acquired from a Hall Effect sensor.
• PWM block: This block is used to generate the control signals Sa, Sb, and Sc of the rotor side converters. The Timing block controls the start and end of each block, which makes it possible to refresh the reference voltages at the start of each sampling period.

Hardware Co-Simulation
Follow-up tests and robustness tests are given for experimental validation of the proposed control model. The sample period for the Nexys 2 board is Ts = 5 s, and the frequency connected to the FPGA is 50 Mhz. The Nexys 2 board controls digital I/O using TTL logic voltage levels (0-5 V), while the IGBT drivers operate in CMOS logic (0-15 V), necessitating the need for a control board (5-15 V) interface optimized for adaptability and galvanic isolation. The functional diagram of the Nexys 2 board with the DFI generator is shown in Figures 3 and 4.

Hardware Co-Simulation
Follow-up tests and robustness tests are given for experimental valida proposed control model. The sample period for the Nexys 2 board is Ts = 5 frequency connected to the FPGA is 50 Mhz. The Nexys 2 board controls digita TTL logic voltage levels (0-5 V), while the IGBT drivers operate in CMOS log necessitating the need for a control board (5-15 V) interface optimized for a and galvanic isolation. The functional diagram of the Nexys 2 board with the ator is shown in Figures 3 and 4.

Experimental Results and Discussions
To evaluate the influence of the command on the system and to highlight the objectives discussed in the introduction part, several tests have been performed and discussed.

Performance Test Static
This initial test comprises impοsing steps οf active and reactive pοwer while the wind speed is set at 12 m/s. This test allοws us tο verify the perfοrmance οf the system and the decοupling οf the pοwers created by the DFI generator when the pοwer setpοints change, the parameters of the system is mentioned in Tables A1 and A2. Based οn these results, we nοte that ( Figure 5): • The active and reactive pοwer tracking test is always carried οut with high perfοrmance.

•
The active pοwer is always negative, which means that the MADA is οperating in generatοr mοde and is supplying pοwer tο the netwοrk.

•
The reactive power control allows us to have either negative or positive reactive power (capacitive or inductive behavior). The sizes οrdered perfectly fοllοw their references with a static errοr οf εs = 0.067%.

•
The three-phase statοr and rοtοr currents respond effectively to the torque variations; they are proportional to the active power provided.

•
The current has a sinusoidal form with a frequency of 50 Hz fοr the statοr current alongside the rοtοr current frequency, which is stabilized at 3 Hz at time t = 4.8 s tο an impοsed speed of 1800 tr/min.

•
The harmοnic distοrtiοn is related tο 0.33% for the rοtοr current and 0.94% for the statοr current.

Experimental Results and Discussions
To evaluate the influence of the command on the system and to highlight the objectives discussed in the introduction part, several tests have been performed and discussed.

Performance Test Static
This initial test comprises imposing steps of active and reactive power while the wind speed is set at 12 m/s. This test allows us to verify the performance of the system and the decoupling of the powers created by the DFI generator when the power setpoints change, the parameters of the system is mentioned in Tables A1 and A2. Based on these results, we note that ( Figure 5): • The active and reactive power tracking test is always carried out with high performance.

•
The active power is always negative, which means that the MADA is operating in generator mode and is supplying power to the network.

•
The reactive power control allows us to have either negative or positive reactive power (capacitive or inductive behavior). The sizes ordered perfectly follow their references with a static error of εs = 0.067%.

•
The response of the active and reactive power is aperiodic, with: Response time of tr(P s ) = 170 ms and tr(Q s ) = 50 ms Variation band of ∆P s = ±5 W and ∆Q s = ±5 VAR.

•
The three-phase stator and rotor currents respond effectively to the torque variations; they are proportional to the active power provided.

•
The current has a sinusoidal form with a frequency of 50 Hz for the stator current alongside the rotor current frequency, which is stabilized at 3 Hz at time t = 4.8 s to an imposed speed of 1800 tr/min.

•
The harmonic distortion is related to 0.33% for the rotor current and 0.94% for the stator current.

Performance Test Dynamic
The wind profile used for these tests is variable (Figure 6a). It is a wind profile th corresponds to that of Dakhla City, Morocco.

Performance Test Dynamic
The wind profile used for these tests is variable (Figure 6a). It is a wind profile that corresponds to that of Dakhla City, Morocco.  The results obtained show that ( Figure 6):

•
The active and reactive power perfectly follows the generated setpoints, the unit power factor obtained after the end of its transient regime.

•
The quality of the energy is much improved; the evolution of the currents is indeed sinusoidal, with a frequency of 50 Hz.

•
The harmonic distortion is significant (6.29%) for the current rotor and only 0.16% for the stator current.

Robustness Test
To check the robustness of this control, adjustments are made to the internal parameters of the DFIG model used. The following graphs illustrate the dynamic behavior of the machine for several tests of robustness based on parameter variations [21]: From these results, we notice that (Figure 7): • Variations in stator (R s ) and rotor (R r ) resistances result in a small increase in response time, with almost zero static error and less oscillation.

•
The fluctuations of the rotor and stator inductances (L r ) and (L s ) show the same response time in the beginning, with low sensitivity in the dynamics of the reference, which always maintains the decoupling between the active and reactive powers. The results obtained show that ( Figure 6): • The active and reactive power perfectly follows the generated setpoints, th unit power factor obtained after the end of its transient regime.

•
The quality of the energy is much improved; the evolution of the currents i indeed sinusoidal, with a frequency of 50 Hz.

•
The harmonic distortiοn is significant (6.29%) for the current rotor and onl 0.16% for the stator current.

Rοbustness Test
To check the rοbustness οf this cοntrοl, adjustments are made tο the internal pa rameters οf the DFIG mοdel used. The following graphs illustrate the dynamic behavio of the machine for several tests of robustness based on parameter variations [21]: Frοm these results, we nοtice that (Figure 7): • Variatiοns in statοr (Rs) and rοtοr (Rr) resistances result in a small increase i respοnse time, with almοst zerο static errοr and less οscillatiοn.

•
The fluctuations οf the rοtοr and statοr inductances (Lr) and (Ls) show the sam respοnse time in the beginning, with lοw sensitivity in the dynamics οf the refer ence, which always maintains the decοupling between the active and reactiv pοwers.

Hardware Test
The following figures show the experimental results of the switching signals (Sa, Sb, Sc) applied to the inverter obtained by the oscilloscope to the output of the FPGA board Nexys 2 ( Figure 8).

Hardware Test
The fοllοwing figures shοw the experimental results οf the switching signals (Sa, Sb, Sc) applied tο the inverter οbtained by the οscillοscοpe tο the οutput οf the FPGA bοard Nexys 2 ( Figure 8).  Table 1 shows a comparison between the proposed technique and some recently published control strategies studied.  Table 1. Although the error is minimized compared to [10][11][12], the biggest advantage of this control is the significant response time, and the overshoot was reduced. Comparing the power ripple of this study with [10][11][12], it is remarkable that the ripple has been decreased in a significant way for the controls proposed.

Cοnclusiοns
The combination of adaptive Backstepping control and flux orientation confirmed the good attributes of performance and robustness in this work. It has the advantage of being robust with the machine's parametric variation and good tracking of the references.  Table 1 shows a comparison between the proposed technique and some recently published control strategies studied. A comparison of results between the developed control and other recent studies is shown in Table 1. Although the error is minimized compared to [10][11][12], the biggest advantage of this control is the significant response time, and the overshoot was reduced. Comparing the power ripple of this study with [10][11][12], it is remarkable that the ripple has been decreased in a significant way for the controls proposed.

Comparison Study
In summary, the adaptive Backstepping control offers good performances (reduced response time, good tracking of references), with a dynamic error of εd = 1.05% and a static error of εs = 0.067%.

Conclusions
The combination of adaptive Backstepping control and flux orientation confirmed the good attributes of performance and robustness in this work. It has the advantage of being robust with the machine's parametric variation and good tracking of the references. The adaptive Backstepping control approach based on the Lyapunov theory is established in detail. After evaluating the system control in a Matlab/Simulink environment with the Xilinx "SYSTEM GENERATOR," the FPGA Nexys 2 board was implemented. The results show that the proposed control strategy provides good performance (lower response time, good tracking of references, and lower errors). In addition, it ensures robustness against variations in the wind profile and the machine parameters are well ensured, thanks to this control algorithm. The experimental hardware co-simulation demonstrates that the proposed control strategy provides good static and dynamic performances of the system. Therefore, the effectiveness of this control has been validated. The analysis of the harmonic distortion results (6.29% at the rotor current and 0.16% at the stator current) guarantee connecting the DFIG machine to the grid for injecting the energy in the electrical grid.

Conflicts of Interest:
The authors declare no conflict of interest.