Design of Super Twisting Sliding Mode Controller for a Three-Phase Grid-connected Photovoltaic System under Normal and Abnormal Conditions

: The novelty behind the research in this paper is to investigate the Super Twisting Sliding Mode Controller (ST-SMC) for e ﬃ ciently injecting both active and reactive power under normal and abnormal operating conditions for a three-phase grid-connected photovoltaic (PV) system. The ST-SMC is aimed to inject sinusoidal current to the grid with low Total Harmonic Distortion (THD), to avoid chattering with easy real implementation, and to enhance the quality of disturbance rejection and sensitivity to parameter variation. The test under normal conditions includes initialization, steady state behavior, dynamic behavior, and interrupting the injection of acting and reactive power while the abnormal conditions consists of voltage sag, voltage swell, frequency variation, DC-link variation, and inclusion of 5th harmonics, etc. The phase lock loop used for synchronization is based on a synchronous reference frame that works well under distorted grids and nonideal. Automatic code is generated in PSIM 9.1 for hardware implementation in the DSP board TMS32F28335 from Texas Instruments while code composer studio 6.2.0 is used for debugging. The real time testing is executed using Typhoon Hardware in Loop (HIL) 402 device on the DSP board. The results authenticate the fastness, e ﬀ ectiveness, and robustness for both steady state and dynamic behavior under various scenarios of the designed controller. ST-SMC for efficiently injecting normal and abnormal operating conditions for a three-phase grid-connected PV system. The ST-SMC is analyzed i.e., ST-SMC injects THD, insensitive ST-SMC controllability,


Introduction
Exponential decrease in fossil fuel, rapidly varying climate, and high electric power demand are currently severe problems due to the abruptly increasing population throughout the world. To fulfill the power demand, the alternative way is to adopt Renewable Energy Resources (RER) [1,2]. An abrupt growth has been seen in Solar Photovoltaic (SPV) system by the past several years; however, its importance will be further increased in the near future as its integration with the grid becomes more sophisticated [3][4][5]. The SPV system is considered one of the favorite RERs due to its abundance,

•
Design of the ST-SMC for efficiently injecting both active and reactive power to the utility grid.

•
Mathematically modeling of the three-phase grid-connected PV system in a comprehensive manner.

•
Employing the SRF-PLL that works accurately under distorted and nonideal grids. • HIL testing under normal conditions that includes initialization, steady-state behavior, dynamic behavior, and interrupting the injection of acting and reactive power.
The remaining of the paper is structured as follows: Section 2 provides the mathematical modeling, system design, and synchronous reference frame based phase lock loop for a three-phase grid-connected PV system; SMC and the design of ST-SMC are broadly outlined in Section 3; Section 4 assesses hardware in loop results for the grid-connected PV system under normal and abnormal perturbations; and finally, the paper is concluded in Section 5.

System Modeling
The control of the direct-quadrature (dq) synchronous reference frame is decoupled. It has a negligible steady state error and fast transient response [53]. The grid-connected PV system is normally controlled in dq frame. The three-phase line voltages provide the single-phase voltages of the inverter as: In above Equation v a , v b , v c are phase voltages in natural-frame and v ab , v bc , v ca are the line voltages. Additionally, using Clark's transformation the three-phase voltages are converted into stationary reference-frame v α and v β [54]: Energies 2020, 13, 3773 4 of 20 Next, Using Park's transformation the v α and v β frame is transformed into synchronous or dq reference-frame: v d v q = cos(θ e ) sin(θ e ) − sin(θ e ) cos(θ e ) v α v β In Equation (3), the synchronous frame axis is presented by a dq subscript. Using PLL, the synchronous frame angle θ e is acquired [53]. Moreover, Equation (4) converts the current into a dq reference frame: The active and reactive power of the inverter can be calculated using the dq components of currents and voltages: Supposing that the grid voltage and current has zero phase shift, i.e., in phase, which gives v d = 0. Thus, the above Equation (5) can be expressed as: The real power depends on i q and reactive power depends on i d , respectively.

System Description
The block diagram of the design system is presented in Figure 1, while Table 1 lists the nominal parameters. The proposed system has the capability to control both active and reactive power. The grid-connected mode is tested under normal and abnormal conditions. The capacity of the inverter is 15 kVA with the output voltage 120 V AC RMS and the DC-link voltage 380 V. The type III controller-based DC-DC boost converter is assumed to supply 380 V whose input voltage is 80 V [55]. The LCL filter is used to connect the inverter with the grid [56,57]. The MPPT controller for RER or high-level energy management controller is utilized to set the P re f and Q re f power references, respectively. For controller designed, Park and Clarke's transformation based on dq theory is used to define control signals. The tuning of the d-axis well tune q-axis as the dynamics of both axes are similar [55]. The inverter is employed with Sinusoidal Pulse Width Modulation (SPWM) technique. Sliding mode Controller (SMC) based on the Super Twisting algorithm is designed to inject high quality fed in current into grid. This design will be discussed in the next section.

System Description
The block diagram of the design system is presented in Figure 1, while Table 1 lists the nominal parameters. The proposed system has the capability to control both active and reactive power. The grid-connected mode is tested under normal and abnormal conditions. The capacity of the inverter is 15 kVA with the output voltage 120 VAC RMS and the DC-link voltage 380 V.

SRF-PLL Design
Currently, Phase Lock Loop (PLL) is widely used to synchronize PV plants to the power grid. The range of the PLL techniques is from a few hertz to gigahertz. There are three main PLL procedures for phase tracking, e.g., (a) zero-crossing based PLL, (b) stationary reference frame, and (c) Synchronous Reference Frame (SRF)-based PLL [54]. The SRF-PLL works accurately under distorted and nonideal grids and is applicable to both single phase and three-phase systems. The overall structure is presented in Figure 2. The voltage V d and V q are calculated from phase voltages v gA , v gB , v gC using αβ and dq transformation. The angle θ * required in the transformation is computed by integrating the ω * . The readers are encouraged for further details about PLL [54,55,[58][59][60].  The type III controller-based DC-DC boost converter is assumed to supply 380 V whose input voltage is 80 V [55]. The LCL filter is used to connect the inverter with the grid [56,57]. The MPPT controller for RER or high-level energy management controller is utilized to set the and power references, respectively. For controller designed, Park and Clarke's transformation based on dq theory is used to define control signals. The tuning of the d-axis well tune q-axis as the dynamics of both axes are similar [55]. The inverter is employed with Sinusoidal Pulse Width Modulation (SPWM) technique. Sliding mode Controller (SMC) based on the Super Twisting algorithm is designed to inject high quality fed in current into grid. This design will be discussed in the next section.

SRF-PLL Design
Currently, Phase Lock Loop (PLL) is widely used to synchronize PV plants to the power grid. The range of the PLL techniques is from a few hertz to gigahertz. There are three main PLL procedures for phase tracking, e.g., (a) zero-crossing based PLL, (b) stationary reference frame, and (c) Synchronous Reference Frame (SRF)-based PLL [54]. The SRF-PLL works accurately under distorted and nonideal grids and is applicable to both single phase and three-phase systems. The overall structure is presented in Figure 2. The voltage and are calculated from phase voltages , , using and transformation. The angle * required in the transformation is computed by integrating the * . The readers are encouraged for further details about PLL [54,55,[58][59][60].

Sliding Mode Controller
In SMC, the systems states are driven toward Sliding Surface (SS) [61,62]. The graphical interpretation of SMC is presented in Figure 3 [62]. After reaching SS the SMC keeps the states on the close neighborhood of the SS. The design of SMC consists of two parts SS and control law design.
interpretation of SMC is presented in Figure 3 [62]. After reaching SS the SMC keeps the states on the close neighborhood of the SS. The design of SMC consists of two parts SS and control law design.
SS: A typical form for SS is given as follows: where = − 1 with equal to a relative degree between and . The choice of is an arbitrary positive constant. The selection of should be in such a way that = 0 gives a stable differential equation. For different values of the SS is given as follows:
Control law design: The second part is the control law design that should steer the variable σ to zero in finite time; in other words, should steer the system trajectories onto the sliding manifold. The control law will be either first order (conventional) or higher order SMC. The discontinuous function causes oscillation in various areas; using continuous functions and ℎ , some chattering is attenuated but the robustness is not maintained. An alternative solution is using higher order SMC that maintain robustness and completely solves the chattering issues. Table 2 presents the comparison of various first order SMCs based on continuous and discontinuous functions [61].

S.NO Function Equation Constants
Nature Chattering SS: A typical form for SS is given as follows: where k = r − 1 with r equal to a relative degree between u and y. The choice of c i is an arbitrary positive constant. The selection of σ should be in such a way that σ = 0 gives a stable differential equation. For different values of k the SS is given as follows: Control law design: The second part is the control law design that should steer the variable σ to zero in finite time; in other words, should steer the system trajectories onto the sliding manifold. The control law will be either first order (conventional) or higher order SMC. The discontinuous sgn function causes oscillation in various areas; using continuous functions sat and tanh, some chattering is attenuated but the robustness is not maintained. An alternative solution is using higher order SMC that maintain robustness and completely solves the chattering issues. Table 2 presents the comparison of various first order SMCs based on continuous and discontinuous functions [61]. Table 2. Comparison of various first-order SMC [61].

S.NO Function Equation Constants
Nature Chattering

Super Twisting Sliding Mode Controller Design
Without affecting the tracking performance and to avoid chattering, the Super Twisting ST-SMC is a viable alternative to the standard first-order SMC particularly intended for systems with relative degree 1. After describing a trajectory similar to one of the Twisting algorithms, this algorithm converges in finite time with a proper choice of parameters [63]. In ST-SMC the trajectories are twisting around the origin on the 2-sliding plane as presented in Figure 4a. The ST algorithm is a nonlinear version of the conventional PI controller presented in Figure 4b. The ST-SMC is highly suitable for real implementation and more immune to output measurement noise and possible errors in the estimation of . σ [64]. The ST-SMC control law u(t) is composed of two terms. The discontinuous time derivative defines the first term, while the second term is a continuous function of the available sliding variable, which is present during the reaching phase only. The following control law defines the control algorithm [63,65,66]: .
where U is the control value boundary and σ 0 is a boundary layer around the SS σ. The sufficient conditions for finite time convergence to the sliding mode manifold are: Φ, Γ m , Γ M , s 0 are positive constants and W, λ, ρ are control gains. When controlled systems are linearly dependent on the control, then σ 0 = ∞ and u does not need to be bound [67]; thus, the final equation of the controller may be simplified as: In Equation (13), λ = √ U and W = 1.1U. Where U is a positive constant with sufficiently large values, its value is tuned by using the "trial and error" method until good performance in closed-loop is achieved. The various values of controller constants are: c = 30, 000, U = 600, 000, and W = 1.1U = 600, 000, and λ = √ U = √ 600, 000. The control law in Equation (13), used in the controller design, is stable and its step by step analysis of stability is given in [68,69].
are positive constants and , , are control gains. When controlled systems are linearly dependent on the control, then = ∞ and does not need to be bound [67]; thus, the final equation of the controller may be simplified as:

Hardware in Loop
Leading to the results very near to practical conditions, Hardware in Loop (HIL) for the design of converters and control in power electronics has been gradually identified as an effective tool [70]. In grid-connected inverters, the practical implementation of some tests is difficult due to the fact they require alterations in the grid conditions or filter or in the inverter; this can be easily executed in HIL. In this paper, the effectiveness and the feasibility of ST-SMC are validated using a Hardware in Loop (Typhoon HIL) 402 device for real-time testing [71]. The power and control structure of Figure 1 is drawn in PSIM version 9.1. The code composer studio 6.2.0 is used for debugging the code, which is automatically generated using PSIM 9.1 using the overall test bench setup presented in Figure 5. The TMS32F28335 DSP board from Texas Instruments is used for validation. The u-grid interface 2.0 board is used for interface among HIL (from Typhoon manufacturer) and the results are captured using Tektronix oscilloscope TPS 2024B. The system is tested for grid-connected mode under various normal and abnormal conditions in different scenarios.
Energies 2020, 13, x FOR PEER REVIEW 8 of 22 In Equation (13), = √ and = 1.1 . Where is a positive constant with sufficiently large values, its value is tuned by using the "trial and error" method until good performance in closedloop is achieved. The various values of controller constants are: = 30,000, = 600,000, and = 1.1 = 600,000, and = √ = √600,000. The control law in Equation (13), used in the controller design, is stable and its step by step analysis of stability is given in [68,69].

Hardware in Loop
Leading to the results very near to practical conditions, Hardware in Loop (HIL) for the design of converters and control in power electronics has been gradually identified as an effective tool [70]. In grid-connected inverters, the practical implementation of some tests is difficult due to the fact they require alterations in the grid conditions or filter or in the inverter; this can be easily executed in HIL. In this paper, the effectiveness and the feasibility of ST-SMC are validated using a Hardware in Loop (Typhoon HIL) 402 device for real-time testing [71]. The power and control structure of Figure 1 is drawn in PSIM version 9.1. The code composer studio 6.2.0 is used for debugging the code, which is automatically generated using PSIM 9.1 using the overall test bench setup presented in Figure 5. The TMS32F28335 DSP board from Texas Instruments is used for validation. The u-grid interface 2.0 board is used for interface among HIL (from Typhoon manufacturer) and the results are captured using Tektronix oscilloscope TPS 2024B. The system is tested for grid-connected mode under various normal and abnormal conditions in different scenarios. The voltage setting for channel 1, channel 2, and channel 3 are set 133.33 V/1 V division, while the current division is set for channel 1, channel 2, and channel 3 as 33.33 A/1 V. The voltage and currents sensor gains are set to ki = 0.03 and kv = 0.0075, correspondingly. Figure 6 presents a three-  The voltage setting for channel 1, channel 2, and channel 3 are set 133.33 V/1 V division, while the current division is set for channel 1, channel 2, and channel 3 as 33.33 A/1 V. The voltage and currents sensor gains are set to k i = 0.03 and k v = 0.0075, correspondingly. Figure 6 presents a three-phase output current during initialization from Pref = 0 to Pref = 10 kW and Qref = 0 kVAr. Phase A, B, C are represented by yellow, blue, and magenta colors, respectively. The current reference abruptly reaches to its reference value by injecting the required power without distortions. Figure 7 shows three-phase output current in steady-state for Pref = 10 kW and Qref = 0 kVAr. The currents are smooth and symmetrical. Figure 8 describes the voltage and current for phase A during Pref = 0 to Pref = 10 kW and Qref = 0. The green color shows the voltage and yellow color shows the current for phase "A." The current switches to its required value as soon as a step-in power is introduced, similar for Phase "B" and "C." Thus, active power is injected. The currents and voltages are in phase authenticating the efficient performance of SRF-PLL. Figure 9 depicts the voltage and current for phase B during Pref = 0 to Pref = 10 kW. Figure 10 illustrates the voltage and current for phase C during Pref = 0 to Pref = 10 kW. The starting transient is negligible validating the robust performance of ST-SMC. Figure 11 demonstrates three-phase currents during stopping from Pref = 10 to Pref = 0 kW. The inverter is turned off and stops injecting active and reactive power. The response is faster during this case. Figure 12 represents the voltage and current for phase A during Qref = 0 to Qref = 10 kVAr and Pref = 0. A phase shift is introduced indicating the injection of reactive power. Figure 13 signifies the steady state of Fig10. There is no oscillation and transients during steady-state operation. Figure 14 elaborates the voltage and current for phase B during Qref = 0 to Qref = 10 kVAr and Pref = 0. A phase shift is noticed, whenever a step in reactive power is introduced, thus injecting reactive power as well. Figure 15 discusses the voltage and current for phase A during Pref = 10 kW and the transition from Qref = 0 to Qref = 15 kVar. Before the injection of reactive power, the current and voltages are in phase as soon as a step-in reactive power is produced, a phase shift in current and voltage is noted.
Step A is clearly highlighted in red color. Similar is the case for phase "B" and "C." Figure 16 introduces the voltage and current for phase B during Pref = 10 kW and the transition from Qref = 0 to Qref = 15 kVar. Figure 17 expresses the voltage and current for phase C during Pref = 10 kW and the transition from Qref = 0 to Qref = 15 kVar. The designed controller shows less sensitivity towards the sudden disturbance. In short, the performance of the designed controller is faster, accurate, efficient, and robust when tested under various scenarios.
Energies 2020, 13, x FOR PEER REVIEW 9 of 22 smooth and symmetrical. Figure 8 describes the voltage and current for phase A during Pref = 0 to Pref = 10 kW and Qref = 0. The green color shows the voltage and yellow color shows the current for phase "A." The current switches to its required value as soon as a step-in power is introduced, similar for Phase "B" and "C." Thus, active power is injected. The currents and voltages are in phase authenticating the efficient performance of SRF-PLL. Figure 9 depicts the voltage and current for phase B during Pref = 0 to Pref = 10 kW. Figure 10 illustrates the voltage and current for phase C during Pref = 0 to Pref = 10 kW. The starting transient is negligible validating the robust performance of ST-SMC. Figure 11 demonstrates three-phase currents during stopping from Pref = 10 to Pref = 0 kW. The inverter is turned off and stops injecting active and reactive power. The response is faster during this case. Figure 12 represents the voltage and current for phase A during Qref = 0 to Qref = 10 kVAr and Pref = 0. A phase shift is introduced indicating the injection of reactive power. Figure 13 signifies the steady state of Fig10. There is no oscillation and transients during steady-state operation. Figure 14 elaborates the voltage and current for phase B during Qref = 0 to Qref = 10 kVAr and Pref = 0. A phase shift is noticed, whenever a step in reactive power is introduced, thus injecting reactive power as well. Figure 15 discusses the voltage and current for phase A during Pref = 10 kW and the transition from Qref = 0 to Qref = 15 kVar. Before the injection of reactive power, the current and voltages are in phase as soon as a step-in reactive power is produced, a phase shift in current and voltage is noted.
Step A is clearly highlighted in red color. Similar is the case for phase "B" and "C." Figure 16 introduces the voltage and current for phase B during Pref = 10 kW and the transition from Qref = 0 to Qref = 15 kVar. Figure 17 expresses the voltage and current for phase C during Pref = 10 kW and the transition from Qref = 0 to Qref = 15 kVar. The designed controller shows less sensitivity towards the sudden disturbance. In short, the performance of the designed controller is faster, accurate, efficient, and robust when tested under various scenarios.   . Three-phase current during a stop from Pref = 10 kW to Pref = 0 kW. Figure 11. Three-phase current during a stop from Pref = 10 kW to Pref = 0 kW.

Abnormal Conditions
The design system is subjected to various perturbations and non-ideal conditions, i.e., voltage sag, voltage swell, frequency variation, DC-link variation, inclusion of 5th harmonics during injection of active power, reactive power, both cases, etc. Figure 18 presents voltage and current for phase A during a drop in the grid voltage from 120 Vrms to 108 Vrms with Pref = 10 kW and Qref = 0 kVAr, clearly highlighted by arrows. A small transient is shown at the start, which is recovered abruptly. The response is faster and chatter-free. Figure 19 shows the voltage and current for phase A during an increase in the grid voltage from 108 Vrms to 120 Vrms with Pref = 10 kW and Qref = 0 kVAr. When the normal value of grid voltage has restored, the effect of the disturbance is negligible indicating the fault-tolerant behavior of ST-SMC. Figure 20 introduces voltage and current for phase A during f = 61 Hz, Pref = 10 kW, and Qref = 0 kVAr. The controller shows insensitivity to frequency variation. Figure 21 depicts voltage and current for phase A during the inclusion of oscillation in the DC-link voltage 38V at 120 Hz having Pref = 10 kW and Qref = 0. The DC-link variation has no effect on the current and voltage; the PLL works efficiently. The current and voltage are in phase and oscillation free. Figure 22 illustrates voltage and current for phase A during VDC = 380 V + 38 V at 120 Hz with Pref = 10 kW and Qref = 10 kVar. Due to the injection of reactive power, a phase shift is noticed in the current and voltage; moreover, there is no effect on the symmetry of waveforms validating the effectiveness of the design controller. Figure 23 portrays voltage and current for phase A during a swell in the grid voltage from 120 Vrms to 132 Vrms. A small transient shows the insertion

Abnormal Conditions
The design system is subjected to various perturbations and non-ideal conditions, i.e., voltage sag, voltage swell, frequency variation, DC-link variation, inclusion of 5th harmonics during injection of active power, reactive power, both cases, etc. Figure 18 presents voltage and current for phase A during a drop in the grid voltage from 120 Vrms to 108 Vrms with Pref = 10 kW and Qref = 0 kVAr, clearly highlighted by arrows. A small transient is shown at the start, which is recovered abruptly. The response is faster and chatter-free. Figure 19 shows the voltage and current for phase A during an increase in the grid voltage from 108 Vrms to 120 Vrms with Pref = 10 kW and Qref = 0 kVAr. When the normal value of grid voltage has restored, the effect of the disturbance is negligible indicating the fault-tolerant behavior of ST-SMC. Figure 20 introduces voltage and current for phase A during f = 61 Hz, Pref = 10 kW, and Qref = 0 kVAr. The controller shows insensitivity to frequency variation. Figure 21 depicts voltage and current for phase A during the inclusion of oscillation in the DC-link voltage 38V at 120 Hz having Pref = 10 kW and Qref = 0. The DC-link variation has no effect on the current and voltage; the PLL works efficiently. The current and voltage are in phase and oscillation free. Figure 22 illustrates voltage and current for phase A during V DC = 380 V + 38 V at 120 Hz with Pref = 10 kW and Qref = 10 kVar. Due to the injection of reactive power, a phase shift is noticed in the current and voltage; moreover, there is no effect on the symmetry of waveforms validating the effectiveness of the design controller. Figure 23 portrays voltage and current for phase A during a swell in the grid voltage from 120 Vrms to 132 Vrms. A small transient shows the insertion of the swell point out with double-headed arrow. The voltage and current are in the phase where the waveform is distortion free. Figure 24 describes voltage and current for phase A during inclusion of 3% of 5th harmonic in the grid voltage with 120 Vrms, Pref = 10 k, and Qref = 0. Figure 25 demonstrates voltage and current for phase A during the inclusion of 3% of 5th harmonic in the grid voltage (120 Vrms and Pref = 10 k Qref = 10 kvar). The above two Figures show the behavior of the currents and voltages during the inclusion of 5th harmonics. The injected currents have high quality under harmonic distortions, thus authenticating that the design control is reliable, efficient, and less insensitive to abnormal conditions and uncertainties.

Conclusions and Future Work
This paper successfully investigated the modeling and design of ST-SMC for efficiently injecting both active and reactive power under normal and abnormal operating conditions for a three-phase

Conclusions and Future Work
This paper successfully investigated the modeling and design of ST-SMC for efficiently injecting both active and reactive power under normal and abnormal operating conditions for a three-phase grid-connected PV system. The ST-SMC is analyzed and tested both under normal operation i.e., initialization, steady state behavior, dynamic behavior, and interrupting the injection of active and reactive power for normal operation as well as abnormal conditions, i.e., voltage sag, voltage swell, frequency variation, DC-link variation, inclusion of 5th harmonics, etc. The obtained finding shows that ST-SMC injects high-quality sinusoidal current with low THD, which is insensitive to a sudden disturbance, chatter-free, and fault-tolerant. The ST-SMC also ensures controllability, reliability, and safety for the interface with the utility grid. The HIL results authenticate the fastness, effectiveness, robustness, and stable operation for both steady-state and dynamic behavior of the designed controller.
In the near future, we will replace the simple inverter with a Modular Multilevel Inverter. Inserting an FRT strategy in compliance with modern grid code during symmetrical/asymmetrical faults and utilizing advance PLL is also one of direction. Moreover, a comparative assessment of advanced controller, i.e., H-infinity, Adaptive-SMC, Neuro-Fuzzy, etc., can also be performed. To further enhance the efficiency of the inverter, the silicon carbide (SiC) or gallium arsenide (GaN) devices will be used, instead of IGBT or MOSFET.