This is only a preview of the April 2022 issue of Practical Electronics. You can view 0 of the 72 pages in the full issue. Articles in this series:
|
Care for your rechargeable batteries
High-current
Battery Balancer
Part 1 – by Duraid Madina
Proper balancing is critical for a long battery life, especially if they are
lithium-based rechargeable types. But many balancers are inefficient,
as they dump excess charge for a given cell, restricting how fast you can
charge the batteries and wasting power. Not this one – it redirects that
extra charge into other cells, so you can charge fast with little heat or waste!
M
ost rechargeable batteries
consist of an array of nominally identical cells, connected in series, parallel or series/parallel
to meet particular voltage, current and
capacity requirements.
Batteries with many series-connected cells often only expose the connections at the extreme ends. For example, a typical lead-acid car battery
has six cells (2V × 6 = 12V) but only
two terminals.
To charge such a battery, we apply
a higher voltage than the total of all
the cells across those two terminals,
and current flows through all six cells,
increasing their state of charge.
But there is no guarantee that each
cell starts with an identical voltage,
and despite their identical construction, cell capacity can vary, especially
as the battery ages.
This is not a big problem with car
batteries because lead-acid cells tolerate slight overcharging well. By overcharging the battery a little, cells with
a lower charge get a chance to ‘catch
up’ to the others, while the most highly charged cells dissipate the charging
current as heat.
Despite this, large lead-acid battery
banks (as might be used in a renewable
energy installation) will last longer if
38
they are kept balanced. In this case, you
might have several batteries in series, so
not only do you need to be concerned
about inter-cell balancing within a given battery, you also need to consider
balancing the charge between batteries.
The fact that you might be using
batteries with different ages and possibly even from different manufacturers makes this even more critical.
Then there is the case of lithium-ion
and similar rechargeable cells. There is
a great variety of lithium chemistries
around, but many of them do not tolerate overcharging. They also can be
easily damaged by over-discharging.
So keeping lithium rechargeable batteries balanced is even more crucial.
This Battery Balancer can handle
cell voltages as low as 3V and as high
as 15V, so it is suitable for a wide range
of balancing tasks, including balancing the cells within a lithium-ion battery, or balancing individual lithiumion or lead-acid batteries.
Each Balancer can handle up to four
cells (or groups of cells) or batteries,
and you can combine multiple Balancers for larger installations.
Avoiding cell damage
One conservative option would be to
immediately stop charging as soon as
any cell reached its maximum permissible voltage, but that would leave
the remainder of the cells not quite
fully charged.
Left unchecked, what might start
as a minimal imbalance between the
cells, could over repeated charge/discharge cycles develop into a much
larger imbalance, with the result that
as a whole, the battery has significantly
less usable capacity. Worse, when the
battery is fully discharged, those cells
which were not fully charged could
become over-discharged and damaged.
So we need a way to ensure that as a
battery is charged and/or discharged,
the cells are kept in balance. Each is
then charged to approximately the
same voltage, so that the battery capacity remains good and the cells degrade
equally. This way, a battery need not
be discarded just because one cell has
degraded more rapidly than the others (a common problem).
The simplest way to do this is to
shunt current around any cell that has
a higher voltage than the others during
charging. We have used that approach
in the past, for example, in our April
2017 Battery-Pack Cell Balancer.
That design could handle packs
with up to six cells, but only provided about 200mA of balance current.
Practical Electronics | April | 2022
The Battery Balancer is constructed on a single 4-layer
PCB just over 100mm wide, so it’s small enough to slot in
anywhere. Got more than four batteries? Build as many
Balancers as you need!
That limited
it to applications with
chargers up to
10A, and it got quite warm during operation, as all that power was being
turned into heat.
Our new Balancer, being much more
efficient, produces much less heat for a
given balance current and thus can handle much higher battery charge currents
– to 50A or more, assuming the cells
are matched to within 5% (a fairly conservative figure for a healthy battery).
Operational overview
This Battery Balancer helps to ensure
that cells in a battery are kept in balance
by periodically checking the cell voltages and moving charge from cells at a
higher voltage to cells at a lower voltage.
To do this, it has three main sections,
as shown in Fig.1. These are:
1) A voltage sensing front-end which
draws very little current from the cells.
2) A control section consisting of little more than a Microchip SAM-L10
32-bit microcontroller, which also
draws hardly any current when idle
(according to Atmel, it’s the ‘industry’s lowest power in its class’).
3)A power section for moving charge
between cells.
The Balancer has been designed to
achieve a high level of practical efficiency in three ways. First, the amount
of power consumed when not actively
balancing cells is kept low, by allowing virtually everything to be switched
off, and ensuring that most of what remains draws very little power.
Second, the amount of power required to see if balancing required is
kept low, through the use of simple
but energy-efficient voltage dividers.
Third, instead of using inefficient
schemes for balancing such as simply
dumping charge from cells that have
too much charge into resistive loads,
the Balancer recycles charge by taking
it from cells that have too much, and
adding it to those that have too little.
Practical Electronics | April | 2022
We h a v e
also tried to make
the Balancer flexible; not
only can it balance batteries of
up to four cells, or sets of up to four
batteries, but with a small amount of
external help, it can serve as a battery
charger and even a battery discharger!
Transferring charge
Perhaps the most critical part of the
Battery Balancer is the section which
transfers charge between batteries/
cells (and maybe also a charger or a
load). This section is replicated four
times on the board, once for each battery/cell that can be connected.
SC
Ó
Fig.1: while highly simplified, this
shows the basic configuration of
the High-current Battery Balancer.
Microcontroller IC2 measures the
voltage across each battery/cell via
resistive dividers. If one has a voltage
that is significantly higher or lower
than the others, it transfers power
into or out of the imbalanced cells via
the four power transfer blocks. These
can efficiently transfer energy to or
from one battery/cell to the entire
‘stack’, and by extension, between
multiple batteries/cells via the stack.
A simplified version of this circuit
is shown in Fig.2.
This section can transfer energy to
or from the battery/cell shown at the
left and the complete battery/‘stack’.
Energy can be transferred from one
battery/cell to another via the ‘stack’.
Let’s suppose we notice that one
cell has a voltage that is lower than
the other three. We can use that cell’s
power section to transfer charge from
the whole battery to that cell, to bring it
into balance. This happens cyclically.
First, the ‘stack-side’ transistor (QX)
is switched on and current begins to
flow from the battery, through the
stack-side transformer winding, energising the transformer’s core. Because
the cell-side power transistor (QY) is
off, the voltage across the cell-side
transformer winding quickly rises.
A moment later, the stack-side power
transistor is switched off, and the cellside power transistor (QY) is switched
on. This transfers the energy from the
transformer’s core into the cell. When
this is estimated to have completed,
the cell-side power switch is turned
off and the cycle repeats, with a duty
cycle proportional to the desired rate
of charge transfer.
The inductance of the transformer
can be chosen relatively freely. Transformers with higher inductance allow
operation at lower frequencies, but
have higher resistive losses. Transformers with lower inductance require operation at higher frequencies, but have
lower resistive losses.
Note, however, that transformers
with particularly low winding inductances tend to have slightly reduced coupling between the windings,
though only a few such transformers
have coupling so poor as to be a significant factor for this Battery Balancer.
The voltages at the drains of QX and
QY can exhibit significant inductive
ringing. If it is too severe, it might exceed the transistor ratings.
We have attempted to keep the inductance of these paths low by placing these devices very close to their
respective transformers. But for higher-voltage applications, it is still prudent to place series RC snubbers (ie,
Csnub and Rsnub) across the transformer windings.
For lower-voltage applications (eg,
balancing lithium-ion cells), these
snubbers can be safely omitted, and
that might even result in a small efficiency gain.
The micro controls MOSFETs
QY and QA via an ISO7041 isolator
39
because the negative end of the battery/
cell is not connected to ground (unless
it is the bottom-most in the stack). The
driving scheme is a bit more complicated than shown here, as will soon
become apparent.
The ISO7041 is powered by its own
‘floating’ 3.3V regulator from the battery/cell, to allow for the battery/cell
voltage to vary over a wide range.
Note how the negative terminals of
the bypass capacitors both for the individual battery/cell and for the stack
are connected via N-channel MOSFETs, rather than directly to the negative terminal of the battery/cell and
GND respectively. This is to provide
a ‘soft-start’ function which greatly reduces the sparks generated when connecting up batteries or cells.
Full circuit details
The full Battery Balancer circuit is
shown in Fig.3, although two of the
four charge-balancing circuits have
been partly omitted to save space. All
four are configured identically. Now
you can see the full detail of this part
of the circuit, which reveals a few extra subtleties.
First, the isolator outputs cannot
drive the MOSFET gates and microcontroller directly as they are too weak to
achieve the required switching speeds.
We spent a lot of time investigating the
use of integrated gate-driver ICs in that
role, but most of them have a significant quiescent current draw and stop
functioning at low supply voltages.
While this could be resolved for the
lower cell power sections by deriving
their supply rails from ‘one cell up’,
Features and specifications
• Balances two, three or four series-connected cells or batteries
• Suits Li-ion, LiPo, LiFePO4, lead-acid, AGM and other chemistries
• Each cell or battery can range from 2.5V (fully discharged) up to 15V maximum
• Balancing current: up to 2.5A
• Charging current: up to 50A
• fficienc t icall around 80%
• Quiescent current: around 100µA per battery/cell
• 5mm spade lug connections for high-current batteries
• 2.54mm-pitch pin header for connecting smaller batteries
• Switching frequency: typically 100kHz
• Multiple Balancers can be combined for balancing more cells or batteries
• t can also act as an efficient atter char er or dischar er
• Four onboard status LEDs plus one adjustment potentiometer
• Serial status/debugging interface
• om act size (108 80mm
)
this would leave the topmost power
section needing an alternative source
of power, eg, from a boost converter.
Instead of using integrated gate drivers, we decided instead to use simple
NMOS/PMOS transistor pairs configured as inverters. Happily, there are
many dual SMD MOSFETs available
which include one N-channel device
and one P-channel device, so each inverter is contained within a single package. In the case of the uppermost section
of the circuit, these are Q11 and Q12.
In each case, the MOSFET driving
the stack side of the transformer (eg,
Q9) is connected source-to-ground,
and is a logic-level FET. It is driven by
the 0-3.3V output of the inverter pair,
which are themselves driven from a
microcontroller digital output pin (in
this case, pin 22, labelled SSPWM3).
A 10kW pull-up resistor is provided at the input of each of these
SC
Ó
Fig.2: a stripped-down version of the
circuitry in each power transfer block. Power
goes between the battery/cell and the stack via
MOSFETs QX and QY and the transformer. QX is
ground-referenced, so it is controlled from a microcontroller output pin, while
QY is referenced to the negative cell/battery terminal. Therefore, the signal
from the microcontroller to control QY goes through an ISO7041 isolator,
which is powered from a 3.3V rail derived from the cell/battery voltage.
40
MOSFET-driving inverters so they
have a low output when the micro is
not in control of that pin (eg, it is in
reset or being programmed).
The other transformer-connected
MOSFET (for example, Q10) has its
source connected to the junction of
this battery/cell and the one below.
So as we described above, it is driven by an isolator that runs off a 3.3V
floating supply referenced to that
same voltage. Therefore, the MOSFET-driving inverter is also connected across this 3.3V floating supply,
to provide an appropriate swing for
that MOSFET.
It too has a 10kW pull-up resistor
to hold the MOSFET off by default.
But note that the Texas Instruments
ISO7041 low-power digital isolator
has variants with different default
pin states. The one we have chosen
provides high outputs if its inputs
are not driven, or the input side of the
device is not powered (as opposed to
the ISO7041F, which offers low outputs). This provides us with a safe
‘resting’ state.
1W resistors limit the power through
the gate drive inverters, adding to the
inverters’ intrinsic ~0.2W output resistance. This keeps the peak gate drive
currents below 3A.
It is not critical that the low-dropout
(LDO) floating regulator (REG3 here)
falls out of regulation if the cell voltage
drops below 3.3V, as both the isolator
and gate driver are capable of operating below this voltage.
Note though that if a cell voltage is
ever at less than 2.5V (a dangerously
low voltage for a lithium-polymer cell,
and a very low voltage for a lithium-ion
cell), no attempt will be made to transfer charge to or from this cell.
Instead, it is assumed that a battery
with cell voltages this low is likely to
have minimal charge, and so even if
imbalanced, merely charging the entire battery will quickly bring the cell
Practical Electronics | April | 2022
Scope1: this shows how the power switching MOSFETs
are driven. For clarity, two isolated pulses are shown. The
red and blue traces show stack-side and cell-side PWM
signals for balancer channel 2 (gate-driving inverter inputs)
as driven by the microcontroller and digital isolator,
respectively. The yellow and green show the stack-side
and cell-side power MOSFET gate voltages (gate-driving
inverter outputs). The majority of the ringing on these
traces is due to measurement error.
voltages above 2.5V. Balancing can
then resume long before any of the
cells approach full charge.
For more details on how charge
transferral works, refer to scope grabs
Scope1 and Scope2 and their captions.
Voltage sensing
To know which batteries or cells
should be charged or discharged, the
Battery Balancer needs to be able to
take accurate voltage measurements
across each battery/cell.
Sensing low voltages accurately is
becoming easier; high-performance
analog-to-digital converters (ADCs)
are readily available, and modern microcontrollers often include ADCs that
would have been considered high-performance not that long ago. In our case,
the SAM-L10 micro has a 12-bit ADC
capable of taking one million samples
per second.
As we need to sense voltages up to
around 60V (say, four 12V lead-acid
batteries in series under charge), a kind
of front-end is required to bring these
voltages down into typical ADC ranges.
One option would be to use operational amplifiers (op amps) that can tolerate these higher voltages, to divide
(and possibly shift) the voltages as required. Suitable parts are not hard to
find, but they are not cheap.
Moreover, because the voltages the
Battery Balancer needs to sense do
not vary quickly, very little in the way
of high-frequency performance is required, so offset-correcting chopperstyle op amps are applicable.
However, the performance of the required op amp circuits would be dominated by the accuracy of the connected resistors. The power consumption
of these op amps, while impressively
Practical Electronics | April | 2022
Scope2: here, the red and blue traces are as in Scope 1, but
the yellow and green traces show the drain voltages of the
main switching MOSFETs (ie. the bottom ends of the power
transformer) – the stack-side node is in yellow, while the
cell side node is in green. Here, less of the ringing on the
switching nodes is due to measurement error, particularly
in the phase where both power MOSFETs are off, allowing
their drains to float.
low in many devices, is high enough
that we couldn’t leave them powered
all the time.
So instead, we use a simple switchedcapacitor, switched-ground resistive
voltage divider, as shown in Fig.3. To
avoid the constant power consumption
of an always-on voltage divider, we add
low-side NMOS FETs (Q8a, Q13a, Q19a
and Q24a). Even very small-signal FETs
introduce only a couple of ohms of error while on.
When off, however, the voltage can
drift above the tolerance of the microcontroller input pins. So a second set
of NMOS pass transistors (Q8b, Q13b,
Q19b and Q24b) ensures the microcontroller never sees such voltages. Once
again, we can take advantage of dual
MOSFET packages so that each pair
of transistors is just one part to be soldered to the board.
To save microcontroller pins, all of
the voltage dividers share a common
pair of control lines. To take a set of
voltage readings, first, the low-side
NMOS switches are turned on, enabling the divider. Next, the pass gate
NMOS switches are turned on, allowing the filter capacitors to start settling
towards their respective values.
Finally, the microcontroller’s onboard
ADC takes its samples, allowing the software to know the voltage across each
battery or cell. With the 100kW 2.2kW dividers used, and the 12-bit ADC having
a 1.65V reference, the nominal sensed
voltage range is 0-76.65V, and the resolution is 18.7mV. That’s precise enough
to detect small differences between 12V
battery voltages.
Refer to Scope3 for more information
on how this process works.
For lower voltage batteries such as
li-ion, LiPo or LiFePO4 packs with
cells typically ranging from 2.7-4.2V,
the resistive dividers are changed to
100kW/6.8kW which gives a range of
0-25.9V and a resolution of 6.3mV,
which means we can balance out inter-cell voltage differences starting at
about 10mV.
A virtually identical arrangement
is used to sense the voltage across the
whole stack using MOSFETs Q18a and
Q18b (which will probably be the same
as one of the cells, but not necessarily
the same one, hence the separate divider) and also the rotation of potentiometer VR1 via MOSFETs Q7a and Q7b.
This is used to set various parameters,
which will be described later.
While an independent stack voltage monitor might seem redundant, it
comes in handy when using the Battery Balancer in other applications.
For example, it can be used to allow
charging batteries from other power
sources such as solar panels, or also
as a battery charger.
It can even be used in conjunction
with another Battery Balancer, to transfer energy between two different batteries, in either direction, while keeping both in balance.
Note that to avoid error, we don’t
take voltage readings while the power
section is active.
Soft starting/spark mitigation
We found that the first prototype produced some nasty sparks when connecting batteries (as is not uncommon). This was mainly due to the inrush current to charge the capacitor
banks. These sparks could possibly
damage the connectors, or even weld
them! We therefore decided that, since
it was not difficult to mitigate this, we
would do so.
41
Four-channel Battery Balancer
When power is first applied, the
MOSFETs in series with the negative
terminals of each set of bypass capacitors are off. Those capacitors therefore slowly charge via the parallel
20W resistors.
42
After the initial battery connection
is made but before any balancing takes
place, the microcontroller switches
these MOSFETs on, presenting the full
decoupling capacitance only after the
connection is made.
The MOSFETs effectively increase
the ESR of the capacitor banks a little.
However, with on-resistances that are
only a fraction of an ohm, the capacitors are still capable of doing their
job of stabilising the cell and battery
Practical Electronics | April | 2022
Fig.3: the full Battery Balancer circuit consists of four identical
sections at left, which efficiently transfer power between the
batteries/cells and the ‘stack’ connected between CON2 and CON7.
The control and sensing section is at right, and is based around
32-bit microcontroller IC2. The voltage-sense resistive dividers are
disconnected using MOSFETs when they are not in use to keep the
quiescent current draw low. LEDs7-9 and LED11 flash to indicate
when charge is being transferred to or from specific cells.
voltages nicely. The MOSFET turnon time is quite slow because there
are no inverters to drive them – however since they only switch on after the capacitors have charged, this
doesn’t matter.
Practical Electronics | April | 2022
While we still recommend taking care
to positively connect batteries to the Battery Balancer and being prepared for
some amount of sparking to take place,
this approach does greatly reduce the
sparking that typically occurs.
Circuit protection
No you’ve doubt noticed that all cell
and battery connections are via fuses;
a good idea given how much current a
large battery (or in some cases, even a
small one) can deliver if there is a fault.
43
Each input also has a zener diode
across it (after the fuse) which provides two functions. One, if a cell or
battery is connected backwards, the
zener will immediately conduct and
blow the fuse. Two, if the cell or battery
voltage is too high for some reason (eg,
you’ve connected to the wrong battery
terminal), the zener will go into avalanche breakdown, and in most cases,
the fuse will again blow.
By the way, in the parts list we’ve
specified unidirectional transient voltage suppressors (TVSs) instead of zener
diodes for these parts. They are effectively zener diodes, just with very high
pulse current handling capability. Also
note that the actual clamping voltage
will be somewhat higher than the specified voltage, depending on the current
being delivered from the source.
We have taken that into account
when selecting the parts, so that the
protected parts of the circuit will not
be exposed to damaging voltages at any
reasonable current level.
As the micro monitors all the various voltages, it will shut down if any
of them are out of range. For example,
if a cell voltage is too low for the circuit to function.
Control section
The microcontroller section is quite
straightforward due to the high level
of integration on the SAM-L10 micro (IC2).
Its internal oscillator is more than
adequate as an instruction clock
source in this application. Currentlimiting resistors on digital outputs
15, 16, 23 and 24 are provided for it to
drive four status LEDs directly (more
on these later). ESD clamps are connected across the programming and
UART interfaces to protect them from
static discharge as these pins could be
externally accessible.
The microcontroller derives its power from linear regulator REG1, another
NJW4184U3-33B. This was chosen to
minimise quiescent current and operate over a relatively wide input voltage range (up to 35V). Its output passes
through ferrite beads before reaching
the microcontroller supply pins. It also
provides power to the ‘near side’ of the
various low-power digital isolators and
the stack-side gate drivers.
As these consume only a few milliamps while active, the power dissipated in the linear regulator is only a few
tens of milliwatts in the worst case,
when it is powered by a fully-charged
12V battery. While the gate drivers
consume small amounts of current on
average, they do so in an extremely
bursty fashion, so they each have a local bypass capacitor.
44
Parts list – High Current Battery Balancer
(suitable for 12V battery balancing – see below for other options)
1 four-layer plated through PCB coded 14102211, 108 x 80mm, available from the
PE PCB Service
4 4.7µH 1:1 transformers (T1-T4) [eg, Coilcraft MSD1278**]
5 3A fast-acting SMD fuses, M6125/2410-size (F1-F5)
[eg, Bourns SF-2410FP300W-2]
1 0.75A fast-acting SMD fuse, M6125/2410-size (F7) [eg, Bourns SF2410FP075W-2]
2 SMD ferrite beads, 470W <at> 100MHz, M2012/0805-size (FB1,FB2) [eg, Taiyo
Yuden BK2125HM471, Murata BLM21AG471SZ1D or Kemet Z0805C471BSMST]
1 100kW vertical multi-turn trimpot (VR1)
1 momentary SPST tactile pushbutton switch (S1)
11 5.08mm pitch PCB-mount vertical spade lugs (CON2-CON12)
[eg, Altronics H2094/H2095]
1 5-pin straight or right-angle header (CON13; optional – for smaller battery packs)
1 4-pin header (CON14)
1 8-pin header (CON15; optional, for ICSP)
1 2x4-pin header (JP1)
1 jumper/shorting block (JP1)
Semiconductors
1 ATSAML10E16A-AUT 32-bit microcontroller programmed with 1410221A.hex,
TQFP-32 (IC2)
4 ISO7041 4-channel digital isolators, QSOP-16 (IC4,IC6,IC8,IC10)
[Note: not ISO7041F]
5 NJW4184U3-33B# 3.3V LDO regulators (REG1,REG3,REG5,REG7,REG9)
4 BUK9Y4R8-60E* NMOS FETs, LFPAK-56 (Q1-Q4)
1 BUK9Y8R5-80E* NMOS FET, LFPAK-56 (Q5)
1 UM6K34N dual NMOS FET, SOT-363 (Q7)
5 UM6K31N dual NMOS FETs, SOT-363 (Q8,Q13,Q18,Q19,Q24)
8 BUK9Y14-80E* NMOS FET, LFPAK-56 (Q9,Q10,Q14,Q15,Q20,Q21,Q25,Q26)
8 QS6M4 dual NMOS+PMOS FETs, SOT-457T (Q11,Q12,Q16,Q17,Q22,Q23,Q27,Q28)
4 3mm or 5mm through-hole LEDs (LED7-LED9,LED11)
4 SMD 24V* TVS diodes, SMB size (M3226/1210) size (ZD1-ZD4) [eg, SMBJ24A]
1 SMD 64V* TVS diode, SMB size (M3226/1210) size (ZD5) [eg, SMBJ64A]
2 5V ESD clamp diode arrays (D6,D10) [Littlefuse SP0503BAHTG]
Capacitors (all SMD M2012/0805 size X7R ceramic unless otherwise stated)
4 100µF* 35V radial organic polymer electrolytic (eg, Kemet A759KS107M1VAAE031)
2 47µF* 80V radial organic polymer electrolytic (eg, Kemet A759KS476M1KAAE045)
4 4.7µF 100V or 10µF 75V M3226/1210
11 10µF 50V
** for lower-current applications, Coilcraft
8 4.7µF 6V
MSD1278-562 is a suitable alternative
6 1µF 50V
# AP7370-33Y-13 is a suitable alternative
8 470nF 6V
3 100nF 50V
Note: Csnub and Rsnub components
5 1nF 50V C0G
are not fitted for 4V/cell version
8 470pF* 250V C0G (Csnub)
Resistors (all SMD M2012/0805 size 1% metal film unless otherwise stated)
5 100kW 0.1% 8 10kW 5 2.2kW* 0.1% 4 680W 5 330W 5 100W 5 20W
8 30W* (Rsnub)
8 1W M1608/0603-size
Parts for ~4V cell balancing (eg, li-ion) – substitute for asterisked (*) items above
5 BUK9Y1R3-40H NMOS FETs, LFPAK-56 (Q1-Q5)
8 BUK9Y12-40E NMOS FET, LFPAK-56 (Q9,Q10,Q14,Q15,Q20,Q21,Q25,Q26)
4 SMD 10V TVS diodes, SMB size (M3226/1210) size (ZD1-ZD4) [eg, SMBJ10A]
1 SMD 24V TVS diode, SMB size (M3226/1210) size (ZD5) [eg, SMBJ24A]
4 100µF 16V radial electrolytic polymer capacitors
2 33µF 35V radial electrolytic capacitors
5 6.8k 0.1% M2012/0805 size metal film resistors
Software
The Battery Balancer software is fairly simple, but it took some development to get it right, and there were a
few choices to be made along the way.
Perhaps the most critical task the
CPU has to perform is producing the
eight PWM signals required for balancing. There are many larger microcontrollers, frequently aimed at
Practical Electronics | April | 2022
to configure both the peak balancing current and the cell
mismatch threshold above which balancing takes place.
Scope3: this shows the voltage sensing circuit in operation.
The yellow trace shows the voltage to be measured (~12V)
and the green trace shows the divided voltage present on
the micro input pin (~240mV). The red trace is the voltage
divider enable line, which has a duty cycle of less than 1%,
minimising the power consumption of the voltage dividers.
The blue trace is the divided voltage pass control line,
which ensures that only stable divided voltages reach the
micro input pin.
motor control applications, that feature large numbers
of advanced PWM generators. The SAM L10 is small,
inexpensive, and sips power, but has a more limited set
of peripherals.
The Battery Balancer needs to produce short pulses of
variable length at variable frequencies; if a pulse is too
long, substantial currents can flow through the Battery
Balancer, leading to a blown fuse and possibly damage
to other components, particularly the power MOSFETs.
Moreover, the Battery Balancer needs to produce two
PWM signals per cell.
To achieve this, we use a software-driven approach.
When a cell is to be charged or discharged, we define a
‘blip’ routine as a series of instructions that are either
NOP (no-operation), or single-I/O set/clear instructions.
With a 16MHz CPU frequency, this allows us to control
pulse trains with roughly 60ns precision. We then compute the desired number of ‘blips’ up to a safe maximum
(currently set to 10,000), disable interrupts, and call the
blip routine in a loop.
Once the blip routine has run the desired number of
times, the software stops all power train activity and determines the next course of action.
Voltage sensing
When not in the middle of charging or discharging cells
to bring a battery into balance, the Battery Balancer periodically checks the cell/battery voltages to determine
which should provide charge, and which need to be given charge.
We set the ADC voltage reference to Vdd/2 (ie, around
1.65V), noting that as the power train is inactive, the
power consumption and consequently noise on the Vdd
LDO output will be relatively small. Therefore, this voltage should be nice and steady.
To measure a set of cell voltages, we first enable the resistor dividers by connecting their bottom ends to ground
via the small-signal NFETs, and then enable the passtransistor NFETs. We then pause for about 1ms while
the capacitors on each of the sense lines settles towards
their final value. Finally, we use the ADC to sample each
of the settled lines before disabling the pass transistors
and voltage dividers.
The rotation of potentiometer VR1 is sensed at the same
time that the other voltages are measured. It can be used
Practical Electronics | April | 2022
Serial/USB interface
The microcontroller features a UART, which is connected
(via slew-limiting resistors and ESD clamping diodes) to
pin header CON14. This can be easily converted to USB
through the use of third-party ICs or cables such as FTDI’s ‘TTL-234X-3V3’, though note that these cables cannot be plugged directly into this header; some jumper
leads will be required.
If electrical isolation is required (or at least desired),
our Mini Isolated Serial Link project in lat month’s issue,
could be connected between the Battery Balancer board
and the USB/serial adaptor.
This board can be programmed by plugging a PICkit
4 into the ICSP header (CON15). For safety, this should
only be done with no batteries or cells connected to the
Battery Balancer.
The board features four LEDs, one for each battery/cell.
These are off by default but blink slowly if a battery/cell
is being charged, or rapidly if a battery/cell is being discharged. The power consumed by the Battery Balancer’s
control logic is small compared to that consumed by the
LEDs while switched on! For this reason, the LED duty
cycles have been kept low.
Next month
In part two of this feature next month, we will cover
building the Battery Balancer, testing it, configuring it
and using it, as well as some safety tips.
Reproduced by arrangement with
SILICON CHIP magazine 2022.
www.siliconchip.com.au
Your best bet since MAPLIN
Chock-a-Block with Stock
Visit: www.cricklewoodelectronics.com
O r ph one our friendly kn owledgeable staff on 0 2 0 8 4 5 2 0 1 6 1
Components • Audio • Video • Connectors • Cables
Arduino • Test Equipment etc, etc
V i s i t o u r S h o p , Ca l l o r B u y o n l i n e a t :
w w w .c r ic k le w o o d e le c tr o n ic s .c o m
0 2 0 8 4 5 2 0 1 6 1
V is it o u r s h o p a t:
4 0 - 4 2 Cr i c k l e w o o d B r o a d w a y
L o n d o n N W 2 3 E T
45
|