Theory of Operation
The project is split into two circuit boards. The one on the left is the battery, the other is the power supply. The battery board holds six Lithium-Ion cells, the protection and charger circuitry, and a microcontroller to keep track of the SOC (State Of Charge). All the components besides the cells are located on the backside. The power supply board on the right has all the circuitry to handle the user interface and to generate the output voltages. The output voltage is regulated in two steps, there's a switching pre-regulator to keep efficiency high followed by a linear one to reduce noise. The two boards are connected by a 10-way cable that carries power and control signals. When the power supply is on, the battery sends its SOC to the PSU via UART.
Battery Block Diagram
This is the simplified block diagram for the battery board. This board is responsible for charging and protecting the Lithium-Ion cells. The three main components are the BMS IC, the charging IC, and the microcontroller.
The BMS BQ76920 from Texas Instruments continuously monitors cell voltages and current. If an over-voltage, under-voltage, or over-current condition is detected the cells are immediately disconnected. The IC also features internal balancing FETs that are activated by the microcontroller to balance the cells. The BMS is connected to the microcontroller through I2C.
The Charger IC BQ25700A also from Texas Instruments uses a switching buck-boost converter to take the input voltage and charge the cells with a constant-current constant-voltage scheme. Its I2C interface is connected to the microcontroller through an I2C isolator.
The microcontroller is a PIC16LF18345 from Microchip. It keeps track of the battery SOC, balances the cels, and enables/disables the charger. The microcontroller is connected directly to the batteries, when the BMS goes into protection mode and the cells are disconnected from the rest of the circuit, the only things powered are the BMS and the microcontroller.
To save power, the voltage to the I2C isolators is removed when they're not in use.
The flow chart above describes the SOC Estimation algorithm adopted, it is a variation of this Coulomb-Counting Algorithm. Coulomb-Counting consists of temporal integration of the battery current during charge and discharge. To take into account the battery self-discharge, the SOC is recalibrated by looking at the open-circuit voltage after the battery is left sitting unused for 24 hours. During charge and discharge the coulomb-counter 16-bit ADC inside the BMS is active and configured to trigger an interrupt every 250 ms. Inside the microcontroller, there are three variables: capacity, energy, and SOC. When the board is first powered the capacity is initialized with the expected capacity from a new set of cells, the SOC is estimated from the open-circuit voltage, and energy is set as a fraction of the initial capacity based upon the SOC. Each time the BMS triggers an interrupt the energy is updated, when the battery is empty the energy is set to zero. At the end of the charging process, if the battery has been charged from empty without interruptions, the accumulated energy is by definition the real battery capacity so the capacity variable is updated. This takes into account the aging of the cells in the SOC estimations.
Charging and Balancing
The microcontroller controls the charger IC, when the charging cable is plugged in, the charger is enabled if the SOC is less than 95% and it's disabled when SOC reaches 100%.
Balancing is performed only near the end of the charging process when the cell voltages are closer. If the difference in voltage between cells is greater than 15 mV, the balancing FET for the cell with the highest voltage is activated. It remains active until its voltage equals that of another cell. This simple scheme works surprisingly well. Once the cells are balanced they remain aligned pretty much on their own and only small corrections are needed.
PSU Block Diagram
This is the block diagram for the power supply. The microcontroller PIC24FJ1024GB610 handles the user interface and controls the rest of the circuitry. The connection to the LCD uses the EPMP peripheral configured as an 8-bit 6800 bus. The buttons and the encoder are handled by interrupts. When the power supply is turned off, all the flyback converters are disabled, the 3.3V rail is disabled, and the microcontroller enters sleep mode. During sleep the main 8MHz external clock is halted, the only way to wake the CPU is the interrupt triggered by the power button.
The power supply has two identical isolated channels, to set the output voltage and current limits, each channel has two DACs connected to the same I2C bus through isolators. Control signals are passed on with optocouplers. The output voltage is regulated in two steps, there is a flyback switching converter to keep isolation between channels followed by a linear regulator to reduce noise. The 100KHz clocks for the flyback converters are provided by the microcontroller, the clock signals for the two converters are 180° out of phase, this prevents the primary side MOSFETs from turning on at the same time thus reducing the RMS load on the primary capacitors. There is also a third flyback converter to provide power to the control circuitry.
There are three custom transformers: two identical ones for the two main flyback converters and one for the auxiliary flyback converter. The picture above shows the winding scheme for each transformer.
- Fix issues with PCBs
- BOM consolidation
- Add USB functionality to the main uC
- Implementation of an Improved Coulomb-Counting Algorithm
- A Closer Look at State of Charge and State of Health Estimation Techniques
- Lithium-Ion Battery Cell-Balancing Algorithm for Battery Management System Based on Real-Time Outlier Detection
- Flyback transformer design considerations for efficiency and EMI
- Flyback Converter Snubber Design
- Battery university - Charging Lithium-ion
- Battery Cell Balancing - What to Balance and How
- Fast Cell Balancing Using External MOSFET
- Cell balancing buys extra run time and battery life