With the charging circuit already designed for the LiFePO4 battery charger, I had to figure out a way to simulate a battery in order to simulate the circuit. A battery is really just a voltage source with some internal resistance, so for the purposes of my simulation I just placed a .02 Ohm resistor in series with a voltage source.
To be realistic, I had the voltage source roughly follow the charging voltage curve of a LiFePO4 cell. Just to be thorough, I also slightly varied the voltages of each of the four cells so that they were always slightly out of balance. This better reflects real world conditions since cells are never identical and the circuit needs to be able to properly balance cells.
For each of the four duplicate cell circuits, I measured the current through the battery cell (using R2, R3, R10, & R14), the current through the TL431 (using R4, R7, R11, & R15), the current through the PNP transistor (using Q1, Q2, Q3, & Q4), and the voltage across each cell.
The results show almost identical voltage curves for each of the four circuits. The charging voltage of the constant current circuit follows the voltage of cell, maintaining a consistent 1A of current through each of the cells. Once the desired 3.65V is reached for each of the cells, the current rapidly tapers off and maintains that voltage, continually trickling top-off current to each cell. The transistor is then turned on and routes the excess current around the battery, correctly balancing each cell.
Overall everything looks correct and is performing as expected, so next up is putting this all on a PCB. My next post will show the final schematic and board layout for the charger.