Fuzzy logic control of active and reactive power for a grid-connected photovoltaic system using a three-level neutral-point-clamped inverter

ABSTRACT


INTRODUCTION
Photovoltaic energy is now recognized as one of the promising renewable energy sources that can ensure energy transition in the future. Photovoltaic energy is known to be safe, pollution-free and does not require expensive maintenance, such as fossil fuels [1].
Large photovoltaic systems are now connected to the utility grid and contribute to the growing demand for electrical energy [2]. To ensure maximum transmission of electrical energy, the photovoltaic (PV) system must maintain the PV array to operate at its maximum power point (MPP).
Moreover, the grid-connected PV system must be highly controlled to guarantee the security and reliability of the power system [3]. Active and reactive control is a crucial task to maintain the stability of the power system network. Therefore, the renewable energy sources connected to the electrical utility must be well controlled to avoid any instability of the power flow [4]. During the last decades, many studies have been carried out to improve active and reactive power control of grid-connected PV systems. Recently, Laagoubi et. al. [5] proposed active and reactive power control strategy of PV grid-connected system based on two fuzzy logic controllers. The first one for MPPT and the second one for active and reactive currents. The main weakness of the proposed strategy is that the system is not sensitive to change in a local load connected to the AC side. Nagaraja Rao et. al. [6] developed a control strategy applied to a PV gridconnected system using a multilevel inverter. In the proposed strategy the active and reactive currents of the AC side are not measured. Therefore, the stability and reliability of the power system cannot be guaranteed especially when changes occurred in the weather parameters. Ameerul et. al. [7] proposed a nonlinear control of a PV grid-connected system that uses instantaneous active and reactive power components as dynamic variables. The method has some advantages to the aforementioned methods but in a presence of a three-phase fault, the system exhibits a high voltage peak at the AC side. However, active and reactive power control is a critical task in power management for the power system. Usually, electrical companies guarantee an active power flow for industrial users with mandatory that users must control reactive power in the AC side. Any deficit in reactive power will have a great impact on the voltage profile and power system reliability [8]- [12].
In this paper, fuzzy logic controllers (FLCs) for active and reactive power are proposed. The goal of the proposed control strategy is to transfer the active power generated by a PV array to the grid utility with a unity power factor. The control strategy design is based on calculating the instantaneous active and reactive power from the measured grid voltages and currents; therefore, the control system gives dynamic robustness performance against a sudden change in reactive power and satisfactory active power tracking under rapid solar radiation changes. Under a simulation study with Matlab Simulink Simpowersystems toolbox, it can be noticed that the proposed fuzzy logic control (FLC) strategy has a fast dynamic performance response compared to conventional PI control.

RESEARCH METHOD 2.1. Main structure of grid-connected PV system
The grid-connected PV system is shown in Figure 1. It consists of a PV array rated to 80 kW and composed of 40 parallel and 10 series-connected Kyocera solar KC200GT modules. The parameters of the Kyocera solar KC200GT module are taken as given by the manufacturer [13]. Perturb and observed (P&O) based MPPT control strategy is implemented using a boost DC-DC converter to maintain the PV array to operate at its maximum power point. The (P&O) method used in this work is as studied in previous work [14]- [16]. A three-level neutral point clamped inverter (3L-NPC) is connected to the grid utility through an LCL filter to enhance the AC power flow quality. A local reactive load is connected to the grid which can be changed from 10 kVAR inductive mode to 10 kVAR capacitive mode and vice versa. The local reactive load is used to check the reactive control capability of the system to provide a unity power factor at the AC bus bar. The instantaneous active and reactive power flowing to the AC grid are calculated as given by (1) and (2): Where: v gd , v gq : AC grid utility side voltage in dq frame. i gd , i gq : active and reactive current in dq frame. Taking into account that the d axis is definitely aligned with the grid voltage which means that v gq = 0, the currents in the dq frame are calculated as (3) and (4) [17], [18]: As shown in Figure 2, the active and reactive power control provides as output the active and reactive currents setpoints used in the decoupled current control. The output power generated by the PV array is taken as the active power reference while the reference reactive power is set to zero. Therefore, the active power generated by the PV array is completely transferred to the AC grid  The mathematical model of the currents flowing from the inverter to the grid utility is given by (5). where: = + and = + R s , L s : grid side resistor and inductor. R f , L f : 3L-NPC side resistor and inductor.
The matrix model as shown in equation (5) exhibits cross-coupling terms and , and have feed-forward terms and . For efficient control, the two current components must be decoupled.

Decoupled PI control design
In the last decades, LCL filters were extensively used in a grid-connected PV system due to their capability to attenuate harmonics and provide high power quality [19], [20]. The LCL filter is an essential device to eliminate harmonics contents present in inverter output currents. It is calculated taking into account the power rating of the inverter, the switching frequency, and the grid frequency. The effect of damping can obstruct resonance problems passively or actively. The power rating of the inverter, the switching frequency, and the grid frequency are essential as inputs for selecting the LCL filter parameters.
Since the equations above, the transfer function of the open-loop current control for the system can be given as (6): Where: Kp and Ki are the PI controller parameters.  is the time delay due to the PWM calculation and computation needed in digital control.
Tuning of PI gain parameters is justified by (7): Thus, the transfer function of the closed-loop current control for the system can be shown as (8): The closed-loop current control transfer function in a second-order general form system is (9): By identifying equation (8) to equation (9), the PI controller parameters are found to be: The proportional and integral gains of the PI controller are calculated from the equations above. The damping coefficient was proposed to be 0.7071 and  was approximated to be 0.001 s:

Model of PQ FLC controller
The FLC compared to other conventional control techniques does not require prior knowledge of the mathematical model of the system. On the other hand, this artificial intelligence control strategy needs a set of rules based essentially on the knowledge of the operator manipulating the system [21]. The description of the fuzzy controller shows that the significant quantities for the control are the error and the change of error of the active and reactive power. The active power reference P * is supplied by the PV array and the reactive power reference Q * is set to zero. For the inputs of the fuzzy logic controller, we will adopt the two characteristics parameters noted as E and E  . The basic technique of FLC is an association of the following three processes: fuzzification, fuzzy inference, and defuzzification [22].
The fuzzy logic control diagram is presented in Figure 3. It is composed of four blocks which are explained as follow: -The normalization factors are associated with the error E , its variation E  , and the variation of the variable control . -The block of Fuzzification of the error and its variation.  Tahri) 457 -The rules of the fuzzy logic controller.
-The defuzzification block is used to convert the fuzzy control variation to a numerical value [23]. Figure 3. The scheme of a fuzzy controller.

Design of PQ Fuzzy control
The PQ fuzzy logic control diagram is depicted in Figure 4.    Figure 5.

Fuzzy inference:
The MFs are combined with the control rules to get the control output. The fundamental part of this step is the fuzzy control rules, which are related directly to a human being's expertise. However, in Table 1, 49 fuzzy rules for error and change of error are selected according to the Mamdani method [24], [25].

Defuzzification:
The defuzzification operation allows us to calculate from the fuzzy inference the real value of the output variable. After that, this output value is converted into numerical value to be applied to the process. Four defuzzification strategies are commonly used: the maximum method, the average maximum method, the center of gravity (centroid) method, and the weighted height method.
The center of gravity also known as a centroid method is the most commonly used method in the fields of fuzzy controllers. This method calculates the center of gravity of the resulting membership function µ(x). The abscissa of the center of gravity ΔU is determined using (3).
where: s : the domain of the membership function.
x: the degree of membership functions. The integral of the denominator gives the surface, while the integral of the numerator corresponds to the moment of the surface.

SIMULATION RESULTS
To compare the performance of the FLC strategy to the conventional PI control, a set of simulation test cases has been done using MATLAB\Simulink environment. The simulation parameters of the system are given in the simulation parameters ix. Figure 6 shows the output current, voltage, and power of PV array using perturb and observe MPPT technique. A rapid step changes are applied to irradiance starting with 1000 (W\m 2 ) from 0 to 0.3 s, 500 (W\m 2 ) from 0.3 to 0.6 s and ending to 1000 (W\m 2 ) from 0.6 to 0.9 s.
The PQ FLC and PI control are depicted in Figure 7. It can be seen that the active power response controlled by the fuzzy logic controller follows the active power reference generated by the PV array better than the one controlled by the PI controller. It can be also noticed that the reactive power controlled by the fuzzy logic controller tracks the reference seted to zero with a fast transient response compared to the one controlled by the PI controller. Therefore, the total active power supplied by the PV array is transferred to AC grid with unity power factor. Figure 8 shows the responses of active current and its reference using the two control strategies. It is clear that the PQ FLC technique has a better dynamic performance and more sensitive to a sudden change in irradiance compared to the PQ PI control strategy.
The reactive current and its reference responses are depicted in Figure 9. The reactive current controlled by fuzzy logic controller has a faster response and it is more sensitive to a sudden change in irradiance compared to the one controlled by PI controller. It can be noticed that the reactive current always after a short transient state returns to zero. Figures 10 and 11 show load current and voltage waveforms on the top and the grid current and voltage waveforms on the bottom controlled by PQ PI and PQ FLC controllers respectively. These waveforms are obtained with a change of local load from inductive mode to capacitive mode at 0.15 s. It can be seen that the grid current is always in phase with the grid voltage. However, the power factor is improved and always equal to unity. The proposed fuzzy logic control approach allows the PV grid-connected system to transfer the total active power generated by the PV array with compensating the reactive power.

CONCLUSION
In this paper, fuzzy logic control of active and reactive power for a grid-connected photovoltaic system using a three-level neutral-point-clamped inverter (3L-NPC) is presented. The three-level neutral point clamped inverter has been used with an LCL filter to minimize harmonics contents and improve current and voltage waveshaping. The goal of the proposed control strategy is to transfer the active power generated by a PV array to the grid utility with a unity power factor. The control strategy design is based on calculating the instantaneous active and reactive power from the measured grid voltages and currents; therefore, the control strategy gives dynamic robustness performance to the grid-connected PV system against a sudden change in reactive power and satisfactory active power tracking under rapid solar radiation changes. The simulation results of the grid-connected PV system using Matlab-Simulink environment show clearly that the FLC strategy has a better dynamic performance with less settling time, and overshoot compared to the conventional PI control.

Simulation parameters Parameters
Variables Values The group of (PV) modules which comports 40 parallel and 10