Ashveer Hooblal 207500768 Design 5-2nd Progress Report

Embed Size (px)

Citation preview

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    1/42

    1

    Second Progress Report: PV Module

    By

    Ashveer Hooblal

    207500768

    Supervisor: Dr. A. K. Saha

    Final Year Design 5 Project

    School of Electrical, Electronic and Computer

    Engineering

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    2/42

    ii

    Abstract

    The simulation of a Photovoltaic module is one of the many Electrical Design 5 topics. This report

    presents an electrical model of a Photovoltaic module that was simulated using the Matlab Simulink

    program. Two models were achieved, namely, a voltage input model and a current input model. Thecurrent input PV model was integrated with a controlled voltage source to achieve an electrical voltage

    signal for further analysis. Thereafter maximum power point tracking was applied with a buck-boost

    converter as an interface for the PV module.

    A design procedure and plan together with an understandable theory was provided. Specifications for the

    proposed simulation model, the theoretical output I-V characteristic and the simulation results of a

    photovoltaic module are also stated.

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    3/42

    iii

    List of Symbols

    Symbol Definition Units

    D Duty Cycle

    n Diode Quality Factor

    a Temperature Coefficient Kelvin/Amps

    q Charge of an Electron Coulombs

    k Boltzmanns Constant Joules/Kelvin

    f Frequency Hertz

    T Period of Cycles Seconds

    Lmin Minimum Inductance Henry

    Cmin Minimum Capacitance Farad

    Voc Open Circuit Voltage Volts

    Vmp Maximum Voltage Volts

    Vripple Ripple Voltage Volts

    I Current Amps

    Isco Short Circuit Current (From Datasheet) Amps

    Ioref Diode Saturation Current Reference Amps

    Isc Short Circuit Current Amps

    Io Saturation Current Amps

    Iph Photon Current Amps

    Id Diode Current Amps

    Ia PV Module Current Amps

    Imp Maximum Current AmpsG Irradiance Watts/(square meter)

    Go Irradiance at STD Watts/(square meter)

    R Resistance Ohms

    Rs Series Resistance Ohms

    To Reference Temperature Kelvin

    Tin Temperature of PV Module Kelvin

    t Junction Temperature Kelvin

    Table 1 List of Symbols

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    4/42

    iv

    Declaration

    I hereby declare that the contents of this report are my own original and unaided work, except where specific

    mention is made to the contrary in the form of a numbered reference.

    Authors full name: Ashveer Hooblal

    Authors student number: 207500768

    Authors signature:

    Date: 2 May 2011

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    5/42

    v

    Table of Contents

    Abstract......................................................................................................................................................................... ii

    List of Symbols............................................................................................................................................................ iii

    Declaration ...................................................................................................................................................................iv

    1. Introduction ........................................................................................................................................................... 12. Design Procedure .................................................................................................................................................. 2

    2.1 Specifications of the Design ......................................................................................................................... 2

    2.2 Functional Requirements ............................................................................................................................. 3

    3 Theory of PV Modules.......................................................................................................................................... 5

    3.1 The Photovoltaic Cell ................................................................................................................................... 5

    3.2 Equivalent Circuit of PV Cell ........... ........... .......... ........... .......... ........... .......... .......... ........... .......... ........... .. 6

    3.3 The PV Module ............................................................................................................................................ 8

    3.4 Maximum Power Point Tracking ............................................................................................................... 10

    3.4.1 Perturb and observe tracking method ......................................................................................................... 104 Simulation Results .............................................................................................................................................. 11

    4.1 Voltage input PV model ............................................................................................................................. 11

    4.2 Current input PV model ............................................................................................................................. 14

    4.3 PV module with MPPT .............................................................................................................................. 19

    4.4 PV Array .................................................................................................................................................... 25

    5 Work Plan ........................................................................................................................................................... 27

    5.1 Design Schedule ................................................................................................................................................ 27

    5.2 Future Work ....................................................................................................................................................... 27

    6 Conclusion .......................................................................................................................................................... 28

    7 References ........................................................................................................................................................... 29

    A. Appendix A1 ........................................................................................................................................................ A

    B. Appendix B1 ........................................................................................................................................................ C

    C. Appendix C .......................................................................................................................................................... E

    D. Appendix D .......................................................................................................................................................... G

    E. Appendix E .......................................................................................................................................................... H

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    6/42

    1

    1. IntroductionThe human population on Earth is now more than 6.8 billion and continues to grow by 83 million people

    per year [1], and these inhabitants require energy to sustain their lives. Exactly how much energy and in

    particular, what sources of energy will meet these needs are questions that will be addressed by thepresent and future generations. Photovoltaic power systems receive their power from solar energy

    produced by the sun and are capable of satisfying certain present power demands. Solar energy is a

    renewable energy resource and assists in the reduction of emission of green house gases and decrease the

    dependence on fossil fuels. Photovoltaic (PV) systems produce direct current (D.C.) electricity whensunlight shines on PV modules [2]. The D.C. power can be converted to alternating current (A.C.) power

    or it can be stored in relevant power storing devices. PV systems consist of a PV generator (cell, module,

    and array), energy storage devices (such as batteries), A.C. and D.C. consumers and elements for power

    conditioning [2]. In this report the theory of a PV module will be explained and two Simulink models will

    be presented that has been simulated.

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    7/42

    2

    2. Design Procedure2.1 Specifications of the Design

    The project requires Modelling and Simulation of a PV module. The deliverables of the project include

    simulation results, showing the voltage, current and power output of the PV module to determine thesystems behaviour to various conditions (i.e. variations in solar isolation and input voltages or current).There are various PV modules on the market today. They range from a few watts to hundreds of watts. In

    Table 1 a short list of PV modules are displayed which are intended to be used for the simulation. Therating and specification are summarised in Table 1.Solar home systems" (SHSs) provide small amounts

    of electricity to households beyond distribution networks. The systems on average consist of a 10 to 50

    watts peak (WP) PV module (which can easily be expanded by adding additional modules) [3].

    Since no precise numerical data was specified, suitable ratings had to be created to ensure an

    executable system design. The project requires simulation only to be prepared in order to evaluate the

    systems behaviour, therefore a 65 watt PV module was chosen for simulation as it would be adequate toprovide small amounts of electricity for solar home systems.

    PV Powered System type Specifications

    PV Module

    20W, 12V Voc: 21.5V, Isc: 1.55A Vmp: 16V , Imp: 1.22A

    PV Module

    65 W, 12V Voc: 22.7V, Isc: 3.99A, Vmp: 17.6V , Imp: 3.69A

    PV Module150W, 24V

    Voc:42,60V, Isc:4.70A, Vmp:33.90V, Imp:4.40A

    The simulation was to be implemented in Simulink with the use of the C programme language. It requires

    irradiation, temperature and either current or voltage inputs.

    Table 1 Specifications of different PV modules [4], [5].

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    8/42

    3

    2.2 Functional RequirementsThe Top-Down or Hierarchy approach was drawn to show the progress of the design of a PV module.

    This sequence of blocks describe the development cycle:

    The system specification, Modelling specification Functional implementation specification

    To simulate a PV module, an equivalent electrical model of a Photovoltaic/Solar cell was created. A

    single cell had to be developed in Simulink, thereafter a PV module (consists of many cells) wasimplemented. This is seen in Figure 2 according to the required specifications.

    Simulation ofPV Module

    DetermineEquivalent Circuitmodel of PV Cell

    Model ofEquivalent

    circuit

    Determine Inputs/Outputs of PVModule for Simulink Model.

    Inputs:Temperature,

    Voltage,Current,

    Irradiance

    Outputs:Current,Voltage

    UsingSpecificationsof PV Module

    ImplementPV Module

    Figure 1.Hierarchy approach for the simulation of a PV module

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    9/42

    4

    In Simulink the S function builder block was used to accommodate C programming code whichimplements the PV model. The C code used to generate the current input and the voltage input PVmodels are listed in Appendix B1 and B2. Inputs enter the function block and the required outputs are

    transported to a scope or X-Y graph or to the Matlab Workspace. Simulation results are thereafter

    captured in either graphical or tabulated format.

    Figure 2 Basic Matlab Representation of PV Module

    Within the s function block input and output parameters are specified. For an example, T in, Suns and Vin

    are labelled and can only be used to transport variables to and from the s function block. In order to

    compile the C programming code in Matlab a C compiler was needed. The generated code was stored in

    MEX files which Matlab can read as C code.

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    10/42

    5

    3 Theory of PV Modules3.1 The Photovoltaic Cell

    The basic element of photovoltaic systems is the photovoltaic cell. Since a typical photovoltaic cell

    produces less than 2 watt at approximately 0.5 volt DC [6], many cells are connected in either parallel orseries to obtain higher power capabilities. Modules have a peak power rating ranging from a few watts to

    more than three hundred watts. PV modules only produce power when illuminated and most often energy

    storage devices are used to store power absorbed by the PV module.When no light shines on a solar cell the output I-V characteristic is very similar to that of the diode with a

    p-n junction or Schottky barrier device shown in Figure 3. When a PV cell is illuminated incident photons

    with energy greater than the band-gap energy of the semiconductor are absorbed. These photons interact

    with the atom of the PV cell creating electron-hole pairs. Figure 3 illustrates the production of electron-

    hole pair. The electric field created by the cell junction separates the photon-generated electron-hole pairs,

    causing electrons to flow to the n-region of the cell and the holes to drift to the p-region. This creates a

    current proportional to the incident radiation.

    The PV cell has electrical contacts on its top and bottom to capture the electrons, as shown in Figure 4.

    When the PV cell delivers power to the load, the electrons flow out of the n-region into the connecting

    wire, through the load, and back to the p-region where they recombine with holes [8]. The conventional

    current flows in the opposite direction from electrons.

    Figure 3.Creation of an electron-hole pair by illumination [7]

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    11/42

    6

    3.2 Equivalent Circuit of PV CellWhen the output terminals of the PV module are short circuited, the short circuit current flows in an

    external circuit. When the cell is open-circuited, this current is shunted internally by the intrinsic p-njunction diode [9]. The characteristics of this intrinsic p-n junction diode set the open circuit voltage

    characteristics for the specific PV cell.

    The PV cell in Figure 4 is represented by the simplest equivalent circuit, i.e. an ideal current source in

    parallel with a diode. The output from the current source is directly proportional to the irradiance falling on thecell [9].

    In the ideal case the I-V characteristic equation can be written as [6]:

    (1)

    where,

    Vis the voltage across the PV cell,

    Iis the output current from the cell.

    q = 1.610-19

    Coulombs,

    k = 1.3810-23

    J/K,

    To increase the accuracy and complexity of PV models, different elements can be added to the simpleequivalent circuit. Temperature dependence on the diode saturation current and on the photo current may

    be inserted. Series resistance RS, can be included which gives a more accurate shape between the

    maximum power point and the open circuit voltage [9]. Shunt resistance RP may be in parallel with the

    diode. The diode quality factor (n) may be made as a variable parameter (instead of being fixed at either 1

    or 2) or introducing two parallel diodes (one with n = 1, one with n = 2) with independently set saturation

    currents, can be conceded.

    Figure 4.Equivalent circuit of a PV cell [8]

    Figure 5 Moderate circuit diagram of PV model [9].

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    12/42

    7

    The diode currentIdis given by the Shockleys diode equation [6]:

    (

    ) (2)where,

    n is the diode quality (n = 1 or 2),

    Io

    is the reverse saturation current of diode (A),Vis the voltage across the diode (V),tis the junction temperature in Kelvin (K),Rsis the series resistance.

    The output current () can be calculated for this model (Figure 5) using Kirchhoffs current law (KCL):

    (3)

    where,

    is the component of cell current due to photons,Equation 3 can be used to determine the ideal I-V characteristics of a PV cell, namely the short circuit

    current and the open circuit voltage. This equation will be model used to simulate the PV cell. To a goodapproximation the cell current is directly proportional to irradiance and is also temperature sensitive [6].

    Equation 4 and 5 accommodates for these weather conditions.

    (4) (5)where,

    G is current irradiance on PV cell (Wm-2),

    Gois reference irradiance at STD (1 Sun = 1000Wm-2

    ),

    Tin is the temperature of the PV cell,

    Tois the reference temperature at STD,

    a is the temperature coefficient ofIscin percent change per degree temperature given in the datasheet.

    The reverse saturation current of diode at the reference temperature (T0) is given by equation 6.

    (6)

    The reverse saturation current (Io) is also temperature dependent and equation 7 is used to accommodate

    this.

    (7)

    To calculate the series resistance equation 3 is differentiated and then rearranged in terms ofRs

    (8)

    (9)

    can be found from the I-V characteristic curve in the datasheet at the open circuit voltage [10].

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    13/42

    8

    The open circuit voltage is the voltage across the p-n junction when the generated current is zero [9].

    Short circuit current is known as the highest value of generated current in a cell and is calculated under

    short circuit conditions, i.e. V=0.

    (10)

    A PV cell generally converts approximately twenty present of irradiance into electricity [6]. The balance

    is converted to heat which heats the PV cell. Hence, the cell operates above ambient temperature resulting

    in temperature degradation of the cells performance.

    3.3 The PV ModuleA PV module is a series combination of many PV cells to achieve an adequate voltage. Illustrated inFigure 6 is a PV module represented by a series combination of PV cells. The diodes in the diagram

    symbolize the PV cells. Since PV systems are commonly operated at multiples of twelve volts [6], the

    modules are designed to operation in these systems. The cells in the module should be matched veryclosely since they are connected in series. The reason behind this statement is that while some cells are

    operating at peak efficiency, others may not be optimized. As a result, the power of the module will bereduced significantly. When modules are further connected to each other they form PV arrays that can

    accommodate large loads.

    Figure 6 PV Module [6]

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    14/42

    9

    Figure 7 illustrates the theoretical power to voltage (P-V) characteristics in graphical form for a 50W PV

    module. As the current is directly proportional to the irradiance, it can be noticed that different P-V

    characteristics curves can be drawn for different irradiance. In Figure 8 it can be noted that temperature of

    a PV module affects the output power from the PV module. Increasing temperature decreases the

    operating power output.

    Figure 7 I-V characteristics of a 150W PV module [11].

    Figure 8 Power characteristics of a 150W PV module [12].

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    15/42

    10

    3.4 Maximum Power Point TrackingThe output power from a Solar PV module changes with a change in the direction of sun, solar irradiation

    and with varying temperature. This was witnessed in Figure 7 and 8. As seen in the power vs. voltage

    curve of the module there is a single maximum point of power. This suggests that there is a peak power

    corresponding to a particular voltage and current. It is desirable to operate the module at the peak power

    point so that the maximum power can be delivered to the load under varying temperature and irradiationconditions [9]. This maximizes the power utilization of the PV module. A maximum power point tracker

    (MPPT) is used for extracting the maximum power from the PV module and transferring that power to the

    load. A dc/dc converter (step up/step down) serves the purpose of transferring maximum power from a

    PV module to a load. A dc/dc converter acts as an interface between the load and the module (Figure 9).

    The peak power is reached with the help of a dc/dc converter by adjusting its duty cycle [9].

    An automatic tracking can be performed by various algorithms:

    Perturb and observe, Incremental Conductance, Parasitic Capacitance, Voltage Based Peak Power Tracking, Current Based peak power Tracking.

    Perturb and observe method was used in the design for its efficient and accurate results.

    The algorithms, in practice, are implemented in a microcontroller or a personal computer to implement

    maximum power tracking. The algorithm is used to change the duty cycle of the of the dc/dc converter to

    maximize the power output of the module and make it operate at the peak power point of the module.

    3.4.1 Perturb and observe tracking methodIn this algorithm a slight perturbation is introduced to the system. The perturbation changes the power of

    the module. If the power increases due to the perturbation then the perturbation is continued in that

    direction. After the peak power is reached the power at the next instant decreases and hence after that the

    perturbation reverses.

    When the steady state is reached the algorithm oscillates around the peak point. In order to keep the

    power variation small the perturbation size is kept very small [13]. The algorithm is developed to set a

    reference voltage of the module corresponding to the peak voltage of the module. A PI controller then

    acts moving the operating point of the module to that particular voltage level [13].

    Figure 9 PV system including a load [9]

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    16/42

    11

    4 Simulation ResultsThere were two separate models built to simulate a PV module. The models were of moderate complexity

    for the relevant simulations. The PV models included temperature dependence of the photo current and

    the saturation current of the diode. A series resistance was included, but a shunt resistance was not

    included. A single shunt diode was used with the diode quality factor. The circuit diagram for a voltageinput PV module is shown in Figure 10.

    4.1 Voltage input PV modelTo develop the PV modules behaviour the input voltage is varied. This variation produces a range of

    current values. These voltage and current values were then used to draw the current-voltage

    characteristics and the power-voltage relationships.

    The current-voltage equation is complex. This is because the solution of current is recursive by inclusionof a series resistance in the model. Although it may be possible to find the answer by simple iterations,

    the Newtons method is chosen for rapid convergence of the answer[9].

    Newtons method is described below in equation 11.

    (11)where,

    f(x) is the derivative of the function,f(x) = 0, xnis a present value, andxn+1 is a next value.

    (12) (13)

    The output current (Ia) in the simulation was therefore calculated iteratively using equation 14.

    (14)

    Figure 10 Voltage input 65 W PV model in Simulink

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    17/42

    12

    The effect of the module temperature on the I-V characteristics was captured and illustrated in Figure 11.

    The dominant effect with increasing the modules temperature was the linear decrease of the open circuitvoltage, the module being thus less efficient. The short circuit current slightly increases with a module

    temperature increase.

    Figure 12 shows that the open circuit voltage increases logarithmically with the ambient irradiation, while

    the short circuit current is a linear function of the ambient irradiation. As the irradiance level increased the

    short circuit current increased dramatically.

    0 5 10 15 200

    0.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    4.5

    5

    5.5

    Va- Module Voltage(Volts)

    Ia-ModuleCurrent(Amps)

    25 degrees

    50 Degrees

    75 degrees

    100 degrees

    0 5 10 15 200

    0.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    4.5

    5

    Va- Module Voltage(Volts)

    Ia-ModuleCurrent(Amps)

    1000 W/m2

    750 W/m2

    500 W/m2

    250 W/m2

    Irradiance

    Figure 11 Current-Voltage Characteristics of a Voltage input PV model (temperature varied)

    Figure 12 I-V curves for various irradiances. (Remain constants at standard temperature ratings)

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    18/42

    13

    At standard operating conditions the series resistance was calculated to be 13mOhms. Figure 13 displays

    the effect of changing the series resistance. The diagram illustrates that series resistance changes the slope

    at the open circuit voltage. An increase in the resistance increases the slope and a decrease in resistance

    decreases the slope. This is the reason for calculating series resistance with the slope at the open circuit

    voltage.

    The quality factor of a diode is a measure of how closely the diode follows the ideal diode equation.

    When the diode quality factor equals one, the curve (in Figure 14) follows the ideal diode equation. As

    the diode quality increases second order effects occur so that the diode does not follow the simple diode

    equation.

    0 5 10 15 200

    0.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    4.5

    5

    Va- Module Voltage(Volts)

    Ia-ModuleCurrent

    (Amps)

    13.011mOhms

    7.455mOhms

    1.9mOhms

    21.344mOhms

    Rs= 21.344mOhms

    Rs = 1.9mOhms

    0 5 10 15 200

    0.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    4.5

    5

    Va- Module Voltage(Volts)

    Ia-ModuleCurrent(Amps)

    n = 1

    n = 2

    Figure 13 I-V curves for various series resistances. (Remain constants at standard temperature ratings)

    Figure 14 I-V curves for various diode quality factors. (Remain constants at standard temperature ratings)

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    19/42

    14

    The amount of power produced by the PV module varies greatly depending on its operating condition.

    Figure 15 illustrates the effects of module temperature on the output power. The efficiency of the PVmodule decreases since the output power decreases with an increase in temperature.

    4.2 Current input PV modelTo develop the PV modules behaviour in this model the input current is varied. This variation produces arange of voltage values. These voltage and current values were then used to draw the current-voltage

    characteristics and the power-voltage relationships. The PV model was built as seen in Figure 16. Using

    the voltage output from the PV module, a signal was sent to a controlled voltage source, producing anelectrical voltage signal. This can be used to connect to loads and analysis the PV model under various

    loads.

    To calculate the module voltage, the current output characteristic equation (equation 3) was manipulated,

    giving equation 15.

    *

    + (15)

    The output curves produced from this model under different temperature, irradiance, series resistance, and

    diode quality factors are identical to that of the current input model and are explained in section 4.1.

    0 5 10 15 200

    10

    20

    30

    40

    50

    60

    70

    Va- Module Voltage(Volts)

    P-ModulePower(Watts)

    25 degrees

    50 Degrees

    75 degrees

    100 degrees

    Figure 15 P-V curves for various temperatures. (Remain constants at standard temperature ratings)

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    20/42

    15

    As seen previously, and increase in temperature causes the open circuit voltage to decrease and the short

    circuit current to increase slightly. The current and voltage of the PV module is highly dependent on the

    module temperature.

    0 5 10 15 20 250

    0.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    4.5

    5

    Va- Module Voltage (Volts)

    Ia-ModuleCurrent(Amps)

    Temp 25deg

    Temp 0deg

    Temp 50deg

    Temp 75deg

    Figure 16 Current input 65 W PV model in Simulink

    Figure 17 I-V curves for various temperatures. (Remain constants at standard temperature ratings)

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    21/42

    16

    The short-circuit current (Isc) is proportional to the intensity of irradiance. This is witnessed in

    Figure 12 and Figure 18.

    Series resistance plays an important in keeping the slope of the curve (at open circuit voltage) closest to

    the curves presented in the datasheet (Appendix A1).

    0 5 10 15 20 250

    0.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    4.5

    5

    Va- Module Voltage (Volts)

    Ia-ModuleCurrent

    (Amps)

    250 W/m2

    500 W/m2

    750 W/m2

    1000 W/m2

    Irradiance

    0 5 10 15 20 250

    0.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    4.5

    5

    Va- Module Voltage (Volts)

    Ia-ModuleCurrent(Am

    ps)

    13mOhms

    7.455mOhms

    1.3mOhms

    21.34mOhms

    Rs=21.34mOhms

    Rs=1.3mOhms

    Figure 18 I-V curves for various irradiances. (Remain constants at standard temperature ratings)

    Figure 19 I-V curves for various series resistances. (Remain constants at standard temperature ratings)

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    22/42

    17

    The diode quality affects the curvature at the knee of the graph. This is because the diode quality factor

    describes how well the diode characteristic equation is followed.

    The power was calculated by multiplying the output current and voltage. An increase in temperature

    causes a decrease in the output power of the PV module. Another observation is that the maximum power

    that the PV model can output, as the temperature increases, is reduced.

    0 5 10 15 20 250

    0.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    4.5

    5

    Va- Module Voltage (Volts)

    Ia-ModuleCurrent

    (Amps)

    n=1

    n=2

    0 5 10 15 20 250

    10

    20

    30

    40

    50

    60

    70

    Va- Module Voltage (Volts)

    P-ModulePower(Watts)

    25 degrees

    50 degrees

    75 degrees

    100 degrees

    Figure 20 I-V curves for various diode quality factors. (Remain constants at standard temperature ratings)

    Figure 21 P-V curves for various temperatures. (Remain constants at standard temperature ratings)

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    23/42

    18

    Using a rate limiter the input current into the PV model was gradually increased, as supposed to rising

    rapidly. This was done to view the electrical voltage signal (in Figure 23) under a gradual change in

    current. When the current saturates at approximately 3.99A the voltage drops down to zero with regardsto time, at time = 13.7 seconds.

    0 2 4 6 8 10 12 14 16 18 200

    0.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    4.5

    5

    Time (Seconds)

    Ia-ModuleCurrent

    (Amps)

    0 2 4 6 8 10 12 14 16 18 200

    5

    10

    15

    20

    Time (Seconds)

    Va-ModuleVolta

    ge(Volts)

    Figure 22 Current after rate limiter added (at STD)

    Figure 23 Electrical Voltage signal (at STD)

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    24/42

    19

    4.3 PV module with MPPTPerturb and observe method of tracking the maximum power point of the PV module. A flow chart

    illustrating this method is shown in Figure 24 to get a better understanding of this method.

    For the operation of MPPT being implemented into the project, a buck-boost convertor was selected to

    interface the PV module to a load. The reason for the buck-boost chopper was the voltage output from the

    PV module ranges from 0 V to 22.7 V, as seen in Figure 23.The boost converter was required to supply an output voltage of 17.493V and 3.716A of current for

    standard conditions.

    igure 24 Perturb and Observe Tracking Method [13]

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    25/42

    20

    Hence, using ohms law, the value of the load resistor required is calculated as follows:

    (16) The PMW frequency was set to 1.96 kHz; the time period is calculated as follows:

    (17) Voltage ripple:

    (18)

    The minimum capacitance and inductance values can be calculated as follows for a load of 5.5. Forpractical purposes the duty cycle chosen as 75% for safety measures.

    (19)

    (20)

    The PV module with maximum power point tracking was implemented in real time as shown in Figure25. The PV module with maximum power point tracking and the buck-boost chopper can be illustrated in

    Simulink as in Figure 29.

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    26/42

    21

    The MPPT S-Function block in Figure 25 held the coded language for MPPT as described previously.

    This tracked the maximum power point in real time. On the Power verses Voltage waveform in Figure 21

    it was clear that there was an increasing gradient ( ) before the maximum power point. At

    maximum power point the gradient was zero, and after the maximum power point the gradient was

    decreasing ( ). This prediction was verified in the simulation and was depicted in Figure 26.

    0 2 4 6 8 10 12 14 16-5

    0

    5

    10

    15

    20

    25

    30

    35

    Time (Seconds)

    dP/dV(W/V)

    dP/dV < 0

    dP/dV > 0

    dP/dV = 0 at MPPT

    Figure 25 PV Module with MPPT

    Figure 26 Gradient to find MPPT

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    27/42

    22

    For maximum power point the voltage was perturbed until the gradient became zero. In Figure 27, 17.493volts was achieved when the graph became linear. The current at this point was 3.716 Amps. This

    produces maximum power and was calculated to be 65 Watts.

    0 2 4 6 8 10 12 14 160

    5

    10

    15

    20

    25

    Time (Seconds)

    Va-ModuleVoltage

    (Volts)

    Voltage at MPPT

    0 2 4 6 8 10 12 14 160

    0.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    Time (Seconds)

    Ia-ModuleCu

    rrent

    Current at MPPT

    Figure 27 Voltage waveform for finding MPPT

    Figure 28 Current waveform to find MPPT

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    28/42

    23

    MPPT is irradiance and temperature dependent since the output power is temperature dependent.

    Since creating PWM signals for the switch in Figure 29 prolongs simulations in Simulink, the time of the

    simulation had to be reduced. The voltage predicted by MPPT was approximately 17.493 Volts. To control thesignals into the switch of the buck boost chopper an integral control loop was implemented. This measured the error

    between the output voltage and the reference voltage (in this case the MPP voltage) and adjusted the duty cycle

    accordingly output the correct voltage. In Figure 30 the output voltage waveform clearly shows that the voltage

    oscillates around the maximum power point voltage.

    0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.20

    2

    4

    6

    8

    10

    12

    14

    16

    18

    20

    Time (Seconds)

    Va-ModuleVoltage(Volts)

    Figure 29 PV module with buck-boost chopper

    Figure 30 Output Voltage from the Buck-Boost Chopper

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    29/42

    24

    0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4

    0

    2

    4

    6

    8

    10

    12

    14

    16

    18

    Time (Seconds)

    Vout-ModuleVoltage(Volts)

    0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.20

    2

    4

    6

    8

    10

    12

    14

    16

    18

    20

    Time (Seconds)

    Va-ModuleVoltage(Volts)

    Figure 31 Output Voltage from the Buck-Boost Chopper at 50 degrees

    Figure 32 Output Voltage from the Buck-Boost Chopper at 500 W/m2

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    30/42

    25

    4.4 PV ArrayTheoretically PV arrays are series combinations of PV modules. To simulate a PV array, four 65 watt PV modules

    were added in series producing a PV array. This array has an open circuit voltage of voltageof . The open circuit current of the PV array however, is still 3.99Amps.

    Figure 33 Simulink representation of a PV Array

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    31/42

    26

    In Figures 34 and 35 the PV Array characteristics are shown. They follow the predicted curves for PV modules but

    with higher voltage and power capabilities.

    0 10 20 30 40 50 60 70 80 90 1000

    0.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    4.5

    5

    PV Voltage (Volts)

    PVCurrent(Amps)

    0 10 20 30 40 50 60 70 80 90 1000

    50

    100

    150

    200

    250

    300

    PV Array Voltage (Volts)

    PVArrayPower(Watts)

    Figure 34 I-V Characteristics of a PV Array

    Figure 35 P-V Characteristics of a PV Array

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    32/42

    27

    5 Work Plan5.1 Design Schedule

    A Gantt chart was drawn to illustrate the procedure that will be followed in order to maximize the final

    resulting simulation of a PV module in the given time. Figure 36 shows the design project divided intothree phases. Phase 1 being the specification of the proposed design, phase two to being the paper design

    and phase three being the completion or final product.

    ID Task Name Start Finish Duration Mar 2011

    17/420/2 6/3 8/5 24/427/2 20/3 13/3 15/5

    3 5d2/28/20112/22/2011Research for first Report

    4 9d3/4/20112/22/2011First Progress Report completion

    31d4/15/20113/4/2011Research on Report & Simulation

    35d4/11/20112/22/2011Interim Report completion

    40d4/18/20112/22/2011Interim Presentation

    1d2/22/20112/22/2011Task Allocation

    11 20d5/16/20114/19/2011Phase 3:

    13 11d5/3/20114/19/2011Second Progress Report

    15 9d5/13/20115/3/2011Final Report

    16

    May 2011Apr 2011

    27/3 1/5 3/4 10/4

    10d5/16/20115/3/2011Final Presentaion

    10

    9

    6

    2

    1 9d3/4/20112/22/2011Phase 1: Specification

    32d4/18/20113/4/2011Phase 2: Paper Design

    22/5

    27d4/11/20113/4/2011Simulation of PV cell

    7 7d4/11/20114/1/2011Paper Design completion

    8

    5

    12 10d5/2/20114/19/2011Simulation of PV Module- working

    14 9d5/12/20115/2/2011Final Simulation

    5.2 Future Work

    The PV module output was monitored under various temperature and irradiance values. For the final

    outcome the PV module and array will be investigated under weather conditions for South Africa. This

    will state the relevance of using PV modules in this country.

    Figure 36 Gantt chart

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    33/42

    28

    6 ConclusionPhotovoltaic modules are energy capturers that obtain renewable energy from the Sun which reduces

    carbon emissions. It can provide electricity to small scale operations singularly or to larger loads if

    connected as arrays.

    The aim of this report was to provide an insight to the simulation and theory of a moderate photovoltaic

    module. A 65 watt photovoltaic module was considered for the Matlab Simulink representation of the

    module. The model was influenced by temperature and irradiance, diode quality factors and series

    resistances and was characterised by the module voltage and current results.

    Maximum power point tracking was used in the simulation. It was observed that there are some power

    losses due to this perturbation and also fails to track the power under fast varying atmospheric conditions.But still this algorithm is very popular and simple and gives good results.

    The PV array was series combinations of the 65 W PV modules and it followed the predicted PV module

    I-V characteristics but producing higher power capabilities.

    Simulations of PV modules have been implemented in the past; however the simulations done in this

    project are implemented in C language in Simulink which aids with further analysis of the PV module.

    The ratings and specifications created for the photovoltaic module was appropriately structured,

    researched and designed to ensure a detailed system design.

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    34/42

    29

    7 References

    1. Gibbs Studios. Population, 2010, Available:http://www.populationmedia.org/issues/population/?gclid=CJjb1orum6cCFQgMfAodHlblcQ

    2. Renewable energy policy project. Rural Electrification with Solar Energy as a ClimateProtection Strategy, 1999, Available:

    http://www.repp.org/repp_pubs/articles/resRpt09/01Role.htm

    3. Francisco M. Gonzlez-Longatt. Model ofPhotovoltaic Module in Matlab, , 2005,Available: http://personnel.univ-

    reunion.fr/lanson/typosite/fileadmin/documents/pdf/Heuristiques_M2/Projet/lecture_ModelPV.pd

    f

    4. TE1700 Data sheet, Plan My Power, Available: http://www.solarpanel.co.za/Specification-sheets/

    5. Alldatasheet.com. 2003 2011, Available: http://pdf1.alldatasheet.net/datasheet-pdf/view/111113/ETC1/BP365.html

    6. Roger Messenger & Jerry Ventre. Photovoltaic Systems Engineering,ISBN-13: 978-0849320170,United States of America, 2000.

    7. Christiana Honsberg & Stuart Bowden. PVEducation, 2010, Available:http://pvcdrom.pveducation.org/CELLOPER/IDEALCEL.HTM

    8. Masters, Gilbert M. Renewable and Efficient Electric Power Systems, Online ISBN:9780471668824, John Wiley &Sons Ltd, 28 January 2005.

    9. Walker, Geoff R. Evaluating MPPT converter topologies using a MATLAB PV modelAustralasian Universities Power Engineering Conference, AUPEC 00, Brisbane, 2000

    10.Powersim.Inc, PSIM TUTORIAL, Available: http://www.ebookbrowse.com/tutorial-solar-module-physical-model-pdf-d22106398

    11.Milad Momayyezan.Maximum Power Point Tracking for Photovoltaic Arrays with MinimumSensors School of Electrical and Computer Eng. University of Tehran, Tehran, Iran.

    12.Adel El. PV Cell Module Modeling & Ann Simulation For Smart Grid Applications ResearchScientist, Mechatronics-Green Energy Lab., Elect. & Comp. Eng. Dept., OSU, USA, 43210, 2005

    2010.

    13.Hairul Nissah Zainudin, Saad Mekhilef. Comparison Study of Maximum Power Point TrackerTechniques for PV Systems Proceedings of the 14th International Middle East Power Systems

    Conference (MEPCON10), Cairo University, Egypt, December 19-21, 2010.

    14. Alibaba.com, 1999-2010 Hong Kong, Available: http://www.alibaba.com/product-gs/259094074/60W_PV_Module_Solar_Panel_ZXM060W18V_12502.html

    http://www.populationmedia.org/issues/population/?gclid=CJjb1orum6cCFQgMfAodHlblcQhttp://www.populationmedia.org/issues/population/?gclid=CJjb1orum6cCFQgMfAodHlblcQhttp://www.repp.org/repp_pubs/articles/resRpt09/01Role.htmhttp://www.repp.org/repp_pubs/articles/resRpt09/01Role.htmhttp://personnel.univ-reunion.fr/lanson/typosite/fileadmin/documents/pdf/Heuristiques_M2/Projet/lecture_ModelPV.pdfhttp://personnel.univ-reunion.fr/lanson/typosite/fileadmin/documents/pdf/Heuristiques_M2/Projet/lecture_ModelPV.pdfhttp://personnel.univ-reunion.fr/lanson/typosite/fileadmin/documents/pdf/Heuristiques_M2/Projet/lecture_ModelPV.pdfhttp://personnel.univ-reunion.fr/lanson/typosite/fileadmin/documents/pdf/Heuristiques_M2/Projet/lecture_ModelPV.pdfhttp://www.solarpanel.co.za/Specification-sheets/http://www.solarpanel.co.za/Specification-sheets/http://www.solarpanel.co.za/Specification-sheets/http://pdf1.alldatasheet.net/datasheet-pdf/view/111113/ETC1/BP365.htmlhttp://pdf1.alldatasheet.net/datasheet-pdf/view/111113/ETC1/BP365.htmlhttp://pdf1.alldatasheet.net/datasheet-pdf/view/111113/ETC1/BP365.htmlhttp://pvcdrom.pveducation.org/CELLOPER/IDEALCEL.HTMhttp://pvcdrom.pveducation.org/CELLOPER/IDEALCEL.HTMhttp://www.ebookbrowse.com/tutorial-solar-module-physical-model-pdf-d22106398http://www.ebookbrowse.com/tutorial-solar-module-physical-model-pdf-d22106398http://www.ebookbrowse.com/tutorial-solar-module-physical-model-pdf-d22106398http://www.ebookbrowse.com/tutorial-solar-module-physical-model-pdf-d22106398http://www.ebookbrowse.com/tutorial-solar-module-physical-model-pdf-d22106398http://www.ebookbrowse.com/tutorial-solar-module-physical-model-pdf-d22106398http://www.ebookbrowse.com/tutorial-solar-module-physical-model-pdf-d22106398http://www.alibaba.com/product-gs/259094074/60W_PV_Module_Solar_Panel_ZXM060W18V_12502.htmlhttp://www.alibaba.com/product-gs/259094074/60W_PV_Module_Solar_Panel_ZXM060W18V_12502.htmlhttp://www.alibaba.com/product-gs/259094074/60W_PV_Module_Solar_Panel_ZXM060W18V_12502.htmlhttp://www.alibaba.com/product-gs/259094074/60W_PV_Module_Solar_Panel_ZXM060W18V_12502.htmlhttp://www.alibaba.com/product-gs/259094074/60W_PV_Module_Solar_Panel_ZXM060W18V_12502.htmlhttp://www.ebookbrowse.com/tutorial-solar-module-physical-model-pdf-d22106398http://www.ebookbrowse.com/tutorial-solar-module-physical-model-pdf-d22106398http://pvcdrom.pveducation.org/CELLOPER/IDEALCEL.HTMhttp://pdf1.alldatasheet.net/datasheet-pdf/view/111113/ETC1/BP365.htmlhttp://pdf1.alldatasheet.net/datasheet-pdf/view/111113/ETC1/BP365.htmlhttp://www.solarpanel.co.za/Specification-sheets/http://www.solarpanel.co.za/Specification-sheets/http://personnel.univ-reunion.fr/lanson/typosite/fileadmin/documents/pdf/Heuristiques_M2/Projet/lecture_ModelPV.pdfhttp://personnel.univ-reunion.fr/lanson/typosite/fileadmin/documents/pdf/Heuristiques_M2/Projet/lecture_ModelPV.pdfhttp://personnel.univ-reunion.fr/lanson/typosite/fileadmin/documents/pdf/Heuristiques_M2/Projet/lecture_ModelPV.pdfhttp://www.repp.org/repp_pubs/articles/resRpt09/01Role.htmhttp://www.populationmedia.org/issues/population/?gclid=CJjb1orum6cCFQgMfAodHlblcQ
  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    35/42

    A

    A.Appendix A1

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    36/42

    B

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    37/42

    C

    B.Appendix B1The following code was used to generate a voltage in, current out PV model.

    /*This code is used to simulate a Photovoltaic module: BP 65WFor this design the module is simulated in Simulink and coded in C.This code is done by Ashveer Hooblal (207500768) for Electrical Design 5.2011*/

    //Declaration of variables used in the PV characteristicsdouble suns, Ta, Va;double Eg, Ns;double k, q, n;double Tr, TaK;double Voc_Tr;double Isc_Tr;double Iph_Tr, a;double Iph, Vt_Tr, Io_Tr;double b;double Xv, dVdI_Voc, Rs;double Vt_Ta, Vc;double Io, Ia;double temp1;double Isc;int i;

    //constantsTa = Tin[0];suns = Suns[0];Va = Vin[0];n=nd[0]; //diode quality factor

    if (Va

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    38/42

    D

    Iph=Isc*suns; /*Photon generated current-irradiance dependent */

    Vt_Tr=n * k * Tr/q; //Thermal potential (Vt) at temp ref

    // Calculate reverse saturation current for a given temperatureIo_Tr=Isc_Tr/ (exp(Voc_Tr / (Vt_Tr) ) -1);

    temp1=pow((TaK/Tr),(3/n)); // (TaK/Tr)^(3/n) using 'pow' functionb=Eg * q / (n*k);

    Io=Io_Tr * (temp1 * exp (-b * (1/TaK - 1/Tr)));

    // calculate series resistance per cellXv = (Io_Tr / (Vt_Tr) ) * exp(Voc_Tr /(Vt_Tr) );

    Rs = - dVdI_Voc - 1/Xv;

    Vt_Ta = n * k * TaK / q; //Thermal potential (Vt) at temp Ta

    /*Ia = Iph Io * (exp((Vc + Ia * Rs) / Vt_Ta) -1)f(Ia) = Iph - Ia Io * ( exp((Vc + Ia * Rs) / Vt_Ta) -1) = 0Solve for Ia by Newton's method: Ia2 = Ia1 - f(Ia1)/f'(Ia1) */Ia=0;for (i=1;i

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    39/42

    E

    C.Appendix CThe following code was used to generate a current in, voltage out PV model.

    /*Current Input PV Module:This code is used to simulate a Photovoltaic module: BP 65WFor this design the module is simulated in Simulink and coded in C.This code is done by Ashveer Hooblal (207500768) for Electrical Design 5.2011*/

    //Declaration of variables used in the PV characteristicsdouble suns, Ta, Va;double Eg, Ns;double k, q, n;double Tr, TaK;double Voc_Tr;double Isc_Tr;double Iph_Tr, a;double Iph, Vt_Tr, Io_Tr;

    double b;double Xv, dVdI_Voc, Rs;double Vt_Ta, Vc;double Io, Ia;double temp1, temp2;double Isc;int i;

    //constantsTa = Tin[0];suns = Suns[0];Ia = Iin[0];

    k=1.38e-23; //Boltzmanns Constantq=1.602e-19; //Charge of an electronn=nd[0]; //diode quality factorEg=1.12; //band gap voltage for Si.Ns=36; //number of cells (BP 365)a=0.065*exp(-3); //Temperature coefficient of IscTr=273+25; //Reference Temperature in KelvinVoc_Tr=22.7/Ns; //From datasheetIsc_Tr=3.99; //From datasheetdVdI_Voc = dV_dI[0] /Ns; /* gradient of graph from

    datasheet close to Voc */

    TaK=273+Ta; //input temp in Kelvin

    Isc=Isc_Tr*( 1 + (a * (TaK - Tr) ));

    Iph=Isc* (suns / 1000); /*Photon generated current-irradiance dependent */

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    40/42

    F

    Vt_Tr=n * k * Tr/q; //Thermal potential (Vt) at temp ref

    // Calculate reverse saturation current for a given temperatureIo_Tr=Isc_Tr/ (exp(Voc_Tr / (Vt_Tr) ) -1);

    temp1=pow((TaK/Tr),(3/n)); // (TaK/Tr)^(3/n) using 'pow' functionb=Eg * q /(n*k);

    Io=Io_Tr * ( temp1 * exp(-b * ( 1/TaK - 1/Tr )) );

    // Calculate series resistance per cellXv = (Io_Tr / (Vt_Tr) ) * exp(Voc_Tr /(Vt_Tr) );

    Rs = - dVdI_Voc - 1/Xv;

    Vt_Ta = n * k * TaK / q; //Thermal potential (Vt) at temp Ta

    if ((Iph - Ia) >= 0) {

    temp2=((Iph - Ia)/Io +1); //Takes care of imaginary values if any}

    Vc = Vt_Ta * log(temp2) - (Ia)*Rs;

    Va=Vc * Ns; // cell voltage

    Vout[0]=Va; // Output current from PV blockRs1[0] = Rs; //Series Resistance from PV block.

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    41/42

    G

    D.Appendix D/*MPPT in C Code: P & O Tracking in real time.This code is used to simulate a maximum power point tracking: BP 65WFor this design the module is simulated in Simulink and coded in C.This code is done by Ashveer Hooblal (207500768) for Electrical Design

    5. 2011*/

    //Declaration of variables

    double Pout, Vout;double Pdelay, Vdelay;double delta_p, delta_v;double d, delta_d;double time;

    Pout = P[0];Pdelay = P_delay[0];

    Vout = V[0];Vdelay = V_delay[0]; //variable used to

    delay voltage for perturbation

    delta_p = Pout - Pdelay; //change in powerdelta_v = -(Vout -Vdelay); //change in voltagedelta[0] = delta_p / delta_v; //Gradientdelta_d = delta[0];

    if (delta_d > 0 ) {if (delta_d < 0) {//reverse perturb

    }Vo[0] = V[0]; //tracks voltage for MPPTImpp[0] = Iin[0]; //tracks current for MPPT

    }

  • 8/3/2019 Ashveer Hooblal 207500768 Design 5-2nd Progress Report

    42/42

    E.Appendix E% Maximum Power Point Tracking: Perturb and Observe Method.

    This part code is used to find the MPP from a Photovoltaic module: BP 65WFor this design the module is simulated in Simulink and coded in C.The MPPT code done in Matlab code for faster simulation.

    This code is done by Ashveer Hooblal (207500768) for Electrical Design5.2011

    function [Pa_max, Imp, Vmp] = fcn(u) %function to calculate MPPT

    Ia = linspace(0,6,500); %increments of current for perturband observe MPPT

    Vc = 0;Va1 = zeros(size(Ia)); %initialize voltage for incrementfor z= 1:500;

    if Iph - Ia(z) > 0; %prevents imaginary values

    temp2=((Iph - Ia(z))/Io +1);

    Vc = Vt_Ta * log(temp2) - (Ia(z))*Rs;

    endif Iph == Ia(z)

    temp2=((Iph - Ia(z))/Io +1);

    Vc = Vt_Ta * log(temp2) - (Ia(z))*Rs;end

    if Iph - Ia(z) < 0 %prevents imaginary valuesVc = 0;

    end

    Va1(z) = Vc * Ns; % incremented voltage

    endVa = Va1;

    % Start process for finding Maximum power pointPa_new = 0;Pa_max = 0;Imp = 0;Vmp = 0;

    for n = 1 : 500;Pa_new = Ia(n) * Va(n);

    if Pa_new > Pa_max

    Pa_max = Pa_new;

    Imp = Ia(n);Vmp = Va(n); % voltage at MPPT goes to chopper