Fast Battery Charger using a Buck-Boost Full H-Bridge Circuit

The Buck-Boost full H-Bridge circuit described elsewhere is adapted to provide a battery charger for a number of different battery types, by adding an SLA battery charging algorithm to the SMPS algorithm. The full H-Bridge buck-boost converter provides somewhat better efficiency at higher currents than the half H-bridge, but it adds its own challenges, particularly when used as a battery charger. The circuit was tested with 1.4AH and 7.5AH, 12V, SLA batteries by Diamec.

The circuit is intended for use with sensitive radio equipment to provide direct battery power for periods up to 8 hours, with automatic switch over to recharge when the equipment is turned off. A simple load current detection provides the switching.

One challenge with this circuit is to prevent the battery discharging back through the MOSFETs and coil during the startup phase. To avoid this, the charger is kept turned off after power on or reset until the analogue circuitry has settled and a steady battery terminal voltage can be read. Then the charger is activated, with the upper boost MOSFET turned off, until a measurable current starts to flow into the battery and the output voltage climbs above that of the originally measured battery terminal voltage. This ensures that the battery cannot discharge back through the circuit. The Schottky diode (1A capacity) that bypasses the upper boost MOSFET can provide the boost function adequately with the low currents that occur during this stage. Once charging has begun, the upper boost MOSFET is allowed to operate. This will reduce the power dissipation in this part of the circuit (in which the full output current is flowing).

The battery current is the critical parameter to be monitored for the battery charger control. The battery voltage tends to be clamped heavily by the battery, but increasing the terminal voltage above the battery's natural terminal voltage can cause the current to increase strongly. As such the current is measured every program cycle and is unfiltered to allow rapid response of the algorithm.

The remaining parameters to be measured are the input voltage, the battery voltage and the load current. Each of these is measured every four cycles and is filtered with an exponential moving average IIR filter to reduce the variance. The SMPS control algorithm is computed every program cycle while the remaining algorithms are computed every four cycles. As an A/D conversion takes 13 microseconds, the program cycle will take on average about 26 microseconds; the computation time of the algorithms is designed to be very short by making use of integer arithmetic and avoiding multiply/divide operations.

Pseudocode for the program is as follows:

// Variable to indicate that the charger has been turned off
triggered = false;

// Wait for analogue electronics to settle
Vb_original = 0;
do {
        measure_battery_voltage(Vb);
        absolute_difference = abs(Vb_original-Vb);
        Vb_original =Vb;
}
while(absolute_difference != 0);

// Main loop
do {
        measure_battery_current(Ib);
        if (cycle_count & 0x03 == 0)         measure_battery_voltage(Vb);
        if (cycle_count & 0x03 == 1)         measure_load_current(Io);
        if (cycle_count & 0x03 == 2)         measure_source_voltage(Vs);
// Filter all four variables
        Ib_smooth = exp_mov_avg_filter(Ib);
        Vb_smooth = exp_mov_avg_filter(Vb);
        Io_smooth = exp_mov_avg_filter(Io);
        Vs_smooth = exp_mov_avg_filter(Vs);
// Algorithms computed every four cycles
        if (cycle_count & 0x03 == 3) {
// Turn off MOSFET and set very low current until charging phase kicks in
                if (! triggered) {
                        if ((Vb_smooth > Vb_original) && (Ib_smooth > current_trigger)) {
                                turn_on_upper_boost_MOSFET();
                                target_Ib = bulk_current;
                        }
                        else {
                                turn_off_upper_boost_MOSFET();
                                target_Ib = slow_current;
                        }
                }
// Detection of absorption phase end and float charge phase start
                if (startup_delay_ended && (Ib_smooth < float_trigger) {
                        target_Vb = float_voltage;
                }
// Detection of output current on, and isolation of charger and load
                if (Io_smooth < Io_trigger_high) {
                        if (! triggered) {
                                turn_off_charger();
                                triggered = true;
                        }
                }
// Detection of output current off, and restart of charger
                if (Io_smooth > Io_trigger_low) {
                        if (triggered) {
                                turn_on_charger();
// Revert to absorption phase charging as battery will have been discharged
                                target_Vb = absorption_voltage;
                                triggered = false;
                        }
                }
        }
        SMPS_control_algorithm(Ib, target_Ib, Vb_smooth, target_Vb, Vs_smooth);
        cycle_count++;
}
until(false);

A suitable SMPS control algorithm is described for the half H-bridge SMPS battery charger.


First created
4 December 2010
Last Modified 30 December 2010
© Ken Sarkies 2010