A Nature-inspired Optimization-based Optimum Fuzzy Logic Photovoltaic Inverter Controller Utilizing an Ezdsp F28335 Board

Photovoltaic (PV) inverters essentially convert DC quantities, such as voltage and current, to AC quantities whose magnitude and frequency are controlled to obtain the desired output. Thus, the performance of an inverter depends on its controller. Therefore, an optimum fuzzy logic controller (FLC) design technique for PV inverters using a lightning search algorithm (LSA) is presented in this study. In a conventional FLC, the procedure for obtaining membership functions (MFs) is usually implemented using trial and error, which does not lead to satisfactory solutions in many cases. Therefore, this study presents a technique for obtaining MFs that avoids the exhaustive traditional trial-and-error procedure. This technique is implemented during the inverter design phase by generating adaptive MFs based on the evaluation results of the objective function formulated with LSA. The mean squared error (MSE) of the inverter output voltage is used as an objective function in this study. LSA optimizes the MFs such that the inverter provides the lowest MSE for the output voltage, and the performance of the PV inverter output is improved in terms of amplitude and frequency. First, the design procedure and accuracy of the optimum FLC are illustrated and investigated through simulations conducted in a MATLAB environment. The LSA-based FLC (LSA-FL) are compared with differential search algorithm (DSA)-based FLC (DSA-FL) and particle swarm optimization (PSO)-based FLC (PSO-FL). Finally, the robustness of the LSA-FL is further investigated with a hardware that is operated via an eZdsp F28335 control board. Simulation and experimental results show that the proposed controller can successfully obtain the desired output when different loads are connected to the system. The inverter also has a reasonably low steady-state error and fast response to reference variation.


Introduction
Nowadays, renewable energy (RE) has become the main impetus of the energy sector, primarily because it is environment friendly, clean, and a secure energy source [1].Among REs, photovoltaic (PV) power generation is one of the most promising technologies that can be utilized in industrial power systems and rural electrification [2].Given that PV generators can only supply DC power, an inverter is required to connect the load to PV generators [3].The main feature of a good power inverter is its capability to provide clean, high-quality power and constant amplitude sinusoidal voltage and frequency, regardless of the load type to which it is connected.Furthermore, a power inverter must also have the capability to recover quickly from transients caused by external disturbances without causing power quality problems.In the context of a stand-alone PV generator, the output voltage and current waveforms should be controlled based on the reference values.Therefore, an efficient PV inverter controller is required [4].However, the extensive use of PV generators raises many challenges, such as harmonic pollutions, low efficiency of energy conversion, fluctuation of output power, and reliability of power electronic converters [5].
Numerous PV inverter controllers have been suggested by many researchers to solve these problems.A proportional integral (PI) controller is a widely accepted technique in inverter controls.Selvaraj et al. [6] implemented a digital PI current control algorithm in a PV inverter through a eZdsp F2812 to maintain the current fed into the utility grid network to be sinusoidal.However, this PI controller requires trapezoidal sum approximation to transform the integral term into a discrete-time domain.Similarly, Sanchis et al. [7] proposed a traditional PI controller to control a DC-to-AC boost converter.However, their controller requires the differential equations of the system to obtain good performance.In a related work, PI controllers were implemented for a three-phase inverter utilizing dSPACE DS1104 control hardware [8].However, the method of tuning the gains of PI controllers has not been elaborated.In recent years, researchers have focused on the utilization of optimization techniques in PI controller tuning to achieve improved performance.An optimal DC bus voltage regulation strategy with PI controllers for a grid-connected PV generator was suggested in [9].In this research, PI control parameters were optimized through simplex optimization technique.Various other optimization methods, such as particle swarm optimization (PSO), have also been used in PI controller parameter tuning for different applications [10][11][12][13].The performance of a PI controller is limited to small load disturbances.Its design is based on an accurate mathematical model of the real system under consideration, and it needs appropriate setting of its parameters.
Artificial intelligence-based controllers have been used in inverters with high efficiency and great dynamics.Various methods, including artificial neural network (ANN), fuzzy logic, and adaptive neuro fuzzy inference system (ANFIS)-based controllers, were reported in the literature.ANN-based maximum power point tracking controller in a PV inverter power conditioning unit was proposed in [14].In this work, the ANN module was used to estimate the voltages and currents corresponding to a maximum power delivered by PV panels.The module was then utilized to obtain the desirable converter duty cycle.Nonetheless, this proposed controller requires a large amount of training data before it can be trained and implemented in the controller.Fuzzy logic controllers (FLCs) have become increasingly popular in designing inverter controls because of their simplicity and adaptability to complex systems without a mathematical model [15].Some good examples of FLCs for inverter control can be found in [16,17].In these studies, two individual FLCs were used to control both the DC-DC and DC-AC converter in a fuel cell grid-connected inverter and stand-alone PV inverter, respectively.The authors claimed that acceptable results can be achieved with seven membership functions (MFs) and that the proposed technique can be implemented easily.In [18], the interval type-II fuzzy rule-based static synchronous compensator (STATCOM) for voltage regulation in a power system has been investigated.The interval type-II fuzzy rule base utilizes the output of the PID controller to tune the signal applied to the STATCOM to mitigate bus voltage variation caused by large changes in load and intermittent generation of PV arrays.Nonetheless, the performance of FLC depends on the rule base, number of rules, and MFs.These variables are determined based a trial-and-error procedure which is time consuming [19].Therefore, various techniques, such as neuro-fuzzy model and other optimization techniques were proposed in the literature to overcome the limitations of the FLC design.In [20], Collotta et al. developed a neuro-fuzzy model for dynamic and automatic regulation of indoor temperature.The ANN is applied to forecast indoor temperatures that are used to feed a FLC unit to manage the on/off switching of the ventilating and air-conditioning system and the regulation of the inlet air speed.However, neuro-fuzzy model requires extensive training data similar to ANN controllers and that training data are difficult to obtain in many cases.In [21], a particle swarm optimization (PSO) algorithm was applied to optimize a FLC for maximum power point tracking of a PV system.The selection of a proper optimization technique is important because PSO is prone to premature convergence.To date, such adaptive MF tuning method has not been applied in a FLC for PV inverter control.
In the proposed research, the LSA is developed to enhance the performance of the fuzzy logic controller for the three-phase PV inverter.The proposed approach aims to solve the problem of trial-and-error procedure in obtaining MFs used in the conventional FLC.LSA is a novel nature-inspired technique formulated to solve both single-modal and multimodal optimization problems.This algorithm is particularly recommended to solve multimodal problems, such as for tuning the MFs of the FLC [22].Therefore, the utilization of the LSA improves the performance of the FLC for PV inverters.LSA optimizes the MFs of the FLC based three-phase inverter by minimizing the objective function which is the mean squared error (MSE) of the output voltage.The system is first modeled in the MATLAB environment and then implemented in the eZdsp F28335 control board (Spectrum Digital Inc, Stafford, TX, USA) to validate the performance of the proposed controller by considering perturbation such as change in DC input voltage and load.

Inverter Control Algorithm
Inverter control aims to regulate the AC output voltage at a desired magnitude and frequency with low harmonic distortion.This regulation is performed by the controller by implementing a proper control algorithm to maintain the voltage at a set reference.The structure of the standalone PV inverter used in this study is shown in Figure 1 to illustrate the main control loops for achieving the aforementioned control objective.This inverter consists of a DC input from the PV source, DC-AC inverter, transformer, and load.This type of inverter with a DC input source is known as a VSI.
Energies 2016, 9, 120 3 of 32 proper optimization technique is important because PSO is prone to premature convergence.
To date, such adaptive MF tuning method has not been applied in a FLC for PV inverter control.
In the proposed research, the LSA is developed to enhance the performance of the fuzzy logic controller for the three-phase PV inverter.The proposed approach aims to solve the problem of trial-and-error procedure in obtaining MFs used in the conventional FLC.LSA is a novel nature-inspired technique formulated to solve both single-modal and multimodal optimization problems.This algorithm is particularly recommended to solve multimodal problems, such as for tuning the MFs of the FLC [22].Therefore, the utilization of the LSA improves the performance of the FLC for PV inverters.LSA optimizes the MFs of the FLC based three-phase inverter by minimizing the objective function which is the mean squared error (MSE) of the output voltage.The system is first modeled in the MATLAB environment and then implemented in the eZdsp F28335 control board (Spectrum Digital Inc, Stafford, TX, USA) to validate the performance of the proposed controller by considering perturbation such as change in DC input voltage and load.

Inverter Control Algorithm
Inverter control aims to regulate the AC output voltage at a desired magnitude and frequency with low harmonic distortion.This regulation is performed by the controller by implementing a proper control algorithm to maintain the voltage at a set reference.The structure of the standalone PV inverter used in this study is shown in Figure 1 to illustrate the main control loops for achieving the aforementioned control objective.This inverter consists of a DC input from the PV source, DC-AC inverter, transformer, and load.This type of inverter with a DC input source is known as a VSI.To apply the control algorithm in the inverter system, the three-phase output voltages in the synchronous reference frame must be sensed at the load terminals through the appropriate voltage sensors.The three-phase output voltages of the load terminal ( , , and ) can be represented as:

Controller Controller
sin ω (1) where is the voltage magnitude, and ω is the output frequency.These voltages ( , , and ) are then scaled and transformed into a d-q reference frame to simplify the calculations for controlling the three-phase inverter [23,24].The two DC quantities, namely, and , can be obtained by applying Park's transformation, as shown in Equation ( 4).This transformation employs a 50 Hz synchronization signal from a phase-locked loop block: To apply the control algorithm in the inverter system, the three-phase output voltages in the synchronous reference frame must be sensed at the load terminals through the appropriate voltage sensors.The three-phase output voltages of the load terminal (V a , V b , and V c ) can be represented as: where V is the voltage magnitude, and ω is the output frequency.These voltages (V a , V b , and V c ) are then scaled and transformed into a d-q reference frame to simplify the calculations for controlling the three-phase inverter [23,24].The two DC quantities, namely, V d and V q , can be obtained by applying Park's transformation, as shown in Equation ( 4).This transformation employs a 50 Hz synchronization signal from a phase-locked loop block: The error E between the measured voltages V d and V q and reference voltages V dre f and V qre f per unit can then be computed.Similarly, the change in error CE can be determined by taking the derivative of E. These signals (i.e., E and CE) are then sent to the controller at each sampling time T s to compute the missing components in V d and V q and to generate the new V d and V q signals.The new V d and V q are again converted into the synchronous reference frame voltages V a , V b , and V c through the following equation: These voltages can be applied in generating the pulse width modulation (PWM) to drive the insulated-gate bipolar transistor IGBT switches in the inverter block in Figure 1.As a result of inverter switching, a series of pulsating DC input voltage V dc appears at the output terminals of the inverter.Given that the output voltages of the inverter are pulsating DC voltages, an appropriate low-pass filter must be used (Figure 1) before importing PV-generated electrical energy to the load.The design procedure of the filter circuits can be found in [25].

Inverter Control Using FLC Strategy
In consideration of the nonlinearity of the power conversion process in PV inverters, fuzzy logic is a convenient method to adopt in a PV inverter control system.An FLC represents the human expert decision in the problem solving mechanism.The main advantages of FLC are: i FLC can be used in many applications especially for control and modeling of non-linear systems [19].ii FLC is less dependent on a mathematical model and system parameters [26].iii FLC is based on linguistic rules with an if-then general structure, which is the basis of human logic [27].
Figure 2 shows the inverter control concept with FLC as a control strategy.
These voltages can be applied in generating the pulse width modulation (PWM) to drive the insulated-gate bipolar transistor IGBT switches in the inverter block in Figure 1.As a result of inverter switching, a series of pulsating DC input voltage appears at the output terminals of the inverter.Given that the output voltages of the inverter are pulsating DC voltages, an appropriate low-pass filter must be used (Figure 1) before importing PV-generated electrical energy to the load.The design procedure of the filter circuits can be found in [25].

Inverter Control Using FLC Strategy
In consideration of the nonlinearity of the power conversion process in PV inverters, fuzzy logic is a convenient method to adopt in a PV inverter control system.An FLC represents the human expert decision in the problem solving mechanism.The main advantages of FLC are: i.
FLC can be used in many applications especially for control and modeling of non-linear systems [19].ii.
FLC is less dependent on a mathematical model and system parameters [26].iii.
FLC is based on linguistic rules with an if-then general structure, which is the basis of human logic [27].
Figure 2 shows the inverter control concept with FLC as a control strategy.The first step in FLC is to select the number of inputs and outputs.In this work, where FLC serves as a PV inverter controller, E and CE are used as inputs, whereas the missing component of or defined as O is used as the output of the FLC.The two inputs for the FLC depicted in Figure 2, namely, E and CE, at the tth sampling step that corresponds to can be described as follows: The first step in FLC is to select the number of inputs and outputs.In this work, where FLC serves as a PV inverter controller, E and CE are used as inputs, whereas the missing component of V d or V q defined as O is used as the output of the FLC.The two inputs for the FLC depicted in Figure 2, namely, E and CE, at the tth sampling step that corresponds to V d can be described as follows: CE ptq " E ptq ´E pt ´1q The output O for this case can be obtained at the last stage of the FLC design, which is explained in the next section.The FLC design must pass through the following steps, namely, fuzzification, inference engine design, and defuzzification [28,29].

Fuzzification
After the inputs and outputs are defined, the next stage involves the fuzzification of inputs.This step represents the inputs with suitable linguistic value by decomposing every input into a set and by defining a unique MF label, such as "big" or "small".Thus, the number of MFs used in the FLC depends on the linguistic label.The MFs of E and CE for the FLC can be defined as trapezoidal and triangular MFs.This process translates the crisp values of "E" and "CE" as the fuzzy set "e" and "ce", respectively, through the MF degrees µ e (E) and µ ce (CE), which range from 0 to 1, as shown in Figure 3 for triangular MFs.In Figure 3a, the MF of error (MFE) is defined by three elements, namely, X 1 , X 2 , and X 3 , whereas the MF of change of error (MFCE) in Figure 3b is defined by another three elements represented by X 4 , X 5 , and X 6 .
Energies 2016, 9, 120 5 of 32 ( 6) The output O for this case can be obtained at the last stage of the FLC design, which is explained in the next section.The FLC design must pass through the following steps, namely, fuzzification, inference engine design, and defuzzification [28,29].

Fuzzification
After the inputs and outputs are defined, the next stage involves the fuzzification of inputs.This step represents the inputs with suitable linguistic value by decomposing every input into a set and by defining a unique MF label, such as "big" or "small".Thus, the number of MFs used in the FLC depends on the linguistic label.The MFs of E and CE for the FLC can be defined as trapezoidal and triangular MFs.This process translates the crisp values of "E" and "CE" as the fuzzy set "e" and "ce", respectively, through the MF degrees μe(E) and μce(CE), which range from 0 to 1, as shown in Figure 3 for triangular MFs.In Figure 3a, the MF of error (MFE) is defined by three elements, namely, X1, X2, and X3, whereas the MF of change of error (MFCE) in Figure 3b is defined by another three elements represented by X4, X5, and X6.After defining the MFs, μe(E) and μce(CE) can be calculated with a basic straight line equation that consists of two points.For example, μe(E) and μce(CE) for the MFs in Figure 3 can be expressed as follows: In a standard FLC design, the selection of the number of MFs and the boundary values of each MF must be adjusted by the designer by using the trial-and-error method until the FLC provides a satisfactory result.However, this process is time consuming and laborious.After the inputs are fuzzified, the fuzzy inputs are subjected to an inference engine to generate a fuzzy output.

Inference Engine Design
This stage represents the decision making process based on the information from a knowledge base, which contains linguistic labels and control rules.Two types of inference systems mainly exist, After defining the MFs, µ e (E) and µ ce (CE) can be calculated with a basic straight line equation that consists of two points.For example, µ e (E) and µ ce (CE) for the MFs in Figure 3 can be expressed as follows: In a standard FLC design, the selection of the number of MFs and the boundary values of each MF must be adjusted by the designer by using the trial-and-error method until the FLC provides a satisfactory result.However, this process is time consuming and laborious.After the inputs are fuzzified, the fuzzy inputs are subjected to an inference engine to generate a fuzzy output.

Inference Engine Design
This stage represents the decision making process based on the information from a knowledge base, which contains linguistic labels and control rules.Two types of inference systems mainly exist, namely, Mamdani type and Sugeno type.The Mamdani-type inference system is adopted in this study because of its simple implementation steps.The rules with two inputs for the Mamdani type can be written as follows: R : IF E is "label" AND CE is "label, " THEN u is "label." The quantity of rules depends on the number of inputs and MFs used in the FLC [28,29].An FLC with a large rule base demands great computational effort in terms of memory and computation time.

Defuzzification
The final step in the FLC is the selection of the defuzzification method.This process generates a fuzzy control action as a crisp value.Several methods can be used to generate the crisp value.The most common methods include the center of area (COA) and the mean of maximum (MOM) methods.The widely used COA method generates the center of gravity of the MFs.In this study, the COA method given in Equation ( 10) is used to generate the crisp value because it is more accurate than MOM method [28]: where n is the number of rules, and w i is the weighted factor that can be calculated with Mamdani-MIN between µ e (E) and µ ce (CE), as expressed by: The implementation steps of the standard FLC are illustrated in Figure 4.
Energies 2016, 9, 120 6 of 32 namely, Mamdani type and Sugeno type.The Mamdani-type inference system is adopted in this study because of its simple implementation steps.The rules with two inputs for the Mamdani type can be written as follows: R: IF E is "label" AND CE is "label," THEN u is "label." The quantity of rules depends on the number of inputs and MFs used in the FLC [28,29].An FLC with a large rule base demands great computational effort in terms of memory and computation time.

Defuzzification
The final step in the FLC is the selection of the defuzzification method.This process generates a fuzzy control action as a crisp value.Several methods can be used to generate the crisp value.The most common methods include the center of area (COA) and the mean of maximum (MOM) methods.The widely used COA method generates the center of gravity of the MFs.In this study, the COA method given in Equation ( 10) is used to generate the crisp value because it is more accurate than MOM method [28]: where n is the number of rules, and is the weighted factor that can be calculated with Mamdani-MIN between μe(E) and μce(CE), as expressed by: The implementation steps of the standard FLC are illustrated in Figure 4.

Proposed Optimum FLC Design Procedure
As noted in the standard FLC design procedure, the main drawback of FLC design is the time-consuming trial-and-error process used to adjust the boundary values of MFs in the fuzzification process.Improper selection of MF boundaries may lead to the poor performance of the overall system.Therefore, this work presents a methodology to optimize MFs through a heuristic optimization algorithm.A heuristic optimization algorithm is used to solve complex and intricate problems that are otherwise difficult to solve with classical methods.It is a population-based

Proposed Optimum FLC Design Procedure
As noted in the standard FLC design procedure, the main drawback of FLC design is the time-consuming trial-and-error process used to adjust the boundary values of MFs in the fuzzification Energies 2016, 9, 120 7 of 32 process.Improper selection of MF boundaries may lead to the poor performance of the overall system.Therefore, this work presents a methodology to optimize MFs through a heuristic optimization algorithm.A heuristic optimization algorithm is used to solve complex and intricate problems that are otherwise difficult to solve with classical methods.It is a population-based method designed to solve a problem quickly or to determine an approximate solution when classic methods fail to determine a solution particularly with multimodal optimization problems.LSA has been developed as a heuristic optimization tool to adjust the boundary values of MFs adaptively because of its suitability for multimodal problems, such as the FLC design for PV inverter control.

Overview of LSA
LSA is a nature-inspired metaheuristic optimization algorithm [22].LSA is based on the natural phenomenon of lightning.The probabilistic nature and tortuous characteristics of lightning discharges originate from a thunderstorm.The proposed optimization algorithm is generalized from the mechanism of step leader propagation.It considers the involvement of fast particles known as projectiles in the formation of the binary tree structure of a step leader.Three projectile types are used to represent the transition projectiles that create the first step leader population N, the space projectiles that attempt to become the leader, and the lead projectile that represents the best positioned projectile that originated among N number of step leaders.The details of the LSA, including its basic concepts and algorithms, can be found in [22].

Optimal FLC Problem Formulation
The three basic components that are considered in any optimization method are input vectors, objective function formulation, and constraints.Each component is developed and clarified to obtain the optimal MFs.The optimization technique searches the optimal solution as formulated in the objective function through manipulation of the input vector subject to the constraints in each generation of the iterative process.

Input Vector
As the first step in FLC design, the number of MFs must be defined to provide the solution from the optimization technique.Depending on the number of MFs, the input vector Z can be described by: where Z i,j represents the jth solution in the population during the ith iteration, X k i,j is the kth element of Z i,j , and n is the total number of parameters.For example, the input vector Z i,j should contain six parameters indicating the boundaries of MFs that should be optimized to represent the MFs in Figure 3.

Objective Function
An objective function is required to determine and evaluate the performance of Z i,j for the MFs.Thus, the objective function to determine the optimal values is formulated in such a way that Z i,j generates the best fuzzy control action as a crisp value according to Equation (10) described in the defuzzification process.In the FLC design for the PV inverter control, E and CE at the tth sampling step that corresponds to V d (which is the transformed inverter output voltage) indicate the goodness of the crisp value of the fuzzy control action.Therefore, the MSE (13) obtained from the reference values V dre f and the measured values V d are used as the objective function: Energies 2016, 9, 120 where V dre f is the reference value that is equal to (1 p.u.), V d is the measured value, and is the number of the samples used to evaluate MSE.In the optimization process, Equation ( 13) needs to be minimized.

Optimization Constraints
The optimization algorithm must be implemented while satisfying all constraints used to determine the optimal values of MF parameters.The boundaries of these parameters should not overlap.In other words, the element X k i,j should be between X k´1 i,j and X k`1 i,j .If the element X k i,j is greater than X k`1 i,j or less than X k´1 i,j , this element should be regenerated within its boundaries.Therefore, the following restriction must be fulfilled to ensure that each MF parameter is within the prescribed boundaries: Energies 2016, 9, 120 8 of 32 overlap.In other words, the element , should be between , and , .If the element , is greater than , or less than , , this element should be regenerated within its boundaries.Therefore, the following restriction must be fulfilled to ensure that each MF parameter is within the prescribed boundaries:  Energies 2016, 9, 120 9 of 32

Implementation Steps of LSA to Obtain the Optimal FLC Design
The implementation starts by resetting the LSA parameters, namely, number of iterations (T), population size (N), problem dimension (D), and channel time.The initial populations for the MFs are then generated and encoded according to Equation (12).The next step involves the evaluation of the objective function through Equation (13).A suitable running time T r is required to populate the FLC output for the evaluation of MSE in population N.After the initial population is evaluated, the direction and position are updated with Equations ( 15) and ( 16), respectively: After updating all the values of Z i,j in the population, the procedure re-evaluates the objective function, and the process continues to the next iteration.This updating and objective function reevaluation process is repeated until the maximum iteration count is reached, as explained in Figure 5.
where p S i_new is the new space projectile, p S i is the old space projectile, and p L new is the new lead projectile.After updating all the values of Z i,j in the population, the procedure re-evaluates the objective function, and the process continues to the next iteration.This updating and objective function reevaluation process is repeated until the maximum iteration count is reached, as explained in Figure 5.

FLC Design for PV Inverter Control Using the Proposed Method
A 3 kW, 240 V, 50 Hz PV inverter system is modeled in the Matlab Simulink environment (Figure 6) to demonstrate the application of an optimum FLC design by supplying various types of loads continuously.As depicted in Figure 6, the output voltages (V a , V b , and V c ) are measured and converted to V d and V q at each sampling time T s = 2 µs.The controller block shown in the figure contains two FLCs that correspond to V d and V q in the d-q reference frame.The controllers require E and CE to generate new V d and V q and to convert to V a , V b , and V c .The converted signals are then utilized to create the PWM for driving the IGBT switches of the inverter.

Implementation Steps of LSA to Obtain the Optimal FLC Design
The implementation starts by resetting the LSA parameters, namely, number of iterations (T), population size (N), problem dimension (D), and channel time.The initial populations for the MFs are then generated and encoded according to Equation (12).The next step involves the evaluation of the objective function through Equation (13).A suitable running time Tr is required to populate the FLC output for the evaluation of MSE in population N.After the initial population is evaluated, the direction and position are updated with Equations ( 15) and ( 16), respectively: After updating all the values of , in the population, the procedure re-evaluates the objective function, and the process continues to the next iteration.This updating and objective function reevaluation process is repeated until the maximum iteration count is reached, as explained in Figure 5.
where _ is the new space projectile, is the old space projectile, and is the new lead projectile.After updating all the values of , in the population, the procedure re-evaluates the objective function, and the process continues to the next iteration.This updating and objective function reevaluation process is repeated until the maximum iteration count is reached, as explained in Figure 5.

FLC Design for PV Inverter Control Using the Proposed Method
A 3 kW, 240 V, 50 Hz PV inverter system is modeled in the Matlab Simulink environment (Figure 6) to demonstrate the application of an optimum FLC design by supplying various types of loads continuously.As depicted in Figure 6  As explained previously for each input, seven MFs defined as trapezoidal and triangular MFs are used according to the illustration in Figure 7. Seven parameters (i.e., , , ) are used to define the first input (E), whereas the seven other parameters (i.e., , , are used to define the second input (CE).Therefore, each controller input in the optimum FLC design contains 14 parameters.Thus, the FLC control rule for the PV inverter control system includes 49 rules (Table 1).As explained previously for each input, seven MFs defined as trapezoidal and triangular MFs are used according to the illustration in Figure 7. Seven parameters (i.e., X 1 i,j to X 7 i,j ) are used to define the first input (E), whereas the seven other parameters (i.e., X 8 i,j to X 14 i,j ) are used to define the second input Energies 2016, 9, 120 10 of 32 (CE).Therefore, each controller input Z in the optimum FLC design contains 14 parameters.Thus, the FLC control rule for the PV inverter control system includes 49 rules (Table 1).
Energies 2016, 9, 120 10 of 32 (a) (b)  The input vector and control rules are then defined.The optimization process described in the previous section can be performed by evaluating the objective function given in Equation ( 13) with the Simulink model shown in Figure 6 for a suitable running time of Tr = 0.2 s.In this design illustration, the optimization process based on LSA is started by initializing the following parameters: the number of iterations (T) as 100, number of populations (N) as 20, dimension of the problem (D) as 14, and maximum channels as 10.After the creation of the initial population and the calculation of the corresponding objective function for each input vector in the population, LSA updates the population and initiates a new iteration.If LSA reaches the maximum iteration, then the FLC with the best MF is obtained (Figure 5).This result indicates that the proposed approach provides a systematic and easy way to design FLCs for PV inverter control systems.

Fuzzy Logic PV Inverter Controller Implementation Based eZdsp F28335
The implementation in the hardware of the developed optimized FLC for PV inverter using eZdsp F28335 control board is essential to appraise the performance of the controller in real time.Therefore, the implementation to test the optimized FLC-based PV inverter is performed in the laboratory.

eZdsp F28335 Controller
The eZdsp F28335 board is appropriate for the inverter control platform because of its ability to link the MATLAB/Simulink inverter model to the real-time hardware.It is an inexpensive standalone digital controller that contains an analog-to-digital converter (ADC), a digital input/output, and a TMS320F28335 floating-point DSP.In the controller, Code Composer Studio (CCS) and MATLAB/Simulink should be operated properly.The Simulink PV inverter model is compiled, converted to C-code, and then automatically linked to the real-time TMS320F28335 processor ONB = output negative big, ONM = output negative medium, ONS = output negative small, OZ = output zero, OPS = output positive small, OPM = output positive medium, and OPB = output positive big.
The input vector and control rules are then defined.The optimization process described in the previous section can be performed by evaluating the objective function given in Equation ( 13) with the Simulink model shown in Figure 6 for a suitable running time of T r = 0.2 s.In this design illustration, the optimization process based on LSA is started by initializing the following parameters: the number of iterations (T) as 100, number of populations (N) as 20, dimension of the problem (D) as 14, and maximum channels as 10.After the creation of the initial population and the calculation of the corresponding objective function for each input vector in the population, LSA updates the population and initiates a new iteration.If LSA reaches the maximum iteration, then the FLC with the best MF is obtained (Figure 5).This result indicates that the proposed approach provides a systematic and easy way to design FLCs for PV inverter control systems.

Fuzzy Logic PV Inverter Controller Implementation Based eZdsp F28335
The implementation in the hardware of the developed optimized FLC for PV inverter using eZdsp F28335 control board is essential to appraise the performance of the controller in real time.Therefore, the implementation to test the optimized FLC-based PV inverter is performed in the laboratory.

eZdsp F28335 Controller
The eZdsp F28335 board is appropriate for the inverter control platform because of its ability to link the MATLAB/Simulink inverter model to the real-time hardware.It is an inexpensive standalone digital controller that contains an analog-to-digital converter (ADC), a digital input/output, and a TMS320F28335 floating-point DSP.In the controller, Code Composer Studio (CCS) and MATLAB/Simulink should be operated properly.The Simulink PV inverter model is compiled, converted to C-code, and then automatically linked to the real-time TMS320F28335 processor through MATLAB/Simulink.During the linking process, a user should include eZdsp input-output (I/O) interface blocks, such as ADC, and the enhanced PWM (ePWM) in the Simulink models.The behavior and performance of the inverter can be monitored in real time by applying the CCS software.The most important features of the eZdsp F28335 board include a TMS320F28335 digital signal controller, 150 MHz operating speed, 68 Kb on-chip RAM, 512 Kb on-chip flash memory, 256 Kb off-chip SRAM memory, and on-chip 12-bit ADC with 16 input channels.These components constitute the eZdsp F28335 board, which is suitable for prototype development and cost-sensitive, rapid-control prototyping.

Control Algorithm Implementation
The control algorithm described in Section 2 is implemented with the eZdsp F28335 board.This algorithm initially reads the measured voltages V a , V b , and V c through LEM LV25-P sensors.Therefore, three sensors are utilized to interface the output voltages of the inverter with the eZdsp F28335 board.These three sensors decrease the voltages to a level suitable for the eZdsp F28335 working voltages, and these voltages are fed to the ADC channels of the eZdsp F28335 for additional processing.
V a , V b , and V c are then transformed into the d-q reference frame, and E and CE are calculated in per unit according to Equations ( 6) and (7), respectively.The resulting E and CE are fed to the FLC to control the steady-state error and the output voltage.
Space vector PWM (SVPWM) is employed in the inverter control algorithm to produce sinusoidal AC waveforms from the three-phase voltage source inverter [30,31].Each output signal cycle is divided into six sections that resemble a hexagon (Figure 8).V re f and α in each sector are the products of two adjacent nonzero and zero vectors, respectively.The hexagon consists of six nonzero vectors, namely, V 1 , V 2 , . . ., V 6 , and two zero vectors, particularly V 0 and V 7 [32].The PWM control includes the modulation index (MI), which is necessary to improve the accuracy by decreasing the total harmonic distortion (THD) of the output signals from the inverter [33].The MI is computed as follows: where V p1 is the maximum fundamental voltage, and V p1six is the maximum fundamental voltage through a six-step operation.Thus, V p1six " 2 π V dc , where V dc is the DC-link voltage [30].The remainder of T s is filled with the zero space vectors V 0 and V 7 .The time shares are calculated as follows [34]:

Control Algorithm Implementation
The control algorithm described in Section 2 is implemented with the eZdsp F28335 board.This algorithm initially reads the measured voltages , , and through LEM LV25-P sensors.Therefore, three sensors are utilized to interface the output voltages of the inverter with the eZdsp F28335 board.These three sensors decrease the voltages to a level suitable for the eZdsp F28335 working voltages, and these voltages are fed to the ADC channels of the eZdsp F28335 for additional processing.
, , and are then transformed into the d-q reference frame, and E and CE are calculated in per unit according to Equations ( 6) and (7), respectively.The resulting E and CE are fed to the FLC to control the steady-state error and the output voltage.
Space vector PWM (SVPWM) is employed in the inverter control algorithm to produce sinusoidal AC waveforms from the three-phase voltage source inverter [30,31].Each output signal cycle is divided into six sections that resemble a hexagon (Figure 8).and α in each sector are the products of two adjacent nonzero and zero vectors, respectively.The hexagon consists of six nonzero vectors, namely, , , … , , and two zero vectors, particularly and [32].The PWM control includes the modulation index (MI), which is necessary to improve the accuracy by decreasing the total harmonic distortion (THD) of the output signals from the inverter [33].The MI is computed as follows: (17) where V is the maximum fundamental voltage, and V is the maximum fundamental voltage through a six-step operation.Thus, V V , where V is the DC-link voltage [30].The remainder of Ts is filled with the zero space vectors and .The time shares are calculated as follows [34]: where n = 1 to 6 are the sectors at 0 ď α ď π/3; T 1 , T 2 , and T 0 are the time vectors of the respective voltage vectors; T s is the switching time; and α is the angle of the reference vector relative to the space vector.
The inverter uses the optocoupler in the driver circuit to establish the interface of the SVPWM to the IGBT.The voltage values of the produced SVPWM switching signals are appropriate for the IGBT working voltage to achieve an effective inverter switching operation.

Experimental PV Inverter Control System
The real-time model shown in Figure 9 is utilized to implement the PV inverter control system through eZdsp F28335 board.In this model, the employed eZdsp F28335 I/O blocks include C280x/C28x3x ADC, unit16, and C280x/C28x2833x ePWM.The inverter output voltages, particularly V a , V b , and V c , are sampled via C280x/C28x3x ADC.These voltages are then converted to digital values for processing.The C280x/C28x2833x ePWM block produces the PWM switching signals for the IGBTs.
Energies 2016, 9, 120 12 of 32 where n = 1 to 6 are the sectors at 0 α π 3 ⁄ ; , , and are the time vectors of the respective voltage vectors; T is the switching time; and α is the angle of the reference vector relative to the space vector.
The inverter uses the optocoupler in the driver circuit to establish the interface of the SVPWM to the IGBT.The voltage values of the produced SVPWM switching signals are appropriate for the IGBT working voltage to achieve an effective inverter switching operation.

Experimental PV Inverter Control System
The real-time model shown in Figure 9 is utilized to implement the PV inverter control system through eZdsp F28335 board.In this model, the employed eZdsp F28335 I/O blocks include C280x/C28x3x ADC, unit16, and C280x/C28x2833x ePWM.The inverter output voltages, particularly , , and , are sampled via C280x/C28x3x ADC.These voltages are then converted to digital values for processing.The C280x/C28x2833x ePWM block produces the PWM switching signals for the IGBTs.Referring to Figure 9, the first block is the ADC C280x/C28x3x.The ADC module which has 16 channels, is configurable as two independent 8-channel modules (module A and module B) to service the ePWM modules.The two independent 8-channel modules can be cascaded to form a 16-channel module.Multiple input channels and two sequencers are available with only one converter in the ADC module.The two 8-channel modules can auto sequence a series of conversions with each module having the choice of selecting any one of the respective eight channels available through an analog MUX.In the cascaded mode, the auto sequencer functions as a single 16-channel sequencer.On each sequencer, once the conversion is completed, the selected channel value is stored in its respective ADCRESULT register.Auto sequencing allows the system to convert the same channel multiple times.Functions of the ADC module include a 12-bit ADC core with built-in dual sample-and-hold (S/H), and analog input from 0 V to 3 V.The analog input for the ADC is in the range of 0 to 3 V.As the ADC is 12-bit, the digital value of the input analog voltage is calculated as: Referring to Figure 9, the first block is the ADC C280x/C28x3x.The ADC module which has 16 channels, is configurable as two independent 8-channel modules (module A and module B) to service the ePWM modules.The two independent 8-channel modules can be cascaded to form a 16-channel module.Multiple input channels and two sequencers are available with only one converter in the ADC module.The two 8-channel modules can auto sequence a series of conversions with each module having the choice of selecting any one of the respective eight channels available through an analog MUX.In the cascaded mode, the auto sequencer functions as a single 16-channel sequencer.On each sequencer, once the conversion is completed, the selected channel value is stored in its respective ADCRESULT register.Auto sequencing allows the system to convert the same channel multiple times.Functions of the ADC module include a 12-bit ADC core with built-in dual sample-and-hold (S/H), and analog input from 0 V to 3 V.The analog input for the ADC is in the range of 0 to 3 V.As the ADC is 12-bit, the digital value of the input analog voltage is calculated as: From Equation ( 21), the digital output is from 0 to the 4095.To remove the bias from the digital signal and get the actual signal, it must be subtracted from half of the highest value (4095).Experimentally, the half of the highest value is found to be 2058.As the control procedure is working in per unit (p.u.), therefore the actual signal should be converted to p.u. signal.The actual signal should be divided by the highest value for converting to p.u. signal.Therefore, the actual signal is dived by 1240 to get the p.u. signal.
The C280x/C28x2833x ePWM block is one of the most important blocks in the eZdsp F28335 control board for PV inverter control.As shown in Figure 9, three ePWM blocks are used.Each ePWM block is responsible to generate the switching for the switching devices (IGBTs) in each inverter leg.The dead-time which is the time delay between the upper switch (e.g.IGBT1) turning ON time and lower switch (e.g., IGBT4) turning OFF time should be taken into account.The dead-band sub-module supports independent values for rising-edge (RED) and falling-edge (FED) delays.The amount of delay is programmed using the dead-band RED (DBRED) and dead-band FED (DBFED) registers.Since the DBRED and DBFED are 10-bits, they can be set to values from 0 to 1023.The rising-edge-delay and falling-edge-delay can be calculated as: FED " DBFED CPU clock (23) where DBFED is the dead-band FED and DBRED is the dead-band RED.
In the experiment, 25 SolarTIFSTF-120P6 PV modules with a peak capacity of 3 kW are utilized to supply the load.The modules are subsequently arranged in a series-connected configuration; thus, a DC output voltage of 435 V is produced.The characteristics of the SolarTIFSTF-120P6 PV module are shown in Table 2. Solar irradiation and temperature are the two main parameters responsible for the output power of the solar cell.The mathematical model of the PV electrical circuit is represented by the output of the cell current, which is obtained as follows [35][36][37][38]: where I PV is cell output current (A), I ph is the light-generated current (A), I o is the cell reverse saturation current or dark current (A), q is the electronic charge (1.6 ˆ10 ´19 C), V is the cell output voltage (V), n is the ideality factor, K B is the Boltzmann's constant (1.38 ˆ10 ´23 J/K), T is the cell temperature (K), and R S is the internal resistance of the stack.The short-circuit current I sc,n under the nominal condition and that at the short-circuit current temperature coefficient α are provided in Table 2.The PV characteristics are programmed in the PV simulator Chroma 62050H-600s to represent the actual variation of voltage and current.In the inverter input stage, the configuration of the PV modules in series, parallel, or combination is responsible for the current I PV and voltage V PV of the PV system.In the proposed PV system, I PV and V PV are expressed as follows: V PV " N S " V re f ´β pT ´Tn q ´Rs pT ´Tn q ı (25) where N S is the series module number, V re f is the PV reference voltage, β is the voltage temperature coefficient, T is the stack temperature, T n is the nominal temperature, N P is the parallel module number, I re f is the PV reference current, G is the irradiance, and G n is the nominal irradiance.The inverter prototype is developed and verified on based on the experimental setup shown in Figure 10.
Energies 2016, 9, 120 14 of 32 where is the series module number, is the PV reference voltage, β is the voltage temperature coefficient, is the stack temperature, is the nominal temperature, is the parallel module number, is the PV reference current, is the irradiance, and is the nominal irradiance.The inverter prototype is developed and verified on based on the experimental setup shown in Figure 10.

Results and Discussion
The PV inverter system depicted in Figure 6 is used to evaluate the proposed LSA-based FLC (LSA-FL) optimization method and the robustness of the overall system.Figure 11 shows the convergence characteristics of LSA-FL to determine the best optimal solution for the test system, along with the results obtained with DSA-based FLC (DSA-FL) and PSO-based FLC (PSO-FL) optimization methods.For a fair comparison, all optimization algorithms used the same parameters (i.e., problem dimension, population, and iteration).Figure 11 shows that LSA-FL converges faster than DSA-FL and PSO-FL.The optimal solution generated with LSA-FL is also better than those generated with DSA-FL and PSO-FL.The optimum performance of LSA-FL shown in Figure 11 is obtained when both FLCs that represent and accomplish the MFs shown in Figure 12.In consideration of its effectiveness, only FL-LSA is used to evaluate the performance of the overall PV inverter system when subjected to different types of loads.

Results and Discussion
The PV inverter system depicted in Figure 6 is used to evaluate the proposed LSA-based FLC (LSA-FL) optimization method and the robustness of the overall system.Figure 11 shows the convergence characteristics of LSA-FL to determine the best optimal solution for the test system, along with the results obtained with DSA-based FLC (DSA-FL) and PSO-based FLC (PSO-FL) optimization methods.For a fair comparison, all optimization algorithms used the same parameters (i.e., problem dimension, population, and iteration).Figure 11 shows that LSA-FL converges faster than DSA-FL and PSO-FL.The optimal solution generated with LSA-FL is also better than those generated with DSA-FL and PSO-FL.The optimum performance of LSA-FL shown in Figure 11 is obtained when both FLCs that represent V d and V q accomplish the MFs shown in Figure 12.In consideration of its effectiveness, only FL-LSA is used to evaluate the performance of the overall PV inverter system when subjected to different types of loads.

Results with Resistive Load (R)
A simulation is conducted with a resistive load of 1500 W for 0.1 s as can be shown in Figure 13a.Furthermore, the experiment is conducted in the laboratory to evaluate the overall performance of the proposed fuzzy logic PV inverter controller.Experimental voltage waveforms are measured with differential probes with a scale (X200), as depicted Figure 13b.

Results with Resistive Load (R)
A simulation is conducted with a resistive load of 1500 W for 0.1 s as can be shown in Figure 13a.Furthermore, the experiment is conducted in the laboratory to evaluate the overall performance of the proposed fuzzy logic PV inverter controller.Experimental voltage waveforms are measured with differential probes with a scale (X200), as depicted Figure 13b.

Results with Resistive Load (R)
A simulation is conducted with a resistive load of 1500 W for 0.1 s as can be shown in Figure 13a.Furthermore, the experiment is conducted in the laboratory to evaluate the overall performance of the proposed fuzzy logic PV inverter controller.Experimental voltage waveforms are measured with differential probes with a scale (X200), as depicted Figure 13b.

Results with Resistive Load (R)
A simulation is conducted with a resistive load of 1500 W for 0.1 s as can be shown in Figure 13a.Furthermore, the experiment is conducted in the laboratory to evaluate the overall performance of the proposed fuzzy logic PV inverter controller.Experimental voltage waveforms are measured with differential probes with a scale (X200), as depicted Figure 13b.Both the simulation and experimental output voltage waveforms of the inverter, namely, , , and , are sinusoidal with 50 Hz, and no negative effect exists, such as overshoot or oscillation.The shift is 120° between each phase.The controller distinctly succeeds in regulating the magnitude of the phase voltage waveform at approximately 339 V and the rms voltage of 240 V.This result confirms that the proposed FLC is in accordance with the exact voltage reference; therefore, the proposed inverter control algorithm is efficient.The three-phase load current waveforms should also be recorded analysis.The load current waveforms are measured, as shown in Figure 14.Similar to the three-phase output voltage waveform, the phase load current waveforms in the simulation and the experimental are successfully regulated through the proposed controller within approximately 3. Both the simulation and experimental output voltage waveforms of the inverter, namely, V a , V b , and V c , are sinusoidal with 50 Hz, and no negative effect exists, such as overshoot or oscillation.The shift is 120 ˝between each phase.The controller distinctly succeeds in regulating the magnitude of the phase voltage waveform at approximately 339 V and the rms voltage of 240 V.This result confirms that the proposed FLC is in accordance with the exact voltage reference; therefore, the proposed inverter control algorithm is efficient.The three-phase load current waveforms should also be recorded analysis.The load current waveforms are measured, as shown in Figure 14.Similar to the three-phase output voltage waveform, the phase load current waveforms in the simulation and the experimental are successfully regulated through the proposed controller within approximately 3.3 A. The load current waveforms are purely sinusoidal with 50 Hz, and a 120 ˝shift is demonstrated between each phase.Both the simulation and experimental output voltage waveforms of the inverter, namely, , , and , are sinusoidal with 50 Hz, and no negative effect exists, such as overshoot or oscillation.The shift is 120° between each phase.The controller distinctly succeeds in regulating the magnitude of the phase voltage waveform at approximately 339 V and the rms voltage of 240 V.This result confirms that the proposed FLC is in accordance with the exact voltage reference; therefore, the proposed inverter control algorithm is efficient.The three-phase load current waveforms should also be recorded analysis.The load current waveforms are measured, as shown in Figure 14.Similar to the three-phase output voltage waveform, the phase load current waveforms in the simulation and the experimental are successfully regulated through the proposed controller within approximately 3. Power factor is essential for the three-phase inverter design to indicate the efficiency of the proposed inverter and its control algorithm.The goal of the design is to obtain a unity power factor.Therefore, the voltage and the load current waveforms are measured simultaneously (Figure 15) to depict the phase difference between these signals.The voltage and the current waveforms exhibit the same phase angle, which is in accordance with the unity power factor operation, as expected.The phase relationship of load current and voltage signals in the simulation and the experimental indicates high efficiency (Figure 15).Power factor is essential for the three-phase inverter design to indicate the efficiency of the proposed inverter and its control algorithm.The goal of the design is to obtain a unity power factor.Therefore, the voltage and the load current waveforms are measured simultaneously (Figure 15) to depict the phase difference between these signals.The voltage and the current waveforms exhibit the same phase angle, which is in accordance with the unity power factor operation, as expected.The phase relationship of load current and voltage signals in the simulation and the experimental indicates high efficiency (Figure 15).Power factor is essential for the three-phase inverter design to indicate the efficiency of the proposed inverter and its control algorithm.The goal of the design is to obtain a unity power factor.Therefore, the voltage and the load current waveforms are measured simultaneously (Figure 15) to depict the phase difference between these signals.The voltage and the current waveforms exhibit the same phase angle, which is in accordance with the unity power factor operation, as expected.The phase relationship of load current and voltage signals in the simulation and the experimental indicates high efficiency (Figure 15).The THD of the voltage and current signals are measured in the simulation and the experimental to verify the quality of the inverter output waveforms.The quality of the waveform is inversely proportional to the THD percentage.Figures 16 and 17 show the THD percentages of the voltages and currents obtained for the R load analyzed in this study.Figure 16a,b shows that the THD of the voltage waveform is 0.56% and 2.1% for the simulation and the experimental, respectively, which satisfies the IEEE-929-2000 international standard [39].
Energies 2016, 9, 120 18 of 32 The THD of the voltage and current signals are measured in the simulation and the experimental to verify the quality of the inverter output waveforms.The quality of the waveform is inversely proportional to the THD percentage.Figures 16 and 17 show the THD percentages of the voltages and currents obtained for the R load analyzed in this study.Figure 16a,b shows that the THD of the voltage waveform is 0.56% and 2.1% for the simulation and the experimental, respectively, which satisfies the IEEE-929-2000 international standard [39].Figures 17a,b shows that the THD of the current waveform is 0.57% and 3% for the simulation and the experimental, respectively, which complies with the IEEE-929-2000 international standard.The low THD in the voltage and current waveforms is mainly achieved with the robustness of the proposed FLC.Two tests are conducted to appraise the proposed fuzzy logic PV inverter controller.The robustness and efficiency of any controller are indicated prominently when perturbation occurs in DC input voltage or when a change in the value of load occurs.Therefore, two tests were performed, namely, changing R load and changing DC input voltage, to determine the validity and ability of the proposed fuzzy logic PV inverter controller.The controller regulates the inverter output waveforms successfully.Therefore, the inverter output responses indicate that the proposed controller is sufficiently robust to achieve a favorable response to a change in step load.The controller regulates the inverter output waveforms successfully.Therefore, the inverter output responses indicate that the proposed controller is sufficiently robust to achieve a favorable response to a change in step load.

Step Change in V dc
The intermittent PV characteristics should be appraised to determine the effectiveness of the proposed controller.The PV system suffers from a fluctuating DC voltage.Therefore, the change in the step DC voltage, V dc , should also be examined to analyze the proposed controller.V dc is increased from 200 V to 300 V at 1.6 s to test the proposed controller.Figure 20a,b illustrates the voltage and current waveforms, respectively.Meanwhile, Figure 20c illustrates the experimental voltage and current signals.An increase in V dc also increases the voltage and current waveforms.Therefore, the proposed controller regulates the inverter output waveforms successfully; thus, the proposed controller is implemented successfully.

Step Change in
The intermittent PV characteristics should be appraised to determine the effectiveness of the proposed controller.The PV system suffers from a fluctuating DC voltage.Therefore, the change in the step DC voltage, , should also be examined to analyze the proposed controller. is increased from 200 V to 300 V at 1.6 s to test the proposed controller.Figure 20a,b illustrates the voltage and current waveforms, respectively.Meanwhile, Figure 20c illustrates the experimental voltage and current signals.An increase in also increases the voltage and current waveforms.Therefore, the proposed controller regulates the inverter output waveforms successfully; thus, the proposed controller is implemented successfully.V dc is decreased from 300 V to 200 V at 2.2 s to evaluate further the proposed controller.The voltage and current waveforms are illustrated in Figure 21a,b, respectively.Meanwhile, Figure 21c shows the experimental voltage and current waveforms.The decrease in V dc decreases the inverter voltage and current output waveforms.The proposed FLC successfully regulates the voltage and current waveforms.This finding indicates that the proposed controller can deal with the change in V dc with different loads, and it can be efficiently used in PV systems.
is decreased from 300 V to 200 V at 2.2 s to evaluate further the proposed controller.The voltage and current waveforms are illustrated in Figure 21a,b, respectively.Meanwhile, Figure 21c shows the experimental voltage and current waveforms.The decrease in decreases the inverter voltage and current output waveforms.The proposed FLC successfully regulates the voltage and current waveforms.This finding indicates that the proposed controller can deal with the change in with different loads, and it can be efficiently used in PV systems.

Results with Resistive and Inductive Load (RL)
Another type of load is used to test the robustness of the controller.In this case, RL load represented by a motor with a capacity of 1 hp is used.The equivalent circuit for this motor is equal to (89.9161 + j57.509).Therefore, the values of the RL load are R = 89.9161Ω and L = 183.1 mH.
The simulation is performed for 0.1 s, as depicted in Figure 22a.Figure 22b shows the experimental voltage waveforms of the three-phase inverter, namely, V a , V b , and V c .The voltage waveforms are not affected by a change in the load type.The controller still succeeds in preserving the magnitude of the AC voltage signals for the three-phase inverter at approximately 339 V.The waveforms are stable, clean, and balanced at 50 Hz.The displacement between each two phase is 120 ˝.

Results with Resistive and Inductive Load (RL)
Another type of load is used to test the robustness of the controller.In this case, RL load represented by a motor with a capacity of 1 hp is used.The equivalent circuit for this motor is equal to (89.9161 + j57.509).Therefore, the values of the RL load are R = 89.9161Ω and L = 183.1 mH.The simulation is performed for 0.1 s, as depicted in Figure 22a.Figure 22b shows the experimental voltage waveforms of the three-phase inverter, namely, , , and .The voltage waveforms are not affected by a change in the load type.The controller still succeeds in preserving the magnitude of the AC voltage signals for the three-phase inverter at approximately 339 V.The waveforms are stable, clean, and balanced at 50 Hz.The displacement between each two phase is 120°.The phase shift between the voltage and current with RL load is also measured to evaluate the controller further.Figure 24a The phase shift between the voltage and current with RL load is also measured to evaluate the controller further.Figure 24a The phase shift between the voltage and current with RL load is also measured to evaluate the controller further.Figure 24a The THD for the inverter output waveforms are also measured to verify the quality of the signals when the inverter is connected with RL load.Figure 25a,b shows the voltage THD for the simulation and the experimental.Figure 25 clearly shows that the controller succeeds in maintaining the voltage THD at a small percentage of 0.54% and 2.7% for the simulation and the experimental, respectively.The current THDs for the simulation and the experimental are shown in Figure 26.The controller also succeeds in maintaining the current THD of 1.15% and 3.6% for the simulation and the experimental, respectively.This finding indicates that the controller can successfully deal with RL load, and clean waveforms can be supplied, thereby meeting the IEEE-929-2000 international standard.
(a)  The THD for the inverter output waveforms are also measured to verify the quality of the signals when the inverter is connected with RL load.Figure 25a,b shows the voltage THD for the simulation and the experimental.Figure 25 clearly shows that the controller succeeds in maintaining the voltage THD at a small percentage of 0.54% and 2.7% for the simulation and the experimental, respectively.The current THDs for the simulation and the experimental are shown in Figure 26.The controller also succeeds in maintaining the current THD of 1.15% and 3.6% for the simulation and the experimental, respectively.This finding indicates that the controller can successfully deal with RL load, and clean waveforms can be supplied, thereby meeting the IEEE-929-2000 international standard.The THD for the inverter output waveforms are also measured to verify the quality of the signals when the inverter is connected with RL load.Figure 25a,b shows the voltage THD for the simulation and the experimental.Figure 25 clearly shows that the controller succeeds in maintaining the voltage THD at a small percentage of 0.54% and 2.7% for the simulation and the experimental, respectively.The current THDs for the simulation and the experimental are shown in Figure 26.The controller also succeeds in maintaining the current THD of 1.15% and 3.6% for the simulation and the experimental, respectively.This finding indicates that the controller can successfully deal with RL load, and clean waveforms can be supplied, thereby meeting the IEEE-929-2000 international standard.
(a)  Step Change V dc The step change in V dc is also implemented for RL load to appraise the robustness of the proposed FLC controller.V dc is increased from 250 V to 350 V to determine the effect of a step change in the DC on the inverter output waveforms when the inverter is connected to an RL load.Figure 27 shows the inverter response with DC step change.Figure 27a,b illustrates the simulation voltage and current signals when V dc increased from 250 V to 350 V at 0.4 s.Meanwhile, Figure 27c shows experimental voltage and current waveforms.
Energies 2016, 9, 120 28 of 32 Step Change in The step change in is also implemented for RL load to appraise the robustness of the proposed FLC controller.
is increased from 250 V to 350 V to determine the effect of a step change in the DC on the inverter output waveforms when the inverter is connected to an RL load.Figure 27 shows the inverter response with DC step change.Figure 27a  Figure 27 shows that the DC step change leads to an increase in voltage and current waveforms.In this case, the controller succeeds in regulating the inverter output waveforms, and the effect of the Figure 27 shows that the DC step change leads to an increase in voltage and current waveforms.In this case, the controller succeeds in regulating the inverter output waveforms, and the effect of the overshoot is limited with a short time.Figure 28a,b illustrates the voltage and current signals when V dc changes from 350 V to 250 V at 1 s with RL load.Figure 28c shows the experimental voltage and current waveforms.Figure 28 clearly shows that the proposed FLC controller succeeds in regulating the voltage and current waveforms with a slight drop.Figure 28 indicates that the proposed FLC can also effectively deal with RL load with high efficiency.
Energies 2016, 9, 120 29 of 32 overshoot is limited with a short time.Figure 28a,b illustrates the voltage and current signals when changes from 350 V to 250 V at 1 s with RL load.Figure 28c shows the experimental voltage and current waveforms.Figure 28 clearly shows that the proposed FLC controller succeeds in regulating the voltage and current waveforms with a slight drop.Figure 28 indicates that the proposed FLC can also effectively deal with RL load with high efficiency.

Conclusions
This paper has presented a novel nature-inspired optimization technique called as the LSA to enhance the performance of the three-phase PV inverter and its practical implementation using the

Conclusions
This paper has presented a novel nature-inspired optimization technique called as the LSA to enhance the performance of the three-phase PV inverter and its practical implementation using the eZdsp F28335 controller board.The LSA is applied to optimally tune the MFs of the FLC based PV inverter instead of manual tuning.To optimize the MFs of the FLC, a suitable objective function is Energies 2016, 9, 120 30 of 32 formulated by minimizing the MSE of the inverter output voltage.A comparative study with DSA and PSO techniques was performed to validate and compare the performance of the LSA.The simulations results showed that the FLC with optimally tuned MFs using the LSA performs well in tracking the reference value and regulating the output voltage waveforms at the desired amplitude for various loads.In addition, the LSA gives better results with high convergence rate compared to the DSA and PSO techniques.
To demonstrate the functionality of the proposed method, a hardware prototype of the optimal FLC based PV inverter is developed and compiled using the eZdsp F28335 controller board.The real-time model for the optimized FLC using LSA was first developed in the MATLAB environment to generate PWM switching signals for the IGBTs of the inverter.Thereafter, the developed controller was implemented in hardware using the eZdsp F28335 controller board in a prototype three-phase voltage source inverter.The developed PV inverter model was compiled, converted to the C-code, and automatically linked to the real-time TMS320F28335 processor board.The performance and behavior of the inverter was monitored in real-time by developing a GUI program in the CCS software.The experimental results with the prototype PV inverter showed that the proposed controller successfully regulated the inverter output waveform when connected to the resistive and combined resistive and inductive loads and also demonstrated the ability to handle changing DC input voltage and changing load.High quality inverter output voltage waveforms were obtained with low voltage THD values of 2.1% and 2.7% for the resistive and combined resistive and inductive loads, respectively.Furthermore, low current THD values of 3% and 3.6% are obtained for the resistive and resistive inductive loads, respectively.Therefore, the developed prototype optimum fuzzy logic based PV inverter controller implemented using the eZdsp F28335 control board is considered a useful device to be use in stand-alone and grid-connected PV systems.

Figure 1 .
Figure 1.Structure circuit of the three-phase inverter system.

Figure 1 .
Figure 1.Structure circuit of the three-phase inverter system.

Figure 3 .
Figure 3. Membership functions for (a) E and (b) CE.
, the output voltages ( , , and ) are measured and converted to and at each sampling time Ts = 2 μs.The controller block shown in the figure contains two FLCs that correspond to and in the d-q reference frame.The controllers require E and CE to generate new and and to convert to , , and .The converted signals are then utilized to create the PWM for driving the IGBT switches of the inverter.

Figure 6 .
Figure 6.Simulation model for the three-phase inverter.

Figure 6 .
Figure 6.Simulation model for the three-phase inverter.

Figure 7 .
Figure 7. FLC with seven MFs for (a) E and (b) CE.

Figure 9 .
Figure 9. Real-time implementation of the eZdsp F28335 inverter system algorithm.

Figure 9 .
Figure 9. Real-time implementation of the eZdsp F28335 inverter system algorithm.

Figure 10 .
Figure 10.Experimental setup for the proposed PV inverter control system.

Figure 10 .
Figure 10.Experimental setup for the proposed PV inverter control system.

Figure 12 .
Figure 12.Optimized MFs of (a) E and (b) CE using LSA.

Figure 13 .
Figure 13.Output voltage waveforms (i.e., , , and ) of the three-phase inverter with R load for (a) simulation and (b) experimental.

Figure 15 .
Figure 15.Output voltage and current load of the inverter with R load for (a) simulation and (b) experimental.

Figure 14 .
Figure 14.Output current waveforms (i.e., I a , I b , and I c ) of the three-phase inverter with R load for (a) simulation and (b) experimental.

Figure 14 .
Figure 14.Output current waveforms (i.e., , , and ) of the three-phase inverter with R load for (a) simulation and (b) experimental.

Figure 15 .
Figure 15.Output voltage and current load of the inverter with R load for (a) simulation and (b) experimental.

Figure 15 .
Figure 15.Output voltage (V a ) and current load (I a ) of the inverter with R load for (a) simulation and (b) experimental.

Figure 16 .
Figure 16.THD for the phase voltage of the three-phase inverter with R load for (a) simulation and (b) experimental.

Figure 16 .
Figure 16.THD for the phase voltage of the three-phase inverter with R load for (a) simulation and (b) experimental.

FigureFigure 17 .Figure 17 .Figure 18 .
Figure17a,b shows that the THD of the current waveform is 0.57% and 3% for the simulation and the experimental, respectively, which complies with the IEEE-929-2000 international standard.The low THD in the voltage and current waveforms is mainly achieved with the robustness of the proposed FLC.Two tests are conducted to appraise the proposed fuzzy logic PV inverter controller.The robustness and efficiency of any controller are indicated prominently when perturbation occurs in DC input voltage or when a change in the value of load occurs.Therefore, two tests were performed, namely, changing R load and changing DC input voltage, to determine the validity and ability of the proposed fuzzy logic PV inverter controller.

FigureFigure 18 .
Figure 19a,b illustrates the simulation voltage and current, respectively, for load that increases from 750 W to 1500 W at 1 s. Figure 19c shows the experimental voltage and current signals.The change in the load disturbs the voltage and the current waveforms.

FigureFigure 19 .
Figure 19a,b illustrates the simulation voltage and current, respectively, for load that increases from 750 W to 1500 W at 1 s. Figure 19c shows the experimental voltage and current signals.The change in the load disturbs the voltage and the current waveforms.

Figure 19 .
Figure 19.Output waveforms with R load increasing from 750 W to 1500 W. (a) Simulation voltage waveforms; (b) simulation current waveforms; and (c) experimental voltage and current waveforms (Ch. 1, Ch. 2, Ch. 3, and Ch. 4 for V a , V b , V c , and I a , respectively).

Figure 22 .Figure 22 .Figure 23 .
Figure 22.Output voltage waveforms (i.e., , , and ) of the three-phase inverter with RL load for (a) simulation and (b) experimental.The simulation and experimental three-phase load current waveforms are presented in Figure23a,b, respectively, to observe the effect of RL load on the current waveform.The change in load type does not affect the quality of the current waveforms.The waveforms remain stable, and the controller achieves a constant peak level with approximately 1.95 A and an approximately 1.37 A•rms.The waveforms remain balanced at 50 Hz, and they are displaced by 120° between each two phases.

Figure 23 .
Figure 23.Output current waveforms (i.e., , , and ) of the three-phase inverter with RL load for (a) simulation and (b) experimental.

Figure 24 .
Figure 24.Output voltage (V a ) and current load (I a ) of the inverter with RL load for (a) simulation and (b) experimental.

Figure 24 .
Figure 24.Output voltage and current load of the inverter with RL load for (a) simulation and (b) experimental.
,b illustrates the simulation voltage and current signals when increased from 250 V to 350 V at 0.4 s.Meanwhile, Figure 27c shows experimental voltage and current waveforms.

Figure 27 .
Figure 27.Output waveforms with V dc increasing from 250 V to 350 V with RL load.(a) Simulation voltage waveforms; (b) simulation current waveforms; and (c) experimental voltage and current waveforms (Ch. 1, Ch. 2, and Ch. 3 for V dc , V a , and I a , respectively).

Figure 28 .
Figure 28.Waveforms with V dc decreasing from 250 V to 350 V with RL load.(a) Simulation voltage waveforms; (b) simulation current waveforms; and (c) experimental voltage and current waveforms (Ch. 1, Ch. 2, and Ch. 3 for V dc , V a , and I a , respectively).
then be computed.Similarly, the change in error CE can be determined by taking the derivative of E. These signals (i.e., E and CE) are then sent to the controller at each sampling time Ts

Table 1 .
Fuzzy control rules based on seven MFs.
ONB = output negative big, ONM = output negative medium, ONS = output negative small, OZ = output zero, OPS = output positive small, OPM = output positive medium, and OPB = output positive big.

Table 1 .
FLC with seven MFs for (a) E and (b) CE.Fuzzy control rules based on seven MFs.
Simulink.During the linking process, a user should include eZdsp input-output (I/O) interface blocks, such as ADC, and the enhanced PWM (ePWM) in the Simulink models.The behavior and performance of the inverter can be monitored in real time by applying the CCS software.The most important features of the eZdsp F28335 board include a TMS320F28335 digital signal controller, 150 MHz operating speed, 68 Kb on-chip RAM, 512 Kb on-chip flash memory, 256 Kb off-chip SRAM memory, and on-chip 12-bit ADC with 16 input channels.These components constitute the eZdsp F28335 board, which is suitable for prototype development and cost-sensitive, rapid-control prototyping.