# DSPACE Real-Time Implementation of MPPT-Based FLC Method

Authors: Abdullah M. Noman; Khaled E. Addoweesh; Hussein M. Mashaly
Journal: International Journal of Photoenergy
 (2013)

---

## Abstract

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.


---

## Body

## 1. 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–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–12]. The proportional constant K depends on the meteorological conditions, fabrication of the PV cell and on the fill factor of the PV cell [8]:
(1)K=VMPPVoc≅constant<1.
The proportional constant K has been reported to be between 0.71 and 0.78 [13]. The common value of K 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 factorK 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 P-V 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].Figure 1
Variation ofdp/dV in the P-V characteristic of the PV module.The maximum power point is reached whendP/dV=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 (ΔV) and the change in the power (ΔP) 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].Table 1
The operation of P&O algorithm.
Δ
P
PV
Δ
V
PV
Perturbation
>0
>0
IncreaseV
>0
<0
DecreaseV
<0
>0
DecreaseV
<0
<0
IncreaseVFigure 2
The flow chart of the P&O algorithm.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 MATLAB/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.


## 2. 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 current-collecting 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 Figure3.Figure 3
Equivalent circuit of PV cell simulation.The output current delivered to the load can be expressed as follows [4, 17, 18]:
(2)I=IPV-Io(e(q(V+IRs)/(nkTa))-1),
where I is the output current of the solar module (A) and V 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, IPV is the current source of the solar module by solar irradiance (A), Iois the reverse saturation current of a diode (A), NS is the series connection number of the solar module, n is the ideality factor of the diode (n=1~2), q is the electric charge of an electron (1.6×e-19c), k is Boltzmann’s constant (1.38×10-23j/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 short-circuit current (Isc) at a given temperature (Ta) must be calculated as follows [17–19]:
(3)IPV=Iscn(1+a(Ta-Tn))GGn,
where Iscn is the short-circuit current at normal conditions (25°C, 1000 W/m2), Ta is the given temperature (°K), IPV  is the short-circuit current at a given cell temperature (Ta), a is the temperature coefficient of Isc,  and Gn is the nominal value of irradiance, which is normally 1000 W/m2.On the other hand, the reverse saturation current of diode (Io) at the reference temperature (Tn) is given as follows [17, 18]:
(4)Ion=Iscne(qVocn/(nkTn))-1,
where Vocn is the open-circuit voltage at normal conditions. The reverse saturation current at a given cell temperature (Ta) can be expressed as follows [18]:
(5)Io=Ion(TaTn)(3/n)e((-qEg/nK)(1/Ta-1/Tn)).The BP3115 PV module is used in this paper. The PV module parameters under the reference conditions (1000 W/m2, 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/m2 to 1000 W/m2 while keeping the temperature constant at 25°C. On the other hand, Figure 5 shows the simulation results of the P-V curves of the PV module under changing temperature from 10°C to 50°C while keeping the solar radiation constant at 1000 W/m2.Table 2
PV module parameters.
Maximum power (Pmax)
115 W
Voltage atPmax (Vmp)
17.1 V
Current atPmax (Imp)
6.7 A
Open-circuit voltage (Voc)
21.8 V
Short-circuit current (Isc)
7.5 A
Temperature coefficient ofIsc
0.065 ± 0.015%/°CFigure 4
P
-
V curves under changing solar radiation.Figure 5
P
-
V curves under changing temperature.


## 3. DC-DC Buck-Boost Converter

DC conversion has gained the great importance in many applications, starting from low-power applications to high-power 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 Figure6.Figure 6
The buck-boost converter circuit.The relation between the input and the output voltages of the buck-boost converter is given as follows:(6)Vout=-D1-DVin,
where D is the duty cycle of the converter which is given as follows:
(7)D=TonTS,
where Ton is the on-state time of the MOSFET while TS 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 Table3.Table 3
Buck-boost converter parameters
L
1 mH
C
1
1000μF
C
2
330μF
f
s
40 KHZ
Resistive load RL
5 Ω
Controller type: dSPACE 1104 DSP
MOSFET type:  IRF3710
Diode type:  BYV32-200
Components used in the measurement circuit
Current transducer
LTS 25-NP
Voltage divider
Two 120 KΩ and 39 KΩ resistors are connected in series. The voltage is taken across 39 KΩ resistor.


## 4. 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 Figure7. 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.Figure 7
The stages of the FLC.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–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–25] the inputs to the FLC are the error (E) and the change in error (ΔE). The error (E) is calculated as the change in the PV power to the change in the PV voltage (ΔP/ΔV). 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 (ΔP) while the output from FLC is either the change in the duty ratio of the power converter (ΔD)or the change in the reference voltage (ΔV). Li and Wang use ΔV and ΔP 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 (ΔV) and the change in the power of the PV module (ΔP). The proposed output from FLC is (ΔU) which corresponds to the modulation signal which is applied to the PWM modulator in order to produce the switching pulses.


## 5. The Proposed MPPT Fuzzy Logic Base Method

The input variables are defined as in (8). During fuzzification, the numerical input variables which are converted into linguistic variables are based on the membership functions. Figures 8, 9, and 10 show the membership of ΔP,  ΔV, and ΔU,  respectively. Five fuzzy levels are used for all the input and output variables: NB (negative big), NS (negative small), ZE (zero), PS (positive small), and PB (positive big):
(8)ΔV=V(K)-V(K-1),ΔP=P(K)-P(K-1).Figure 8
The membership function of the input variable (ΔP).Figure 9
The membership function of the input variable (ΔV).Figure 10
The membership function of the output variable (ΔU).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 Table4. 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.Table 4
Rule base used in the fuzzy logic controller.
Δ
V
Δ
P
NB
NS
Z
PS
PB
NB
PB
PS
NB
NS
NS
NS
PS
PS
NB
NS
NS
Z
NS
NS
NS
PB
PB
PS
NS
PB
PS
NB
PB
PB
NB
NB
PB
PS
PB


## 6. Simulation Results

In order to verify that the proposed MPP tracker tracks the maximum power point successfully, 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 MATLAB/SIMULINK. The model used for simulation is shown in Figure11. 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/m2 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.Figure 11
MPPT system used for simulation.Changing ambient condition.
(a)
(b)MPP tracking with FLC.
(a)
(b)
(c)MPP tracking with P&O method.
(a)
(b)
(c)


## 7. Experimental Setup

The implementation of the MPPT hardware setup is done by using dSPACE real-time control. Figure15 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 buck-boost 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.Figure 15
Block diagram of the hardware setup.Figure 16
The hardware setup of the system.Figure 17
MPPT SIMULINK model implemented in dSPACE 1104.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.Every signal came from A/D converter must be multiplied by 10. The filters are used for removing any high-frequency noise or any switching noise that appears in the signals. As shown in Figure17 the instantaneous measured voltage and current are then multiplied by each other to obtain the PV instantaneous power. The PV voltage and the PV power are then applied to the MPPT algorithm to generate the required duty cycle. The output signal of the MPPT algorithm is then applied to the DS1104SL_DSP_PWM block which is used to generate the required switching signal to drive the MOSFET. 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.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ΔP 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.Table 5
Modified rule base used in the fuzzy logic controller.
Δ
V
Δ
P
NB
NS
Z
PS
PB
NB
PB
NB
NB
NS
NS
NS
PB
NB
NB
NS
NS
Z
NS
NS
NS
PB
PB
PS
NS
PB
PS
NB
PB
PB
NB
NB
PB
PS
PBFigure 18
Modified membership function of the input variableΔP.After doing the above-mentioned modifications, FLC MPPT method is tested under some different ambient conditions. Figure19 shows the changing in the ambient conditions on 02-10-2012 starting from 08:38 AM to 02:38 PM. Figure 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.Changing the ambient conditions on October 2, 2012.
(a)
(b)Experimental tracking behavior of the FLC MPPT. 02-10-2012.
(a)
(b)
(c)
(d)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 Figure21. As shown in this figure, the proposed MPPT method has tracked the maximum power effectively and accurately under rapidly changing solar radiation.Performance of the FLC MPPT method under rapidly changing solar radiation.
(a)
(b)
(c)
(d)


## 8. 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.



---

*Source: 549273-2013-04-11.xml*