DESIGN AND IMPLEMENTATION OF ENHANCED PSO BASED MPPT FOR PV PRODUCTION UNDER PARTIAL SHADING CONDITIONS

The search for cleaner energy solutions is being encouraged by the increasing world's energy demand and the emerging environmental concerns. Renewable sources are free, clean and virtually limitless and for those reasons they present a great potential. Photovoltaic systems (PV) have low operation and maintenance costs and to increase the efficiency of a PV production, a Maximum Power Point Tracking (MPPT) algorithm is proposed based on the particle swarm optimization (PSO) algorithm. The proposed PSO-based MPPT is able to avoid the oscillations around the maximum power point (MPP) and the convergence to a local maximum under partial shading conditions (PSC). Experimental and simulations tests were done to evaluate the performance of the proposed algorithm. The results show that it exhibits an excellent tracking under rapid variation in environment conditions (irradiance), no oscillations once the MPP is found and it can avoid the convergence to local maxima.


INTRODUCTION
Among all sources of renewable energy, solar energy is seen as an attractive source of renewable energy for microgrids and remote systems, due to its advantages, notably low operating cost and low maintenance cost [1].The main purpose of any solar energy production is to extract the maximum power available at every instant [2].A photovoltaic (PV) panel has a non-linear power output, which depends mainly on the irradiance and temperature and is subjected to the existence of local optima under partial shading conditions (PSC) [3].For these reasons and to increase the efficiency of a PV production it is necessary to use a controller that tracks the maximum power available at every instant.
Several examples of Maximum Power Point Tracking (MPPT) algorithms can be found in the literature, diverging in complexity, speed of convergence, required sensors, cost, efficiency, hardware implementation and other aspects [4][5][6][7].These can be roughly divided into two main groups: intelligent and non-intelligent.A very popular nonintelligent MPPT is the perturb and observe (P&O) algorithm [8][9][10] which has two classic configurations.In the first configuration, there is no feedback (open loop) and the algorithm consists of perturbing the duty cycle of the converter and taking periodic samples of voltage and current values.After this, the algorithm changes the duty cycle of the converter in a way that allows the PV panel to work in its Maximum Power Point (MPP).In the second configuration there is a feedback (closed loop) of either the voltage or the current of the PV panel, and the algorithm consists of perturbing the PV reference and comparing the value of power before and after that perturbation.In both configurations, when the MPP is reached the algorithm oscillates around it [11].The amplitude of the perturbation is fixed and predetermined, and the oscillation around the MPP is determined by this value.A small amplitude value results in small oscillation but higher convergence time whereas large amplitude results in high oscillations around the MPP and a faster convergence.This conflict can be resolved with variable perturbation amplitude, starting with a reasonably high value and decreasing it as the algorithm approaches the MPP.
Another well-known non-intelligent MPPT is the incremental conductance algorithm [12].This algorithm is similar to P&O algorithm, with the exception that it compares the instantaneous and the incremental conductances.Although this is a technique known to be more efficient than the P&O method, in practice, the MPP is difficult to achieve due to several factors such as noise or the voltage and current analog-to-digital conversion, making it to oscillate around the MPP as well.
All the above-mentioned algorithms have the main advantages of an easy implementation and a low computational cost.However they have some drawbacks, like oscillations around the MPP and poor tracking under rapid changing irradiation levels.Another important drawback is their poor mechanism to avoid being trapped in a local maximum.When under non-uniform irradiance conditions, or in other words partial shading conditions (PSC), multiple peaks arise in the output power curve, presenting a huge struggle to these algorithms.
An effort to overcome these disadvantages has been developed with alternative methods based on artificial intelligence, such as neural networks, fuzzy logic and Metaheuristic-based MPPT algorithms [13][14][15][16][17][18].Although neural networks and fuzzy logic are both highly powerful and dynamic techniques, they have a high computational cost.Therefore, metaheuristic based MPPT algorithms have emerged as an alternative approach because of their skills to solve complex non-linear and dynamic problems.Thus, several Metaheuristic-based MPPT have been proposed such as: Genetic Algorithm (GA), Cuckoo Search (CS), Particle Swarm Optimization (PSO), Ant colony Optimization (ACO) and many others [19][20][21][22][23].
This manuscript is organized as follows: Section 2 describes the Particle Swarm Optimization algorithm; Section 3 presents the PV cell single diode model under PSC and the PV system profiles used in the simulation tests; Section 4 presents the hardware implementation; Section 5 explains the proposed algorithm design and implementation; Section 6 presents obtained results and discussion; Section 7 concludes the paper.

PARTICLES SWARM OPTIMIZATION
This optimization algorithm is a bio-inspired approach based on animal social behaviour, proposed in 1995, by Eberhart and Kennedy [24].The algorithm initiates with a random population of particles, where each particle/individual represents a possible solution.Every particle has its own velocity (change factor), which is adjusted by update equations that consider the history of individual and collective experiences, that is, the experience of each particle and the experience of all particles in the population.
The main idea is to move the particles in such a way that they explore the search space for an optimal solution.The algorithm evaluates the performance of each particle position ( ) at every iteration via a fitness function and changes its velocity in the direction of its own best performance ( ) and the best performance of the population ( ), illustrated in Fig. 1.The way the particles communicate with each other influences the algorithms performance.There are several different topologies found in the literature, amongst them the most used are: the star topology, where all particles communicate with each other; the Ring topology, there is only a connection between the k adjacent neighbors; the cluster topology where the population is divided into groups and there's a full intra-communication and a single line of inter-communication between the groups; the Von Neumann topology, the communication takes place as the particles were connected in a rectangular matrix and each one only communicates with the vertical and horizontal direct neighbors.

Figure 1 -Graphical representation of the evolution of particles
Each particle velocity is calculated with equation (1), and the new particle position is determined by equation (2).
where i is the particle number, k the iteration number, D the dimension index, and random numbers between [0, 1], C1 and C2 positive acceleration constants and w the inertial weight.
The PSO is a flexible and robust approach based on a population which is well known for its simplicity of implementation, good performance and has shown excellent performance in different optimization problems, for example: controller tuning [25]; neural network optimization [26]; mathematical model parameters optimization [27]; and PV MPP tracking [28].
When applied to MPPT problem is able to deal with the non-linear characteristic of PV panels and can offer some advantages like mitigate the oscillations around the MPP, good tracking under rapid changing irradiation levels and in partial shading conditions, and avoids the local maxima trapping problem.

PV SYSTEM
Photovoltaic cell mathematical models are used to accurately describe the behavior of PV systems.Different models can be found in the literature however the most used is the single-diode model (SDM) due to its simpler complexity (reduced number of parameters) [29].
The equivalent electrical circuit of the photovoltaic cell for the SDM is shown in Fig. 2. The current source represents the photoelectric current (Iph) generated by the exposure of the PV device to incident light.The diode (D) in parallel represents the physical effects of the PN junction.The resistance Rs accounts for the ohmic losses and resistivity of the material in the metal contacts and the resistance Rp accounts for current leakages.
where Iph is the photoelectric current, Id is the diode current, described by Equation ( 4), Ip is the parallel resistance current, calculated by Equation ( 5) where I0 is the diode's reverse saturation current, V is the output voltage, n is the diode's ideality factor, and Vt is the thermal voltage, which is determined by Equation ( 6) where = 1.381 ⁄ is the Boltzman constant, T is the junction temperature in Kelvin, Ns is the number of cells connected in series and = 1.602 is the electron charge.With Equations ( 3)-( 6) the output current I of the SDM can be implicitly expressed by Equation ( 7) In partial shading conditions (PSC), power is severely affected and in the worst-case scenario it can compromise the PV operation due to the occurrence of hotspots [30].A common practice to minimize the negative effects of partial shading is to use bypass diodes (Dby) connected in antiparallel with each cell string.Fig. 3 shows the equivalent electric circuit for the SDM of a PV module with m bypass diodes.In PSC the output current can be determined by solving Equations ( 8), ( 9) and (10) [29].
For the simulation tests four profiles were created under uniform and non-uniform irradiance conditions.The profiles are shown in Fig .4 and their characteristics in Table 1.These profiles were created from a PV system consisting of 2 SOLAREX MSX-60 PV modules in series, with a total of 72 cells and two bypass diodes (one for each 36 cells).For the experimental tests four profiles, under uniform irradiance conditions, were created with the Photovoltaic Power Profile Emulation software from Magna Power.These profiles characteristics are shown in Table 2.

HARDWARE IMPLEMENTATION
The hardware developed to test and implement the MPPT algorithms, shown in Fig. 5

PROGRAMMABLE DC SOURCE
The power supply used was the 2.6 KW MAGNA-POWER programmable DC source SL500-5.2.Its PPPE software allows to simulate the

ACQUISITION SYSTEM
The acquisition system is based on the analog-todigital converter (ADC) AD7367, which is a 14-bit converter with 4 channels of simultaneous conversion.It can be configurated via the microcontroller able to operate with various conversion amplitudes, such as +/-5 V, +/-10 V, +/-12 V, 0-10 V, allowing good precision and flexibility with conversion time lower than 1.25 μs and a transmission rate of 500 kbps.An external ADC provides the microcontroller a greater resolution and flexibility.This ADC was configured to operate with conversion amplitude of 0-10 V and the communication with the processing unit is performed through SPI communication.
The voltage sensor used was the CYHVS025A, with a transformation ratio of 2500:1000, with a primary nominal current of +/-10 mA and a secondary nominal current of +/-25 mA.It was assembled in a way so that the input range is +/-250 V.The current sensor used was the Hall Effect current CYHCS-B1-25.This sensor grants excellent accuracy, good linearity and maximum nominal current of 25 A.

POWER CIRCUIT
For the experimental tests a boost converter was used.It is a non-isolated DC-DC converter able to generate an output voltage equal or higher than the input voltage (step up).In Fig. 6 the electric circuit of the converter is presented [31].The converter operating in continuous conduction mode has two distinct stages, as a function of duty cycle (d).In the first stage [0 ≤ ≤ ] the MOSFET conducts and no current flows through the diode.In the second stage [ ≤ ≤ ] the MOSFET is off and the diode is forward biased.The differential equations that characterize these two conduction stages (considering ideal semiconductors), where the state vector is given by the expression = [ ] ′ , are the following: The mathematical model of the converter can be obtained by a weighted arithmetic mean of its modulation index in both models of the conduction stages, thus: ) The transient regime component of system ( 13) is given by: Solving the equation ( 14), we get the gain (G) of the converter: where d is the duty cycle.Assuming an ideal converter, i.e., considering and equal to zero, we get: Fig. 7 shows the gain variation in function of / .This is a non-inverting configuration and it displays a non-linear curve for a modulation index greater than 0.5 and a mostly linear tendency for a modulation index (duty cycle) less than 0.5.

Figure 7 -Gain variation as a function of the modulation index for different values of
A relevant aspect that must be taken into consideration when implementing MPPT algorithms is to never design the converter to operate with a modulation index close to its maximum gain.This is because from the maximum gain point on, the gain decreases as the modulation index increases, i.e. if higher output voltage is required, by adjusting the modulation index, it might operate in the descending part of the curve, therefore decreasing the output voltage instead.

PSO ALGORITHM IMPLEMENTATION
The PSO-based MPPT algorithm was implemented on Code Composer Studio v5 in C programming language.Fig. 8 presents the flowchart for the implemented algorithm.It has a main function where all peripherals are configured, such as the EPWM module and the SPI module.All the interrupt routines are configured as well and variable initialization is executed.
The CNVST interrupt routine is responsible for triggering the analog-to-digital converter, via configuration of GPIO6 as a digital output.This pin controls the conversion start signal (CONVST) for the ADC, which is active low, i.e. the conversion is initiated on the falling edge of CONVST (Fig. 9).PSO interrupt routine is responsible for tracking the MPP, as described in Fig. 11.The algorithm has a star topology, with a population of three particles, where every particle can communicate with each other.The PSO parameters used were the inertia = 2.In the beginning, the algorithm places the particles randomly in the search space (converter duty cycle -d) and then performance of each particle is evaluated through the output power of the PV panel.Finally, position of every particle is updated through equations ( 1) and ( 2) and the process is repeated.As they approach to the maximum power point, the velocity of each particle converges to zero.
If the velocity of every particle is within a radius inferior to 0.1 and a variation in the environmental condition (for example a change in irradiance and temperature or partial shading) occurs, the search process is restarted for a power difference greater than 1 W.

OBTAINED RESULTS
To validate the performance of the PSO-based MPPT algorithm, simulation and experimental tests were performed under different profiles of uniform and non-uniform irradiance conditions.

SIMULATION RESULTS
The simulation tests were performed with the single diode model under non-uniform irradiance conditions, or in PSC, using the software Matlab ® .To test the dynamic performance, the proposed approach was tested during the transitions between the four profiles created, shown in Table 1 and Fig. 4. Then its performance was compared with a Perturb and Observe (P&O) MPPT with variable step size (for better performance).The step variation is calculated via the power error to obtain the best tradeoff between the settling time and the oscillation amplitude.
In the first simulation test both algorithms started with profile PS3 and transitioned to profile PS1.Fig. 12 shows the performance of the proposed MPPT approach and Fig. 13 the performance of the classic P&O MPPT.Both algorithms show similar behavior in terms of the settling time at system startup, both found the global maximum at PS3.The main differences are the visible P&O oscillation once the MPP was reached, and the particle restart from the proposed approach at the transition point.In the third and last simulation test the algorithms started with profile PS2, transitioned to profile PS4 and finalized with profile PS1, the performance of the proposed algorithm is shown in Fig. 16 and of the P&O in Fig. 17.The results of this test were similar to the previous test.In terms of settling time both algorithms exhibit similar behavior, the proposed PSO-based MPPT algorithm shows no oscillations once the MPP was reached.Once again the proposed algorithm acquired the global maximum while the P&O algorithm remained on a local maximum.
Table 3 present the performance of both algorithms, for the three simulation tests, in terms RMSE, MAE, MARE and MAPE.The results show that the proposed PSO-based MPPT algorithm for the second and third simulation tests exhibit better performance in all metrics.For the first simulation test the P&O MPPT show better RMSE.This can be explained because RMSE gives a relatively high weight to large errors when comparing to the other metrics.However, in terms of MAE, MARE and MAPE the proposed PSO-based MPPT obtained better results.In general, the proposed approach performed better in terms of global maximum tracking, in terms of oscillation once the MPP is reached and in terms of the error.

EXPERIMENTAL RESULTS
The first experimental test was performed with a single profile (PE1) under uniform irradiance conditions.Fig. 18 a) and b) and Fig. 19 illustrate the output waveforms for the voltage, current and power of the PV system respectively.The experimental results show the excellent performance of the algorithm with a convergence time of 10 samples (equivalent to 5 seconds), and once the MPP is reached there are no oscillations around it.The particle search is noticeable in the first iterations, the particles start from their initial random positioning and rapidly evolve to the MPP.Another important point is the tracking capability of the algorithm, i.e. the algorithm repositions the particles when a variation in the environment conditions (irradiance) occurs.In this case if the convergence was achieved (velocity of every particle is within a range inferior to 0.1) and there is a difference between the power of two consecutive iterations is greater than 1 W the MPPT algorithm repositions the particles and the PSO mechanism restarts.The evolution of the voltage, current and power errors is illustrated in Fig. 23 demonstrating once again the excellent performance of the controller.
These results show that the MPP is reached for every profile and that the proposed algorithm reacts quickly (reposition the particles) to changes in environmental conditions (irradiance).

CONCLUSION
With the intent of increasing the efficiency of a PV production, a MPPT algorithm was proposed based-on PSO algorithm.The proposed PSO-based MPPT was tested under uniform and non-uniform environment (irradiance) conditions.Simulation and experimental tests were performed with the proposed alogrithm that was compared with a P&O MPPT under non-uniform irradiance conditions.From the results we can conclude that this type of MPPT algorithms based on meta-heuristics exhibits excellent performance presenting no oscillations once the MPP is reached, avoids the convergence to a local maximum under partial shading conditions and also has an excellent tracking capability under rapid variation in environment conditions, particularly irradiance.

Figure 2 -
Figure 2 -Equivalent electric circuit for the SDM

Figure 3 -
Figure 3 -Equivalent electric circuit for the SDM under PSC

Figure 4 -
Figure 4 -PV profiles used in the simulation tests under different partial shading conditions.

Figure 5 -
Figure 5 -Block representation of the proposed hardware PV panel, considering different solar irradiance and temperature levels defined by the user.It also has the possibility to program I-V curves, according to specific needs, which facilitates testing MPPT algorithms.After setting the profile of the PV panel this can be transferred to the programmable DC source through serial communication.

Figure 9 -Figure 10 -
Figure 9 -Temporal diagram of the analog to digital converter (AD7367)

Figure 12 -Figure 13 -Figure 14 -Figure 15 -
Figure 12 -Performance of the proposed PSO-based MPPT algorithm for the first simulation test

Figure 16 - 3 Figure 17 -
Figure 16 -Performance of the proposed PSO algorithm for the third simulation test 3

Figure 18 -Figure 19 -
Figure 18 -Voltage output waveform (a) and Current output waveform (b) under uniform irradiance conditions

Figure 20 -
Figure 20 -Evolution of the error for voltage, current and power under uniform irradiance conditions