A lithium-ion pack charges in two stages. While it is low the charger pushes a fixed current (CC); when the pack reaches its voltage limit the charger holds that voltage (CV) and the current tapers away. A charger design is a pair of nested loops and a limit between them, and the check is that the hand-over is clean.
What the job needs checked
- The constant current. That the inner loop holds the current at its limit while the pack is low.
- The hand-over. When the outer voltage loop leaves its limit, and that the pack voltage does not overshoot the target as it does.
- The taper and the end. That the voltage is held at the target while the current falls, and how far the charge has come by the end.
- The limit as a design choice. A lower current charges more gently and takes longer to reach the same state.
How Voltecx does it
- The example Battery charger, constant current then constant voltage is a synchronous buck from 24 V onto four cells in series, with an inner current loop and an outer PI voltage loop whose output is limited between 0 and the CC current.
- The battery model carries its state of charge, so the pack's rest voltage rises during the run and the taper follows from the physics, not from a script.
scope.measurereads the held current, the hand-over time and the end state; changeIccor the targetVcvunder Circuit › Variables, or sweep them withanalysis.paramSweep.
Try it
Tutorial 25 runs the charger, reads the hand-over on the scope and halves the current limit to move it from 150 ms to 330 ms. About 10 minutes. Tutorial 22 charges a real pack for 1.5 hours in seconds of compute.
Know the limits
The example's pack has a capacity of 1 mAh, far smaller than any real pack, so the charge moves in a fraction of a second instead of hours; its parameters are illustrative, not a cell's data sheet. Pre-charge of a deeply discharged pack, termination by a current threshold and temperature-dependent limits are not in the example. Nothing has been compared with a built charger yet.
Related: Simulation · Models and parts · Solar and storage