Method and algorithm for efficient cell balancing in the lithium-ion battery control system Volodymyr Voloskyi1,*,†, Yurii Leshchyshyn1,*,†, Nestor Romanyshyn1,†, Andriy Palamar *,† and Lev Tarasenko2,† 1 Ternopil Ivan Puluj National Technical University, Ruska str., 56, 46001, Ternopil, Ukraine 2 Lviv Polytechnic National University, 12, S. Bandery str., Lviv, 79013, Ukraine Abstract This paper presents the development of a new combined passive balancing method for lithium-ion battery packs. The proposed algorithm integrates existing passive balancing techniques that are based on measuring the current voltage and determining the cell voltage at open-circuit voltage. The aim of the work is to reduce the energy imbalance between serially connected cells during charging to improve the accuracy and reliability of the battery pack. This research involves developing a proprietary system for monitoring and balancing lithium-ion batteries, evaluating the effectiveness of the proposed algorithm, and comparing it with existing balancing methods. Keywords battery management system, lithium-ion battery, passive balancing, open-circuit voltage, State of Charge, voltage, energy 1 1. Introduction The active development and utilization of electrical energy alternative sources are increasingly associated with the need for its storage, given that generating capacities operate only at specific times depending on the availability of sun, wind, etc [1]. One of the methods of storing electrical energy is the usage of lithium-ion batteries. Battery system is a crucial component of modern technologies, which necessitates addressing the proper utilization of this resource. This is especially important in systems powered solely by built-in batteries, such as electric vehicles and medical devices. Typically, this type of battery system comprises multiple cells to achieve a high output voltage level. To ensure efficient and long-term usage, it is essential to monitor the charging and discharging processes. These tasks are the responsibility of the battery management system (BMS) [2]. The BMS plays a critical role in ensuring the safety and performance of batteries [3]. Specifically, this system monitors for overcurrent or overvoltage conditions in the batteries, as 1 BAIT’2024: The 1st International Workshop on “Bioinformatics and applied information technologies”, October 02-04, 2024, Zboriv, Ukraine ∗ Corresponding author. † These authors contributed equally. voloda99911@gmail.com (V. Voloskyi); leshchishin@gmail.com (Y. Leshchyshyn); rnr102@gmail.com (N. Romanyshyn); palamar.andrij@gmail.com (A. Palamar); lev.o.tarasenko@lpnu.ua (L. Tarasenko) 0009-0002-9527-1630 (V. Voloskyi); 0000-0002-8577-6494 (Y. Leshchyshyn); 0009-0003-5966-7176 (N. Romanyshyn); 0000-0003-2162-9011 (A. Palamar); 0009-0008-2869-1436 (L. Tarasenko) © 2024 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR ceur-ws.org Workshop ISSN 1613-0073 Proceedings well as overcharging or overdischarging processes, which significantly accelerate aging or lead to serious safety issues, increasing the risk of fire or explosion [4]. The primary tasks of the BMS include evaluating battery operational parameters, which is crucial for analyzing battery behavior, monitoring its status, diagnosing faults, and measuring temperature [5]. Furthermore, the BMS determines key battery parameters such as state of charge (SoC), state of health, internal resistance, and other that cannot be measured directly. These parameters are vital for managing battery operation and must be determined during its usage through various estimation methods. The BMS also plays a significant role in the charging process due to its direct impact on operational safety. A properly chosen charging strategy protects batteries from damage, reduces temperature fluctuations, and extends the lifespan of the batteries. The safest operational mode for the BMS is considered to be slow charging, as it allows sufficient time for balancing the battery cells and monitoring each one. However, this mode adversely affects the availability of already charged batteries. Conversely, fast charging can lead to significant energy losses and irreversible damage to the batteries due to uneven cell charging and temperature increases [3]. One of the indicators of BMS efficiency is a battery balancing algorithm. The challenge is in selecting an appropriate algorithm, as the most common passive algorithms are simple but lack sufficient efficiency. Implementing complex algorithms with high efficiency requires powerful controllers, which are expensive and not easily accessible. The research aims to reduce the energy imbalance between series-connected cells during charging by optimizing the balancing algorithm, as well as to improve the accuracy and reliability of lithium-ion battery operation. 2. Related works The primary methods of battery balancing are divided into passive and active types. Passive balancing involves the simple dissipation of excess energy, whereas active methods include transferring energy between cells to achieve uniform distribution [6]. Passive balancing methods [7] can be classified, based on their operational principles, into algorithms that are based on:  (a) determining the current voltage of each battery cell [8-10];  (b) determining the cell voltage at open-circuit voltage (OCV) [11];  (c) calculating the state of charge of the battery cell [12, 13]. Algorithm (a), which is based on determining the current voltage of each battery cell, is simple to implement [8, 9] as it does not require the pre-creation of an OCV table for each battery cell and does not depend on the SoC. This algorithm is appropriate when it is necessary to achieve the same voltage across the battery, even though the capacity of each cell may vary. However, during charging with this algorithm, a significant amount of energy is dissipated as heat in cells with higher resistance. Therefore, such an algorithm can cause imbalance, potentially leading to a loss of more than 13% of the battery capacity [7]. In algorithm (b), which is based on determining the cell voltage at open-circuit voltage, the OCV value is estimated by calculating the internal resistance of each cell and the voltage drop across the cell using formula [7]: OCV bat =V bat −I bat ∙ R bat , (1) where OCV bat – open-circuit voltage; V bat – cell voltage; I bat – current flowing through the battery cell; R bat – internal resistance of the battery cell. Thus, the voltage of each individual cell can be balanced. However, this algorithm is imperfect since, due to the aging of the battery, the capacity and resistance of each cell change differently, leading to energy losses and accelerated battery aging. The imbalance for this algorithm at the beginning of operation may be insignificant, but over time it reaches 8% [7]. Algorithm (c), which is based on evaluating the SoC value, is the most technically complex balancing algorithm [12]. It relies on information about the SoC history of each cell and the calculation of the time required to balance each cell. Since the process of measuring current and voltage is not perfect, it can lead to inaccuracies in energy calculation. Thus, it is necessary to periodically adjust the balancing time of each element and rewrite the maximum battery capacity at the end of charging. As a result of using this algorithm, the cell imbalance of the battery can be reduced to 1.6%, though it is complex to implement [7]. This algorithm also shows promising results under controlled conditions. Variable temperatures and loads can further complicate its implementation [14]. A similarly low imbalance of battery cells for algorithm (c) can be achieved by combining algorithm (a), based on the current voltage of each battery cell, and algorithm (b), based on the cell voltage at open-circuit voltage (OCV). 3. Structure of the proposed battery management system Since implementing the modified cell balancing algorithm on standard equipment is not feasible, a BMS with hardware support for such an algorithm was designed. The developed BMS features galvanically isolated current/voltage sensors, a STM32F407 microcontroller, and specialized circuits for measuring voltage and balancing each battery cell, implemented on LTC6810-type specialized chips. These chips ensure that the voltage measurement and cell balancing circuits are independent. The structural diagram of the proposed BMS is shown in Figure 1. The developed BMS performs the following functions: 1. Protecting batteries from overcharging, overdischarging, and overheating. 2. Creating OCV tables for each battery cell. 3. Determining the internal resistance of battery cells. 4. Calculating and storing the energy of each battery cell. 5. Calculating the accumulated energy of the battery and each cell. 6. Balancing battery cells. Figure 1: Block diagram of the proposed battery management system. 4. Proposed balancing method The battery protection function is ensured by the BMS algorithm, which involves measuring the voltage of the battery cells and subsequently determining the residual capacity of the cells according to the OCV tables or capacity tables saved during the previous system shutdown. Based on these measurements, the system checks for critical states (overdischarging, overcharging, overheating). If the battery is not in a critical state, the BMS activates the protective relays. The ongoing operation of the BMS includes continuous monitoring for critical states, as well as processing battery parameters and calculating the current energy of the cells. These parameters will be saved for the next startup instead of the OCV parameters, if the system is shut down correctly. The creation of OCV tables for each battery cell is performed according to the technical descriptions provided by the lithium-ion battery manufacturer. These tables are stored in the non-volatile memory of the controller [15]. The determination of the battery cells internal resistance is conducted in accordance with IEC 61951-1:2017 standard [16], and detailed in [17]. Specifically, the BMS algorithm stipulates that if the difference in internal resistances of the cells exceeds the permissible value, such a battery is deemed to have critically uneven degradation and cannot be balanced. Consequently, the BMS issues a message to replace the cell and ceases operation. The calculation of the energy accumulated in the battery is determined as the sum of the energies accumulated by the battery for each second of charging. When calculating this energy (2), losses due to the internal resistance of the battery and the energy expended by the balancer, which is converted into heat, are taken into account. ( E cell = t )( I cell∗U cell − t )( I cell2∗R cell − ) R balans t∗U cell2 , (2) where I cell – the average value of the current through the cell for a time of 1s; U cell – the average value of the voltage across the cell for a period of 1s; R cell – the internal resistance of I cell∗U cell the cell determined by the resistance determination algorithm; – the energy t entering or leaving the cell for 1s without taking into account internal resistance losses and I cell2∗R cell energy dissipated during balancing; – the energy loss due to the internal t R balans resistance of the battery; R balans – the resistance of the balancer; – energy losses for t∗U cell2 balancing, if there was no balancing, then for this second this value is; t – time for calculating power per hour, the time constant is 3600 s. Cell balancing of the battery pack occurs only during the charging process, as passive balancing during discharge is an inefficient use of energy. The proposed cell balancing algorithm is derived by combining algorithm (a), based on the current voltage of each battery cell, and algorithm (b), based on the open-circuit voltage (OCV) of the cell. To determine which cells need to be balanced, the cell with the lowest voltage (Ucell_min) is identified from the voltage values obtained in the last second. Then, all cells with a voltage difference greater than ΔU (set to 0.003V for testing) are selected for balancing (Figure 2). According to the proposed algorithm, balancing occurs for 800 ms, followed by 200 ms of voltage measurement for all battery cells, which determines which cells need to be balanced for the next 800 ms. Thus, cell balancing takes 80% of the charging time [18]. At the end of the charging process, this algorithm switches to OCV-based balancing. This transition is possible because charging at low currents allows an accurate prediction of the cell capacity at a given voltage. In this mode, it is checked whether the energy of a cell ( E cell ) has reached the theoretical capacity (Eocv) within an error margin (ΔE, set to 0.05W for testing, approximately 1% of the battery's charge at the end of charging). If a cell's capacity reaches E ocv, its charging is stopped; otherwise, all cells that have not reached the required capacity continue to be balanced. This type of balancing is feasible if the BMS can dissipate almost all the energy entering the cell. The proposed algorithm involves the integration of balancing methods based on current cell voltage and OCV balancing, which improves capacity estimation accuracy and process efficiency while reducing energy losses. The flow chart for the proposed balancing algorithm is shown in Figure 2. Figure 2: The flow chart for the proposed balancing algorithm. 5. Results and discussions The testing of the algorithm and BMS was conducted on a battery pack with cells having approximately equal internal resistances and capacity characteristics, with a total energy capacity of 120W. During the initial test discharge, 90% of the total energy was extracted from the battery, which amounts to 108W (Figure 3). Figure 3: Discharge graph of a test battery with approximately equal internal cell resistance. As shown in the discharge graph of the test battery, cell 11 discharged the fastest, causing the BMS to shut down and preventing the discharge of all other cells. Consequently, for all subsequent tests of the balancing algorithm, cell 11 was replaced. After replacing the cell, it was possible to extract 96% of the battery's capacity during discharge, amounting to 115.2W. The next test involved charging and balancing the battery. Figure 4 illustrates the charging graph with balancing. The graph indicates a noticeable slowing down of the charging rate of the battery cells as their voltages increase. In the first half an hour of charging the battery, the charging current was maximum and the balancing process was imperceptible. After cell 9 reached an energy of more than 87%, the first peak on the graph which is approximately fifteen minutes of charging, of the total cell capacity, the BMS slowed down the charging. After that, starting from the fifteenth minute to the third hour, the charging was accelerated again, as a result of which the voltage and capacity imbalance of the cells was reduced with the help of the balancer. At the moment, the actual capacity of the most charged cell 2 is 93%, and cells 11 and 3 with the lowest charge are 88% of the maximum, and the imbalance between the cells is 5% of the capacity. The total battery capacity is approximately 91% of the total capacity. After that, the charge was slowed down again by the BMS command. From the third hour to the fifth hour, smooth charging with balancing took place, which reduced the energy imbalance between cells to 3%. The last stage of charging for the last thirty minutes was a slow charging that allowed balancing to a difference in energy of up to 1.8%. Figure 4: Chart of charging battery cells with approximately equal internal resistance. As a result of this charging test, the battery was balanced to 4.13V and 97.3% of capacity on the most charged cell and 4.12V and 95.8% capacity according to OCV. The energy that was actually accumulated was 115.92W, which is 96.6% of the full battery capacity according to OCV. After repeating the battery charging test several times, it was determined that the average percentage of the battery was 96.3% of its nominal capacity according to OCV. Figure 5: Comparing the stored energy in the battery with different balancing algorithms. As shown in Figure 5, the proposed algorithm (d) demonstrates superior energy accumulation efficiency in the battery, relative to its nominal capacity, compared to the open- circuit voltage based balancing algorithm (b) by 5.2%, and by 9.8% relative to the current voltage-based algorithm (a). However, it performs 3% worse compared to the SoC-based algorithm (c). The developed cell balancing algorithm integrates algorithm (a), which is based on the current voltage of each battery cell with algorithm (b), which is based on the open-circuit voltage of the cell. The proposed algorithm achieves a 9.8% improvement in battery balancing efficiency over algorithm (a) and a 5.2% improvement over algorithm (b). Nevertheless, it is 3% less effective compared to algorithm (c), which is based on the state of charge of the cells. However, the complexity of the proposed balancing algorithm is lower compared to algorithm (c). 6. Conclusions The article analyses existing passive battery cell balancing algorithms and proposed a new algorithm based on these methods. The combined balancing algorithm, which integrates the advantages of methods based on current cell voltage and open-circuit voltage, demonstrated high effectiveness. Testing results revealed that this algorithm significantly reduces energy imbalance between cells, achieving a discrepancy of only 1.8% at the end of charging, ensuring high accuracy and reliability in battery operation. Throughout the charging process, the algorithm effectively reduced the energy imbalance from an initial 5% to a final 1.8%, resulting in an average battery charge level of 96.3% of its nominal capacity. Utilizing a BMS with this algorithm optimizes the charging process, minimizes energy losses, and enhances battery longevity. The proposed algorithm ensures more efficient energy accumulation in the battery, improving results by 9.8% compared to the current voltage-based balancing algorithm and by 5.2% compared to the OCV-based algorithm. Although the efficiency of this algorithm is 3% lower compared to the SoC-based algorithm, its implementation is less complex. Future research will focus on improving the cell balancing algorithm and BMS operation by tracking the internal resistance of cells and determining the actual battery capacity to assess battery. References [1] A. Voloshchuk, D. Velychko, H. Osukhivska, A. Palamar, Computer system for energy distribution in conditions of electricity shortage using artificial intelligence , In CEUR Workshop Proceedings, volume 3742, 2024, pp. 66-75. [2] K. Liu, K. Li, Q. Peng, C. Zhang, A brief review on key technologies in the battery management system of electric vehicles, Frontiers of mechanical engineering, 14 (2019) 47-64. doi:10.1007/s11465-018-0516-8. [3] B. Park, C.H. Lee, C. Xia, C. Jung, Characterization of gel polymer electrolyte for suppressing deterioration of cathode electrodes of Li ion batteries on high-rate cycling at elevated temperature, Electrochimica Acta, 188 (2016) 78-84. [4] A. Palamar, M. Palamar, Fire Safety Monitoring System Based on Internet of Things, In CEUR Workshop Proceedings, volume 3468, 2023, pp. 164–172. [5] A. Palamar, M. Karpinskyy, V. Vodovozov, Design and implementation of a digital control and monitoring system for an AC/DC UPS, In 7th International Conference- Workshop “Compatibility and Power Electronics” (CPE), 2011, pp. 173–177. [6] C. Hochgraf, J. Schmitz, Passive and Active Cell Balancing for Lithium-Ion Batteries, IEEE Transactions on Power Electronics, 28(12), 2013, pp. 5642-5650. [7] C. Fleischer, B. Ostendorp, D.U. Sauer, Simulative comparison of balancing algorithms for active and passive cell balancing systems for lithium-ion batteries, Proceedings of the Advanced Automotive Battery Conference (AABC), 2013, pp. 11-20. [8] I. Baccouche, S. Jemmali, A. Mlayah, B. Manai, N.E.B. Amara, Implementation of an improved Coulomb-counting algorithm based on a piecewise SOC-OCV relationship for SOC estimation of li-Ion Battery, International Journal of Renewable Energy Research, 8(1) (2018) 178-187. doi:10.48550/arXiv.1803.10654. [9] N. Samaddar, N. Senthil Kumar, R. Jayapragash, Passive Cell Balancing of Li-Ion Batteries Used for Automotive Applications, Journal of Physics: Conference Series, 1716 (2020) 012005. [10] C. Piao, Z. Wang, J. Cao, W. Zhang, S. Lu, Lithium-Ion Battery Cell-Balancing Algorithm for Battery Management System Based on Real-Time Outlier Detection, Mathematical Problems in Engineering, 1 (2015) 168529. doi:10.1155/2015/168529. [11] H. Song, S. Lee, Study on the Systematic Design of a Passive Balancing Algorithm Applying Variable Voltage Deviation. Electronics, 12(12) (2023) 2587. [12] J. Li, C. Huang, X. Zhang, X. Tian, J. An, High-performance lithium-ion battery equalization strategy for energy storage system, International Journal of Low-Carbon Technologies, 18 (2023) 1252–1257. doi:10.1093/ijlct/ctad068. [13] P.S. Babu, K. Ilango, Comparative Analysis of Passive and Active Cell Balancing of Li-Ion Batteries, In 2022 Third International Conference on Intelligent Computing Instrumentation and Control Technologies (ICICICT), 2022, pp. 711-716. [14] P. Maruschak, I. Danyliuk, R. Bishchak, T. Vuherer, Low temperature impact toughness of the main gas pipeline steel after long-term degradation, Central European Journal of Engineering, 4 (4) (2014) 408–415. doi:10.2478/s13531-013-0178-6. [15] A. Tessier, M. Dubois, J. Trovão, Real-Time Estimator Li-ion Cells Internal Resistance for Electric Vehicle Application, World Electric Vehicle Journal, 8(2) (2016) 410–421. [16] IEC 61951-1:2017. Secondary cells and batteries containing alkaline or other non-acid electrolytes - Secondary sealed cells and batteries for portable applications - Part 1: Nickel. Official edition, 2017. [17] V. Voloskyi, Y. Leshchyshyn, N. Romanyshyn, Computer control system and balancing of lithium-ion batteries, Current issues in modern technologies of the X International scientific and practical conference of young researchers and students, Ternopil, 2021, pp. 87-89 (in Ukrainian). [18] I. Baccouche, S. Jemmali, A. Mlayah, B. Manai, N.E.B. Amara, Implementation of an improved Coulomb-counting algorithm based on a piecewise SOC-OCV relationship for SOC estimation of li-Ion Battery, arXiv, 1803.10654 (2018) 178-187.