Simulations and dSPACE Real-Time Implementation of Photovoltaic Global Maximum Power Extraction under Partial Shading

: Under partial shading conditions (PSCs), solar photovoltaic (PV) energy systems generate multiple peaks; one global peak (GP) and several local peaks (LPs). Thus, tracking the GP of the PV systems under PSCs is necessary to enhance the system reliability and e ﬃ ciency. Conventional maximum power point tracker (MPPT) algorithms are capable of tracking the unique peak under uniform conditions but they fail to track the GP under PSCs. To the best of our knowledge, this paper represents the ﬁrst study that introduces a comprehensive comparison of three e ﬃ cient maximum power point tracker (MPPT) algorithms that are used to extract the GP of the PV system under both uniform and PSCs. These MPPT techniques include two metaheuristic techniques, which are cuckoo search optimization (CSO) and particle swarm optimization (PSO) techniques in addition to one conventional MPPT; perturb and observe (P&O). Although the simulation and dSPACE-based experimental results demonstrated the superiority of CSO and PSO in tracking the GP, CSO requires less tracking time and thus provides a higher e ﬃ ciency than the PSO. In addition, P&O can be used to follow the ﬁrst peak, regardless if it is a local peak or global peak with notable oscillation. H.M.H.F


Introduction
Solar photovoltaic (PV) systems are the most promising clean energy technologies because they are abundant, noiseless, and environment-friendly compared with conventional energy sources. Tracking the maximum power of solar PV systems can increase the generated output power by almost 30% and thus represents an attractive research area. Several DC/DC converters are used to control the output voltage of PV arrays and thus the generated power by controlling the duty cycle [1][2][3]. Several DC/DC converters may be utilized to detect the global peak (GP) such as boost, buck, buck-boost, SEPIC and flyback converters. The boost converter is one of the most popular DC/DC converters used in many PV applications because they require boosting of the output voltage to be suitable for the loads [3][4][5].
Under uniform irradiance conditions, the correlation between the output power and output voltage of the PV system shows only one GP. In this case, the traditional maximum power point tracker (MPPT) methods; for example, perturb and observe (P&O), incremental conductance, and hill climbing; are adequate to detect this GP in the P-V curve [6,7]. In contrast, a unique GP and multiple local peaks (LPs) are created under partial shading conditions (PSCs), which may cause the traditional MPPT methods to append to one of the LPs under certain partial shading conditions (PSCs). Metaheuristic MPPT techniques can be used to solve and overcome this problem; they can be used to

PV Module Modelling
Among the various PV modules, the two-diode model presented in Figure 1 requires less computational time and provides good results under low solar irradiance. The equivalent circuit of a PV array, which contains series (Ns) and parallel (Np) modules arranged in a series-parallel configuration, based on the two-diode model is presented in Figure 1b [21,22]. The PV array current is formulated as follows: where I sun is the PV generated current by the incident light; R s and R p are the series and parallel resistances, respectively; and I d1 and I d2 are the diodes 1 and 2 reverse saturation currents, respectively. The other parameters are defined as follows: V T1 and V T2 are the thermal voltages of the PV module.
Both V T1 and V T2 equal to N s k T/q where; N s is the series cells number, T is the cell temperature, k is the Boltzmann coefficient (1.3806503 × 10 −23 J/K), and q is the charge of electron (1.60217646 × 10 −19 C). The variables a 1 and a 2 are the diode ideality coefficients.   Figure 2 represents the MATLAB/SIMULINK schematic diagram of the PV system under study. The power conversion system comprises two PV modules interconnected in series, DC/DC converter, and resistive load. The electrical parameters of Sharp ND R240A5 240W PV module which are used in this study are listed in Table 1. The DC/DC converter parameters are selected to make the converter operate in continuous conduction mode. Its specifications are shown in Table 2. The instantaneous output power is measured by multiplying the voltage (VPV) and current (IPV). The output power is sent to the MPPT algorithm, which in turn produces the duty cycle (D). The boost converter is enforced to drive based on this D value, which results in the desired voltage (VMPP).  Figure 2 represents the MATLAB/SIMULINK schematic diagram of the PV system under study. The power conversion system comprises two PV modules interconnected in series, DC/DC converter, and resistive load. The electrical parameters of Sharp ND R240A5 240W PV module which are used in this study are listed in Table 1. The DC/DC converter parameters are selected to make the converter operate in continuous conduction mode. Its specifications are shown in Table 2. The instantaneous output power is measured by multiplying the voltage (V PV ) and current (I PV ). The output power is sent to the MPPT algorithm, which in turn produces the duty cycle (D). The boost converter is enforced to drive based on this D value, which results in the desired voltage (V MPP ).   Three different shading patterns are chosen and applied to the PV array based on the site characteristics (Riyadh region in Saudi Arabia) to simulate uniform and PSCs, as shown in Figure 3. Under uniform conditions, the irradiances applied to both PV modules are the same (Ir 1 = 900; Ir 2 = 900) and the P-V curve shows a unique GP with a power value of 400 W. In contrast, two different shading patterns are applied to simulate the PSCs. Under PSCs, the P-V curve is more complex; it contains multiple peaks. The highest one is the GP, which denotes the maximum power generated from the PV system, while the others are LPs. The GP of the first shading pattern (SP), that is, SP #1 (900 600), is placed at the end of the power curve and has output power of 286 W. On the other hand, the GP of SP #2 (900 300) is placed in the beginning of the power curve and has a power of 196 W. A CSO technique-based MPPT is proposed in this study to quickly follow the GP and avoid trapping to any LPs. The inputs of the CSO are the PV current and voltage while the duty cycle is its output. The CSO follows and tracks the GP through controlling the duty cycle (D) of the boost converter. To prove the superiority of the CSO, the CSO is compared with a metaheuristic PSO technique and conventional P&O using both simulation and experimental setups.

Cuckoo Search Optimization Technique
The CSO is a nature-inspired metaheuristic algorithm, stimulated by the sponging reproduction

Cuckoo Search Optimization Technique
The CSO is a nature-inspired metaheuristic algorithm, stimulated by the sponging reproduction tactics of certain cuckoo species. It is known that several types of cuckoos use brood parasitism strategies, that is, they place their eggs in the nest of another bird. The following rules describe the CSO technique [23,24]: - The cuckoo places one egg at a time in an arbitrarily selected nest. - The best nests with high quality eggs will pick up to the subsequent generations. - The cuckoo destroys several eggs of the host bird to improve the hatchlings' chances of receiving more food. - The host bird notices an unfamiliar egg. In this situation, the host bird either destroys the cuckoo's eggs or dumps the nest to erect a new nest in a different place, with a probability P a .
Based on these four rules, the CSO is utilized to track the GP in both the simulation and experiment according to the following steps: Step 1: First, the CSO parameters for the GP search are defined. In this study, the boost converter duty cycles, that is, D i (i = 1, 2 . . . n), and Lévy multiplication coefficient (L m ) were selected as parameters.
Step 2: The initial duty cycles D i are consecutively sent to the boost converter and the respective power (objective function) values are calculated. The maximum power and duty cycle are reserved as the current best sample. New duty cycle samples are created by using the Lévy flight and the following equation: where β = 1.5, L m is the Lévy multiplication factor, and u and v are randomly selected from the normal distribution function, that is: The variables σ u and σ v are calculated using the gamma function: Step 3: The new duty cycles are sent to the DC/DC converter and the respective power is measured. The maximum power produced by the duty cycle is chosen as the new best sample. In addition, certain samples are arbitrarily neglected, with a probability of P a , to mimic the actions of the host bird noticing and destroying the cuckoo's eggs. Therefore, new random samples are produced to substitute the destroyed ones and the power values of all new samples are measured. The best current is chosen by comparing the power values.
Step 4: When the termination criteria are reached, the CSO is stopped and the best duty cycle is the output, which corresponds to the GP.
The flowchart including these four steps is shown in Figure 4.
actions of the host bird noticing and destroying the cuckoo's eggs. Therefore, new random samples are produced to substitute the destroyed ones and the power values of all new samples are measured. The best current is chosen by comparing the power values.
Step 4: When the termination criteria are reached, the CSO is stopped and the best duty cycle is the output, which corresponds to the GP.
The flowchart including these four steps is shown in Figure 4.

Particle Swarm Optimization Technique
The PSO is a metaheuristic technique, which is characterized by simplicity, efficiency, accuracy, and robustness. Tracking the GP relies on the particle position and velocity, which are revised to identify the right track of the GP instead of trapping to one of the LPs. The updated position of the particle can be calculated as follows [16,18]: The particle velocity v i k+1 can be calculated using the current position x i k , particle velocity v i k , and global best position (G best ) as follows [16,25]: where ω is the inertia weight that governs the exploration region and c 1 and c 2 are the acceleration coefficients [26,27].
In the PSO technique, the GP search process is started by submitting the duty cycles D i to the boost converter. The output voltage and current are multiplied together to estimate P best and G best , as shown in Figure 5. The updated duty cycles are estimated and renewed using the previously mentioned position and velocity Equations (5) and (6), respectively. The PSO logic steps used for the simulations and experiments are as follows: Step 1: The PSO coefficients (ω, c 1 and c 2 ) for the GP search are defined, the duty cycles are sequentially sent, and the respective power values are determined.
Step 2: The new particle position and velocity (D k+1 i and v k+1 i ) are updated based on Equations (1) and (2), respectively.
Step 3: The new duty cycles are sent and the respective generated power is measured.
Step 4: The P best,i , G best and the associated particle position (duty cycles) are evaluated; then, repeat Step 2.

Perturb and Observe (P&O) Technique
The P&O is commonly applied to detect the MPP due to its low cost and simplicity [7]. In this technique, the output voltage and current of the PV system are measured. Subsequently, the system voltage is varied and the power calculated between each two voltages is compared. After each perturbation, the P&O compares the generated power of the PV system before and after each perturbation. The direction of each perturbation depends on the generated power: the perturbation will be in the same direction if the PV system generates more power when the system voltage changes and otherwise will be in the reverse direction. These trials are recurring continuously, and the reference voltage is produced and fed to the boost converter controller as shown in Figure 6 [5,7]. The mathematical illustration of the P&O is represented as follows:

Perturb and Observe (P&O) Technique
The P&O is commonly applied to detect the MPP due to its low cost and simplicity [7]. In this technique, the output voltage and current of the PV system are measured. Subsequently, the system voltage is varied and the power calculated between each two voltages is compared. After each perturbation, the P&O compares the generated power of the PV system before and after each perturbation. The direction of each perturbation depends on the generated power: the perturbation will be in the same direction if the PV system generates more power when the system voltage changes and otherwise will be in the reverse direction. These trials are recurring continuously, and the reference voltage is produced and fed to the boost converter controller as shown in Figure 6 [5,7]. The mathematical illustration of the P&O is represented as follows: where, P pv (k) and P pv (k − 1) are the present power and former generated power, V pv (k) and V pv (k − 1) stand for present PV voltage and the former one.
Sustainability 2020, 12, x FOR PEER REVIEW 9 of 18 where, ( ) and ( − 1) are the present power and former generated power, ( ) and ( − 1) stand for present PV voltage and the former one.

Simulation Results and Discussion
To investigate the performance of the three MPPT techniques (CSO, PSO, and P&O) with and without partial shading, numerical simulations were carried out under uniform and PSCs for comparison purpose. Three different uniform and partial shading cases are selected based on the site characteristics (Riyadh region in Saudi Arabia), as shown in Figure 3. The dSPACE real-time implementation for the CSO and PSO will be discussed in detail in the next section.
The characteristics of the simulation results based on these MPPT techniques under uniform and PSCs are introduced as follows:

Case #1:
Under uniform conditions, the irradiances applied for the two PV modules are the same (900 900) and a unique peak with power and voltage values of 400 W and 53 V, respectively, is created in the P-V curve shown in Figure 3. From Figure 7, some observations can be summarized as follows: -Although the CSO, PSO, and P&O can detect the unique peak power (400 W), the P&O technique requires less time to detect the peak power compared with the CSO and PSO. - The P&O technique shows a notable oscillation around the generated peak power and voltage, which can be mitigated through the reduction of the sampling time.

-
The CSO and PSO require longer tracking times to search for the GP compared with the P&O technique due to their initialization and complex computations. Therefore, the P&O technique efficiently tracks the unique peak under uniform conditions.

Case #2:
The GP of SP #1 (900 600) is placed at the end of the power curve and has a power value of 286 W. From Figure 8, some observations can be summarized as follows:

Simulation Results and Discussion
To investigate the performance of the three MPPT techniques (CSO, PSO, and P&O) with and without partial shading, numerical simulations were carried out under uniform and PSCs for comparison purpose. Three different uniform and partial shading cases are selected based on the site characteristics (Riyadh region in Saudi Arabia), as shown in Figure 3. The dSPACE real-time implementation for the CSO and PSO will be discussed in detail in the next section.
The characteristics of the simulation results based on these MPPT techniques under uniform and PSCs are introduced as follows:

Case #1:
Under uniform conditions, the irradiances applied for the two PV modules are the same (900 900) and a unique peak with power and voltage values of 400 W and 53 V, respectively, is created in the P-V curve shown in Figure 3. From Figure 7, some observations can be summarized as follows: -Although the CSO, PSO, and P&O can detect the unique peak power (400 W), the P&O technique requires less time to detect the peak power compared with the CSO and PSO. - The P&O technique shows a notable oscillation around the generated peak power and voltage, which can be mitigated through the reduction of the sampling time. regard to the tracking time and GP tracking compared with the PSO and P&O techniques.

Case #3:
The GP of SP #2 (900 300) is located in the beginning of the power curve and has a power value of 196 W. From Figure 9, some observations can be summarized as follows:

Case #2:
The GP of SP #1 (900 600) is placed at the end of the power curve and has a power value of 286 W. From Figure 8, some observations can be summarized as follows: - The P&O technique is unable to detect the GP and stick to the first LP with a power of 196 W. In addition, oscillation is notable, as shown in Figure 8. -Although the CSO and PSO succeed in detecting the GP, the CSO requires less tracking time (0.73 s) compared with the PSO (1.03 s). Therefore, the performance of the CSO is superior with regard to the tracking time and GP tracking compared with the PSO and P&O techniques.

Case #3:
The GP of SP #2 (900 300) is located in the beginning of the power curve and has a power value of 196 W. From Figure 9, some observations can be summarized as follows:

Experimental Implementation, Results, and Discussion
The hardware of the MPPT algorithms is implemented via a dSPACE real-time control. The DS1104 real-time controller board is a well-known dSPACE prototype. It provides many controlling and monitoring functions and facilitates more efficient enhancements of the control algorithms. The schematic diagram and the photo of the experimental setup used for the MPPT algorithms are shown in Figures 10  and 11, respectively. In the experimental setup, two series Sharp ND R240A5 240W modules are connected to the DC/DC converter, which supplies the load. The signal measurements and MPPT algorithms are carried out using the dSPACE software, DS1104 card, and a PC. The PV voltage and current are measured with LV 25-P and LTS 25-NP sensors, respectively. The measured variables are sent to the MPPT algorithms via the dSPACE ADC converter to produce the required duty cycle (D). A signal of +10 V applied to the dSPACE ADC channel provides an internal value of 1.00 in the DS1104. Therefore, each signal sent from the ADC converter must be multiplied by a factor of 10 in Simulink. Low-pass filters are used to eliminate any switching noise that emerges in the signals. The duty cycle is then sent to the DS1104SL DSP PWM block to produce the On/Off signal to drive the IGBT. The MPPT algorithms, which are built using MATLAB/Simulink, are presented in Figure 12. The PWM signals should not be directly sent to the IGBT because the maximum current allowed by the dSPACE-DS1104 board must not exceed 13 mA. Accordingly, a single driver circuit (SKHI 10/12R) from SEMIKRON is used. The PWM signal is sent from the dSPACE to the SKHI 10/12R driver and the output is then sent to the IGBT gate on the boost converter to switch the IGBT on or off.

Experimental Implementation, Results, and Discussion
The hardware of the MPPT algorithms is implemented via a dSPACE real-time control. The DS1104 real-time controller board is a well-known dSPACE prototype. It provides many controlling and monitoring functions and facilitates more efficient enhancements of the control algorithms. The schematic diagram and the photo of the experimental setup used for the MPPT algorithms are shown in Figures 10 and 11, respectively. In the experimental setup, two series Sharp ND R240A5 240W modules are connected to the DC/DC converter, which supplies the load. The signal measurements and MPPT algorithms are carried out using the dSPACE software, DS1104 card, and a PC. The PV voltage and current are measured with LV 25-P and LTS 25-NP sensors, respectively. The measured variables are sent to the MPPT algorithms via the dSPACE ADC converter to produce the required duty cycle (D). A signal of +10 V applied to the dSPACE ADC channel provides an internal value of 1.00 in the DS1104. Therefore, each signal sent from the ADC converter must be multiplied by a factor of 10 in Simulink. Low-pass filters are used to eliminate any switching noise that emerges in the signals. The duty cycle is then sent to the DS1104SL DSP PWM block to produce the On/Off signal to drive the IGBT. The MPPT algorithms, which are built using MATLAB/Simulink, are presented in Figure 12. The PWM signals should not be directly sent to the IGBT because the maximum current allowed by the dSPACE-DS1104 board must not exceed 13 mA. Accordingly, a single driver circuit (SKHI 10/12R) from SEMIKRON is used. The PWM signal is sent from the dSPACE to the SKHI 10/12R driver and the output is then sent to the IGBT gate on the boost converter to switch the IGBT on or off.   Table 3) under uniform and PSCs are introduced as follows:   The experimental characteristics of the CSO and PSO MPPT techniques based on the three different patterns (shown in Table 3) under uniform and PSCs are introduced as follows:

Case #1:
Under uniform conditions (900 900), a unique peak is created. As shown in Figure 13, both the CSO and PSO techniques can track the unique peak power (400 W), but the CSO requires less tracking time (3.2 s) to detect the peak than the PSO (5.5 s).

Case #2:
For SP#1 (900 600), the GP occurs at the end of the power curve, with a GP power of 286 W. As shown in Figure 14, both the CSO and PSO succeed in tracking the GP power, but the CSO technique requires less tracking time (3.2 s) compared with the PSO technique (5.5 s). This means that the metaheuristic technique is suitable under PSCs, regardless of the GP position. In conclusion, the CSO has a superior performance with regard to the tracking time and GP tracking than the PSO and thus a higher efficiency.  The experimental characteristics of the CSO and PSO MPPT techniques based on the three different patterns (shown in Table 3) under uniform and PSCs are introduced as follows:

Case #1:
Under uniform conditions (900 900), a unique peak is created. As shown in Figure 13, both the CSO and PSO techniques can track the unique peak power (400 W), but the CSO requires less tracking time (3.2 s) to detect the peak than the PSO (5.5 s).

Case #2:
For SP#1 (900 600), the GP occurs at the end of the power curve, with a GP power of 286 W. As shown in Figure 14, both the CSO and PSO succeed in tracking the GP power, but the CSO technique requires less tracking time (3.2 s) compared with the PSO technique (5.5 s). This means that the metaheuristic technique is suitable under PSCs, regardless of the GP position. In conclusion, the CSO has a superior performance with regard to the tracking time and GP tracking than the PSO and thus a higher efficiency.

Case #1:
Under uniform conditions (900 900), a unique peak is created. As shown in Figure 13, both the CSO and PSO techniques can track the unique peak power (400 W), but the CSO requires less tracking time (3.2 s) to detect the peak than the PSO (5.5 s).

Case #2:
For SP#1 (900 600), the GP occurs at the end of the power curve, with a GP power of 286 W. As shown in Figure 14, both the CSO and PSO succeed in tracking the GP power, but the CSO technique requires less tracking time (3.2 s) compared with the PSO technique (5.5 s). This means that the metaheuristic technique is suitable under PSCs, regardless of the GP position. In conclusion, the CSO has a superior performance with regard to the tracking time and GP tracking than the PSO and thus a higher efficiency.

Case #3:
For SP#2 (900 300), the GP occurs in the beginning of the power curve, with a GP power value of 196 W. As shown in Figure 15, both the CSO and PSO succeed in tracking the GP power, but the CSO requires less tracking time (3.2 s) compared with the PSO (5.5 s). Thus, the CSO has a better performance than the PSO technique.          Both the simulated and experimental results reveal that the CSO technique tracks the GP power faster than the PSO technique. Thus, a high efficiency can be achieved and the PV system is characterized by less disturbance because the search time is shorter. The difference between simulated and experimental tracking time values occurs because the effect of the wind speed and the ambient temperature variation are not considered in the simulation. Furthermore, the IGBT switch and the boost inductor are assumed to be ideal in the simulation.

Conclusions
Uniform irradiance of the PV modules generates a unique peak in the P-V curve, while multiple peaks are observed under PSCs; one GP and many LPs. Three different GP cases are applied to the PV array under uniform and PSCs based on the site characteristics (Riyadh region in Saudi Arabia). The simulated and experimental results obtained using the CSO, PSO, and P&O-based MPPT techniques were compared to investigate the performances of these three MPPT techniques in terms of GP power tracking and tracking time. Based on these comparisons, it can be concluded that CSO has a superior performance in terms of GP tracking without oscillation and tracking or convergence time under both uniform and PSCs compared with the PSO. The CSO requires less time for GP convergence compared with the PSO. Thus, the efficiency and stability of the PV system are improved. The PSO-based MPPT technique has a superior performance than the P&O with regard to GP tracking and oscillation around the generated GP. Finally, P&O-based MPPT has trapped to a LP instead of tracking the GP. In addition, oscillation around the output power generated is notable, which may lead to a disturbance in the PV system. Thus, the use of the P&O-based MPPT technique is not suitable under PSCs.