MPPT of a Photovoltaic Panels Array with Partial Shading Using the IPSM with Implementation Both in Simulation as in Hardware

This article presents a method for the Maximum Power Point Tracking (MPPT) of a Photovoltaic (PV) panels array with partial shading, applying an Improved Pattern Search Method (IPSM). The method is simulated in PSIM@ and then implemented in hardware in the loop system, emulating the PV array on an industrial computer (Speedgoat) that allows real-time emulations and the IPSM is applied in an Arduino DUE. The experiments were carried out with TP245S-20/WD, KYOCERA KC200GT, YINGLY SOLAR JS65, and MSX60 photovoltaic panels. The results are the proper MPPT with changes in partial shading over time, inducing the increase and decrease of the maximum power point. The results obtained are the search for the global maximum power point in a matrix of panels in which, due to partial shading, it might have several local maximum power points, and thanks to the IPSM algorithm, it always manages to find the global maximum power point. Finally, the results are compared with other methods where it was found that IPSM had faster answers.


Introduction
Electricity is mostly generated through systems that deteriorate the environment, such as the burning of fossil fuels. This method of conventional generation has caused strong criticism from the scientific community and society in general due to its direct impact on global warming. The need for electric power has grown exponentially in recent decades and issues related to current power supply systems are fundamental to this [1], making the development of sustainable, renewable energy generation processes a highly interesting topic for the academic community.
As a solution to all these problems, smart grid systems are being worked on. This consists of migrating from a centralized energy generation system to a distributed energy generation system. Among the energy conversion systems most used for these systems are renewable generation systems [2].
Among the renewable generation systems, the most commonly used are wind turbines and photovoltaic (PV) panels. Wind-powered systems, whose fuel is abundant and free, present an intermittent flow since it depends both on the geographical location of the turbine and, on the season of the year. On the other hand, photovoltaic systems (in this case the fuel is solar radiation) have been gaining strength in the last decade, transforming the energy of the light into electrical energy. PV systems are attractive due its (i) high availability of solar radiation in most territories around the globe, (ii) its maintenance cost is cheap, and (iii) it being environmentally friendly [3].
However, photovoltaic systems have difficulties in extracting the maximum available power, as this varies according to circumstantial variations, so it works with MPPT [4].
Several methodologies have been used for the MPPT in PV arrays, the ones that use optimization algorithms aim to find the Maximum Power Point (MPP) and techniques based on data comparison. For instance, [5] presents a method called Adaptive Radial Movement Optimization (ARMO) to mitigate the effect of the Partial Shading (PS) problem in the MPP detection for PV systems with additional dynamic applications. In [6,7] a voltage-oriented MPPT method is proposed, where the perturb and observe (P&O) algorithm is combined with the proposed external voltage control based on an adaptive integral-derivative sliding mode. Authors in [8] introduce a method based on a power versus static conductance curve of a PV panel, where the MPP is obtained by comparing the PV array instantaneous power to a varying power reference generated by the MPPT algorithm. Authors in [9] suggests an overall distributed MPPT algorithm to rapidly search the area near the global MPP, which is further integrated with the Particle Swarm Optimization (PSO) algorithm to improve the accuracy of the MPP location. As is reported in the literature, the classical optimization algorithms can be found in: Particle swarm optimization (PSO) [10][11][12][13], Cukoo search [14], and Artificial Neural Network (ANN) [15,16]. However, the most widely-used solutions are probably the classical P&O [17][18][19] and those based on the Incremental Conductance (IC) [20]. Nevertheless, it has been shown that P&O MPPT and the MPPT based on IC, exhibit a bad behavior when the system is under a partial shading condition or the temperature is variable [21,22]. Hence, partial shading represents a main operational challenge for PV arrays analysis.
Due to the lack of hardware implementations for this topic found in the literature, in contrast with the validations made by simulations that are commonly used, to show the potential real-life application, hardware implementation must be sought since this is an active search field. For instance, an implementation of a P&O MPPT in Arduino can be found in [23]. In [24] a MPPT based on a modified incremental conductance is implemented in hardware. Recently, authors in [25] proposed a hybrid MPPT algorithm in combination with a Whale Optimization algorithm. Therefore, this paper proposes an optimization algorithm based on the improved pattern search method (IPSM) applied to the MPPT with partial shading. The study was performed with four PV of different references (MSX60, STP245S, KC200GT, and JS65) connected in series, taking into account different levels of solar radiation. To validate the proposed application, a circuit analysis is applied with four PV panels in a series connection with its corresponding simulation in PSIM @ software applying the IPSM. In addition, through a hardware in the loop emulation implemented with a SpeedGoat, the operation of the MPPT algorithm based on IPSM in simulation was demonstrated, emulating a three PV panels array connected in series. The IPSM for the MPPT was applied from an external device, in this case an Arduino DUE, to evidence the efficiency of the applied algorithm.
The paper is organized as follows: The mathematical models for both a single PV panel and an array of PV panels are introduced in Section 2. In Section 3, the Partial Shading problem is exposed. Section 4 presents the proposed MPPT based on IPSM. Simulation and experimental results are presented in Section 5. Finally, Section 7 summarizes the main conclusions.

Mathematical Model of a Photovoltaic Panel
For the proper study of the MPPT algorithms, it is necessary to have a mathematical model of the PV panel able to perform the simulations with changes in solar radiation or Irradiance (G) and Temperature (T), different from what is supplied by the manufacturer. This is in order to work in a controlled environment to guarantee the results on variable operating conditions. The model utilized is the single diode model is the most common mathematical model found in the literature and is explained in [26][27][28][29]. Its equivalent circuit is presented in Figure 1. The I-V characteristic of the circuit is given by Equation (1), with the following parameters: Saturation current (I d ), Series Resistance (R s ), Shunt Resistance (R p ), Photovoltaic current (I p h), and Thermal voltage (V t ) depends on the Ideality factor (m) of the diode as seen in Equation 2. Number of cells in series (N s ), Boltzman's constant (K) which value is (1.381 × 10 −23 J/K), and the Electron charge (q) (1.602 × 10 −9 C). To estimate the variables I d , R s , R p , and I ph , optimization algorithms can be used basing on the data of a known PV panel. An example of such optimization-based identification algorithms can be seen in [30], where the variables I d , R s , R p , and I ph are estimated and the curve representing the PV panel is generated as shown in Figure 2 where the power vs voltage (P-V) curve is depicted. Equation (4) describes the short circuit current relation with the solar radiation whose measure unit is W/m 2 and its measure in standard conditions is G = 1000 W/m 2 . The equation obtained from [31] shows how the solar radiation affects the PV panel characteristic curve, affecting the MPP directly. Equation  (1) and (5) the power in Equation (6) can be calculated. It can be concluded that the power is directly dependent on G parameter, since current I ph is in both equations, and the irradiance affects the I ph . Regarding this idea, G change due to partial shading, taking into account that the partial shading can modify the PV panel characteristic curve drastically and in turn the MPP through time. (3)

Mathematical Model of an Array of Photovoltaic Panels
The mathematical models of PV panels are widely known, whether they have one or two diodes, depending on the kind of PV panel, that is to say whether it is mono crystalline or poly crystalline technology. To study a PV array it is necessary to connect several cells in series or parallel. For the partial shading case, it is considered a PV array of panels connected in series where, changes in the characteristic curve can be observed when three or more panels are connected in series. In this case, it presents one peak for every PV panel, considering that each panel might have a different irradiance. It can happen due to partial shading, the generation of multiple-peaks in the P-V curve, thus limiting the MPPT operation. In this study, the implemented configuration was a four panels series connection, which is the configuration that presents difficulty in finding the MPP when there are changes in irradiance (G) or temperature (T) in the PV panels.
The papers [32][33][34] propose the circuit illustrated in Figure 3, Equation (7) represents the circuit with the following parameters: I d is the saturation current of the diode, Output Current of the Panel (I) in the physical terminals, Panel Voltage at the terminals (V), R s is the equivalent series resistance of the panel due to ohmic losses of the metal connections between the N s photovoltaic cells, R p is the parallel resistance of the panel due to leakage currents dissipated in the equivalent diode, and the amount of series and parallel PV panels are specified with N s and Number of cells in paralel (N p ) respectively, for this case N p = 1. Figure 4 shows a good example about partial shading, where four PV panels were used. In this example, each panel has a different irradiance, obtaining the dynamic illustrated in the P-V curve. It can be seen that the GMPP corresponds to the global maximum and three local maximums. As a result of this behavior, it is difficult to find the global maximum online, since every change in irradiance influences the PV panels performance. For this reason, optimization techniques become adequate to find all the peaks and select the proper voltage value to obtain the maximum power.

Shading Partial Problem
PV panels have a non-linear behavior and their performance depend on the MPPT technique. In Figure 2, it is depicted the characteristic curve of a PV panel, highlighting the strong dependency between the power and solar radiation. The maximum power, around 160 W/h, is obtained when the irradiance is about 1000 W/m 2 . On the other hand, if the irradiance is 200 W/m 2 the power will decrease to 60 W/h. These irradiance changes can be generated frequently due to the partial shading that can be presented by stationary clouds or unknown objects that can overlap on the PV panel.
The problem becomes more complicated with several panels connected in series as shown in Figure 5, where for instance, there are 4 PV panels connected in series. Table 1 shows the irradiance that each PV panel receives in each case. In case (a), there is a partial shading in PV panel 2, 3, and 4, and total irradiation in PV panel 1. As a result of this partial shading profile, a characteristic curve with four different peaks is generated. Moreover, the irradiation and partial shading profiles continuously change over time, for this reason it is necessary to have a continuous and fast response MPPT control.

Pattern Search Method (PSM)
Metaheuristic algorithms are used in the optimization of non-linear functions due to the guarantee of convergence to the global optimum regardless of the number of local maximums that the function might have. The pattern search method (PSM) is presented in [35] where it is explained how the algorithm carries out an exhaustive search to find the global extreme, always ensuring convergence. It selects a working area and throws equidistant particles ∆k, as shown in Figure 6. The exploratory movements are conducted determining what the local minimum or maximum is according to the objective function requirements, leaving the latter as a pattern. Once the pattern has been determined, all other particles must make jumps of amplitude ∆j previously defined. Hence, the particles will move towards the standard particle. Once this movement has been made, an exploratory movement will be conducted again. If any of the particles in the iteration have a new global minimum or maximum better than the previous pattern, this will become the new pattern, determining new directions of other particles.
PSM applications as reported in [36], have been applied to a constrained system. In Figure 7 [37], PSM has worked to MPPT in PV arrays with partial shading conditions, whereby a global or general pattern search lead to results in Matlab @ comparing it with other optimization algorithms.

Proposed Method
The IPSM algorithm is presented in this subsection. It is a variation of the PSM presented in Section 4.1, so it inherits the properties of the PSM. The IPSM has the same philosophy of the PSM, where equidistant particles are generated at the beginning in the selected work area δk, as is illustrated in Figure 8. In the (t + 0), the exploratory movements are conducted determining the minimum or maximum according to need and this is marked as a pattern. From this pattern, a new equidistant mesh is generated, taking as limits the closest particles already evaluated. An example is given in Figure 8 in (t + 1). At this point, the exploratory movement is performed again and the process is repeated until it reaches a previously determined stop criterion when an error or a certain number of iterations. It is important to note that for the number of initial particles, it is necessary to know previously the number of peaks that can be generated to establish the minimum amount of particles to start. In Figure 9 it is possible to observe how this restriction might affect some applications but for some approaches, such as the MPPT of a PV array in which the number of peaks can be known since it is equal to the amount of PV panels in series, the improvement in the algorithm is ideal, developing a faster response and obtaining fewer energy losses as shown later.

Initialize
Operation range (Or) P articles number (P n) Jump = Or/P n V olt = Jump

Simulation Setup
The PSIM@ simulation of four panels connected in series was performed to generate a controlled environment simulating partial shading conditions, changing the irradiance time in different PV panels.
First, the setup was implemented as proposed by [38] for the MPPT of a PV system. For this assembly, a DC-DC converter commonly used for photovoltaic systems as for example in [39], the parameters of the sliding surface were taken into account, as well as the Proportional, Integral, Derivative (PID) control parameters proposed, changing only the load, since there are four panels in a series connection. In Figure 10 the total experimental assembly is displayed, with a battery as a load of V battery = 900 V. The PV panels used were Kyocera KC200GT0, which have a maximum power in standard conditions (i.e., G = 1000 W/m 2 and T = 298 K) of 200 W, therefore, the PV system have a total power of 800 W.

Simulation Results
In the simulation, in a period of 0.12 s, 6 changes were generated in the G of the PV panels over time. A sample of the changes performed with their profiles can be observed in Figure 5, where it is evidenced the MPP for each of the profiles to which the optimization algorithm must arrive. Table 1 reports the changes of irradiance G on each panel every 0.02 s.
The following describes the results obtained from the simulation, by which the speed of response will depend directly on the equipment with which you are working.
With the changes in the irradiance, the simulation yields the MPPT as is shown in Figure 11, that is to say, the ideal power level to which the algorithm should arrive on the blue dashed line (Model MPP). As is depicted, in the first 0.02 s the MPPT reaches the ideal power of 396 W, according to the irradiance described in Table 1. Nevertheless, in the 0.10 s time frame, the MPPT gets very close to the ideal power but there is a small lag of 8 W, having an error of 2%. It was necessary to apply changes on G (both ascending and descending) in the simulation to validate that the algorithm works in all conditions by constantly having results with an error below 2%. Thus, the proposed IPSM proves its accuracy for the MPPT of PV arrays in a series connection under different irradiance conditions.  Figure 12 illustrates the experiment configuration: A Speedgoat IO-02 which has the processing capacity to emulate a real-time PV panel, an Arduino DUE where the IPSM was applied, and a ROHDE & SCHWARZ RTE 1204 oscilloscope to visualize the results.

Experimental Setup
The first step was to make the circuit diagram of PV panels series connection as seen in Figure 13 in Simulink/Matlab @ R2011 software which is compatible with Speedgoat. This model depends on several sub-circuits. The first sub-circuit, presented in Figure 14, emulates a PV panel, the second sub-circuit will emulate the irradiance.
Regarding the PV panel model presented in Section 2, the variables to tune are: Id, R s , R p , and I ph , for each PV panel these variables change. To identify these parameters, several authors [33,40] propose a method based on improved methods that take into account the PV panel parameters obtained from the datasheet of each manufacturer. The experiment was carried out four times with different PV panels: Solarex MSX60, SUNTECH STP245S-20/Wd, Kyocera KC200GT, and Yingli solar JS65. Table 2 expose the technical data for each PV panel and Table 3 presents the parameters used for each PV panel.
The circuit that emulates the irradiance is presented in Figure 15. [41] proposes a Simulink @ system which depends on Isc stc (%/ • C) of each panel. Finally, the model is implemented for three PV panels connected in series. In this way, the input and output of the Speedgoat are set to be able to read the current power (W) and the input to create the changes in the voltage (V).     Different voltage sweeps to the series connection were performed, while G was constant for every sweep. That is to say, a voltage sweep for the series connection was the first test with a G value, for the second one, which changes the G values and the sweep voltage. Figure 16 illustrates the characteristic curves of each configuration in the oscilloscope. With the emulation of the PV series connection suitably working, the Arduino DUE connects the analog input and output with the output and input of the Speedgoat respectively, where the input will indicate the power generated by the PV array and the output will change the voltage of the PV array, which is where the IPSM algorithm established in Section 4.2 will work. The algorithm requires several changes in the G parameter on each one of the PV arrays, in an aim to perform a MPPT in different situations.

Experimental results
Figures 17-20 represents the test results with the PV arrays of Kyocera, MSX60, Solar-SJ65, and STP245S PV panels respectively. As an example, for Figure 17, the blue line depicts the scanning of the PV array, performed under the previously described irradiance conditions, emulating a partial shading in the first 5 s. The black dotted line represents the maximum power at which the system can be transformed if the MPP is reached and the red line is the MPPT. As this figure represents, the algorithm, during the exploration process, identify the area of the most significant peak in the first 2 s. As a starting point, it makes exploitation refining the MPP, finding it at the end in the green circles. The blue line in the box below, which is the reference voltage, represents the Arduino DUE output and this behavior indicates the IPSM search for the MPPT. With a voltage change, there will exist a change in the delivered power, thereby, if the MPPT is located at a local maximum, it could not reach the global MPP. This is also an indicator that the algorithm is doing a search and is not stationary. This analysis confirms not only the algorithm's stable behavior in the MPPT search but the IPSM accuracy to estimate the MPPT under different power points in a PV panels series connection ensuring that the MPP will be reached in a short amount of time as Figures 17-20 show.

Conclusions
In this paper the IPSM optimization algorithm was implemented for a MPPT in a series connected PV array in which, due to PS conditions, its P-V curve presented multi peaks. As shown in the results, the applied algorithm demonstrated the accuracy by having different PV arrays of different types of PV panels as well as the validation with PSIM @ simulations and the corresponding emulations in the hardware in the loop system, the Speedgoat, and the Arduino DUE. The IPSM algorithm application to MPPT worked correctly under adverse circumstances, to be specific, the irradiance changes. Authors in [37] simulate a PV array in which the algorithm applied to the MPPT for partial shading condition was a PSM, its fastest response time was 24 ms, in contrast with the 4 ms time response of the simulation test performed in this paper, as seen in Figure 11. Having a similar PV panels connection previously proposed by the authors, this result led to an improvement in the time response by 96%, however, for the same hardware in the loop test, the response to find the MPP was 3 s. The differences between the simulated and emulated results are due to the different data transmissions speed of the devices. Funding: This work was supported by the Instituto Tecnológico Metropolitano (ITM) of Medellin, Colombia through grant P14105, by the thesis master "Methodology to optimize the maximum power point tracking of a photovoltaic cells generator employing multi-model control techniques" code PM-14101 and the project P14220, and A. Ibeas is partially supported by the Basque Government through project IT1207-19.

Conflicts of Interest:
The authors declare no conflict of interest.