Machine Learning-Based Optimal Cell Balancing Mechanism for Electric Vehicle Battery Management System

Cell balancing is a vital function of battery management system (BMS), which is implemented to extend the battery run time and service life. Various cell balancing techniques are being focused due to the growing requirements of larger and superior performance battery packs. The passive balancing approach is the most popular because of its low cost and easy implementation. As the balancing energy is dissipated as heat by the balancing resistors, an appropriate thermal scheme of the balancing system is necessary, to keep the BMS board temperature under a tolerable limit. In this paper, optimum selection of balancing resistor with respect to degree of cell imbalance, balancing time, C- rate, and temperature rise using machine learning (ML) based balancing control algorithm is proposed to improve the balancing time and optimal power loss management. Variable resistors are utilised in the passive balancing system, in order to optimize the power loss and to obtain optimal thermal characterization. The performance of the proposed system is evaluated using back propagation neural network (BPNN), radial basis neural network (RBNN), and long short term memory (LSTM). Error analysis of the balancing system is done to optimize balancing parameters and the proposed algorithms are compared using performance indices such as mean square error (MSE), root mean square error (RMSE), and mean absolute error (MAE) to validate the balancing model performance. The possible optimization scope for implementing passive balancing using machine learning algorithms are experimented in the Matlab-Simscape environment.


I. INTRODUCTION
Electric vehicles (EVs) play a very important role to minimize the local concentrations of toxins in urban and rural areas. Currently, EVs are the best alternatives for the protection of the environment and convenience of public and personal transportation [1]. The growing dependence on EVs necessitates high voltage, high efficiency and long life-span battery systems, which needs optimized battery monitoring algorithms [2]. To ensure this, it is essential to analyze the battery performance characterization of the monitoring system so as to increase the overall life cycle of the battery pack. Due to high-energy efficiency, high power to weight ratio, low self-discharge rate, less maintenance and no memory effect, the lithium-ion (Li-ion) battery is one of the most attractive rechargeable batteries.
The associate editor coordinating the review of this manuscript and approving it for publication was M. Shamim Kaiser . Therefore, the right choice of the battery technology and its efficient utilization is of paramount importance [3]. Amongst all, the chemistry of Li-ion battery is very sensitive to deep discharge and overcharge which results in damage to the battery and shorten its life span, causing safety hazards [4].
Battery management system (BMS) in electric vehicles helps to monitor, control and protect the Li-ion batteries from extreme conditions of misuse [5]- [7]. One of the important function of BMS is cell balancing, which occurs due to the variations in the cell impedance, temperature and self-discharge characteristics [8]. The balancing systems are categorized as passive and active cell balancing [9]. In the battery pack, to balance the cell voltages equally, the passive system uses balancing resistors to dissipate extra charge from the overcharged cells [10] whereas, the active system transfers extra charge from highly charged cells to low charged cells trying to preserve energy in the battery pack. This requires more expensive and complex hardware solutions [11]. The extra components needed to develop the active system increases the overall cost of BMS, while the standby power loss in these active circuits exceed the power loss of the passive system [5]. Since, the passive system works on the switched shunt resistor across the cell, it is easy to implement at a minimal cost [12]. Based on the study and analysis done so far, the key problems identified in the conventional passive cell balancing system are as follows: • In the passive balancing system heat dissipation from the balancing resistor leads to thermal challenges • Passive balancing is preferably done during charging and it may not be a feasible option under fast charging scenario due to high balancing time Hence, the BMS needs an optimal cell balancing mechanism to achieve the following: • To allow the battery to achieve a higher state of charge (SOC) • To improve the performance of the battery pack • To reduce cell degradation • To avoid thermal run away • To extend the driving range and cell cycle life • To enhance the battery safety The proposed passive balancing algorithm factors three important balancing parameters such as balancing time, power loss and temperature rise to overcome the limitations of the existing passive balancing system. All the three parameters are primarily dependent on the balancing resistor value. During balancing, the optimal selection of the balancing resistor value is based on the various real time parameters such as charging time, charging temperature, charging frequency, thermal effect, battery chemistry, probability of imbalance and charger utilization. The salient features of the proposed passive balancing approach is as follows: • Implementation of optimal passive balancing system by considering the various environmental and operating conditions as well as battery chemistry • The machine-learning algorithm selects the appropriate resistor in such a way that the balancing speed of the system is improved without much increase in power loss and temperature of the system • The performance indices of the proposed ML models are assessed based on the balancing resistor power loss, balancing time, mean squared error (MSE), root mean squared error (RMSE) and mean absolute error (MAE) for verification and validation The organization of this paper is as follows. Section II discusses related work in the area of passive cell balancing and machine learning. Section III presents an overview of the proposed passive balancing system and resistor optimization using machine learning algorithm. Section IV compares the result outcomes. The conclusion and future scope are presented in Section V.

II. RELATED WORKS
Cell balancing has been studied extensively using various balancing techniques. The reduction of balancing time and power loss in the passive system is discussed in many literatures through control algorithms. The data-driven approach based on machine learning algorithms has revolutionized the domain of electric vehicle BMS to improve the accuracy of the system measurements and learning capabilities. A brief summary of these approaches are presented in the following subsections.

A. PASSIVE CELL BALANCING APPROACHES
In the passive cell balancing approach, the battery voltage is a monitor-able parameter and an input to the balancing algorithm, the implementation of algorithms can be based on voltage (balances whenever charging), final voltage (balances at high state of charge) and state of charge (SOC) history [11]. Voltage based balancing algorithm is strongly affected by internal resistance variations and flatness of open circuit voltage (OCV) versus SOC curve at the middle SOC region [13]. The SOC history based algorithm requires more computing power and memory to save the SOC history of each cell [14]. The final voltage based method balances at high SOC, hence it gives better data on true SOC. It avoids working in the flat portion of the OCV versus SOC curve. The charging current can be reduced so errors due to internal resistance are minimized. Meanwhile, it gives least complexity in implementation and is a commonly used method in the electric vehicle domain [15]. In BEV, balancing is frequently done using voltage based methods at the final stage of the charging process [16]. Since, final voltage algorithm only works at the end of charging, it gets lesser time to balance and needs higher balancing current level [11]. By using MOSFET internal resistor as the balancing resistor in the passive system, it reduces the BMS hardware size and the balancing current is improved up to 3.07A which reduces the balancing time [17]. Nevertheless, still it takes more time for higher imbalance. Balancing the cells at different charge current reduces the balancing time by 20% [18]. The power resistors and power transistors are used as main components to dissipate the excess energy [19]. But, the power dissipation across each resistor and transistor is approximatively 7.25W and 3.6W. It reduces the efficiency of the equalization process. Modularized balancing system using different balancing schemes is simulated and prototyped in [20] to decrease the balancing time significantly. To reduce the passive balancing system cost and to improve the balancing performance, the shunt dissipative resistor is replaced with MOSFET [21]. The balancing circuit is controllable up to 1.2 A. The outlier detection based balancing algorithm discussed in [22] significantly reduces the frequency of balancing switch ON/OFF from 1150 to 2 and the SOC variance to 0.157. The algorithm is able to predict the abnormal cell accurately, but some disturbances are observed in the voltage cut-off value. VOLUME 9, 2021 The voltage measurement error due to differential measurement during cell balancing is reduced by using a sequential difference algorithm [23]. A new four step balancing process for lead-acid batteries and three-step process for other batteries i.e. Li-ion batteries are developed and validated by an experimental setup [24]. The cell balancing performances under charging, static, discharging state are analysed by using PI controller and SOC based control logic in [25]. The cell balancing approach represented in [26] mitigate the cell aging up to 23.5% using passive cell balancing and 17.6% using active cell balancing for high power battery packs and considers the lowest possible load current to the cells, which have low state of health (SOH). Hence, the low SOH cell life is extended further, which enhances the whole battery pack life span. Improved fast charging and enhanced driving range capabilities are the main objectives for efficient transportation. Nevertheless, these are of conflicting nature, which leads to increase in demand for power and energy from the battery pack. The battery modelling and the important design factors are significant while designing a BMS for EVs, are discussed in [27]. It clearly highlights the reason for selecting the passive balancing system by discussing the trade-offs of using active balancing system. In [28], passive and inductor based active cell balancing schemes for various e-vehicle use cases to address battery efficiency and balancing speed have been discussed by the authors.

B. MACHINE LEARNING APPROACHES
Machine learning approaches are leading approaches for estimating important battery performance indicators such as SOH, SOC and the remaining useful life (RUL) of the batteries which improve power computing capacity and greater availability of battery data [29]- [31]. Machine learning methods such as feed-forward neural networks (FNNs), radial basis functions neural network (RBNN), support vector machines (SVM), recurrent neural networks (RNNs) are compared in terms of data quality, inputs/outputs, accuracy, test scenarios, and battery types in [32]. To provide more insight about deep learning and classical neural network, long short-term memory (LSTM) and FNN are trained for 50 iterations with 3000 epochs. Neural network has a robust algorithm which handles any non-linear complex system under different dynamic loads and temperatures [33]. Evolutionary control algorithm is proposed in [34] for the optimal design of battery packs to solve the problems in the EV domain. The authors in [35] have proposed an offline optimization algorithm to get an optimal FNN structure by using back-tracking search algorithm for battery state estimation. In [36], a reinforcement learning framework is proposed and learning agents are trained to balance the imbalanced cells. Using FNN based algorithm, a high current pulse injection method is integrated in the balancing circuit to measure the battery parameter for the accurate estimation of SOC [37]. RBNN are typically characterized as having very fast online learning ability, strong tolerance to input noise and good at interpolation [38]. In batteries, using RBNN the parameter uncertainties are quantified such that, an average pack model is good enough to apply each cell for the better terminal voltage estimation. A hybrid vector autoregressive moving average (VARMA) and an LSTM are introduced in [39] to forecast battery voltage and SOC of an electric scooter. The authors in [40] have presented an innovative way to minimize training time by using an LSTM with transfer learning. The various optimization techniques such as Gauss-Newton, steepest descent and Levenberg-Marquardt are applied to the Li-ion battery technology to address the problems such capacity fade, under utilization, material damage due to stress and the potential for thermal runaway from a system engineering perspective in [41]. The method proposed in [42] reduces the lithium plating during fast charging using an optimal layer configuration by considering the thermal limits. It also depicts as to how vehicle driving range is limited by thermal system design at a high degree of charging temperature. Open source toolbox is used for model based layer optimization. However, ML approach for cell balancing were not emphasized in the past work.

III. OVERVIEW OF PROPOSED PASSIVE BALANCING APPROACH
Conventional passive balancing system uses fixed resistors to balance the excess cell voltage, which is suitable for level 1 charging system (slow charging) as shown in Fig.1. Since the balancing current is small, it takes lot of time to balance the cells [43].
The proposed approach uses a variable resistor scheme whereby resistor selection is done depends on the environmental conditions and user requirements. Under fast charging and maximum degree of imbalance scenario, the balancing system containing variable resistors gives an optimum solution as shown in Fig.2.

A. BATTERY MODEL
The Thevenin 3RC electrical equivalent circuit model (ECM) is chosen as the battery model to aid the formulation of the optimal cell balancing problem and model parameters are obtained by conducting electro-chemical impedance spectroscopy test in the previous work [46], [47].  The discrete form of the equations can be formulated using ECM [14] as follows, (1) I B,j − Balancing current, I C,j -Cell current. For N cells in series, V o − Voltage of the battery pack. The output of the battery system, P o − Output power from the battery pack, I o -output current and I Bo,j (t) is the balancing circuit output current. The power balance equation of the each cell during balancing is, P lB,j − Power loss across the balancing circuit. The power loss of the balancing circuit is defined by the associated balancing current and balancing resistor, The balancing circuit current constrains are formulated as below, -Minimum and maximum balancing current limits of the balancing system. The following constrains are introduced to obtain the voltage and thermal balance during balancing, V − Maximum voltage difference between cell and pack average.
T -Maximum temperature difference between cell and pack average. The first order differential equation is used to calculate the change in battery temperature, T B − battery temperature in • C, T int -battery initial temperature equal to ambient temperature in • C, T a -ambient temperature in • C, R T -thermal resistance in • C /Watts, C T -thermal capacitance in Joules/ • C. P L -power loss across the battery internal and polarization resistance. For 3RC equivalent battery model, the power loss is calculated as below, To choose the appropriate passive balancing design, the parameters need to be considered include, battery charging time, charging frequency, charger utilization (one charger for many applications), manufacturing cost, mechanical aspects (high reliability, low weight and low vibration) and balancing current [44]. The balancing current of the cell is calculated as follows [5].
From equation (19), the balancing current requirement is estimated. However, due care should be given while selecting the balancing current since it is related to power loss. Balancing resistor value is calculated from the battery voltage and the balancing current. The equations (12), (13) and (19) indicate that the balancing resistor selection plays a key role in addressing slow balancing and heat dissipation challenges of conventional passive algorithms.

B. BALANCING RESISTOR OPTIMIZATION
The optimal resistor selection is significant which is highly dependent on the following aspects.
• Charging time: When the battery is charged slowly, low balancing current is sufficient to balance the cells. However, if it is charged with high C rate then high balancing current is required to balance the cells within the charging period.
• Charging temperature: Ambient temperature of the battery is also an important parameter needed to be considered while designing the balancing resistor because battery pack temperature rise is high in hot temperature regions compare to low temperature regions.
• Cost for thermal management: The investment for thermal management system is high because more energy is dissipated in the balancing circuit for the fast-charging requirements. So, the selection of the balancing resistor through appropriate control algorithms is essential to ensure the thermal safety of the system.
• Battery chemistry: Depending on the cell chemistry, the balancing current and imbalance rate varies significantly.
• Probability of imbalance: This parameter signifies the age and the amount of imbalance present in the battery pack. The degree of imbalance is more pronounced when manufacturing batch of the cells are different. However this can be controlled if the production lot size is minimal. The probability of imbalance increases as the age of the cell grows. The maximum balancing current is constant in the conventional passive balancing system and it cannot be varied when required. To address this problem, variable resistor based passive balancing mechanism is proposed by considering the above mentioned parameters to optimize the performance of the balancing system. Different optimization techniques are analyzed in a comprehensive way to address these challenges. The balancing time of the passive system is verified under different charge C-rate and minimum to maximum voltage imbalance ( V) of the cells and the battery temperature is monitored to avoid thermal runaway problems. The optimal resistor selection is mainly dependent on the charging time, voltage imbalance and the battery temperature. The voltage imbalances are separated as three different categories low, medium and high imbalance. For the simulation analysis three cells are considered with two parallel combination of resistors having difference resistances as shown in Fig. 4.  The range of resistor values selection are based on the battery chemistry, maximum temperature limit and balancing current tolerance of the BMS balancing board components. The balancing current consumption, power loss, and temperature rise for a range of balancing resistors are estimated. The range of resistor values considered for this analysis is from 1 to 40 based on balancing current, time and power loss equations which are represented in the Fig. 5.
In Fig.6, the battery temperature is estimated by considering various ambient temperature (−20 • C, −10 • C, 0 • C, 15 • C, 30 • C, 45 • C and 60 • C) conditions. Based on the calculation, the balancing current does not exceed the maximum balancing current of 300mA, while the power loss and temperature are within the tolerant limit for the resistor range of 15 to 40 . The selected resistor value for R b11 , R b21 and R b31 resistor is 33 and for R b12 , R b22 and R b32 is 25 . The design of algorithm is detailed in Fig. 7. Balancing of variable voltage and current rate, simulation is conducted under the following conditions. The initial voltage difference of 30-50 mV, 50-100 mV and above 100 mV with the charging current of 0.5C (1.675 A) and 1C (3.35 C) respectively.

C. MACHINE LEARNING ALGORITHM IN CELL BALANCING
In this proposed approach, Machine learning algorithm is introduced along with the conventional passive balancing mechanism in order to optimally select the balancing resistors depending on the environmental factors and user experience requirements. A comprehensive classification of machine learning is shown in Fig.8 which describes the different machine learning approaches that have been used in the BMS application [31] aspects, but does not address the cell balancing requirements. The machine learning methods are divided into four main categories; supervised learning,  unsupervised learning, semi-supervised learning and reinforcement learning.
In the proposed approach, the acquired battery data sets are trained, validated and tested using MATLAB (2019b) by using NN toolbox. The flowchart of the ML algorithm is represented in Fig.9 [45]. It consists of input parameters, feature extraction and ML algorithms to estimate the balancing resistor value. The ML algorithm is trained based on the known data to construct a predictive model of the charging curve. The ML algorithm selects the balancing resistor based on the three important parameters such as battery voltage, charging current and battery temperature.

1) BACK PROPAGATION NEURAL NETWORKS (BPNN)
BPNNs are parallel processing approach, which has an ability to learn the system behavior using input/output data set patterns. The sigmoid activation function of the artificial neurons introduce non-linear properties to the network. The BPNN nodes are generally trained with a stochastic gradient descent method called back-propagation. The BPNN fitting algorithm creates and trains a network for the given data and evaluates its performance using regression analysis and mean square error (MSE) methods. The BPNN is trained with Levenberg-Marquardt backpropagation algorithm because of its good accuracy and training speed. The inputs are collected from current, temperature and voltage sensors of the battery. Input 1, 2, and 3 represent the measured battery voltage, temperature and charging current. 10,672 cell balancing experimented data comprising of cell voltage, charging current and pack temperature are fed as inputs. The output from the ML based model are obtained to select the balancing resistor value and duration. The algorithm uses 20 hidden neuron layers, which determines the accuracy of the balancing system.
A three-layer back propagation neural network model as shown in Fig.10 is used in this work, for the selection of balancing resistor. The first and third layers are used to describe the inputs and output variables. The second layer contains one or more hidden neurons which influences the accuracy. Each step in the algorithm is explained in detail through the below steps [35].
Step 2: The sigmoid function of the hidden layer is defined as For q input pattern, the j th input layer node holds x q,j Total input to the hidden layer i th node is, where, w i,j and θ i,j represent the weight and bias to the hidden layer from the input layer. Output of hidden layer i th node is, S i is the activation function. Total input to the output layer p th node is, where, w p,i , θ p,i are the weight and bias to the output layer from the hidden layer. p th node output in the output layer is, Step 3: The error is calculated and propagates backward to the hidden layer from the output layer and the output layer error is calculated as, A p is the actual output and the hidden layer error is calculated as Step 4: Biases, weights and error are updated. The following equations update the weights where β is the learning rate. The following equations update the biases NMC18650 battery is selected for the experiments and its voltage range of the battery lies between 2.7 V to 4.2 V and capacity of 3.35Ah. The battery cell is charged through constant current-constant voltage (CC-CV) method and passive balancing algorithm is triggered at high SOC region. The most influencing battery parameters such as voltage, current and temperature data are collected and described in our previous work [47], which have a significant impact on balancing performance. The test is conducted under various cell imbalance conditions, charging C-rate and different ambient temperatures (0 • C, 20 • C and 45 • C).
ML is used to shorten the balancing time and create a specialized design for balancing control to reduce power loss and thermal efficiency. The designed algorithm has 6 inputs and outputs. The first three inputs are cell voltages, followed by battery charge current and remaining are the cell and battery temperature. The controller output adjusts the pulse width modulation (PWM) change value of the switch to select the resistors. According to the voltage, current and temperature values of each battery, the ML algorithm further maps these values into the corresponding switch ON/OFF states. If the updated battery voltage is lower than the voltage values of other batteries in the pack, balancing is stopped. Cell balancing behaviour during charging were observed under different degree of voltage imbalance, charging C-rate and ambient temperature and the data were recorded. The 70% and 30% of data set is used to train and test the developed model with optimum value of hidden layer neurons and learning rate. In this study, the maximum numbers of epochs are 1000 and the performance goal is set as 0.000001. The passive cell balancing results of BPNN model are compared with the conventional passive cell balancing system.

2) RADIAL BASIS NEURAL NETWORK (RBNN)
RBNN is composed of an input layer, only one hidden layer and output layer as shown in Fig.11. The design of radial basis function (RBF) networks is generally structured in three steps: selection of network size, selection of initial parameters (widths and centres) and finally, train the neural networks. It generally uses Gaussian functions, so the radial distance is defined as r = ||x − t|| and t is a receptor. The sum squared distance between the each cluster nearest samples and the respective receptor are defined as, A set of non-linear radial basis transformation functions are performed by the each node of the hidden layer. In first stage of training, hidden layers are trained using backpropagation methods, runs through stochastic approximation and the training is done by clustering algorithm which also defines cluster centres. The receptors and the spread of the radial basis function has to be found for each node of the hidden layer. In the second stage, weighting vectors between hidden and output layers are updated. Each node in the hidden layer performs transformation basis function. Then, the linear combination of hidden layer functions are given to the output layer. The output clusters are the receptors. The input vector is projected onto the transformed space is the final interpretation of the training stage. Fig.12 shows the RBNN architecture with N inputs, K hidden layers and M outputs [48].
The steps of the algorithm for the RBF include First layer (input layer) computation: The input vector x is weighted by input weights w h at the hidden unit k.
where, n is the input index; k is the hidden units index, w h n,k is the input weight between n and k, x n is the n th input. Second layer (hidden layer) computation: The output of hidden unit k is derived as: where, the activation function ϕ k (S k ) generally preferred as Gaussian function;σ k is the width of hidden unit k and C k is the center of hidden unit k. Third layer (output layer) computation: The network output m is derived as, where, m is the output index, w o O,m is the bias weight of output unit m, w o k,m is the output weight between hidden unit k and output unit m. The model outputs are evaluated based on the mean square error as below, where, q is pattern index(1 to Q), m is the output index(1 to M) and e q,m is the error at output m when training pattern q calculated as the difference between associated actual output and desired output. The data sets of 6 inputs consists of cell voltages, charging current and battery temperature are generated from the hardware implementation of passive cell balancing system in [47]. During charging, the voltage and current were measured through the passive balancing controller for various degree of cell voltage imbalance at different charging current and temperature. The data encompasses 10,671 training patterns and 1,199 testing patterns.

3) LONG-SHORT TERM MEMORY (LSTM)
LSTM is an updated variant of the RNN for time series prediction problems [49]. Using backpropagation training algorithm through time, it overcomes the vanishing gradient problems. It has memory blocks that are connected through layers instead of neurons, which are used to solve difficult sequential problems. LSTM network model includes forget gate, input gate and output gate, which greatly improve the memory capability of the LSTM in the multi-step time series prediction problems [50] as shown in Fig.13. The data collected from the real time cell balancing implementation were learned using LSTM method. The actual cell balancing results and learned cell balancing results are compared. Program learning and writing is done using Python Tensorflow and Keras package. The long term memory is called as cell state. Cell state equation is shown below.
From the equation (42), by multiply with the forget gate the previous cell state (C t−1 ) information forgets and new information is added to the input gates output.The remember vector is called as forget gate as shown in equation (43).
The forget gate indicates the cell state which information needs to be forget by multiplying with 0 to a matrix position. The information remains in the cell state, if the forget gate output is 1. From equation (44), sigmoid function is applied to the previous hidden state and weighted input. The save vector is called as input gate. It determines which information should enter long term memory/cell state.
Input modulation gate equation is represented aŝ It uses tanh activation function which has a range of [−1, 1], allows cell state to forget the memory. The focus vector is called as output vector. It decides which information should be moving to the next hidden layer.
The working memory is called as hidden state. It decides which information should be taken to the next sequence.

IV. RESULTS & DISCUSSION
In this unique Machine learning statistical based approach, the comparison and bench marking of the results are done with different ML models. The simulation uses 3 lithium manganese cobalt oxide (NMC) cells with capacity of 3.35Ah. The nominal, discharging and charging cut-off voltages of the cells are 3.6, 2.7V and 4.2V, respectively. The first and third cell are kept with a voltage difference higher than the second cell. The simulation scheme is shown in Table 1. The initial voltage difference of the cell1 is 55mV with respect to cell2 and 101mV with cell3. The voltage difference between cell2 and cell3 is 36mV. Due to the non-linear relationship between SOC and battery voltage [51], [52], passive balancing mainly happens in the initial and final stage of charging. In this, the final voltage-based method has been used and the balancing is accomplished towards end of charging. Moreover, the balancing time and power loss across the balancing resistors are same irrespective of charging C-rate.
At each charging C-rate the charging and the dynamic balancing experiments were conducted. The cell voltage, balancing current, temperature, balancing time and other parameters were logged using conventional and proposed ML based cell balancing schemes. In order to do the test design for the passive balancing system, all the essential parameters have been considered. The performance study of the cell balancing system has been studied and the outcomes are plotted.
Balancing capacity ratio [53], where C bal indicates capacity consumption (Ah) during balancing, C indicates rated capacity (Ah). Balancing current ratio, I bal is the balancing current (A), I indicates charging current of the battery (A). Balancing time ratio, t bal indicates balancing time (s), t indicates the charging time of the battery. From Fig.14, greater the voltage difference among cells, higher is the balancing capacity ratio. There is a non-linearity between the capacity ratio and V and this is due to the strong non-linear behaviour of the li-ion battery at the initial and final stage of charging.
The balancing time ratio increases as the battery circuit current ratio increases as shown in Fig.15. It is observed that when the balancing time ratio increases as the voltage deviation among the cells increases.
Since, the balancing current ratio is inversely proportional to the balancing time ratio, in real time application, an appropriate increase in balancing current ratio can assist to get a better balancing effect. The learning-prediction based NN model obtains the balancing resistor selection from the set of balancing data to predict the resistor value under various cell balancing scenarios. Charging and on-line balancing experiments are conducted at different charging C-rate. The balancing data are fed to the feed-forward neural network trained with Levenberg-Marquardt backpropagation algorithm. The data set of the system consist of 7,470 training patterns, 1,601 testing and 1,601 validation patterns. The number of inputs and outputs are 6 with hidden-layer size of 20. The performance of the model is verified based on the mean square error (MSE) of the training and testing set. The training and testing MSE of 0.0046 and 0.0048 with a best validation performance MSE of 0.0045 is shown in Fig.16. The created Simulink NN model is used in the proposed balancing system to perform cell balancing as shown in Fig.17.
The simulation outcomes shows that the optimum measures of balancing parameters are attained for the passive system. In the conventional scheme, time taken by cell1 and cell3 are 165 and 58 minutes for balancing irrespective of the charging C-rate. Compared to conventional cell balancing, the time taken by the proposed ML based scheme is considerably low with reduced power loss. The balancing time, power loss, temperature variations of conventional and proposed schemes are explored from the simulation resultant waveforms of Fig. 18-21. From Table 1, cell1 and cell3 voltages are greater than cell2 voltage, therefore cell1 and cell3 are in balancing mode while cell2 is in normal mode. So the drive signal for cell1 and cell3 are activated as shown in Fig. 18(a). The balancing current, the battery temperature and power loss across the balancing resistors are shown in Fig.18 (b)-18(d). For about 9868s, cell1 is in the balancing mode. This phenomenon is shown    of 101mV to less than 30mV. The balancing time taken by Cell3 is 85 minutes to reduce the voltage difference of 46mV with cell2 and 55mV with cell1. The balancing time of conventional cell balancing schemes are almost constant to balance the cells at 0.5C and 1C charging as shown Fig. 20. Because balancing is done at the end of charging where the charging current is minimum and the only concern is the paucity time to balance. The proposed balancing scheme shown in Fig. 20 and 21, the balancing is done against various degree of cell imbalance and charging conditions. If the V is 30-50mV, then the resistor-1 (33 ) across the imbalanced cell is turned ON, for 50-100mV resistor-2 (25 ) is turned ON and for above100mV both the resistors are ON.
Thus, the increase in the balancing current, speeds up the balancing which improves the balancing effect.In Fig.19, the V is greater than 100mV and both the resistors are ON until V comes below 100 mV and resistor-2 is turned ON as shown in Fig.19 (a). In the proposed scheme, the cell1 and cell3 take 101 and 77 minutes respectively to reach the balancing threshold and at the same time there is no significant increase in the overall power loss and battery temperature. For higher C-rate both the resistors are turned ON as long as the battery temperature is within safe limits. Cell1 and cell3 stays at 4,680s and 1,800s in the balancing mode, before it enters in the normal mode. Table 2 compares the conventional balancing system with the proposed system with respect to balancing time, energy loss and battery temperature during balancing. A drastic change in the balancing time is observed in the proposed approach especially at higher C-rate. In order to increase the battery life span, safe temperature zone is to be maintained during the cell balancing.
The same data set is trained in RBNN and LSTM to compare the performance. Due to their faster learning speed, the best validation performance is achieved at 2 epoch in RBNN with MSE of 0.0717 as shown in Fig. 22. Since it has one hidden layer, convergence of optimization objective is much faster.
In LSTM, the time series data is converted to sequential data with time steps. The time steps indicates the number of previous steps that has to be considered in order to predict the subsequent output. Six features of data are predicted with different timestamps, output graphs and other performance indices are generated during execution. The cell balancing data is collected with the range of temperature from 0 • C to 45 • C and the charging current of 0.2C, 0.5C and 1C. The data includes charging time, temperature, cell voltages and charging current. The algorithm is trained with 10,642 data are considered in which 70% is taken for training and 30% taken for testing. LSTM values are of three dimensions, namely samples, time steps and features, which is an important procedure in LSTM training. The LSTM with 20 neurons in the first layer and the input shape is of 6 features which considers 30 time steps. The mean absolute error (MAE), mean squared error (MSE) loss function and     the Adam version of stochastic gradient descent are used. The model will be fit for 20 training epochs with a batch size of 20. Fig. 23 shows the number of epochs taken to predict the data with time and losses. Interestingly, the testing loss slightly drops below training loss after 13 epoch and it's due to the model fitting the training data. After that the model shows a perfect fit beyond which, the model training could be stopped at the inflection point and the number of training samples could be increased.
Loss are computed during training on scaled target, whereas RMSE and RMAE are computed post on inverse scaled target and shows the real performance. The switching state obtained at each step of algorithm is shown in Fig. 24. The switching state is predicted for 500 time steps. The predicted data matches the actual data with an acceptable error range of 0.01, confirming that the predicted values are accurate. Table 3 shows the performance error at various time steps. It is observed that, increase in MSE and MAE values as the number time steps is increased. The rise in network capacity is not given adequate time to fit the data.
In order to reduce the performance errors, increase in repetition and epochs would help. The testing and training losses are shown at the end of each epoch. Finally, the MSE and MAE of the test data set is displayed. The model achieves   Fig. 25.
For all the models, the testing is repeated for 50 times and the net trajectories of training/testing errors are shown in Fig.26. The LSTM obtained lesser training/testing error than BPNN and RBNN. As the number of hidden layers increase, all the three models perform better due to decrease in overall error. From the repeated testing, the overall MSE, RMSE and MAE are calculated for the 3 networks which are shown in Table 4. For lesser number of hidden units, BPNN performance is better than RBNN. Compared to RBNN, the BPNN takes more time to converge, but the performance is good. The proposed scheme is more appropriate if the    the battery characteristics are highly non-linear, the ML based cell balancing approach predicts the cell imbalances accurately and select the balancing resistor based on the degree of imbalance.
For the simulation purposes only 3 cells with 3 resistor combinations are used, however more number of resistors can be selected based on the charging and balancing criteria's such as charging time, safe operating area (SOA) of the battery, and space availability in the BMS board, etc.

V. CONCLUSION AND FUTURE SCOPE
For the perfect cell balancing of the Li-ion battery pack, comprehensive machine learning algorithms are used to balance the cells by estimating optimum resistor values which considers balancing time, power loss, temperature rise, and operating constraints which further optimizes the balancing currents in the system. The variable resistor based passive cell balancing algorithm is more feasible to implement in realtime for large scale battery pack to minimize the computational complexity. The performance of the proposed approach VOLUME 9, 2021 is evaluated using three machine learning algorithms which include BPNN, RBNN and LSTM due to their better handling of non-linear data. Extensive illustrative results demonstrate the effectiveness of the proposed optimal cell equalizing control strategy. With MAE of 0.0660, the LSTM shows better performance, since the LSTM kernel can extract complex time structured sequential data. BPNN approach performs better than RBNN with 0.1276 MAE. Compared to a conventional approach, the proposed system results are reflected with higher balancing speed corresponding to smaller temperature rise. To conclude, the proposed ML based method further encourages improvement in the cell balancing estimation because of the probability distribution. Further research work may potentially include, using the higher order voltage deviation in the cell balancing algorithm to fine tune the system performance.