Fuzzy Logic Control for Low-Voltage Ride-Through Single-Phase Grid-Connected PV Inverter

This paper presents a control scheme for a photovoltaic (PV) system that uses a single-phase grid-connected inverter with low-voltage ride-through (LVRT) capability. In this scheme, two PI regulators are used to adjust the power angle and voltage modulation index of the inverter; therefore, controlling the inverter’s active and reactive output power, respectively. A fuzzy logic controller (FLC) is also implemented to manage the inverter’s operation during the LVRT operation. The FLC adjusts (or de-rates) the inverter’s reference active and reactive power commands based on the grid voltage sag and the power available from the PV system. Therefore, the inverter operation has been divided into two modes: (i) Maximum power point tracking (MPPT) during the normal operating conditions of the grid, and (ii) LVRT support when the grid is operating under faulty conditions. In the LVRT mode, the de-rating of the inverter active output power allows for injection of some reactive power, hence providing voltage support to the grid and enhancing the utilization factor of the inverter’s capacity. The proposed system was modelled and simulated using MATLAB Simulink. The simulation results showed good system performance in response to changes in reference power command, and in adjusting the amount of active and reactive power injected into the grid.


Introduction
Distributed generation (DG) systems are gaining global interest as a result of environmental concerns, increase in fuel cost, political reasons, and economic impact. Renewable energy sources accounted for 17.5% of the global energy consumption in 2016 [1]. Among the various DG systems, solar PV energy is considered one of the most popular renewable energy sources. It is a clean form of energy, inexhaustible, requires little maintenance, offers flexibility of installation, and its cost is decreasing [2,3]. Solar PV generation increased 31% in 2018 and represented the largest absolute generation growth (+136 TWh) of all renewable technologies, slightly ahead of wind and hydropower [4]. For power output below 10 kW; single-phase voltage source inverter (VSI) configuration is found to be one of the preferable methods for interfacing and integrating small ratings PV system to the grid [5][6][7].
Although the integration of single-phase PV systems with the grid has its advantages, the widespread use of PV systems poses more challenging issues for distribution system operators and the entire grid [8]. One of the important drawbacks of a grid-tied PV system is the existence of an inverter as interface between the PV system and the grid. This leads to many problems: safety, efficiency, stability (voltage and frequency), increased level of harmonics, and poor power factor of the entire system [9,10]. To minimize the effects of grid-connected PV systems, specific grid requirements regarding the penetration of grid-connected PV systems in low voltage networks have been put forward, Figure 1 shows the block diagram of the system presented in this research work. The single-phase inverter in Figure 1 operates with unipolar PWM switching strategy, and is supplied from a constant DC voltage source that emulates the output from a boost DC converter. An LC filter is connected between the inverter and the utility grid equivalent model to maintain total harmonic distortion within acceptable limits. The measured signals that are required in the proposed control scheme are shown as inputs to inverter power management system (IPMS). The role of the IPMS unit is to operate on the measured signals and perform the required calculations to determine the commanded power angle and voltage modulation index to be used in controlling the inverter. A more detailed explanation about the building blocks of the IPMS is given in the following subsections.
Energies 2019, 12, x FOR PEER REVIEW 3 of 19 Figure 1 shows the block diagram of the system presented in this research work. The singlephase inverter in Figure 1 operates with unipolar PWM switching strategy, and is supplied from a constant DC voltage source that emulates the output from a boost DC converter. An LC filter is connected between the inverter and the utility grid equivalent model to maintain total harmonic distortion within acceptable limits. The measured signals that are required in the proposed control scheme are shown as inputs to inverter power management system (IPMS). The role of the IPMS unit is to operate on the measured signals and perform the required calculations to determine the commanded power angle and voltage modulation index to be used in controlling the inverter. A more detailed explanation about the building blocks of the IPMS is given in the following subsections.

PLL and MHDC
The phase locked loop (PLL) and multiple-harmonic decoupling cell (MHDC) are implemented to estimate the phase angle of the grid and filter the higher order components in the measured signals, respectively. The design details of the PLL and MHDC units can be obtained from the work presented in [21][22]. The output from these units is used to transform the measured voltage and current signals to the DQ reference frame to facilitate operating on them in a manner similar to DC signals.

Fuzzy Logic and PQ Calculator
The voltage support requirements as in Figure 2 (usually used in wind-turbines applications) were considered in determining the required level of reactive power injection [15,23]. Voltage support requirements specify the amount of reactive power supplied to the grid for supporting the voltage recovery according to the depth of the voltage sag. For example, from Figure 2, it can be seen that no reactive power injection is required as long as the grid voltage stays in the dead-band region (i.e., 0.9 ≤ ≤ 1.1 ). On the other hand, if the grid voltage drops below 90% of the nominal value, reactive power injection is required according to Equation (1), as given in [8]: (1) Figure 1. Structure of the proposed single-phase grid connected PV system.

PLL and MHDC
The phase locked loop (PLL) and multiple-harmonic decoupling cell (MHDC) are implemented to estimate the phase angle of the grid and filter the higher order components in the measured signals, respectively. The design details of the PLL and MHDC units can be obtained from the work presented in [21,22]. The output from these units is used to transform the measured voltage and current signals to the DQ reference frame to facilitate operating on them in a manner similar to DC signals.

Fuzzy Logic and PQ Calculator
The voltage support requirements as in Figure 2 (usually used in wind-turbines applications) were considered in determining the required level of reactive power injection [15,23]. Voltage support requirements specify the amount of reactive power supplied to the grid for supporting the voltage recovery according to the depth of the voltage sag. For example, from Figure 2, it can be seen that no reactive power injection is required as long as the grid voltage stays in the dead-band region (i.e., 0.9V N ≤ V g ≤ 1.1V N ). On the other hand, if the grid voltage drops below 90% of the nominal value, reactive power injection is required according to Equation (1), as given in [8]: where I q is the reactive current, I N is the rated current, and V g is the grid voltage in per unit. The second function of the PQ calculator is to reset the reference real power of the inverter to zero whenever the voltage sag drops below 50% of its nominal value. Voltage support requirements under grid faults for wind turbines [15,23]. are grid nominal voltage and current, are the voltage and reactive current before failure, and are the instantaneous voltage and reactive current.

Power Angle (δ) Regulator
With reference to Figure 4, the active power supplied to the grid in steady state (with inductor resistances ignored) can be given as: It is worth mentioning that reactive power injection requirements during LVRT differ from one country to another. For example, the reactive current requirements in the Chinese grid [24] specify different compensation levels and has different boundaries when compared to Equation (1) as in German grid requirements. For German grid, a voltage sag at or below 50% requires 100% reactive power compensation (i.e., I q = I N ). In contrast, for the Chinese grid, a voltage sag of 50% requires 60% reactive power compensation (i.e., I q = 0.6I N ) and for a voltage sag of 80% and below the reactive power requirement is at 105% (i.e., I q = 1.05I N ).
A FLC controller is configured to estimate the PF at which the active and reactive power are injected into the grid. The FLC has two inputs; one is the magnitude of the voltage at the PCC, and the second input is the power level available from the PV system. The FLC is implemented with the objective to enhance the reactive power injection by minimizing the inverter's maximum current limitation. For an inverter to support the LVRT operation, as explained above, the minimum value of its predesigned current rating (I max ) should be at least at 2.25I N in the constant average active power strategy [8]. However, in a PV system, the amount of active power delivered by the inverter depends on the level of the solar irradiation, and thus the full capacity of the inverter may not be utilized at all times; hence, the utilization factor of the inverter becomes very low.
The proposed FLC examines how severe the voltage sag is, and the level of real power available from the PV system to decide the level of reactive power injection and the de-rating of the inverter power by adjusting the inverters PF angle. For example, if the voltage sag is small and PV power is high, then PF angle is small. On the other hand, for the small voltage sag and low PV power, the PF angle will be large (i.e., all the inverter capacity will be dedicated to the reactive power injection).
The implemented FLC is characterized by having five membership functions for each input, 25 rules with Mamdani fuzzy inferencing system (FIS), and a defuzzification method that uses the Largest of Maximum method (LOM). The voltage support requirements, and level of available power from the PV influenced the design of the inputs and output membership functions, as depicted in Figure 3 and fuzzy rules as in Table 1. Although it is not addressed in this paper, in Figure 3, the range of the voltage input membership extends above 1.1, which represents the operation when the inverter is required to absorb reactive power in case the grid voltage experiences an over voltage.

Voltage Drop
Voltage Rise -100% Figure 2. Voltage support requirements under grid faults for wind turbines [15,23]. are grid nominal voltage and current, are the voltage and reactive current before failure, and are the instantaneous voltage and reactive current.

Power Angle (δ) Regulator
With reference to Figure 4, the active power supplied to the grid in steady state (with inductor resistances ignored) can be given as:   In addition to the FLC, a PQ calculator is implemented in this work to perform two main functions: it firstly monitors the commanded power to the inverter and ensures that it does not exceed the rated capacity of the inverter without de-rating the real power and using the FLC recommended reactive power injection. If the output exceeds the rated KVA capacity of the inverter, the PQ calculator will de-rate the output real power according to Equation (2): where, S r is the rated KVA of the inverter, P * in and Q * in are the inverter commanded active and reactive power, respectively.
The second function of the PQ calculator is to reset the reference real power of the inverter to zero whenever the voltage sag drops below 50% of its nominal value.

Power Angle (δ) Regulator
With reference to Figure 4, the active power supplied to the grid in steady state (with inductor resistances ignored) can be given as: where V i and V g are, respectively, the peak voltage of inverter and grid, X t is the reactance of the line inductance, δ is the power angle and for small δ, sin(δ) ≈ δ.
where are, respectively, the peak voltage of inverter and grid, is the reactance of the line inductance, is the power angle and for small , sin( ) ≈ . A PI regulator is implemented as in Figure 5 to control the power angle of the inverter and hence the real power to be injected into the grid. The PI controller operates on the error between the reference power ( * ) obtained from the PQ calculator, and inverter DC-link current ( ). The DClink current, is measured, filtered, and regulated to track the reference power command by controlling the power angle ( ) of the PWM command signal. The regulation scheme is shown in Figure 5.  In this regulation scheme, it is assumed that the inverter is lossless [15,25]; thus, the instantaneous power balance at both sides of the inverter can be expressed as in Equation (4): using the space vector representation of the circuit in Figure 4, Equation (4) can be written as [8]: where, , and , are the D and Q components of the inverter space vector output voltage and current, respectively.
The state space equations of the inverter voltages and currents in the DQ reference frame can be expressed as: where = / (is the differential operator). The DQ components can then be obtained as: and, In Equations (7) and (8), if the grid is assumed constant (voltage and frequency), and the inverter voltage is sinusoidal, then the grid and inverter voltages become: * * ( * ) PI -+ A PI regulator is implemented as in Figure 5 to control the power angle of the inverter and hence the real power to be injected into the grid. The PI controller operates on the error between the reference power (P * in ) obtained from the PQ calculator, and inverter DC-link current (i DC ). The DC-link current, is measured, filtered, and regulated to track the reference power command by controlling the power angle (δ) of the PWM command signal. The regulation scheme is shown in Figure 5. where are, respectively, the peak voltage of inverter and grid, is the reactance of the line inductance, is the power angle and for small , sin( ) ≈ . A PI regulator is implemented as in Figure 5 to control the power angle of the inverter and hence the real power to be injected into the grid. The PI controller operates on the error between the reference power ( * ) obtained from the PQ calculator, and inverter DC-link current ( ). The DClink current, is measured, filtered, and regulated to track the reference power command by controlling the power angle ( ) of the PWM command signal. The regulation scheme is shown in Figure 5.  In this regulation scheme, it is assumed that the inverter is lossless [15,25]; thus, the instantaneous power balance at both sides of the inverter can be expressed as in Equation (4): using the space vector representation of the circuit in Figure 4, Equation (4) can be written as [8]: where, , and , are the D and Q components of the inverter space vector output voltage and current, respectively.
The state space equations of the inverter voltages and currents in the DQ reference frame can be expressed as: where = / (is the differential operator). The DQ components can then be obtained as: and, In Equations (7) and (8), if the grid is assumed constant (voltage and frequency), and the inverter voltage is sinusoidal, then the grid and inverter voltages become: * * ( * ) PI -+ In this regulation scheme, it is assumed that the inverter is lossless [15,25]; thus, the instantaneous power balance at both sides of the inverter can be expressed as in Equation (4): using the space vector representation of the circuit in Figure 4, Equation (4) can be written as [8]: where, v iD , v iQ and i iD , i iQ are the D and Q components of the inverter space vector output voltage and current, respectively. The state space equations of the inverter voltages and currents in the DQ reference frame can be expressed as: where ρ = d/dt (is the differential operator). The DQ components can then be obtained as: and, v iQ (t) = v gQ (t) + ρL t + r g i iQ (t) + ωL t i iD (t) In Equations (7) and (8), if the grid is assumed constant (voltage and frequency), and the inverter voltage is sinusoidal, then the grid and inverter voltages become: and for the inverter, v iD (t) = V i cos(δ(t)) and, v iQ (t) = V i sin(δ(t)) Equations (9) and (10) can be linearized around an operating point and used together with Equations (5), (7), and (8) to find a reduced linear model of the inverter-grid system. This linear model relates the change of the power angle and the DC-link current. Linearizing around δ o : similarly, the quadrature component can be written as, Also, Equations (7) and (8) can be written in linear form as: and, ∆v iQ (t) = ρL t + r g ∆i iQ (t) + ωL t ∆i iD (t) If V DC (t) is assumed constant, then from Equation (4), the change in the DC-link current around the operating point for a change in the power angle can be written as: Therefore, the response of the DC-link current to change in the power angle can be obtained by Equation (16); and the transfer function can be written as: where K = ωV 2 io 2V DC L t and it depends on the inverter parameters.

Reactive Power Regulation
The reactive power flow between the inverter and the grid is controlled by regulating the inverter's output voltage at the PCC. Similar to the discussion in Section 2.3, if the inverter's power angle is small, the reactive power into the grid system can be given as: From Equation (18), it can be seen that in steady state, the reactive power flow is related to the difference between the inverter and the grid voltages. The reactive power regulation scheme is carried out by controlling the quadrature component of the inverter current (i iQ ). The current i iQ is regulated to track a reference value that is calculated based on the grid reactive power demand (Q * i ). The PI controller in Figure 6 will continuously regulate the inverter's output voltage by adjusting the voltage modulation index based on the reactive power command. Following the same procedure as in Section 2.3, and linearizing and simplifying the equations, the response of the inverter's reactive power to change in the inverter's output voltage can be written as: where = and it depends on the inverter parameters.
The proportional and integral gains of the PI controllers were obtained by using the PI tuner facility in Simulink. However, to optimize the actual system response, the gains were fine-tuned and readjusted manually around the Simulink values.

Simulation Results and Discussion
To examine the effectiveness of the proposed system, a simulation study was carried out using Simulink from MATLAB. The simulation cases were grouped to represent two conditions: Case (1), the day mode, and Case (2), the cloudy and night mode. The parameters and specifications of the system under investigation are given in Table 2.

Case I: Daytime Operation
The daytime operation corresponds to the situation when the PV system is supplying maximum real power to the grid, i.e., the inverter full capacity is utilized to supply real power. Under this scenario, the grid voltage is stepped down to 75%, 50%, and 10% The simulation results in Figures 7a,b,c show the output power (P, and Q), voltage and current (V, and I), and power factor, respectively. At time t = 0.3 s, the grid voltage dropped to 75% of the nominal value and the drop lasted until t = 0.6 s. The simulation results show that the active power injected into the grid was de-rated below the operating value to allow injection of reactive power, and hence supporting the grid voltage. From Figure 7c, PF is calculated by the FLC at 0.86, and hence the de-rated power is obtained as 1722 (= 2000 × 0.86) W, and the reactive power at the 230 V level is 1016 (= 762/0.75) Vars. Figure 7b shows the voltage and current signals during and outside the voltage sag region. It can be observed that the current leads the voltage during the voltage sag, and is in phase with it during normal operation. This indicates reactive power flow from the inverter during the sag and unity PF operation outside the sag region.
It was also observed that during the voltage sag, the inverter current increased to 16.1 A (peak). Following the same procedure as in Section 2.3, and linearizing and simplifying the equations, the response of the inverter's reactive power to change in the inverter's output voltage can be written as: where K 1 = ωV io L t and it depends on the inverter parameters. The proportional and integral gains of the PI controllers were obtained by using the PI tuner facility in Simulink. However, to optimize the actual system response, the gains were fine-tuned and readjusted manually around the Simulink values.

Simulation Results and Discussion
To examine the effectiveness of the proposed system, a simulation study was carried out using Simulink from MATLAB. The simulation cases were grouped to represent two conditions: Case (1), the day mode, and Case (2), the cloudy and night mode. The parameters and specifications of the system under investigation are given in Table 2.

Case I: Daytime Operation
The daytime operation corresponds to the situation when the PV system is supplying maximum real power to the grid, i.e., the inverter full capacity is utilized to supply real power. Under this scenario, the grid voltage is stepped down to 75%, 50%, and 10%.
The simulation results in Figure 7a-c show the output power (P, and Q), voltage and current (V, and I), and power factor, respectively. At time t = 0.3 s, the grid voltage dropped to 75% of the nominal value and the drop lasted until t = 0.6 s. The simulation results show that the active power injected into the grid was de-rated below the operating value to allow injection of reactive power, and hence supporting the grid voltage. From Figure 7c, PF is calculated by the FLC at 0.86, and hence the de-rated power is obtained as 1722 (= 2000 × 0.86) W, and the reactive power at the 230 V level is 1016 (= 762/0.75) Vars. Figure 7b shows the voltage and current signals during and outside the voltage sag region. It can be observed that the current leads the voltage during the voltage sag, and is in phase with it during normal operation. This indicates reactive power flow from the inverter during the sag and unity PF operation outside the sag region.
It was also observed that during the voltage sag, the inverter current increased to 16.1 A (peak). The increase in current is logical since the inverter has to supply this current at the PCC, which is 75% of the nominal value. This value of the current is about 1.3 × I rated which is well below the 2.25 × I rated criteria quoted earlier for constant average active power scheme.    Figure 7, but this time, the voltage level was set to 50%. The simulation results show that the active power injected into the grid has been de-rated to zero value, allowing maximum injection of reactive power, and thus providing support to the grid voltage. The FLC reduced the PF from unity to zero (i.e., the current leads the voltage by 90 • ) as in Figure 8c. In this simulation case, it can be seen that the full capacity of the inverter was utilized to supply reactive power to the grid during the voltage sag. Again, from Figure 8a, the reactive power is at approximately 1000 Vars, which is supplied at 50% voltage sag, thus, at nominal voltage level, this corresponds to (1000/0.5 =) 2000 Vars. The current and voltage signals in Figure 8b are 90 • out of phase during the voltage sag, and are in phase during the normal mode of operation. Figures 8a,b,c show the simulation results when the system is running under the same operating conditions, as in Figure 7, but this time, the voltage level was set to 50%. The simulation results show that the active power injected into the grid has been de-rated to zero value, allowing maximum injection of reactive power, and thus providing support to the grid voltage. The FLC reduced the PF from unity to zero (i.e., the current leads the voltage by 90 o ) as in Figure 8c. In this simulation case, it can be seen that the full capacity of the inverter was utilized to supply reactive power to the grid during the voltage sag. Again, from Figure 8a, the reactive power is at approximately 1000 Vars, which is supplied at 50% voltage sag, thus, at nominal voltage level, this corresponds to (1000/0.5 =) 2000 Vars. The current and voltage signals in Figure 8b are 90 o out of phase during the voltage sag, and are in phase during the normal mode of operation.  In Figure 9, the system is examined during a severe voltage sag condition at 10% of the nominal voltage. The active power was de-rated to zero and full reactive power injection was achieved as shown in Figure 9a. This is evident, as well, from the current signal in Figure 9b. The current is at a rated level and leads the voltage by 90 o . The results conform with the results in [25] for zero-voltage ride-through, and with the statement quoted in [8]: "When severe voltage fault happens, the PV system should inject full reactive power without delivering active power to the grid". Figure 9c shows the PF has been reduced to zero during the voltage sag. In Figure 9, the system is examined during a severe voltage sag condition at 10% of the nominal voltage. The active power was de-rated to zero and full reactive power injection was achieved as shown in Figure 9a. This is evident, as well, from the current signal in Figure 9b. The current is at a rated level and leads the voltage by 90 • . The results conform with the results in [25] for zero-voltage ride-through, and with the statement quoted in [8]: "When severe voltage fault happens, the PV system should inject full reactive power without delivering active power to the grid". Figure 9c shows the PF has been reduced to zero during the voltage sag. In Figure 9, the system is examined during a severe voltage sag condition at 10% of the nominal voltage. The active power was de-rated to zero and full reactive power injection was achieved as shown in Figure 9a. This is evident, as well, from the current signal in Figure 9b. The current is at a rated level and leads the voltage by 90 o . The results conform with the results in [25] for zero-voltage ride-through, and with the statement quoted in [8]: "When severe voltage fault happens, the PV system should inject full reactive power without delivering active power to the grid". Figure 9c shows the PF has been reduced to zero during the voltage sag. (a)

Case II: Cloudy and Nighttime Operation
In this mode of operation, two scenarios are addressed: the first, when the input power from the PV system is at 40%, to resemble a cloudy day operation; and the second when PV power is at 0% representing (nighttime).
For the cloudy day operation, only the case of the 25% voltage sag (75% rated voltage) is shown in Figure 10. The obtained results in Figures 10a show that the active power remained constant at approximately 800 W (during and outside the voltage sag region). This means no de-rating of the power occurred since the inverter has only 40% of its capacity being utilized. Therefore, the FLC sets the PF at 0.75, slightly lower when compared to the daytime case (PF = 0.86), which allows for more of the inverter capacity to be used for reactive power compensation. In addition, the reactive power remained at approximately 1000 Vars during the 0.75 p.u. voltage level, which corresponds to 2000 × sin (41.4 ) Vars. Figure 10b,c show, respectively, the voltage and current, and the PF as estimated by the FLC. Again, it was observed that the current outside the sag region stayed close to 5.5 A (peak) and in phase with the voltage corresponding to 800 W. During the voltage sag, the current increased to 10.5

Case II: Cloudy and Nighttime Operation
In this mode of operation, two scenarios are addressed: the first, when the input power from the PV system is at 40%, to resemble a cloudy day operation; and the second when PV power is at 0% representing (nighttime).
For the cloudy day operation, only the case of the 25% voltage sag (75% rated voltage) is shown in Figure 10. The obtained results in Figure 10a show that the active power remained constant at approximately 800 W (during and outside the voltage sag region). This means no de-rating of the power occurred since the inverter has only 40% of its capacity being utilized. Therefore, the FLC sets the PF at 0.75, slightly lower when compared to the daytime case (PF = 0.86), which allows for more of the inverter capacity to be used for reactive power compensation. In addition, the reactive power remained at approximately 1000 Vars during the 0.75 p.u. voltage level, which corresponds to 2000 × sin(41.4 o ) Vars.
simulation results show that zero active power is injected into the grid before and after the voltage sag. On the other hand, the inverter's reactive power changed from zero to approximately 100% of the rated capacity corresponding to rated current flowing into the grid at 90 o leading. Note that reactive power level, in all three cases, is reduced in proportion to the voltage sag, thus allowing close to rated current flow. For example, for 90% voltage sag, the reactive power is very low, since this condition resembles an approximate short circuit condition at the grid side.   Figure 10b,c show, respectively, the voltage and current, and the PF as estimated by the FLC. Again, it was observed that the current outside the sag region stayed close to 5.5 A (peak) and in phase with the voltage corresponding to 800 W. During the voltage sag, the current increased to 10.5 A (peak). This current is made up of an active component of 6.5 A (peak), which corresponds to 800W, and a reactive current of 8.2 A (peak) that corresponds to 1000 Vars, both being delivered to the grid at V g = 0.75 × V rated . Note again, that the FLC calculated PF was used to set the reactive power without affecting (de-rating) the real power; hence, the actual power factor of the inverter is cos tan −1 8.2 6.5 = 0.62 leading. Figures 11-13, show, respectively, the night mode results when the grid voltage is at 75%, 50%, and 10% of grid's nominal voltage value (i.e., voltage sag depth of 25%, 50%, and 90%). Again, simulation results show that zero active power is injected into the grid before and after the voltage sag. On the other hand, the inverter's reactive power changed from zero to approximately 100% of the rated capacity corresponding to rated current flowing into the grid at 90 • leading. Note that reactive power level, in all three cases, is reduced in proportion to the voltage sag, thus allowing close to rated current flow. For example, for 90% voltage sag, the reactive power is very low, since this condition resembles an approximate short circuit condition at the grid side.

Conclusions
In this paper, active and reactive power injection for single-phase grid-connected PV system with LVRT capability was explored. Two PI controller and a FLC were used to control the operation of the inverter during normal and faulty operations of the grid-connected inverter. The PI regulators were tasked to regulate the active and reactive power flow according to MPPT settings. However, during faulty operation of the grid, when a voltage sag is detected, the FLC is tasked to recommend a PF for the inverter operation based on the available capacity of the inverter and the voltage sag level. For severe voltage sag levels, the full capacity of the inverter is dedicated to the reactive power compensation and real power is de-rated to zero. On the other hand, whenever a voltage sag of moderate level is detected, the FLC will also use the level of the PV system power; if it is low, the recommended PF value will also be low.
In addition, a PQ calculator was implemented to perform a check to ensure that the inverter's maximum capacity is always not exceeded. If the capacity is exceeded, the real power will be derated using the same PF value obtained from the FLC.
The proposed control scheme showed good performance in terms of accurate control of power flow into grid, detection of voltage sags, and injection of real and reactive power at a selected power factor without exceeding the inverter's capacity. Further improvements in future studies can include examining alternative types of controllers and methodologies to enhance the transient response of the system, namely the overshoot in active and reactive power responses.

Conclusions
In this paper, active and reactive power injection for single-phase grid-connected PV system with LVRT capability was explored. Two PI controller and a FLC were used to control the operation of the inverter during normal and faulty operations of the grid-connected inverter. The PI regulators were tasked to regulate the active and reactive power flow according to MPPT settings. However, during faulty operation of the grid, when a voltage sag is detected, the FLC is tasked to recommend a PF for the inverter operation based on the available capacity of the inverter and the voltage sag level. For severe voltage sag levels, the full capacity of the inverter is dedicated to the reactive power compensation and real power is de-rated to zero. On the other hand, whenever a voltage sag of moderate level is detected, the FLC will also use the level of the PV system power; if it is low, the recommended PF value will also be low.
In addition, a PQ calculator was implemented to perform a check to ensure that the inverter's maximum capacity is always not exceeded. If the capacity is exceeded, the real power will be de-rated using the same PF value obtained from the FLC.
The proposed control scheme showed good performance in terms of accurate control of power flow into grid, detection of voltage sags, and injection of real and reactive power at a selected power factor without exceeding the inverter's capacity. Further improvements in future studies can include examining alternative types of controllers and methodologies to enhance the transient response of the system, namely the overshoot in active and reactive power responses.