DSPACE Real-Time Implementation of MPPT-Based FLC Method

Maximum power point trackers are so important in photovoltaic systems to improve their overall efficiency. This paper presents a photovoltaic system with maximum power point tracking facility. An intelligent fuzzy logic controller method is proposed in this paper to achieve the maximum power point tracking of PV modules. The system consists of a photovoltaic solar module connected to a DC-DC buck-boost converter. The system is modeled using MATLAB/SIMULINK. The system has been experienced under disturbance in the photovoltaic temperature and irradiation levels. The simulation results show that the proposed maximum power tracker tracks the maximum power accurately and successfully in all conditions tested. The MPPT system is then experimentally implemented. DSPACE is used in the implementation of the MPPT hardware setup for real-time control. Data acquisition and control system is implemented using dSPACE 1104 software and digital signal processor card. The simulation and practical results show that the proposed system tracked the maximum power accurately and successfully under all atmospheric conditions.


Introduction
Energy is important for the human life and economy.Consequently, due to the increase in the industrial revolution, the world energy demand has also increased.In the later years, irritation about the energy crisis has been increased.Fossil fuels have started to be gradually depleted.On the other hand, people are more concerned about the fossil fuel exhaustion and other environment problems which are a result of conventional power generation.It is a global challenge to generate a secure, available, and reliable energy and at the same time reduce the greenhouse gas emission [1].Energy saving was suggested by the researchers to meet the worldwide energy demand.But this method is a cost-effective solution.One of the most effective and suitable solutions is the renewable energy supplies.Renewable energy sources are considered as a technological option for generating clean, green, environment-friendly, and sustainable energy [1,2].
Photovoltaic (PV) system has taken a great attention since it appears to be one of the most promising renewable energy sources.The photovoltaic (PV) solar generation is preferred over the other renewable energy sources due to advantages such as the absence of fuel cost, cleanness, being pollution-free, little maintenance, and causing no noise due to absence of moving parts.However, two important factors limit the implementation of photovoltaic systems.These are high installation cost and low efficiency of energy conversion [1].In order to reduce photovoltaic power system costs and to increase the utilization efficiency of solar energy, the maximum power point tracking system of photovoltaic modules is one of the effective methods [3].Maximum power point tracking, frequently referred to as MPPT, is a system used to extract the maximum power of the PV module to deliver it to the load [4].Thus, the overall efficiency is increased [4].
Since the power generated from the photovoltaic module depends on the temperature and the solar radiation, these factors must be taken into account while designing the maximum power point tracker.The main goal of the MPPT is to move the module operating voltage close to the voltage at which the PV produces the maximum power under all atmospheric conditions.MPPT is very important in PV systems.Different techniques have been developed to maximize the output power of the photovoltaic module.They have advantages and limitations over the others.These techniques vary in complexity, in the number of sensors required, in their convergence speed, and in their cost.In the literature some of MPPT methods are introduced such as feedback voltage method, and incremental conductance method, perturbation and observation method [1,[4][5][6][7][8].The open-circuit voltage method is based on (1) which states that the voltage of the PV module at maximum power point is linearly proportional to the open circuit voltage [9][10][11][12].The proportional constant  depends on the meteorological conditions, fabrication of the PV cell and on the fill factor of the PV cell [8]: The proportional constant  has been reported to be between 0.71 and 0.78 [13].The common value of  is about 0.76 (within ±2%) [12].
In order to implement the constant voltage algorithm, PV modules must be interrupted with a certain frequency to measure the open-circuit voltage of the PV module.The measured voltage is then multiplied by the factor  to obtain the voltage at maximum power point.Then the operating voltage of the PV module is adjusted to the calculated voltage in order to obtain the maximum power.This process must be repeated periodically [8].Although this method is simple to implement, it has a drawback which is high power losses due to periodically interrupting the system operation.Another drawback is that it is difficult to choose an optimal value of the constant K [8,10].
The other method is the constant voltage (current) method.The constant voltage (current) method compares the measured voltage (current) of the PV module with a reference voltage (current) to continuously adjust the duty cycle of the DC-DC converter and hence operate the PV module at the predetermined point close to the MPP [8].Although the constant voltage (current) tracking method is very simple, this method is not able to track the maximum power point with changing environment conditions specially when the temperature changes.That means it cannot be applied in a generalized fashion in systems which do not consider the effect of variations of the irradiation and temperature of the PV panels [8,14].
Perturbation and observation (P&O) method is an alternative method to obtain the maximum power point of the PV module.It measures the voltage, current, and power of the PV module and then perturbs the voltage to encounter the change direction [9]. Figure 1 shows the - curve of the PV module.As shown in the left-hand-side MPP the power of the PV is increased with increasing the voltage of the PV module until the MPP is reached.In the right-hand-side of the MPP with increasing the voltage the power is decreased.That means if there is an increase in the power, the subsequent perturbation should be kept in the same direction until MPP is reached.If there is a decrease in the power, the perturbation should be reversed [4,5,8,15,16].The maximum power point is reached when / = 0.The flow chart of P&O method is shown in Figure 2. In order to implement the P&O MPPT method, the PV voltage and current must be initially measured.The change in the voltage (Δ) and the change in the power (Δ) must then be calculated.The PV voltage must then be perturbed by a constant value.If the perturbation in the voltage causes the power to increase, the next perturbation must be kept in the same direction; otherwise, the next perturbation must be reversed.Table 1 summaries the operation of the P&O algorithm [15].
In this paper, a new method based on fuzzy logic controller (FLC) is proposed to achieve maximum power point tracking.The proposed method depends on measuring the change in the PV voltage and power of the PV module.The performance of the FLC method is evaluated by MAT-LAB/SIMULINK.The proposed system is then experimentally implemented.DSPACE real-time control is used in the implementation of the MPPT hardware setup.Data acquisition and the control system is implemented by using dSPACE 1104 software and digital signal processor card on PC.

Characteristics of Solar Module
In order to model the PV module, a PV cell model must be initially established.An equivalent electrical circuit makes it possible to model the characteristic of a PV cell.In a practical PV cell, there are two resistances: series resistance and parallel resistance.Series resistance accounts for the losses in the current path due to the metal grid, contacts, and currentcollecting bus.Parallel resistance due to the loss is associated with a small leakage of current through a resistive path in parallel with the intrinsic device.Parallel resistance is large and its effect is negligible.The equivalent circuit of the PV cell is shown in Figure 3.
The output current delivered to the load can be expressed as follows [4,17,18]: where  is the output current of the solar module (A) and  is the output voltage of the solar cell (V), which can be obtained by dividing the output voltage of the PV module by the number of cells in series,  PV is the current source of the solar module by solar irradiance (A),   is the reverse saturation current of a diode (A),   is the series connection number of the solar module, n is the ideality factor of the diode ( = 1∼2), q is the electric charge of an electron (1.6 ×  −19 c), k is Boltzmann's constant (1.38 × 10 −23 j/K), and T is the absolute temperature of the solar cell ( ∘ K).
To model the PV module using MATLAB, the current generated by the incident light which is also called shortcircuit current ( sc ) at a given temperature (  ) must be calculated as follows [17][18][19]: where  scn is the short-circuit current at normal conditions (25 ∘ C, 1000 W/m 2 ),   is the given temperature ( ∘ K),  PV is the short-circuit current at a given cell temperature (  ),  is the temperature coefficient of  sc , and   is the nominal value of irradiance, which is normally 1000 W/m 2 .On the other hand, the reverse saturation current of diode (  ) at the reference temperature (  ) is given as follows [17,18]: where  ocn is the open-circuit voltage at normal conditions.The reverse saturation current at a given cell temperature (  ) can be expressed as follows [18]:  The BP3115 PV module is used in this paper.The PV module parameters under the reference conditions (1000 W/m 2 , 25 ∘ C) are listed in Table 2.The PV module is simulated using MATLAB.Figure 4 shows the simulated P-V curves of the PV module under changing solar radiation from 200 W/m 2 to 1000 W/m 2 while keeping the temperature constant at 25 ∘ C. On the other hand, Figure 5 shows the simulation results of the - curves of the PV module under changing temperature from 10 ∘ C to 50 ∘ C while keeping the solar radiation constant at 1000 W/m 2 .

DC-DC Buck-Boost Converter
DC conversion has gained the great importance in many applications, starting from low-power applications to highpower applications.In this paper, buck-boost converter is chosen to be used in the MPPT system.Buck-boost converter is used to step down and step up the DC voltage by changing the duty ratio of the MOSFET.If the duty ratio is less than 0.5, the output voltage is less than the input voltage; while if the duty ratio is greater than 0.5, the output voltage is greater than the input voltage.Duty ratio is the time at which the MOSFET is on to the total switching time.The buck-boost converter is shown in Figure 6.
The relation between the input and the output voltages of the buck-boost converter is given as follows:  where  is the duty cycle of the converter which is given as follows: where  on is the on-state time of the MOSFET while   is the switching time.
The buck-boost converter is designed and simulated using MATLAB/SIMULINK.The converter components used in the simulation and in the hardware setup are shown in Table 3.

MPPT-Based FLC Method
PV systems have relatively high initial cost.Approximately 57% is spent on the PV modules, 30% on the batteries, 7% on the MPPT controllers and inverters, and 6% on the installation [20].Therefore, introducing a high-efficient MPPT controller can help in decreasing the total cost of the PV systems.FLC can be used as a controller to obtain the maximum power that the PV modules capable of producing under changing weather conditions.The use of fuzzy logic controllers has been increased over the last decade because they are simplicity, deal with imprecise inputs, do not need an accurate mathematical model, and can handle nonlinearity [21].The nonlinear nature of the PV modules and the environment conditions make the tracking behavior so difficult.Thus, the FLC is an interesting tool to achieve the maximum power and eliminate the complexity in the computation since it is simple, does not need the mathematical model, and does not need any reference MPP parameters [20].
The process of FLC can be classified into three stages, fuzzification, rule evaluation, and defuzzification.These components and the general architecture of an FLC are shown in Figure 7.The fuzzification step involves taking a crisp input, such as the change in the voltage reading, and combining it with stored membership function to produce fuzzy inputs.To transform the crisp inputs into fuzzy inputs, membership function must be first assigned for each input.The number of membership functions used depends on the accuracy of the controller, but it usually varies between 5 and 7 [10].The second step of fuzzy logic processing is the rule evaluation in which the fuzzy processor uses linguistic rules to determine what control action should occur in response to a given set of input values.The result of rule evaluation is a fuzzy output for each type of consequent action.
The last step in fuzzy logic processing is defuzzification in which the expected value of an output variable is derived by isolating a crisp value in the universe of discourse of the output fuzzy sets.In this process, all of the fuzzy output values effectively modify their respective output membership function.One of the most commonly used defuzzification techniques is called center of gravity (COG) or centroid method.
Fuzzy logic was applied in designing different MPPT controllers [14,[20][21][22][23][24][25][26][27].They apply a set of linguistic rules to obtain the required duty cycle.The input variables of the FLC differ from one paper to another.In [22][23][24][25] the inputs to the FLC are the error (E) and the change in error (Δ).The error (E) is calculated as the change in the PV power to the change in the PV voltage (Δ/Δ).The change in the duty cycle is the output from FLC.In other cases, the change in current instead of the change in the PV voltage to calculate the error (E) is used as in [26].Some other papers use other inputs to the FLC such as the change in the voltage (ΔV) and the change in the power (Δ) while the output from FLC is either the change in the duty ratio of the power converter (Δ) or the change in the reference voltage (Δ).Li and Wang use Δ and Δ as the input variables while the output variable is the change in the reference voltage [14].An adaptive fuzzy logic controller for MPPT was presented in [27] to adjust the duty cycle of the defuzzification to enhance the controller performance under changing atmospheric conditions.
In this paper, a new method-based FLC is proposed to achieve tracking the maximum power of the PV module under changing weather conditions.The proposed inputs of the FLC are the change in the voltage of the PV module (Δ) and the change in the power of the PV module (Δ).The proposed output from FLC is (Δ) which corresponds to the modulation signal which is applied to the PWM modulator in order to produce the switching pulses.

The Proposed MPPT Fuzzy Logic Base Method
The input variables are defined as in (8) The theoretical design of the rules is based on the fact that if the change in the voltage causes the power to increase, the moving of the next change is kept in the same direction; otherwise the next change is reversed.After the theoretical design, all the MFs and the rules were adjusted by the trial and error to obtain the desired performance.
The proposed rules are shown in Table 4.The fuzzy rules are designed to track the maximum power point of the photovoltaic system under changing weather conditions.Rapidly changing solar radiation is taken into account while designing these rules.

Simulation Results
In order to verify that the proposed MPP tracker tracks the maximum power point the controller is tested under changing weather conditions.It is important to test the proposed MPPT system under different ambient conditions in order to validate the designed system.The design and the simulation performance are done using MAT-LAB/SIMULINK.The model used for simulation is shown in Figure 11.In this system, the PV module is connected  to the DC-DC buck-boost converter.The output of the converter is the 5 Ω load resistor.In order to start tracking the maximum power, the output voltage and the output current of the PV module must be measured to be used as an input to the MPPT control block.The output of the MPPT control block is the gating signal which is used to drive the MOSFET.The proposed FLC MPPT method is tested under changing weather conditions as shown in Figure 12.As shown in this figure the solar radiation is changed as a constant value 300 W/m 2 until 0.03 sec.The solar radiation is then assumed to be changed as a ramp function with positive slope to account for changing the solar radiation in the sunrise periods.Then the irradiance is changed as a unit step function to account for changing the solar radiation rapidly.In practical point of view, the solar radiation is decreased as a ramp function with a negative slope during the sunset periods.On the other hand, the temperature is kept constant at 25 ∘ C and then raised up rapidly to 50 ∘ C at 0.06 sec.It is clear from Figure 12 that the proposed system will be tested under all expected ambient conditions.These are constant solar radiation, rapidly changing solar radiation, and changing solar radiation as a ramp function.The FLC-based MPPT method is tested under these ambient conditions.The proposed method tracked the maximum power effectively and accurately as shown in Figure 13.The controller tracked the maximum power under all ambient conditions listed above.The proposed system tracked the maximum power under changing solar radiation as a positive and negative ramp function.On the other hand, it follows the maximum power under rapidly changing solar radiation accurately.The tracking efficiency using FLC is 98.13%.The tracking efficiency can be calculated as the energy generated from the PV module divided by the theoretical maximum energy.Comparing the tracking behavior of the proposed FLC MPPT method shown in Figure 13 with the tracking behavior of the P&O MPPT method shown in Figure 14, the tracking efficiency using MPPT fuzzy logic controller is 98.13% which is higher than the tracking efficiency obtained using P&O MPPT method which is 97.15%.On the other hand the oscillation around the MPP when the P&O is used is much higher than that when the FLC is used for MPP tracking.The system performance shows that the proposed system is well functioning to obtain the maximum power that the PV module is capable of producing under different ambient conditions.

Experimental Setup
The implementation of the MPPT hardware setup is done by using dSPACE real-time control.Figure 15 shows the block diagram of the hardware step while Figure 16 shows the hardware setup of the MPPT system.In the hardware setup, one BP 3115J PV module is connected to the DC-DC buckboost converter.Data acquisition and the control system are implemented by using dSPACE 1104 software and digital signal processor card on PC.The PV voltage and the PV current must be initially measured.In this system, the voltage is measured by using the voltage divider while the PV current is measured by using the LTS 25-NP current sensor.The analog measured quantities of the PV voltage and PV current which are fed to the A/D converter of the dSPACE in order to be used in the SIMULINK MPPT control block.The MPPT control which is constructed on MATLAB/SIMULINK is shown in Figure 17.
The signal applied to a dSPACE A/D channel must be in the range from −10 V to +10 V.A signal of +10 V gives an internal value of 1.00 within SIMULINK.The generated PWM signals should not be connected directly to the MOSFET since the maximum current drown from dSPACE board must not exceed 13 mA.For this reason and for the isolation purposes a 6N137 optocoupler is used.The PWM generated signal from the dSPACE is connected to the 6N137 optocoupler and the output of the optocoupler is then connected to the MOSFET gate on the buck-boost converter and manage the on-off time of the switch.

International Journal of Photoenergy
To verify the function and the performance of the proposed FLC MPPT method, the method is experimentally implemented by using dSPACE 1104 data acquisition system.In order to start real-time tracking of the MPP of the PV module, the SIMULINK MPPT control block, must be downloaded to the dSPACE board to generate C code of the MPPT control block.To successfully track the MPP, some modifications were taken into consideration when the proposed method is experimentally implemented.The membership function of the input variable Δ is modified as shown in Figure 18.On the other hand, some of rules are also tuned in order to obtain a better performance.Table 5 shows the modified FLC rules.After doing the above-mentioned modifications, FLC MPPT method is tested under some different ambient conditions.Figure 19 shows the changing in the ambient  20(a) shows the changing in the solar radiation while the lower plot shows the changing in the PV temperature.FLC MPPT method tracked the MPP of the PV module successfully as shown in Figure 20.The upper plot in this figure shows the maximum power tracked.Figures 20(b) and 20(c) show the PV voltage and the PV current at the maximum power.Figure 20(d) the duty ratio which is generated by the proposed FLC method.Duty ratio is measured at the output of the MPPT block which is then directed to the PWM in order to generate the switching pulses of the MOSFET.It is noted that the proposed FLC MPPT method tracked the maximum power successfully and accurately with fast response.Having a deep investigation on the proposed MPPT system performance under rapidly changing solar radiation, the PV module is covered by an opaque cloth to prevent the incidence of the solar radiation on the PV module.Variation of the power, the voltage, and the current of the system is shown in Figure 21.As shown in this figure, the proposed MPPT method has tracked the maximum power effectively and accurately under rapidly changing solar radiation.

Conclusion
Photovoltaic model using MATLAB/SIMULINK and the design of appropriate DC-DC buck-boost converter with a maximum power point tracking facility are presented in this paper.MPPT is achieved using fuzzy logic controller which enhanced the performance of the MPPT and eliminated the complexity in the computation needed.The proposed system is simulated using MATLAB/SIMULINK and tested under different ambient conditions to show the tracking behavior.
The tracking behavior shows that the proposed system successfully and accurately tracked the maximum power point with better performance than that of conventional method.Experimental implementation of the MPPT system is presented in this paper where data acquisition and the control of the proposed FLC MPPT method are achieved by dSPACE 1104.The practical results show that the proposed method tracked the MPP effectively and accurately with fast response.Furthermore, tests verified that the proposed FLC method is well functioning with a good performance on rapidly changing atmospheric conditions.The results indicate that the designed MPP tracker is capable of tracking the PV module maximum power and hence improves the efficiency of the PV system.

Figure 1 :
Figure 1: Variation of / in the - characteristic of the PV module.

Figure 2 :Figure 3 :
Figure 2: The flow chart of the P&O algorithm.

Figure 9 :
Figure 9: The membership function of the input variable (Δ).

Figure 10 :
Figure 10: The membership function of the output variable (Δ).

Figure 16 :
Figure 16: The hardware setup of the system.

Table 1 :
The operation of P&O algorithm.

Table 4 :
Rule base used in the fuzzy logic controller.

Table 5 :
Modified rule base used in the fuzzy logic controller.