Tuning the Fugu MPPT Charging Algorithm

  Uncategorized

The Fugu is an impressive Instructables project. I’ve recently finished building it and put it under test, to see wether I can use it with my 24V 8S LiFePo4 Battery. Compared to lead acid battery, Lifepo4 batteries need a Battery Management System to keep cells in specified voltage range. I expect the Charger to handle situations when the BMS disables charging or discharging by interrupting the battery (-) connection.

For my testing I used a 60V 15A power supply, an 8s LiFePo4 battery with BMS and 47 Ω resistor to limit current from the battery if things go wrong. Battery voltage is about 26 V.

Broken Flow-back Control

The first thing I noticed was that during charge, lowering the PV input voltage from 50 V to 0 V on the power supply would actually feed current into the power supply. The voltage would slowly fade down. This is because the synchronous buck is also a boost converter, just in the other direction. So it can boost the battery voltage and current can flow to the MPPT input.

An easy fix for this issue is to disable the back-flow control bypass (emulated diode), when the current is 0 or below. Because of the back-flow MOSFET’s body diode, current can always flow from the PV input to the buck converter. So we keep the MOSFET off and „wait“ until this current is positive, losing a bit of energy in the body diode, and then switch the MOSFET on.

Over Current Recovery

We can easily provoke an over current situation by increasing the power supply voltage during charge. The algorithm will slowly decrease the buck’s PWM duty cycle until it is in range, but this can take a couple of seconds (of course this is a rather artificial situation which probably does not happen with solar panels)

if(outputCurrent > maxCurrent) --PWM;

My improved version pseudo code:

if(outputCurrent > maxCurrent * 1.2) PWM /=2;
else if(outputCurrent > maxCurrent * 1.05) PWM-=2;
else if(outputCurrent > maxCurrent) --PWM;

Battery Switching

Switching the battery connection while the MPPT is connected to an input can easily destroy the device. This is because of the boost behavior when the lower MOSFET is switching, causing high transient voltages at the PV input. It is always safe to leave the FET off because it has an internal body diode (although it cannot stay switched off completely, see below). Switching it on must be taken with care, as it can produce high voltage at the buck’s input side, destroying components. It actually happened to me: both XL7005A, B1212S, ACS712, ADS1115, ESP32 died 🙁

Solution: only turn on lower fet (and the back-flow FET) when min(current, smooth current) is >100mA . With the Arduino ledc API I didn’t find a way to accomplish, because we would need another PWM channel for *SD, with a synchronized phase shift. Note that we can’t turn off the lower FET completely, because it is part of the high-side driver’s bootstrapping circuit. 1 us per cycle should be sufficient to keep the charge pump running.

Noticeable changes to hardware:

  • Remove PV power supply diode (not reliable if battery is fully discharged and BMS needs a wake-up voltage)
  • Interrupt PV power supply as soon as we have battery voltage
  • Use a MOSFET with high break-down voltage for the back-flow control and carefully turn it on. This might use the same condition as the lower FET
  • Add a Fuse (or PTC, Inductor, Resistor or a combination?) before the power supply DCDCs and a TVS (or crowbar, or varistor, or both?)

LEAVE A COMMENT