Many intrinsic or extrinsic factors influence the life of a battery pack. In actual manufacturing, individual battery differences will seriously affect the long-term service life of the battery pack. The development of battery balance technology is designed to address the internal factors of the battery pack, which is an important technology to extend the battery pack life and ensure the performance of the battery pack. There are two mainstream solutions to battery balance: one is passive balance, and the other is active balance. The passive balance circuit produces less heat, making the overall equilibrium process relatively safer. However, compared with passive balance, active balance is more valuable because active balance is more efficient and better balanced, which can significantly improve the utilization rate of electricity.
Meanwhile, active balance also puts higher requirements for control procedures. Most active balancing circuits use STM32 as the microcontroller of the whole system. Writing a control program with a clear structure and logic in the microcontroller is necessary to realise the smooth operation of the entire system.
In this paper, the DC-DC active balancing circuit's control program is an example to illustrate the program logic in the microcontroller unit.