Lithium-Ion Battery Cell-Balancing Algorithm for Battery Management System Based on Real-Time Outlier Detection

A novel cell-balancing algorithm which was used for cell balancing of battery management system (BMS) was proposed in this paper. Cell balancing algorithm is a key technology for lithium-ion battery pack in the electric vehicle field. The distance-based outlier detection algorithm adopted two characteristic parameters (voltage and state of charge) to calculate each cell’s abnormal value and then identified the unbalanced cells. The abnormal and normal type of battery cells were acquired by online clustering strategy and bleeding circuits (R = 33 ohm) were used to balance the abnormal cells. The simulation results showed that with the proposed balancing algorithm, the usable capacity of the battery pack increased by 0.614Ah (9.5%) compared to that without balancing.


Introduction
Electric vehicles (EV) are widely viewed as an important transitional technology for energy-saving and environmentally sustainable transportation [1].As the new traction battery packs, critical energy sources of EV, lithium-ion (Li-ion) battery pack is drawing a vast amount of attention for its excellent advantages such as compact volume, large capacity, lower weight, and higher safety [2][3][4].Single battery cells are serially connected to a battery stack to achieve higher capacity and voltage.However, the charging process has to stop as soon as one cell is completely charged and the discharging process has to stop as soon as one cell is completely discharged [5].The capacity of the whole battery pack is thus limited by the unbalanced cells required to be balanced (also called abnormal cells in this paper) in the pack which can reduce the usable capacity of the battery pack, decrease the energy usage efficiencies, and shorten the lifetime of battery pack.Therefore, battery cell balancing that is one basic function of BMS is necessary for battery pack in EV [6][7][8][9].
Two algorithms are commonly used for cell balancing: voltage-based balancing algorithm and state of charge-based balancing algorithm.The voltage-based balancing is that when the difference between one cell voltage and the mean value of cell voltages is larger than the threshold  th , the cell is probably considered to be an abnormal cell [10][11][12].This method is simple and easy operating while the external voltage of the cell is affected by its internal state and environment.On the other hand, some researchers pointed that state of charge (SOC) can reflect the capacity of the battery pack in essence and proposed the SOC-based balancing algorithm which controls the range of the SOC smaller than the threshold SOC th [13,14].However, SOC that is affected by battery model, self-discharge, temperature, and other factors can only be calculated by voltage or current indirectly and it is still difficult to get the accurate SOC of each cell.Unfortunately, there are still no observations at present about applying outlier detection algorithm to cell balancing.
Outlier detection algorithm which is an important branch of data mining is applied in many different domains [15][16][17].This paper innovatively proposed to use the algorithm to identify the abnormal cells.The algorithm chooses characteristic parameters of battery cells and develops a flexible distance function to get outliers (viz.the unbalanced cells) effectively [18,19].After getting the accurate category of normal and abnormal cells through clustering method, the abnormal cells are balanced by passive balancing circuit.Outlier detection algorithm can recognize the abnormal battery cell accurately and improve the performance of battery pack, such as increasing the usable energy and extending lifetime.
The research work is organized as follows.Section 2 describes the detailed processes of the proposed balancing algorithm.The simulation models and test cycle are described in Section 3. In the final section, conclusions and final remarks are given.

Balancing Algorithm Based on Outlier Detection
2.1.Outlier Detection Algorithm.As shown in Figure 1, the outlier detection balancing algorithm includes two modules: the unbalanced cells recognition module and the balancing control module.The former module gets normal and abnormal cells by outlier detection algorithm while the latter balances the abnormal cells and gives feedback to the former.There are  battery cells in the power battery pack.And the characteristic parameters of the cells are provided to the unbalanced cell recognition module [20].The Li-ion battery's input-current  and output-SOC, current , and terminal voltage  are shown in Figure 2 [21].The characteristic parameters of voltage and SOC are used to calculate each cell's outlier value.

Unbalanced Cell Recognition.
Abnormal cells are picked up as outlier point by the outlier detection method in unbalanced cells recognition module.First, -score standardized method is used to preprocess the attribute of battery.Second, the outlier detection method based on the distance of multidimensional attribute is adopted to calculate each cell's outlier value which is the summation of distances from one cell to the others.Third, the battery pack will be balanced if the abnormality range is not less than the threshold signed as VOA1, otherwise the unbalanced cells will be obtained by the dynamic cluster method.Finally, passive equalization is applied to the abnormal battery cells.Figure 3 shows the progress of recognizing abnormal cells.
Input.The number of battery cells  and the initial threshold of abnormality range VOA1 are input.
Step 1.If the attribute values of the battery cells are equal, the process ends and the pack is considered balanced; otherwise it goes to Step 2.
Step 2. -score standardized method is adopted to preprocess the characteristic parameters for eliminating the influence of units.Namely, use the formula (1) to preprocess the Voltage  and the SOC as follows: Cell  = ∑  =1 Cell   , where   ( = 1, . . ., 40 and  = 1, 2) is the standardization form of th characteristic parameter of the th cell (i.e.,  12 denotes the standard SOC of the first cell); Cell  represents the original value of th characteristic parameter of the th cell (i.e., Cell 21 denotes the original voltage of the second cell); Cell  describes the mean of th parameters;   denotes the standard deviation of the voltage or SOC when  equals to 1 or 2, respectively;  is the number of cells.
Then, Euclid-distance is used to calculate the abnormal value of each cell in the pack.The calculation formula [22] is defined as follows: The range of outlier The total number of Standard process the selected parameters and calculate abnormal value of each cell Select normal and abnormal initial cluster center respectively and cluster the cells dynamically

Yes
Step 1: Step 2: Step 3: Step 4: Step 5: The attribute values of cells are equal?where  2 (  ,   ) ( = 1, . . ., 40,  = 1, . . ., 40,  ̸ = ) represents the Euclid-distance between the th cell and the th cell;   represents the th cell which has two attributes (i.e.,   = ( 1 ,  2 )); (  ) denotes the summation of Euclid-distance betweenthe th cell and the others.The smaller the (  ) is, the more normal the th cell is.On the contrary, the th battery is probably abnormal.

Yes
Step 3. If the range of outlier values (the difference outlier value between cell with the lowest and that with the highest outlier value) of the cells is smaller than the threshold VOA1, the process ends and the pack is considered balanced; otherwise it goes to Step 4. VOA1 is defined and updated by the formulation as follows: Step 4. Set the cell with the lowest and that with the highest outlier value as initial clustering centroids.
Step 5.The other cells are assigned to their nearest cluster centroid, all at once, followed by recalculation of cluster centroid.Then the other cells are individually reassigned if doing so will reduce the sums of squared error, and cluster centroids are recomputed after each reassignment [23].The process of obtaining the minimum sums of squared error   is formulated as follows: where   denotes the squared error of th cell;   is the sums of all the squared errors;   is initial cluster centroid;   is the normal category or the abnormal category.
When   converges to a global minimum, the process jumps to the next step.
Output.The battery pack is balanced or unbalanced.
By this time, the unbalanced cells are recognized by the outlier detection algorithm and can be balanced with the passive balancing circuit that will be described in detail in next section.

Balancing Control.
At present, the balancing circuit can be divided into two main groups [24]: passive balancing circuit and active cell balancing circuit.Typical passive cell balancing circuit also named shunt method uses switches to control balancing.Specifically, shunt method is designed to use a resistor to discharge the unbalanced cell detected by outlier detection algorithm.With active cell balancing circuit, charge can be transferred between the cells in battery pack by a capacitor or an inductor.Very little energy would be wasted in this case compared to the passive balancing method.However, more switches and associated components are needed in the active balancing circuit.And these additional components may lead to higher cost and unreliability.Passive balancing circuit has already been used in many applications for its simple structure and reliability.Hence, passive cell balancing circuit is applied in this paper.As shown in Figure 4, every battery has a balancing circuit which comprises a resistor and a switch in series.

Simulation Experiments
In order to compare the efficiency of the outlier detection balancing algorithm with the traditional balancing algorithms in detail, the constant-current charging-discharging (CCCD) model and the software-in-the-loop platform (SILP) model for the BMS were established in Sections 3.1 and 3.2, respectively.The simulations were conducted on an Intel 2.3 GHz Windows platform with 4 GB RAM, and implemented in Matlab/Simulink.The battery pack is modeled in Simulink, using the electric drives library.As can be seen in Figure 5(a), the battery pack model consists of five Li-ion batteries connected in series and each battery is made up of eight cells which are also connected in series (see Figure 5(b)).The rated capacity and nominal voltage of cell are 6.5 Ah and 3.6 V, respectively, and the values of other parameters are shown in Table 1.The switch control signal And the SOC for a fully charged cell model is 100% and for an empty cell model is 0%.The SOC is calculated based on Coulomb-counting as where  is the rated capacity;  is the charging or discharging time; () is the charging or discharging current.
Here are several assumptions of the battery cell model in Simulink [21]: (a) The parameters of the model are deduced from discharging characteristics and assumed to be the same for charging.
(b) The internal resistance is supposed to be constant during the charging and the discharging cycles and does not vary with the different amplitude of the current.
(c) The self-discharge of the battery is not represented and the battery has no memory effect.
(d) The model does not take the temperature into account.

CCCD Model and Test Condition.
As shown in Figure 6, the CCCD model provides a 6.5-A (1C) constant charging and discharge current for the battery pack.In a serially connected battery pack, discharging or charging progress has to be stopped immediately as soon as one of the terminal cell voltages falls below discharging voltage limit (DVL) or exceeds charging voltage limit (CVL) [2].The values of DVL and CVL of the cell modeled in this paper are 3.749 V and 4.2 V, and the SOC correspondingly reaches 30% and almost 100%.
Figure 7 shows the simulated SOC, current, and voltage of 10th cell during one CCCD cycle.The cell is charged by a 6.5-A constant current until voltage reaches CVL (4.2 V) and the corresponding SOC is almost 100%.It is discharged by the same current until voltage reaches DVL (3.749 V) and the corresponding SOC is 30%.The initial SOC and voltages of the cells in the battery pack is that one cell's SOC and voltage are 45.06% and 3.794 V while other cells are 35.06% and 3.769 V, respectively.The initial value of threshold VOA1 of the proposed method is 12.33.

Simulation Results and Analysis. The simulation results
during whole CCCD test cycle are shown in Table 2 for different balancing scenarios (no balancing, voltage-based balancing, SOC-based balancing and outlier detection balancing).That the usable capacity calculated over balancing process of abnormal cell decreased by 0.584 Ah is the precondition for comparing the simulation results for different balancing scenarios.
With no balancing, the unbalanced cell (10th cell) in the battery pack cannot be completely discharged before charging and the normal cells cannot be completely charged before discharging during the whole test cycle, as detailed in Figure 8.Hence, the amount of usable energy of the pack decreased at the end of the charging process.With voltage-based balancing, the total voltage (charging cut-off) increased to 163.017 V and the SOC range of cells decreased to 1.030%, but the frequency of balancing switch on/off reaches as high as 352.With outlier detection balancing, the frequency of the switching on/off was significantly reduced from 352 to 2. And the voltage variance (charging cut-off) and the SOC variance were reduced to 0.008 and 0.158, respectively, when compared with voltage-based and SOCbased balancing algorithm.Additionally, the charging time (after CCCD testing, balancing algorithm off) of unbalanced battery pack is 2091 s and the charging capacity is 3.775 Ah while balanced battery pack (same condition with unbalanced pack testing) is 2413 s and 4.389 Ah, respectively.
The definitions of several evaluation standards in Table 2 are as follows.
Testing Time.Time of the whole simulation process.
Balancing Time.Sum of the balancing time.
Frequency of Switch on and off.Sum of the balancing circuit switch on/off times.
Usable Capacity Decrease.This can be calculated by the formula (6):  where   is the decreased usable capacity of th cell during balancing process;  represents the balancing time;  equ () is the balancing current;   () denotes the voltage of battery at  time;  (33 ohm) represents the resistance in cell balancing circuit.
As illustrated by Figure 9, when the voltage-based balancing algorithm determined on and off the 10th cell as abnormal cell (upper plot), the outlier detection algorithm constantly and accurately did that (lower plot).Meanwhile, the testing time of the simulation decreased to 23037 s when implemented outlier detection equalization algorithm on CCCD model.The control signal "1" represents opening the balancing circuit and "0" means shutting it down.
The process that the battery pack transferred from unbalanced state to balanced state using different balancing algorithms under CCCD cycle is shown as Figure 10.And Figure 11 shows the position variation of the abnormal cell (10th) detected by the proposed algorithm after balanced.The abnormal cell was closer to the other cells after it was balanced by outlier detection balancing algorithm.

SILP Model of BMS and ECE + EUDC Test Condition.
The software-in-the-loop platform (SILP) model of BMS for electric vehicles gives a new idea to test the validity and reliability for BMS and power battery in different properties [20,25].Generally speaking, the model can also be used to test the feasibility and effectiveness of balance algorithms in   12.
The ECE + EUDC test cycle is used for EU type approval testing of emissions and fuel consumption from light duty vehicles.As Figure 13 shows, ECE + EUDC (bottom chart) cycle includes four ECE (upper left chart) segments repeated without interruption, followed by one EUDC (upper right  chart) segment.According to Figure 14, the battery pack is discharged with two ECE + EUDC cycle until 2400 s and charged by the generator in the next 822 s since the SOC of the pack reduced to 30%.Simulation test starts in the situation that there is one cell's SOC and voltage value are 64.83% and 4.140 V, and the others are 54.83% and 4.063 V, respectively.

Simulation Result and Analysis. The simulation results
during the whole ECE + EUDC test cycle are shown in Table 3 for different balancing scenarios (no balancing, voltagebased balancing, SOC-based balancing, and outlier detection balancing algorithm).That the usable capacity calculated over balancing process of abnormal cell decreased by 0.584Ah is the precondition for comparing the simulation results for different balancing scenarios.
With no balancing, the unbalanced cell in the battery pack could not be completely discharged before charging and the normal cells could not be completely charged before discharging during the whole test cycle, as detailed in Figure 15.Hence, the amount of usable energy of the pack decreased at the end of the charging process.With voltage-based balancing, the total voltage (charging cut-off) increased to 164.738 V  and the voltage variance (discharging cut-off) decreased to 0.003, but the frequency of balancing switch on/off reaches as high as 1150.With outlier detection balancing, the frequency of the switching on/off was significantly reduced from 1150 to 2 and reduced the voltage variance (charging cut-off) and the SOC variance to 0 and 0.157, respectively, when compared with voltage-based and SOC-based balancing algorithm.Furthermore, the proposed balancing algorithm increased the total charging cut-off voltage from 161.214 V to 165.738 V when compared with the pack without balancing.And it also reduced the discharging cut-off voltage variance and the SOC variance to 0 and 0.157, respectively.The process in which the battery pack transferred from unbalanced state to balanced state with different balancing algorithms under ECE + EUDC test cycle is shown as Figure 16.With outlier detection balancing algorithm, the cells in the battery pack can be completely charged/discharge at the same time and thus increase the available energy stored in the pack.

Conclusions
Aiming at the problem that present cell-balancing algorithms cannot identify the unbalanced cells in lithium-ion battery pack accurately in real-time, an algorithm based on outlier detection was proposed in this paper.The unbalanced cells were identified by the proposed balancing algorithms and balanced by shunt method using switches.After validating the efficiency of the balancing algorithms on two simulation models, the advantages of the proposed algorithm have been   pointed out in the context of simulation and analysis.The outlier detection equalization algorithm is able to recognize the abnormal battery cell accurately and to increase the usable energy and extend the lifetime of battery pack, which has extensive application prospect and theory value.
Further work will focus on taking the temperature of cells into account during whole charging and discharging process.

Figure 1 :Figure 2 :
Figure 1: The design of the outlier detection balancing algorithm.
Obtain the sums of squared error J e until J e reaches the minimum values > VOA1?

Figure 3 :
Figure 3: The process of acquiring abnormal battery cells.

Figure 5 :
Figure 5: The schematic diagram of simulation model of pack (a) and battery (b).

Figure 6 :
Figure 6: The constant current charge-discharge model.

Figure 7 :
Figure 7: The SOC, current, and voltage of 10th cell during one 1C CCCD test cycle.

Figure 10 :Figure 11 :
Figure 10: SOC (a) and voltage (b) of pack with balancing algorithms during CCCD cycle.

Figure 14 :Figure 15 :
Figure 14: Voltage, current, and SOC of the pack during one ECE + EUDC diving cycle.

Figure 16 :
Figure 16: SOC (a) and voltage (b) of pack with balancing algorithms during ECE + EUDC test cycle.

Table 1 :
The parameters of battery cell.

Table 2 :
Performance comparisons of 3 algorithms under CCCD condition.
the algorithms.In addition, the SILP model can simulate more different working conditions and the simulation results have more significance in actual engineering when compared with the CCCD model.The SILP model for BMS mainly includes driving cycle model, driver model, vehicle control unit model, battery management system software model, battery model, power system model, and wheel model.The whole virtual environment model is shown in Figure