PV Interfaces and Maximum Power Point Tracking
A solar module wired straight to a battery gives about in full sun; the same module through a small converter gives . The module is not a voltage source or a current source but something in between, and it delivers its rated power at one point of its curve only, a point that moves with every cloud and every degree of cell temperature. A maximum power point tracker (MPPT) is a converter whose control loop regulates its input voltage and keeps searching for that point. This lesson uses the module model of Solar PV: Cells, Arrays and Inverters, puts a buck converter between it and a battery, and compares the two standard search algorithms, perturb-and-observe and incremental conductance, in Python.
Safety: a single module's open-circuit voltage is to DC and a string's is hundreds of volts, present whenever light falls on it; DC arcs do not self-extinguish. Rooftop strings and grid inverters are calculation and simulation only. The bench part uses a small panel with an open-circuit voltage below .
The curve and its maximum
The single-diode model gives the module current ; power is . At the maximum power point (MPP)
so the module's incremental conductance equals minus its static conductance, and the load the module wants to see is . Left of the MPP the module behaves almost like a current source (), right of it almost like a voltage source (). Two facts make tracking easy and hard at once:
- hardly moves with irradiance ( to from to for this module) but falls with temperature, by about to ( in this model, from to between and ).
- , and so the power, is nearly proportional to irradiance, which can change by a factor of two in a second at a cloud edge.
The converter as an adjustable load
A converter between the module and a fixed-voltage load transforms resistance. An ideal buck with duty cycle feeding a load draws at , so the module sees
With a battery as the load, the output voltage is fixed by the battery and the duty cycle sets the module voltage, for a buck. MPPT charge controllers for 12, 24 and batteries are bucks; string inverters use a boost stage (or several, one per string) to lift the array to the DC link of the grid inverter (Grid-Tied Inverters). The MPPT loop does not choose directly: it chooses a reference voltage , and an inner voltage loop (often with an inner current loop) moves to hold the module there. The input capacitor across the module carries the converter's pulsed input current, so the module sees almost DC.
Worked example: direct connection against MPPT
Given: the 60-cell module of the Solar PV lesson at STC (, , , ); a lead-acid battery between and ; a series diode of for direct connection, or a buck MPPT controller of efficiency.
Find: the MPP and , the power delivered by direct connection at three battery voltages, the power with MPPT, and the buck's duty cycle at the MPP with the battery at .
Solve:
Check: a fully charged battery at plus the diode puts the module at , close enough to the MPP to lose only 8 %; a discharged battery loses 20 %. On a hot roof ( cells) falls to , so direct connection then does better, which is why cheap "PWM" controllers for 36-cell modules on 12 V batteries work tolerably. The MPPT controller wins by to here, and more with a 72-cell module whose MPP is far above the battery.
import numpy as np
from scipy.optimize import brentq, minimize_scalar
# the 60-cell module of the Solar PV lesson: Isc 10.0 A, Voc 41.0 V at STC, n = 1.2, Rs = 0.25 ohm
k, q = 1.380649e-23, 1.602176634e-19
Ns, n, Rs, Isc0, Voc0 = 60, 1.2, 0.25, 10.0, 41.0
def module(G, Tc=25.0):
Vt = n * Ns * k * (Tc + 273.15) / q
Isc = Isc0 * G / 1000 * (1 + 0.0005 * (Tc - 25))
Voc = Voc0 * (1 - 0.0030 * (Tc - 25)) + Vt * np.log(G / 1000)
I0 = Isc / np.expm1(Voc / Vt)
cur = lambda V: brentq(lambda I: Isc - I0 * np.expm1((V + I * Rs) / Vt) - I, -1, Isc + 1)
return Voc, cur
def mpp(G, Tc=25.0):
Voc, cur = module(G, Tc)
r = minimize_scalar(lambda V: -V * cur(V), bounds=(0.5 * Voc, Voc), method="bounded",
options={"xatol": 1e-4})
return r.x, cur(r.x), Voc
Vm, Im, Voc = mpp(1000)
print(f"STC: MPP {Vm:.2f} V x {Im:.3f} A = {Vm*Im:.1f} W, R_mpp = {Vm/Im:.3f} ohm, Vmpp/Voc = {Vm/Voc:.3f}")
_, cur = module(1000)
for Vbat in (25.0, 27.6, 29.0): # 24 V lead-acid battery plus 0.5 V diode drop
P = Vbat * cur(Vbat)
print(f"direct to a battery: module at {Vbat:.1f} V -> {P:6.1f} W ({100*P/(Vm*Im):.1f} % of MPP)")
print(f"buck MPPT controller, 97 % efficient: {0.97*Vm*Im:.1f} W into the battery")
for G, Tc in ((1000, 60), (500, 25), (200, 25)):
Vm, Im, Voc = mpp(G, Tc)
print(f"G = {G:4d} W/m2, {Tc:2d} C: Vmpp = {Vm:5.2f} V = {Vm/Voc:.3f} Voc, Pmpp = {Vm*Im:6.1f} W")STC: MPP 33.32 V x 9.436 A = 314.4 W, R_mpp = 3.531 ohm, Vmpp/Voc = 0.813
direct to a battery: module at 25.0 V -> 249.8 W (79.5 % of MPP)
direct to a battery: module at 27.6 V -> 275.2 W (87.5 % of MPP)
direct to a battery: module at 29.0 V -> 288.3 W (91.7 % of MPP)
buck MPPT controller, 97 % efficient: 305.0 W into the battery
G = 1000 W/m2, 60 C: Vmpp = 28.90 V = 0.788 Voc, Pmpp = 272.8 W
G = 500 W/m2, 25 C: Vmpp = 33.16 V = 0.835 Voc, Pmpp = 156.7 W
G = 200 W/m2, 25 C: Vmpp = 32.19 V = 0.847 Voc, Pmpp = 60.8 W
The ratio stays between and , which is the basis of the simplest tracker, fractional open-circuit voltage: stop the converter briefly, measure , and regulate at about . It is cheap and robust but never exactly at the MPP, and it loses energy during each measurement.
Perturb-and-observe and incremental conductance
Perturb-and-observe (P&O, also called hill climbing) changes the voltage reference by a step every update and keeps the direction if the power rose, reverses it if the power fell. In steady light it ends up oscillating over three points around the MPP; a large step tracks quickly but oscillates widely. Incremental conductance (IncCond) compares with from two successive samples: if they are equal (within a tolerance) it stops, otherwise it steps towards the MPP. It can rest at the MPP, and it knows the direction without trial. Both must wait between updates until the converter and the module voltage have settled, typically tens of milliseconds.
The simulation runs both on the module at , updated every : under a cloud at , the cloud clearing over , then in full sun. The tracking efficiency is the energy harvested divided by the energy available at the MPP.
import numpy as np
from scipy.optimize import brentq, minimize_scalar
k, q = 1.380649e-23, 1.602176634e-19
Ns, n, Rs, Isc0, Voc0 = 60, 1.2, 0.25, 10.0, 41.0
def module(G): # cell temperature held at 25 C
Vt = n * Ns * k * 298.15 / q
Isc, Voc = Isc0 * G / 1000, Voc0 + Vt * np.log(G / 1000)
I0 = Isc / np.expm1(Voc / Vt)
return lambda V: brentq(lambda I: Isc - I0 * np.expm1((V + I * Rs) / Vt) - I, -1, Isc + 1)
# irradiance: 10 s at 400 W/m2 under a cloud, the cloud clears in 5 s, then 15 s at 1000 W/m2
dt = 0.1 # MPPT update every 100 ms
t = np.arange(0, 30, dt)
G = np.interp(t, [0, 10, 15, 30], [400, 400, 1000, 1000])
curves = [module(g) for g in G]
P_mpp = np.array([-minimize_scalar(lambda V: -V * c(V), bounds=(20, 41), method="bounded",
options={"xatol": 1e-3}).fun for c in curves])
def perturb_observe(dV):
V, Vp, Pp, out = 30.0, 29.0, 0.0, []
for c in curves:
P = V * c(V)
step = dV if (P - Pp) * (V - Vp) > 0 else -dV # same direction if power rose
out.append((V, P))
Vp, Pp, V = V, P, V + step
return np.array(out)
def inc_cond(dV, tol=0.002):
V, Vp, Ip, out = 30.0, 29.0, curves[0](29.0), []
for c in curves:
I = c(V)
dI, dv = I - Ip, V - Vp
if dv == 0.0: # parked at the MPP: watch for a current change
step = 0.0 if abs(dI) < 0.01 else (dV if dI > 0 else -dV)
else:
g = dI / dv + I / V # (dP/dV)/V: zero at the MPP
step = 0.0 if abs(g) < tol else (dV if g > 0 else -dV)
out.append((V, V * I))
Vp, Ip, V = V, I, V + step
return np.array(out)
E_mpp = P_mpp.sum() * dt
print(f"available energy {E_mpp/3600:.3f} Wh in 30 s")
print("algorithm dV overall 400 W/m2 ramp up 1000 W/m2 V at 15 s")
segments = [(t < 10), (t >= 10) & (t < 15), (t >= 15)]
for name, f in (("P&O", perturb_observe), ("IncCond", inc_cond)):
for dV in (0.2, 0.5, 1.0):
V, P = f(dV).T
eff = [100 * P[m].sum() / P_mpp[m].sum() for m in segments]
print(f"{name:8s} {dV:4.1f} V {100*P.sum()/P_mpp.sum():7.2f} % "
f"{eff[0]:6.2f} % {eff[1]:6.2f} % {eff[2]:6.2f} % {V[150]:5.1f} V")available energy 1.960 Wh in 30 s
algorithm dV overall 400 W/m2 ramp up 1000 W/m2 V at 15 s
P&O 0.2 V 95.09 % 99.69 % 86.90 % 95.77 % 23.2 V
P&O 0.5 V 98.75 % 99.76 % 92.92 % 99.83 % 31.0 V
P&O 1.0 V 99.39 % 99.49 % 98.49 % 99.57 % 32.0 V
IncCond 0.2 V 95.10 % 99.69 % 86.90 % 95.78 % 23.2 V
IncCond 0.5 V 98.87 % 99.76 % 93.66 % 99.84 % 31.5 V
IncCond 1.0 V 99.40 % 99.49 % 98.56 % 99.58 % 33.0 V
Under the steady cloud every version harvests more than ; the differences come from the ramp and the recovery after it. While the irradiance rises, every step sees the power rise because of the sun, whatever the step did, so P&O keeps walking in the direction it last moved: with steps it drifted down to by the end of the ramp, harvested during it, and needed seconds of full sun to climb back. Incremental conductance is fooled in the same way here, because its compares samples taken on two different curves. Larger steps make the algorithm's own power change larger than the sun's, so it drifts less: at the ramp costs only . Commercial trackers use variable step sizes (large far from the MPP, small near it), check the power change at a mid-step sample to separate irradiance from perturbation ("dP-P&O"), and periodically sweep the whole curve to find the global maximum when partial shading and bypass diodes give the P–V curve several peaks.
Interactive: the MPPT charge controller's power stage
The buck lab with the module at its MPP (), and the battery represented by the resistance it presents, ( at ): it reads , and . The input current is and the module sees , its . Move and watch the output: with a real battery the output would stay at the battery voltage and the module voltage would move instead.
Guided lab: tracking a small panel by hand
Hand calculation. For a , hobby panel with and in full sun, the fractional estimate is , and .
Simulation. Change the first cell to Ns = 12, Isc0 = 0.37, Voc0 = 7.2, Rs = 1.0 and the voltage list to values near to , and compare its MPP and with your estimate.
What you would measure. In steady sun, or under a lamp, load the panel with a decade resistance box and read voltage and current with two DMMs. Be the tracker: start at , step the resistance down in about steps, compute after each step, and reverse when it falls (P&O); then repeat by comparing with (IncCond). Expect to settle within one or two steps of (within about 10 % of the simulated value), and to see the "MPP" move if a cloud passes during the search, exactly the drift of the simulation. A commercial low-voltage MPPT evaluation board feeding a resistive or LED load, never a battery, shows the same search on a scope as small steps of the panel voltage.
Hazards and safe setup. A small panel only ( well below ). Halogen lamps are hot; keep them away from plastic and hands, and never look at the Sun. Do not connect an MPPT board to a lithium battery. Rooftop strings and inverters are calculation and simulation only.
Pitfalls
- Updating faster than the converter settles. The algorithm then reacts to its own transient, not to the panel.
- Too small a step. It oscillates gently in steady light but is easily fooled by changing irradiance.
- Assuming a single peak. With partial shading, the bypass diodes make several maxima; a hill-climber stops on the nearest.
- Forgetting the input capacitor. Without it the module sees the converter's pulsed current, and its average operating point moves off the MPP.
Practice
- A buck MPPT controller feeds a battery from a module whose MPP is , . Find , and the battery current at efficiency.
- A boost stage raises a module to a DC link. What duty cycle holds it at the MPP?
- Why does P&O drift during rising irradiance, and in which direction?
Answer
- ; ; .
- .
- Every step sees the power rise, which P&O reads as "this direction is right", so it keeps stepping the way it last went, up or down, until the irradiance stops rising.
Test yourself
At the maximum power point of a PV module…
In an MPPT buck charge controller with a battery on its output, the duty cycle sets…
- the battery voltage
- the module's operating voltage,
- the irradiance
- the switching frequency
Which change moves a module's MPP voltage the most?
- irradiance from 1000 to 500 W/m2
- cell temperature from 25 to 60 C
- the time of day at constant sun
- the cable colour
Why do some trackers sweep the whole P–V curve every few minutes?
- to measure the temperature
- to find the global maximum when partial shading creates several peaks
- to discharge the input capacitor
- because IEEE 1547 requires it