Development of a generalised PV model in MATLAB/Simulink using datasheet values

: This study proposes an improved single-diode modelling approach for photovoltaic (PV) modules suitable for a broad range of the PV technologies available today, including modules based on tandem cell structures. After establishing the model (which has an overall of seven parameters), this study devises a methodology to estimate its parameters using Standard Test Conditions (STC) data, Nominal Operating Cell Temperature (NOCT) data, and temperature coef ﬁ cient values as provided in most manufacturers ’ datasheets. Simulation results and their comparison with a previous work show a very accurate prediction of critical points in the current-voltage characteristics curve. The precise prediction happens for both STC and NOCT conditions and the error in predicting maximum power point (MPP) lies within 1% limit, and the error in its corresponding voltage and current is almost always within 2% limit. Further, for both MPP and open-circuit voltage, the statistical variance around manufacturer measurements due to temperature changes is demonstrated to be low for ﬁ ve various module technologies.


Introduction
Solar photovoltaic (PV) is one of the fastest growing power industries in the world thanks to its appealing merits, like the widespread accessibility to natural solar resources, high reliability, easy integration into buildings and structures, fast installation, modularity, and predictable annual output [1]. Between 2000 and 2013, total PV production has been experiencing annual growth rates between 40 and 90% reaching an overall increase of two orders of magnitude. By 2010, thin film PV technologies accounted for around 13% of the PV market share. The values were distributed as follows: 5% for a-Si, for 2% copper-indium-di-selenide/ copper-indium-gallium-selenide (CIS/CIGS), and 6% for cadmium telluride/cadmium sulphide (CdTe/CdS) [2]. However, most of the efforts in modelling PV modules focus on modules based on crystalline silicon (c-Si) cells technology which exhibits characteristics closer to ideal cells. Thus, it is necessary to develop generalised models suitable for different types of technologies.
Sera et al. [3] derive expressions for several variables given in a typical data sheet. Since the parameters of interest (series resistance, shunt resistance, and ideality factor) cannot be separated according to the given work, the authors devise an iterative algorithm to estimate these parameters. The algorithm keeps updating the shunt and series resistances, which adjusts the ideality factor accordingly. The process is repeated until all equations are satisfied.
In [4], a matching technique for single-diode models is proposed. The authors accomplish such matching by exploiting the fact that there is only one pair of series and parallel resistances that will match the simulated maximum power point (MPP) with that given in the datasheet under Standard Test Conditions (STC). Thus, by incrementing series resistance within small steps (starting from zero), we can find the corresponding parallel resistance and calculate the maximum power. If the calculated maximum power is within predetermined tolerance limits, the pair of resistances will be accepted. Otherwise, incrementing the series resistance continues. Ishaque et al. [5] extend this technique for the two-diode model, but with the assumption that one of the diodes ideality factors is set to one, while the other is chosen manually to be more than 1.2.
In [6], a new tool to estimate the parameters of the two-diode model using Levenberg-Marquardt algorithm is designed. The algorithm uses the best fit for a given current-voltage (I-V ) characteristics curve. The ideality factors, series and parallel resistances, and (presumed equal) reverse saturation currents are found through the designed tool. With such tool, the error in predicting the maximum power is <2% even in the worst case.
The authors of [7] exploit the fact that at the MPP, the current starts to decrease along with any increase in the operating voltage. Hence, new constraining equations were derived to model PV module using an ideal cell equivalent circuit model.
Five constraining equations to solve a one-diode model with five parameters are proposed in [8]. It is assumed that parallel resistance is linearly varying with irradiance. The open-circuit voltage temperature coefficient is used to verify that the model correctly predicts the open-circuit voltage at any temperature.
Mahmoud et al. [9] devise four constraining equations to solve the five parameter one-diode model. The authors assert that either series resistance or parallel resistance can be eliminated from the model by assigning them to zero or infinity, respectively. Thus, we end up with four parameters that allow us to solve the four equations. The choice as to which resistance should be removed is determined by a devised algorithm which first attempts to solve the equations assuming infinite parallel resistance, and if no solution is found, a zero series resistance will be assumed, and the parallel resistance will be determined. In either case, the rest of the parameters are calculated analytically as well.
Babu and Gurjar [10] devise a simple two-diode model in which parasitic resistances are neglected, leaving only the ideality factors and the two saturation currents to be determined. The removal of the parasitic resistance from the model allows for an easier iterative solution in which the first ideality factor is incremented slowly and the saturation current and ideality factor of the second diode are determined accordingly. The iteration algorithm repeats the process until the calculated MPP current converges to that given by the manufacturer datasheet. Such a process is similar to that provided [4] in the sense that one parameter is incremented and the other is calculated accordingly, except that Babu and Gurjar [10] modify the ideality factors until currents match, but Villalva et al. [4] modify the parasitic resistances until powers match (leaving only the ideality factor for manual tuning).
Seo et al. [11] propose calculating parasitic resistances and the ideality factor in the single-diode model in real-time for solar array simulators. The characteristics are then generated using PV model, which helps generate I-V curves for solar array simulators based on the PV model rather than look-up tables which may require interpolation which sacrifices their accuracy and larger memory size to save data about current-voltage curves.
An improvement for the standard five-parameter model is demonstrated in [12]. The authors add a coefficient to account for the variation of open-circuit voltage and MPP voltage in response to irradiance variations. The authors estimate such parameter in the context of a least square problem. In this model, the series resistance, the shunt resistance, and the ideality factor are determined simultaneously by solving a set of three implicit equations.
Park and Choi [13] develop a PSIM (a software name) tool which determines the parasitic resistances and the ideality factor parameters based on a cost function. The authors determine the cost function based on two facts about PV modules characteristics: (i) at MPP voltage, we also must have the MPP current, and (ii) at MPP voltage, the derivative of power with respect to voltage is zero. After finding the parasitic resistances and ideality factor, the tool finds the photocurrent and the saturation current of the model by solving two simultaneous equations which are derived for both open-circuit and short-circuit conditions. Di Piazza et al. [14] reduce four parameters one using the seriesparallel ratio (SPR), which is a ratio given in terms of open-circuit and MPP voltages as well as short-circuit and MPP currents. If SPR >1, the effect of series resistance is dominant and the shunt resistance is set to infinity. If SPR <1, the shunt resistance is dominant and the series resistance is set to zero. The shunt and series resistance are then determined using explicit relationships as a function of STC data and Lambert function of the SPR. Using these values, photocurrent, reverse saturation current, and ideality factor are determined which, in turn, helps calculate more precise values of parasitic resistances. Note that such method has some similarity with the one proposed in [9], except that it finds the solution analytically and ultimately finds both values of the parasitic resistances instead of neglecting one of them (as in [9]). The equations used in the model of [14] are the same as those used by Batzelis and Papathanassiou [15] except that the former introduces a coefficient to account for the variation of irradiance on the open-circuit voltage.
The motivation for writing this paper is to develop a generalised single-diode with seven parameters. Afterward, it proposes an estimation methodology for these parameters based on STC, Nominal Operating Cell Temperature (NOCT), and temperature coefficients, which are provided by most manufacturers. The presence of three exponents and one logarithmic factor allows for matching the critical points on the I-V characteristics curve and accurately predicting the thermal behaviour under different temperatures. The methodology is shown to be so general that, besides modelling conventional c-Si technology, it accurately models PV modules of different manufacturing technologies including relatively new ones like Hydrogenated amorphous silicon (a-Si:H) and CIS/ CIGS. The accuracy of modelling tandem structures like CdTe/ CdS and a-Si:H/hydrogenated micro-crystalline silicon (mc-Si:H) is also demonstrated.
The contributions in this paper are recapitulated as follows: instead of relying on STC data, this approach uses both STC and NOCT data to estimate the parameters of the proposed model. It also shows that using STC data alone can significantly reduce the model accuracy. Also, even though many papers use the opencircuit temperature coefficient in their parameter extraction approaches, they neglect the fact that manufacturers also provide a temperature coefficient for MPP which can also be incorporated into the parameters estimation algorithm. To the author's best knowledge, this is the first attempt to exploit such an important piece of information.
This paper is organised as follows: Section 2 presents the equivalent circuit of PV modules and explains what each element inside such circuit stands for and how they influence the I-V characteristics of PV modules. Section 3 covers the equations used to model the behaviour of PV modules. Section 4 devises the equations that are used in the modelling approach of this paper, and Section 5 a methodology to estimate the parameters proposed in Section 4. A suitable fitness function allows genetic algorithms to estimate these parameters. Section 6 demonstrates the significance of this work by showing some simulated numerical results for the proposed approach and comparing such results with a recent work reproduced here and taken as a reference case. Section 7 draws final conclusions. Photo-generated (or light-generated) current (I ph ) which models the electron-hole pairs that are generated due to absorbed photons with energy above the band-gap energy of the material. Such current is linearly proportional to irradiance.

PV module equivalent circuit
A diode connected in parallel with I ph (D). This diode represents non-ohmic currents that detract from I ph . It has an ideality factor (a) to account for the real behaviour of the module. A value of one for an ideality factor corresponds to a diffusion mechanism (i.e. an ideal electron transport across the P-N junction according to Shockley theory), whereas a value of two corresponds to predominant recombination in the space-charge (i.e. depletion) region [3,6]. The ideality factor is somewhere between 1 and 2 [6] and measures the quality of the cell (hence, it is sometimes called quality factor), with a value closer to one is considered to be ideal and slightly increases the maximum power [16]. Nonetheless, it is sometimes possible to have values higher than 2 if multi-recombination or multi-step tunnelling occurs [17].
Series and parallel resistances (also called parasitic resistances). Series resistance (R s ) represents the structural resistance to current flow and constitutes an overall sum of the resistances of [7,[18][19][20]: (i) base and emitter regions, (ii) solder bonds, (iii) cells interconnection bus bars, (iv) metal grid and the (rear) metal contact, and (v) junction box terminations. Usually, the grid resistance is the most dominant component that contributes to the series resistance, but the depletion region may also contribute significantly to it [21]. R s affects the characteristics when they are closer to the open-circuit conditions. Hence, it dominates the characteristics in the voltage source region (i.e. close to V oc ) [ 6]. Parallel resistance (R p ) corresponds to the leakage current due to high conductivity paths (shunts) that exist either in the module's cells themselves or their edges. These shunts are the result of manufacturing compromises (during mass production) that result in impurities in (or near) the P-N junction as well as crystal defects [19,20,22]. In contrast to R s , R p affects the characteristics in the current source region (i.e. close to I sc ) [ 6]. A smaller R p would lead the current away from the load which reduces the current available from the module [19] hence lowering its efficiency, whereas a larger shunt resistance engenders a more horizontal slope near I sc , which translates to more idealistic current source characteristics. R p has almost no effect on I sc , but reduces V oc . By contrast, R s does not affect V oc whatsoever, but can significantly reduce I sc [1]. The equation that depicts the IV characteristics of PV module can be derived by applying Kirchhoff's current law to the equivalent circuit in Fig. 1. Such equation is given as [3,4,7,9,23] where V t = ((N s kT op )/q) is the thermal voltage of the module, N s is the number of cells in series in the module, k is Boltzman's constant ( 1.381 × 10 −23 J/K), and q is the electron's charge (1.602 × 10 −19 C). T op is the operating temperature of the P-N junction (in K). I and V are the current and voltage of the module, respectively. The MPP current and MPP voltage are denoted as I mp and V mp , respectively. Equation (1) is the mathematical description of the general single-diode model for PV modules. There is no difference between the characteristics and models of PV cells and those of PV modules except scaling, i.e. all the voltages are proportional to the number of series-connected cells and all the currents are proportional to the number of parallel branches for the groups of seriesconnected cells [4,6,8,24].
The calculation of the reverse saturation current (I rs ) varies considerably in the literature. In most cases, it has a nominal value which is (usually) determined analytically so that the predicted V oc will match that provided by the manufacturer at STC conditions, but then it is modified to account for temperature. One of the common estimations is [3,25] where the reference reverse saturation current (I rs,ref ) is given as where One of the solutions to obviate the need for E g is to include temperature coefficients in (3) instead of using it as reference value that is modified by (2). This is proposed by Villalva et al. [4] and the modified equation is where a is the short-circuit current temperature coefficient (in %/ o Co r% /K), b is the open-circuit voltage temperature coefficient (in %/ o Co r% /K).

Reverse saturation current
A modified version of (4) can be introduced to enhance its accuracy in predicting V oc . Knowing that the V oc takes place when the current equals zero, we set I = 0 and V = V oc in (1), and isolate the expression for I rs . The result would be where where G op is the incident irradiance, G ref is the reference (STC) irradiance.
Equations (5)-(7) allow for more accurate prediction of V oc . Basically, they are formulated to account for both temperature and irradiance effects on V oc . Theoretically, the introduction of w in (7) would allow for modifying V oc logarithmically due to irradiance variation, which in turn modifies I rs (see (5)), thereby the simulated V oc can be more accurate for NOCT conditions (the viability of such concept is demonstrated numerically in Section 6). Note that (7) is not derived based on the assumption that R p is infinite. Thus, it holds even for relatively small values of R p .

Ideality factor
The ideality factor is considered to be a function of temperature (rather than a constant) and is given as modified version of an equation presented in [28] where a ref is the reference ideality factor and z is the temperature exponent for the ideality factor. The idea of proportionality between ideality factor and temperature is first proposed by MacAlpine and Brandemuehl [29] and later modified by Khalid and Abido [28] by introducing a temperature exponent (i.e. z). Such correlation is adapted in this paper. In [28], the ideality factor was substituted in a different form from (8). Specifically, it is defined as a modified ideality factor (i.e. a mod = a ref V t and it is (4) in [28]). This work finds the ideality factor as in (8) and multiplies it by V t in (5), which would eventually leads to the same value (i.e. a mod ) being substituted.

Parasitic resistances
The accuracy in modelling R p can be significantly enhanced by taking into account the fact that it is inversely proportional to the irradiance [28][29][30]. However, an exponential dependency on temperature is incorporated in this work. Thus, R p here is a function of G op and T op . Mathematically speaking R s is considered to have an exponential dependency on temperature, and is given as where d p and d s are the temperature exponents for parallel and series resistances, respectively. R p,ref and R s,ref are the reference parallel and series resistances under STC.

Photo-generated current
I ph can be estimated by assuming that for a short-circuit condition, I d is negligible, which reduces the equivalent circuit in Fig. 1 to a simple circuit where the current divider is applicable [31,32], resulting in The equations that implement the proposed approach are (5)-(11).

Parameters estimation
Equations (5) (5)- (11). Genetic algorithm is biologically-inspired search algorithm that mimics natural selection where the fittest individuals have the most likelihood to survive. For a genetic algorithm to converge to an acceptable solution, the designer needs to define a reasonable fitness function, which is where their understanding of the problem becomes highly critical [33]. The fitness function here is based on carrying out four benchmarking tests, namely: STC, NOCT, and two high-temperature tests. After the tests are carried out, statistical variance of the simulation outputs around the manufacturer measurements is found using the percent mean square error (PMSE av ) which is described mathematically as where x i is the simulated value at a given test (i.e. test i) and y i is the value estimated through the temperature coefficients (see (13a)-(13c)) or provided by the manufacturer, n is the maximum number of simulations to predict a certain value for a given benchmarking test. It is imperative for the reader not to confuse estimated with simulated in the context of this papera simulated value is the output of the modelled equations, whereas an estimated value is what is provided by the manufacturer's datasheet or what can be calculated through that sheet. Typically, manufacturers provide information about the thermal behaviour of under any given temperature for an irradiance equal to the nominal one. We can use the following correlations to achieve such estimations where g is the maximum power temperature coefficient (in %/ o Co r% /K).
In engineering optimisation problems, we are almost always interested in minimising or maximising a certain objective function taking into account constraints of some form. In this work, constraints (which are listed below) are realised through a penalty technique, which is designed to force genetic algorithms to err on solutions that satisfy these constraints. In penalty techniques, genetic algorithms are transformed from a constrained optimisation problem into an unconstrained one. In essence, once a violation of a constraint is detected, we penalise infeasible solutions with a penalty term that is included in the fitness function [33]. In this paper, the percent absolute relative error (PARE) is adopted as a means to integrate constraints of interest and is calculated as PARE integrates the constraints of the problem into the fitness function by detecting violations, that is to say, the number of times in which a set of parameters did not match the corresponding desired accuracy. The number of violations is set to 1, and we increment it by one for each occasion in which one of the following violations is detected: (i) PARE of more than 1% for any of P mp at STC, NOCT or the two high-temperature tests. (ii) PARE of more than 2% for any of V mp or I mp at STC or NOCT conditions (iii) PARE of more than 2% for any of V oc or I sc under STC, NOCT, or high-temperature tests.
Finally, the fitness function is established depending on several PMSE av calculations and scaled according to the violations above. The final fitness function (for each set of parameters) is Parameters Set Fitness = (PMSE av for P mp )(PMSE av for I mp ) (PMSE av for V oc )(PMSE av for I sc ) (Numer of Violations) (15) The goal of (15) is to find a solution that has a minimal modelling error for different points of interest under different operating conditions.

Numerical results and discussion
In this section, we present numerical results of this paper. To demonstrate the generality of the proposed approach, we consider five various kinds of manufacturing technologies. The estimation methodology suggested by Babu and Gurjar [10] is reproduced here, and its equations are simulated using Simulink models. The parameters obtained using this approach and Babu and Gurjar [10] approach are presented in Table 1 for five modules, each one is based on different manufacturing technologies. The dash entry in this table means that the parameter does not exist in the corresponding work and its model. The model of [10] has two parameters to be determined according to its algorithm, that is a 1 (ideality factor of the first diode) and a 2 (ideality factor for the second diode). What follows next demonstrates the importance of taking as much datasheet values as possible in the parameters estimation process, especially for newer PV technologies.
For STC, a comparison between this work and Babu and Gurjar [10] work is shown in Table 2. Although Babu and Gurjar [10] approach is fairly accurate in predicting MPPs for modules with c-Si and CdTe/CdS technologies, it still does not accurately predict P mp for modules with a-Si:H, CIGS, and Si:H/mC technologies, indicating its lack of generality.
A similar comparison to that in Table 2 is carried out for NOCT conditions. The results of such comparison are presented in Table 3 and show that Babu and Gurjar [10] model accurately predicts MPPs for c-Si technology modules, but for other technologies, it either (i) does not accurately predict P mp or (ii) accurately predicts P mp but not its corresponding V mp and I mp . Most MPPs and their corresponding voltages and currents generally have high PARE. In the proposed work, however, MPPs PARE for all modules are within 1% limit for both STC and NOCT conditions. Similarly, V mp , and I mp stay within 3% error limit which is a significant improvement in predicting both the MPP and its corresponding voltage and current for both STC and NOCT conditions. It can be observed that for both approaches, the simulated V oc has relatively low PARE, indicating that this work, just like [10], accurately models V oc . In the work proposed here, such high accuracy in predicting V oc under NOCT conditions is attributed to the parameter w in (7) which allows for integrating the logarithmic variance of V oc due to irradiance changes, thereby modifying saturation current, (2), accordingly.
Finally, the proposed modelling approach is tested for statistical variance. To verify the accuracy in modelling the thermal behaviour of modules, we may simulate both models for a set of temperatures varying from 25 to 75°C within steps of 1°C. A set of simulated points for the V oc and P mp are obtained by simulation and compared with another set of data estimated through temperature coefficients as provided by linear regression of the manufacturer measurements.   Using these data, we may calculate PMSE av . We can also calculate percent maximum absolute relative error (PMARE), which is a measure of confidence limit for the model's accuracy. It is mathematically defined as where y i stands for an estimated value, x i stands for a simulated one, and n represents the number of each of simulations and calculations sets. Both PMSE av and PMARE numerical results for this approach and Babu and Gurjar [10] approach are presented in Table 4.A noteworthy observation here is that even though the work of [10] has very low PMSE av and PMARE for V oc , it still has very high PMSE av and PMARE for P mp , indicating an accuracy in predicting V oc , but not the I-V characteristics in the vicinity of I mp and V mp . The proposed work, however, has low values of both PMSE av and PMARE implying an accurate modelling of PV modules of different PV manufacturing technologies and varying operating temperatures.

Conclusions
This paper presents a modified single-diode model to allow for more accuracy in predicting P mp , V mp , I mp for both STC and NOCT conditions. A fitness function that uses only datasheet values is devised to estimate the seven parameters of the proposed model. Modelling different PV modules with various technologies demonstrate the generality of the model. A noteworthy observation of this paper is that when parameters estimation of PV modules is based solely on STC data, the accuracy in predicting MPP for NOCT conditions and different temperatures is compromised. The proposed approach handles such a problem with a fitness function devised to estimate PV modules parameters. Such fitness function depends on STC data, NOCT data, and statistical variations of temperature for sampled operating points and violations of P mp , V mp , I mp , V oc , and I sc . Finally, to demonstrate the improvement in modeling accuracy, the paper numerically compares the predicted power under different operating temperatures and compares it with a previous approach.