**A Method for the Combined Estimation of Battery State of Charge and State of Health Based on Artificial Neural Networks**

#### **Angelo Bonfitto**

Department of Mechanical and Aerospace Engineering, Politecnico di Torino, 10129 Torino, Italy; angelo.bonfitto@polito.it; Tel.: +39-011-090-6239

Received: 25 March 2020; Accepted: 17 May 2020; Published: 18 May 2020

**Abstract:** This paper proposes a method for the combined estimation of the state of charge (SOC) and state of health (SOH) of batteries in hybrid and full electric vehicles. The technique is based on a set of five artificial neural networks that are used to tackle a regression and a classification task. In the method, the estimation of the SOC relies on the identification of the ageing of the battery and the estimation of the SOH depends on the behavior of the SOC in a recursive closed-loop. The networks are designed by means of training datasets collected during the experimental characterizations conducted in a laboratory environment. The lithium battery pack adopted during the study is designed to supply and store energy in a mild hybrid electric vehicle. The validation of the estimation method is performed by using real driving profiles acquired on-board of a vehicle. The obtained accuracy of the combined SOC and SOH estimator is around 97%, in line with the industrial requirements in the automotive sector. The promising results in terms of accuracy encourage to deepen the experimental validation with a deployment on a vehicle battery management system.

**Keywords:** battery; state of charge; state of health; artificial intelligence; artificial neural networks; hybrid vehicles; electric vehicles; estimation

#### **1. Introduction**

The automotive industry is recently dedicating increasing attention to sustainability, with the objective of mitigating the negative effects of vehicular mobility on the environment. Carmakers cope with the always more stringent regulations about CO2 emissions, focusing their efforts on the development of advanced powertrain architectures [1,2]. Solutions based on the adoption of full electric (battery electric vehicles (BEVs)) powertrains or on the combination of an internal combustion engine (ICE) and electric traction (hybrid/plug-in hybrid electric vehicles (HEVs/PHEVs)) are now established as reliable alternatives to conventional powertrains [3,4]. They exploit batteries as the primary energy source in BEVs or as an auxiliary source in HEVs and PHEVs [5]. In the automotive industry, the most common battery technology exploits lithium because of its remarkable advantages in terms of the energy density, fast charging, low maintenance, and long lifetime allowances. Moreover, lithium-based solutions allow for obtaining powerful, compact, and light configurations together with satisfactory levels of autonomy, which is currently settled in the order of a few hundreds of kilometers [6]. However, the reliability and performance of these type of batteries are strongly influenced by the management of the charging and discharging phases. It is indeed well known that an appropriate handling of these operations is mandatory to avoid the occurrence of overcharging or deep discharging, that would lead to permanent or hardly reversible damages of the pack. A continuous and accurate monitoring of the battery state takes on significant importance to extend the battery lifetime, effectively plan the trip route and charging stops, optimize the energy flow management of HEVs [7,8], and mitigate psychological effects, such as the range anxiety that is commonly experienced by a large

number of BEV drivers [6]. The main parameters to be assessed for a correct battery monitoring are the residual available energy in the pack, known as state of charge (SOC), and the degradation suffered by the battery, indicated by the state of health (SOH) [9]. As is well known, these two states cannot be directly measured, since the technology to make a sensor that plays the equivalent role of a fuel gauge is not available. Therefore, the adoption of some estimation techniques becomes mandatory [10,11]. Typically, carmakers exploit look-up tables (LUTs), where the SOC and SOH behavior is mapped during the preliminary experimental characterizations conducted in a laboratory environment. These tests are done following the so-called direct methods, which are based on ampere-hour counting or the measurement of the internal impedance and open circuit voltage of the battery [10,12]. However, the adoption of LUTs may have a high computational cost and imposes the storage of a huge amount of data in the electronic control unit memory, particularly in the case of the SOH estimation. A further class of methods exploits model-based techniques for the real-time assessment of both the SOC and SOH [13]. The most common are the Kalman filter [14] and its derivations, namely the extended (EKF) [15] and unscented Kalman filters (UKF) [16,17], the adaptive particle filter (APF) [18], and the smooth variable structure filter (SVSF) [19]. Although these solutions can be implemented in real time on a vehicle, they may suffer problems of inaccuracies if the reference model is not completely and accurately tuned in all the possible operating conditions. An alternative and promising approach to overcome this limitation is represented by artificial intelligence (AI). In most cases, these solutions adopt artificial neural networks (ANNs) and allow getting rid of the model while obtaining satisfactory levels of accuracy and reliability, provided that the networks are properly trained. An extensive literature is dedicated to the methods for the estimation of the SOC [20–23] or SOH [24–27] with AI. Nevertheless, to the best of the author's knowledge, very few works deal with the combined estimation of the SOC and SOH and most of them describe model-based techniques [28–30].

This paper proposes a technique for the combined estimation of the SOC and SOH with a set of five ANNs: four regression networks dedicated to the SOC estimation and one classification network for the SOH identification. The method is independent by the battery model and is designed with a training phase conducted with datasets obtained from the preliminary laboratory experimental characterizations. The SOC estimation exploits four nonlinear autoregressive neural networks with exogenous input. Each of them is associated with a specific class of ageing (SOH) of the battery. The correct estimation among the four outputs is selected according to the SOH identification, which is obtained separately by a classifier that is done with a pattern recognition neural network. The SOH estimator provides a class of ageing among four possibilities, ranging from 80% to 100% with a step of 5%. A further class is associated to exhausted batteries and covers the range from 0% to 80% of the SOH, where 80% is the degradation threshold in the automotive sector. The output of the SOH classifier is used to select the correct SOC estimation among the four outputs of the regression ANNs, while the SOC estimation is used as an input for the SOH classifier in a closed-loop recursive architecture. The SOH estimator is an algorithm which is triggered only when a specific battery load condition in terms of the mean charging/discharging capacity request in a predefined time window is detected. This procedure allows reducing the training dataset of the SOH neural classifier to only one specific case. This aspect represents a relevant advantage in terms of a size reduction of the training dataset and a consequent time saving during the dataset collection and learning procedures. Additionally, the size of the network is smaller with a consequent reduction of the memory occupation when deployed on the battery management system (BMS).

The paper describes the design of the two estimators and the validation phase is conducted with the adoption of driving cycles acquired on a mild hybrid electric vehicle. The performance of the SOC estimator is evaluated by comparing the temporal evolution of the expected and estimated state of charge, whereas the SOH classifier accuracy is measured by using a confusion matrix, a common evaluation tool of classification algorithms.

The novel contributions of this work are as follows: a) the proposal of a combined estimation of the SOC and SOH with ANNs, allowing to make the method independent from the model and valid for every operating condition, provided that the network training dataset is complete and accurate; and b) the proposal of an SOH estimation method that is triggered only when a specific load condition corresponding to a predefined charging/discharging current profile is detected: this results in a compact algorithm that can be trained with a dataset that is smaller with respect to what would be needed in the case of a reproduction of the whole set of ageing conditions.

#### **2. Method**

The proposed method aims to provide a combined estimation of both the SOC and SOH of a battery. The approach is equally valid for a battery pack, module, or for the single cell.

Figure 1 illustrates the overall layout of the method that is composed of two subsystems: the SOC estimator, consisting of four regression ANNs, that is illustrated in the top left dashed box, and the SOH estimator, that exploits a neural classifier, that is reported in the bottom right dotted box. As is well known, the behavior of the two parameters is connected: the SOC of a battery is strongly influenced by the ageing, as well as the SOH estimation needing the information of the SOC variation during the charging/discharging operations. This motivates the adoption of a recursive loop architecture, where the SOC output is provided as an input to the SOH classifier and vice-versa. Both algorithms were trained on the basis of the preliminary experimental characterizations conducted in a laboratory. The two subsystems are described in detail in the following sections.

**Figure 1.** Overall method architecture. Dashed box: state of charge (SOC) estimation. Dotted box: state of health (SOH) estimation. *i*(*t*): charging/discharging current. *v*(*t*): voltage at battery terminals. *T*(*t*): battery temperature. *E*(*t*): energy request. SOH classes: 1: (100 ÷ 95)%; 2: (95 ÷ 90)%; 3: (90 ÷ 85)%; 4: (85 ÷ 80)%.

The battery pack considered for the study is composed of 168 cells (the cell model is Kokam SLPB 11543140H5, its characteristics are reported in Table 1) in the configuration 12p14s (p: parallel, s: series). The pack has a nominal voltage of 48 V, a nominal capacity of 60 Ah, and is designed for a mild hybrid electric vehicle with a peak electric power of around 20 kW, obtained considering a discharge rate of around 7C in nominal conditions.


**Table 1.** Main characteristics of the battery cell.

#### *2.1. SOC Estimation*

The SOC estimator consists of four parallel regression ANNs (dashed box in Figure 1) working on the same inputs. Each network is associated with a specific ageing condition: SOH class 1 (from 100% to 95%), SOH class 2 (from 95% to 90%), SOH class 3 (from 90% to 85%), and SOH class 4 (from 85% to 80%). The threshold of 80% was decided considering that in the automotive sector, a battery has to be considered exhausted when the capacity or power fading is higher than 20%. The step of 5% is aligned with the typical precision that can be reached when dealing with the SOH estimation problem [31,32].

Each of the four regression ANNs receive, simultaneously, the following signals as inputs: charging/discharging current (*i*(*t*) [*A*]), voltage at battery terminals (*v*(*t*) [*V*]), and temperature (*T*(*t*) [C]). They provide four different outputs: *SOC*ˆ <sup>1</sup>(*t*), *SOC*ˆ <sup>2</sup>(*t*), *SOC*ˆ <sup>3</sup>(*t*), and *SOC*ˆ <sup>4</sup>(*t*). The final SOC estimation (*SOC*ˆ (*t*)) is obtained with a downstream selector that is operated by a signal fed back from the SOH classifier output, that is running separately, as indicated in Figure 1.

The structure of the four SOC estimators is the nonlinear autoregressive neural network with exogenous input (NARX) architecture. Typically, this layout is adopted for prediction tasks and finds an application in industrial engineering fields as well as in other sectors, namely linguistic search engines or weather forecasting. However, its effectiveness has been demonstrated also for estimation tasks and has been presented as an effective solution to estimate the SOC of lithium batteries in [21], where an additional comparison with other ANN architectures in terms of the computational cost and estimation accuracy is provided. The scheme of the NARX is reported in Figure 2, where the two adopted configurations are illustrated: an open-loop configuration (a), often indicated also as the series–parallel (SP) mode, that is adopted during the training procedure, and a closed-loop configuration (b), or equivalently the parallel (P) mode, that is the final architecture adopted for the estimation when the network is deployed on the vehicle for the real-time execution.

The output of the regression is defined as

$$y(n) = \varphi\left[y(n-1), y(n-2), \dots, y(n-d\_y); \mathbf{x}(n-1), \mathbf{x}(n-2), \dots, \mathbf{x}(n-d\_x)\right] \tag{1}$$

where *<sup>y</sup>*(*n*) <sup>∈</sup> <sup>R</sup> and *<sup>x</sup>*(*n*) <sup>∈</sup> <sup>R</sup> denote the output (state of charge) and inputs (current, voltage, and temperature) of the NARX model at the discrete timestep *n*, respectively, *dx* and *dy* are the input and output memory delays used in the model, respectively, and ϕ is the function, generally non-linear, represented by the ANN. During the regression computation, the next value of the dependent output

signal *y*(*n*) is regressed on the previous *dy* values of the output signal and previous *dx* values of the independent (exogenous) input signal. In the open-loop configuration, the output regressor is

$$y(n) = q \left[ \overline{y}(n-1), \overline{y}(n-2), \dots, \overline{y}(n-d\_y); \mathbf{x}(n-1), \mathbf{x}(n-2), \dots, \mathbf{x}(n-d\_x) \right] \tag{2}$$

A supervised training procedure is conducted using the measured output as the target. This approach allows for enriching the information to be processed by the network and permits using a common static backpropagation algorithm, the Levenberg–Marquardt in this case, for the training process, since the resulting network has a purely feedforward architecture.

**Figure 2.** Nonlinear autoregressive neural network with exogenous input (NARX) architecture. (**a**) Series–parallel (SP) mode (open-loop configuration) adopted during the training. (**b**) Parallel (P) mode (closed-loop configuration) adopted for the estimation when the network is deployed. HAF: hidden activation function. OAF: output activation function. *w*: weight. *b*: bias.

In the first second of computation, the value of the algorithm output is not stable and is unpredictable. Therefore, if this value is fed back and provided as input to the ANN, it generates an estimation divergence over time. To avoid the occurrence of this irremediable condition, during the first second of estimation the feedback of the estimated SOC is replaced by the last estimation value (*SOCINIT* in Figure 2b) recorded on a non-volatile memory at the previous shut down of the vehicle. After 1 second, when the output has become stable, the SOC input of the network switches from the previously recorded value to the real feedback of the estimation so that the regular operation of the algorithm can start.

Referring to Figure 2b and indicating with *n* = *n*<sup>0</sup> the time instant when the feedback signal switches from *SOCINIT* to the estimated output, the characteristic equations of the model are written as

$$\varphi(n) = \varphi\left[\text{SOC}\_{\text{INT}}; \mathbf{x}(n-1, \mathbf{x}(n-2), \dots, \mathbf{x}(n-d\_{\mathbf{x}})) \right], n < n\_0 \tag{3}$$

and

$$y(n) = \varphi\left[y(n-1), y(n-2), \dots, y(n-d\_y); \mathbf{x}(n-1), \mathbf{x}(n-2), \dots, \mathbf{x}(n-d\_x)\right], n \ge n\_0 \tag{4}$$

The four networks have the same size in terms of layers, neurons, and delays and adopts the same activation functions. All these parameters have been designed with a trial and error approach aimed to maximize the estimation accuracy and avoid the risk of overfitting. Specifically, each network has one layer with eight neurons, the delays *dx* and *dy* are equal to two, the activation function in the hidden layer (*HAF*) and output layer (*OAF*) are the hyperbolic tangent and linear functions respectively, and the training function is the Levenberg–Marquardt function.

During the design phase, the training precision is evaluated by computing the mean square error (MSE) that reached a value of 1 <sup>×</sup> 10−<sup>13</sup> as indicated in the small box embedded in Figure 3, and the estimation accuracy is measured with the maximum relative error (MRE), that is computed as

$$\text{MRE}\left[\%\right] = \max\_{1 \le i \le n} \left( \left| \frac{\text{SOC}\_{\text{exp}}(\text{i}) - \text{SOC}\_{\text{est}}(\text{i})}{\text{SOC}\_{\text{exp}, \text{max}} = 1} \right| \right) \times 100 \tag{5}$$

**Figure 3.** Comparison performance between the estimation (dashed line) and expected values (solid line) of the SOC in the case of an SOH = 100%. The obtained maximum relative error (MRE) is equal to 0.35%. The small box in the bottom left indicates the trend of the mean square error during the training phase.

This parameter reached the value of 0.35% as indicated in Figure 3, where the comparison between the estimation (dashed line) and the expected value (solid line) of the state of charge is reported in the case of a new battery (SOH = 100%). This plot wants to represent an indication of the training evaluation during the design phase.

The time length of the training dataset for the four regression ANNs is 13 h.

A more detailed description of the overall method results is reported in the final section of the paper.

#### *2.2. SOH Estimation*

The degradation of the battery is estimated with an algorithm reproducing a pattern recognition classifier with an ANN. Since the algorithm is proposed for the automotive sector, the method considers 20% as the maximum admitted capacity fading. Therefore, the considered life cycle of the battery ranges from an SOH of 100% when the battery is new to an SOH of 80% when the battery has to be considered exhausted. The proposed solution aims at quantifying the degradation suffered by the battery by identifying the five different levels of ageing which correspond to the five classes provided as an output by the classification algorithm. The first class covers the interval of ageing below the level of 80% (assumed as the threshold of the maximum degradation of the battery) of the SOH. The other four classes are equally distributed between 80% and 100% with four intervals of 5%, a percentage that is considered as consistent with the reasonable level of accuracy that can be reached when dealing with the problem of the SOH estimation.

As in the case of the SOC network design, the proposed algorithm for the SOH estimation exploits a preliminary experimental characterization phase conducted on the battery in a laboratory environment. The obtained results are used to build the training dataset to be adopted for the learning phase of the neural classifier. Specifically, the data of interest are recorded in a specific battery load condition corresponding to a mean request of 12 Ah in an interval of time of 120 s. This condition was selected because it can be detected quite frequently during a common driving cycle of an electric or hybrid vehicle. Afterwards, the network is trained with the dataset corresponding to this specific operating condition obtained at different values of temperature. Therefore, when the algorithm is deployed on the vehicle, it is called to estimate the level of ageing whenever the same condition is detected during the real driving cycle. This implies that when driving the vehicle, consecutive buffers of 120 s are analyzed back-to-back by a control logic that is implemented in the "Triggering load detection" block in Figure 1. As soon as the specific load condition of interest (mean capacity request of 12 Ah in 120 s) is detected, the classifier is triggered and provides the SOH classification as an output. Therefore, the estimation rate is not continuous over time, but it is produced in a discrete and not time deterministic way, only in correspondence with the detection of the predefined known load condition. The output of the estimator is kept equal to the last SOH estimation if the triggering condition is not occurring.

Figure 4 reports a part of the ANN training dataset obtained by the preliminary experimental characterization conducted on the battery. Subplot "a)" illustrates the behaviour of the degradation of the battery as a function of the number of discharging cycles at different values of temperature [33]. The discharging is conducted with the predefined load above-mentioned. Subplot "b)" reports the coupling effects between the SOH, capacity, SOC, and battery voltage. In this test, the temperature is set to 25 ◦C and the variation of the capacity is motivated by the difference in the time needed to discharge the battery at the different levels of ageing.

The time length of the training dataset covering all the considered levels of ageing is equal to 916 h obtained from 27,494 buffers with a duration of 120 s.

The SOH classifier works on discrete inputs, the so-called predictors, that are extracted in the "Feature extraction" block in Figure 1 from the time histories of the following signals: current, voltage, temperature, SOC, and energy. The latter is obtained from the "Energy computation" block in Figure 1 and is defined as

$$E = \int\_{t\_0}^{t\_0 + t\_b} v(t)i(t)dt\tag{6}$$

where *t*<sup>0</sup> is the initial time of the buffer and *tb* is the time length of the processed buffer that is set equal to 120 s.

The list of the extracted predictors is state of charge variation (-) (Δ*SOC*), voltage variation (V) (Δ*V*), requested energy (Wh) (*E*), and mean temperature (◦C) (*T*).

The architecture of the classifier is illustrated in Figure 5. The training phase of the neural classifier is performed exploiting the scaled conjugate gradient (SCG) backpropagation training function [27]. This algorithm is designed to minimize the cost function including the difference between the estimated and expected outputs. This approach gives a good performance over a large number of pattern recognition problems that may include numerous parameters and guarantees a low performance degradation while reducing the training error. Additionally, this function is characterized by a relatively low computational cost and memory requirements [21], and its ability to provide well-separated classes in data mining and classification problems has been proven in many research works [34].

**Figure 4.** Battery experimental characterization for the SOH estimation. (**a**) SOH as a function of the number of discharging cycles and of the temperature. (**b**) Behavior of the SOH as a function of the voltage, capacity, and SOC. The temperature in this case is set equal to 25 ◦C.

**Figure 5.** Pattern recognition a feed-forward artificial neural network (ANN) architecture for the SOH classification. HAF: hidden activation function. OAF: output activation function. *w*: weight. *b*: bias.

The classifier is composed of one input, two hidden and one output layer. As in the case of the SOC network design, the number and size of the hidden layers is defined heuristically, by means of a trial and error procedure. Specifically, the hidden layers consist of ten neurons each, HAF is a hyperbolic tangent sigmoid, and OAF is a normalized exponential function. The performance of the training process is evaluated by means of the cross-entropy cost function, that at the end of the training process is equal to 1 <sup>×</sup> <sup>10</sup><sup>−</sup>3, after around 3000 training epochs.

#### **3. Results and Discussion**

The validation of the method is conducted in two separate phases: (a) an analysis of the performance of the SOH identifier and (b) an evaluation of the accuracy of the overall SOC estimation that includes the ageing classification.

#### *3.1. SOH Classification*

As is described above, the classification algorithm is called to identify the class of degradation only when a specific load condition is detected during the driving operations. To evaluate the effectiveness of the method, a profile corresponding to the specific charging/discharging profile was created artificially to have an exhaustive number of occurrences in the different operating conditions to test.

The profile is reported in Figure 6, where it has a duration of 5000 s and includes 42 different consecutive buffers with the time length of 120 s and a mean capacity request of 12 Ah. The profile was cycled until reaching a total duration of 50 h, to sweep the range of the SOC of the battery, corresponding to 1500 buffers of 120 s, for each class of ageing. The resulting timeseries was provided to the LUT representing the battery. This LUT was tuned after the preliminary laboratory experimental characterization and allows for extracting the predictors provided to the classifier in the five ageing conditions.

**Figure 6.** Current profile created to validate the SOH classifier. The profile is replicated until reaching the total duration of 50 h and a number of buffers of 1500 for each class of ageing.

The resulting validation dataset is therefore composed of 7500 different buffers with a time length of 120 s each. The resulting profile represents the different operating conditions at different degradation levels and is given as an input to the classifier.

The tool adopted to evaluate the accuracy of the SOH estimation is the confusion matrix reported in Figure 7. The classified and actual ageing condition instances are reported in the rows and columns, respectively. The values contained in the main diagonal cells indicate the correct classifications, whereas the off-diagonal cells report the number of the misclassifications. The overall obtained estimation accuracy is equal to 2.4%, which is equal to the number of misclassifications (178 buffers) over the total number of tested occurrences (7500 buffers). This result is aligned with the expected accuracy.


**Figure 7.** Evaluation of the SOH classification performance. Confusion matrix obtained for the ANN trained with the scaled conjugate gradient (SCG) algorithm. The cell in the grey background indicates the overall accuracy of the method.

#### *3.2. SOC Estimation*

The second part of the validation is dedicated to the evaluation of the accuracy of the SOC estimation. To this end, the profiles illustrated in Figure 8 have been adopted as validation timeseries. The subplot "a)" reports the current profile, and the subplot "b)" illustrates the behavior of the battery terminal voltage at different levels of ageing. The voltage is only an occurrence of the many possibilities that are associated to a class of degradation. The plots in the right part of the figure are zoomed-in areas with a time length of 2000 s. When providing these timeseries to the SOC estimation block (dashed box in Figure 1), the regression ANNs will provide four different outputs. The one corresponding to the correct ageing level of the battery is then selected according to the output of the SOH classifier (dotted box in Figure 1).

**Figure 8.** ANN validation datasets recorded from a real mild hybrid vehicle. (**a**) Current *i*(*t*). (**b**) Voltage *v*(*t*) at four different degradation levels corresponding to the four SOH classes.

The results obtained in the five ageing levels are illustrated in Figure 9, where for each SOH class, the estimated SOC, on the blue line, is compared with the expected value, on the red line. The expected value is the one obtained from the preliminary experimental characterization conducted in the laboratory. The estimation error is reported in the lower subplot for each case. The accuracy of the estimation is demonstrated by the error that is limited to a maximum value of 3%. The results obtained for the class of ageing going from 0% to 80% (subplot "e") demonstrate that the algorithm keeps being valid also under the threshold of 80%. The reported test has been conducted at a temperature of around 25 ◦C. A more exhaustive validation of the method should be conducted in a climatic test chamber to evaluate the accuracy of the estimation at different environmental conditions.

**Figure 9.** SOC estimation at different degradation levels. Red line: expected value. Blue line: estimation. Error indicates the difference between the estimated and expected values. (**a**): ageing class 1 (SOH: 95 ÷ 100%); (**b**): ageing class 2 (SOH: 90 ÷ 95%); (**c**): ageing class 3 (SOH: 85 ÷ 90%); (**d**): ageing class 4 (SOH: 80 ÷ 85%); (**e**): ageing class 5 (SOH: 0 ÷ 80%).

#### **4. Conclusions**

This paper presented a method for the combined estimation of the state of charge and state of health of batteries with artificial intelligence. The technique is valid at the cell, module, and pack levels and is suitable for adoption in the automotive sector in the case of hybrid and full electric vehicles. The design procedure of the algorithm and specifically the training phase of the artificial neural networks were presented. The method was demonstrated to be effective in terms of the estimation accuracy when tested on real driving cycles extracted from the acquisition on-board of an electric vehicle. The estimation error of the combined method is around 3%. The good potential and the promising results encourage the adoption of the proposed method for deployment in a vehicle battery management system for a real-time battery monitoring.

**Funding:** This research received no external funding.

**Acknowledgments:** This work was developed in the framework of the activities of the Interdepartmental Center for Automotive Research and Sustainable Mobility (CARS) of Politecnico di Torino (www.cars.polito.it).

**Conflicts of Interest:** The author declares no conflict of interest.

#### **References**


© 2020 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

### *Article* **Recursive State of Charge and State of Health Estimation Method for Lithium-Ion Batteries Based on Coulomb Counting and Open Circuit Voltage**

#### **Alejandro Gismero \*, Erik Schaltz and Daniel-Ioan Stroe**

Department of Energy Technology, Aalborg University, Pontoppidanstraede 101, 9220 Aalborg, Denmark; esc@et.aau.dk (E.S.); dis@et.aau.dk (D.-I.S.)

**\*** Correspondence: aga@et.aau.dk

Received: 12 March 2020; Accepted: 2 April 2020; Published: 9 April 2020

**Abstract:** The state of charge (SOC) and state of health (SOH) are two crucial indicators needed for a proper and safe operation of the battery. Coulomb counting is one of the most adopted and straightforward methods to calculate the SOC. Although it can be implemented for all kinds of applications, its accuracy is strongly dependent on the operation conditions. In this work, the behavior of the batteries at different current and temperature conditions is analyzed in order to adjust the charge measurement according to the battery efficiency at the specific operating conditions. The open-circuit voltage (OCV) is used to reset the SOC estimation and prevent the error accumulation. Furthermore, the SOH is estimated by evaluating the accumulated charge between two different SOC using a recursive least squares (RLS) method. The SOC and SOH estimations are verified through an extensive test in which the battery is subjected to a dynamic load profile at different temperatures.

**Keywords:** Coulomb counting; lithium-ion battery; open circuit voltage; state of charge; state of health; temperature

#### **1. Introduction**

Lithium-ion (Li-ion) batteries have prevailed over other energy storage types during the last decade due to the longer lifetime, higher efficiency and energy density [1]. This fact has driven its gradual integration in many applications from consumer electronics e.g., smartphones or power banks to renewable storage systems or electric vehicles.

However, Li-ion batteries may experience a fast degradation or even become hazardous if operated out of the limits specified by the manufacturer [2]. Therefore, a battery management system (BMS) to monitor and control the state of the battery is required. Besides keeping the battery within the operative limits, to estimate the state of charge (SOC) and the state of health (SOH) accurately is an essential function of the BMS.

Numerous methods for SOC estimation have been proposed in the literature, with diverse complexity and accuracy [3]. The coulomb counting relies on the current monitoring and calculates the net charge transferred, to estimate the SOC [4]. The relationship between the open-circuit voltage (OCV) and the SOC can also be used as an estimator if the battery is in a long-enough rest period [5]. Equivalent circuit models and extended Kalman filtering can be applied to calculate the OCV and estimate the SOC during the operation of the battery [6,7]. The accuracy of the model parameters affects the performance of the method, hence dual/joint extended Kalman filters method estimates SOC and model parameters at the same time, increasing the method performance but also its complexity [8]. The model parameters are *Energies* **2020**, *13*, 1811

easy to obtain, however, they are affected by factors such as SOC, current rate (C-rate), temperature or degradation level. The combination of these variables may affect the SOC estimation accuracy [9,10]. These methods are most widely used for online battery monitoring, however, more advanced methods are being developed proving their effectiveness under controlled environments. The complexity of the implementation in practical applications and the robustness of these methods is, however, one of the great challenges that still needs to be solved in this area. Meanwhile, Coulomb counting remains as one of the most accepted and widespread methods in the market for all types of applications.

Coulomb counting method stands out for its simplicity, however, its accuracy is compromised by the error accumulation during the incremental calculation of the transferred charge in a long time operation. Moreover, the method depends on the initial value of SOC and the actual capacity. OCV can be used in combination with coulomb counting to minimize the error and provide a reliable starting point for the estimation [11]. The capacity of the battery depends on the C-rate and the temperature, additionally, there are losses during the charging and discharging process and, to a lesser extent, due to the self-discharge. All these factors must be taken into account during the SOC estimation to improve the accuracy.

This paper presents an approach that improves the method described above providing accurate results throughout the range of temperatures and battery load. The OCV-SOC relationship at different temperatures is used for the SOC estimation during the idling periods, minimizing the cumulative error due to the integration of current. The presented method provides better precision results with a very low computational complexity, therefore representing an evolution of the classic Coulomb counting algorithm. The influence of the different operating conditions is analyzed at the beginning of life (BOL) of the battery in order to implement a correction mechanism. The SOH is evaluated with a recursive least squares method [12] and updated for a reliable SOC estimation. The method is verified through an extensive test based on a real driving pattern at different temperatures.

#### **2. Experimental**

In this work, Lithium Nickel Manganese Cobalt Oxide (NMC) batteries are used to validate the proposed method. The battery's nominal voltage is 3.6 V and the nominal capacity 3.4 Ah. The upper/lower cutoff voltage is 4.2 V/2.65 V. Figure 1 shows the set-up used to test the batteries. A thermal test chamber is used to control the temperature of the battery. The battery test system charges and discharges the cells with a predefined current profile and the host computer collects the measurements from the battery, with one second resolution.

**Figure 1.** Battery test bench.

*Energies* **2020**, *13*, 1811

The experimental procedure is shown in Figure 2. The tests were designed to age the cells simulating a real scenario of cycling at different temperatures. A series of driving cycles and characterization tests were conducted for this purpose.

To carry out the aging process the cells are distributed in three groups and subjected to successive discharge cycles according to the World Harmonized Light-duty Vehicle Test Procedure (WLTP) for class B vehicles at three different temperatures (15 ◦C, 25 ◦C and 35 ◦C). The batteries are charged to 90% SOC with 0.2C (i.e., 0.68 A) just after each driving cycle followed by a rest period before repeating the aging procedure. As shown in Figure 3 each described discharging/charging cycle takes 2 h to complete. After a week of testing equivalent to 84 driving cycles, the cells are characterized by a reference performance test (RPT). This test consists of a first full cycle at low current to stabilize the battery followed by another cycle to measure the capacity and efficiency of the cell.

The OCV-SOC relationship is measured both at beginning of life state (BOL) and after 350 full cycles, which corresponds to 6.5%, 7.35% and 7.65% capacity fade for the cells aged at 15 ◦C, 25 ◦C and 35 ◦C, respectively.

The battery is charged and discharged at a constant low rate of 0.2C until the upper and lower cutoff voltage is reached. The OCV-SOC curve is obtained by averaging the values of both, charge and discharge curves. The OCV-SOC relationship is measured at 5 different temperatures (5 ◦C, 15 ◦C, 25 ◦C, 35 ◦C and 40 ◦C).

**Figure 2.** Aging test procedure.

**Figure 3.** World Harmonized Light-duty Vehicle Test Procedure (WLTP)-based aging cycle. Current profile (red) and voltage response (blue).

#### **3. SOC Determination**

Battery capacity can be represented by different terms. The rated capacity (*Qrated*) represents the capacity that a fresh new battery is capable of delivering from a fully charged state until it is completely discharged, reaching the cut-off voltage under a determined C-rate and ambient temperature.

However, as the battery degrades, its capacity is reduced respect to the BOL condition, so the actual capacity (*Qact*) is used to describe the capacity at a determined degradation state, C-rate and temperature.

Hence the SOC can be defined as the ratio between the remaining capacity (*Qrem*) and the actual capacity, usually expressed as a percentage:

$$\text{SOC} = \frac{Q\_{rm}}{Q\_{act}}.\tag{1}$$

The charge variation between two different points in time can be calculated by integrating the current, what is commonly known as Coulomb counting:

$$q = \int\_{t\_0}^{t} I\_b dt \tag{2}$$

Thus the SOC at a determined time can be expressed as the SOC of a previous time plus the charge variation between both points in time.

$$\text{SOC}\_{l} = \text{SOC}\_{l0} + \frac{q}{Q\_{\text{act}}} \tag{3}$$

The Coulombic efficiency of the battery during the charging and discharging processes depends on the current applied and the battery temperature during operation. Lower battery temperatures lead to a maximum capacity decrease while C-rate effect would have influence mainly at low temperatures. The actual capacity is established at the reference conditions (0.2C and 25 ◦C), this causes an inaccuracy

when estimating the SOC at any other condition. A compensation factor, denoted as *c fi*,*t*, is introduced in the current integration process to normalize the SOC estimation to the reference conditions.

$$q = \int\_{t\_0}^{t} cf\_{I,T} \mathbf{l}\_b dt. \tag{4}$$

Figure 4a,b show the charge and discharge capacity at different temperature and current conditions. While temperatures above 20 ◦C have a minor influence on the measured capacity, lower temperatures produce a decrease in both charging and discharging capacity. High currents also lead to a capacity reduction, mostly at low temperatures. The compensation factor is defined as the ratio between the capacity at the reference condition and the capacity at the actual operating condition. In this work this relationship is assumed to be constant with the degradation of the battery and it is measured at BOL state. Figure 4c,d show the compensation factor values used by the proposed algorithm, the red dot represents the reference conditions (0.2C and 25 ◦C) to establish *Qact*, so that *c f*0.2*C*,25 ◦*<sup>C</sup>* = 1.

**Figure 4.** Charge and discharge capacity under different conditions (**a**) charge capacity, and (**b**) discharge capacity. Compensation factor for charging and discharging processes under different conditions (**c**) charge compensation factor, and (**d**) discharge compensation factor. The red dot represents the reference conditions (0.2C and 25 ◦C).

Once the use of Coulomb counting at different operation conditions is solved and the actual SOC can be estimated from the SOC of a previous time, the challenge is to avoid the cumulative errors produced by the incremental estimation. OCV-SOC relationship is used to set a new estimation starting point when the battery is at a rest period. Generally, a long relaxation time is required to measure the OCV [9], however, measuring it at shorter rest periods can minimize the cumulative error. Figure 5 shows the OCV curves measured at different temperatures. The five curves show the same behavior within the 0.2–0.8 SOC range, however, lower temperatures show higher voltages at the lower end of the curve and lower voltages at the higher end. The error produced by using the OCV-SOC relationship to estimate the SOC at a different temperature could be unacceptable in these SOC ranges, especially for SOC higher than 0.8. Thus is convenient to measure the OCV at different temperatures and interpolate the battery temperature to obtain the SOC.

**Figure 5.** Open-circuit voltage (OCV)-state of charge (SOC) relationship for different temperatures.

#### **4. SOH Determination**

In many applications it is of high importance to know the degradation level of the battery, as it determines the maximum capacity the battery is able to deliver. Furthermore, when the SOC estimation method is based on the capacity integration, knowledge of the actual capacity is crucial to ensure an accurate estimation.

Performing a full charge and discharge cycle at low current is the easiest and obvious method to get the actual capacity; however, this procedure is time-consuming and incompatible with the normal use of the battery and thus not suitable for online estimation in most cases.

As an alternative, it is possible to measure the partial capacity between two known SOC levels to infer the total capacity. Therefore, in this work it is proposed the use of Equation (3) taking advantage of the SOC estimated by OCV, resulting in:

$$Q\_{cst} = \frac{q}{\Delta SOC} \tag{5}$$

where,

$$
\Delta SOC = SOC\_t^{OCVupdata} - SOC\_{t\_0}^{OCVupdata}.\tag{6}$$

*Energies* **2020**, *13*, 1811

Hence, it is possible to estimate the actual capacity of the battery by measuring the transferred charge without affecting the normal operation of the battery. The accuracy of the method will depend on the magnitude of Δ*SOC* as well as on the *q* measurement error, which is influenced by operating conditions (current and temperature) and the self discharging effect.

In order to minimize the error, a recursive least squares filter is used to determine the actual capacity from previous estimations as addressed in [12]. A forgetting factor is included to give less weight to older samples.

#### **5. Proposed Algorithm and Verification**

The flow chart shown in Figure 6 describes the process for estimating the SOC and SOH of the battery. First of all, the actual values of current, voltage and temperature are collected. If the current is different from zero, the algorithm measures the accumulated charge, compensating the temperature and the current, and estimates the SOC from it. If the value of the current is zero for a minimum time of 25 min, it is then considered to be on idle state and a look-up table is used to estimate the SOC from the OCV and temperature. Hence the active periods of the battery begin and end with an OCV-based SOC estimation. If the magnitude of the SOC increment is sufficient for a capacity estimation, the SOH is updated.

**Figure 6.** Flowchart of the proposed estimation algorithm.

A verification test using the aged cells was designed to acquire experimental data at dynamic conditions. As shown in Figure 7a sequence of WLTP cycles at different SOC levels is used to verify the algorithm for SOC and SOH estimation. A total of 58 cycles were performed at different temperatures, with one hour of resting between cycles and charge periods. The voltage, current and temperature of the battery are logged with 1 Hz.

**Figure 7.** Verification test. SOC estimation comparison (top). Current profile and battery temperature (bottom).

Several times during the test, the battery is fully charged (CC-CV) to the 100% SOC, this state is used to evaluate the error of the method. Figure 8 displays the results for the three cells aged at 35 ◦C, 25 ◦C and 15 ◦C respectively. Figure 8a,c,e compare the absolute SOC error of the traditional Coulomb counting method with the proposed method, before and after updating the estimation using the OCV. The error using only Coulomb counting constantly increases with time as it is accumulated in every iteration. The use of OCV to update the estimate limits the maximum error to 5% while the compensation factor reduces it below 2.5% during the next cycle. The error after the OCV update is negligible although it could be higher in SOC areas where the OCV presents a less steeper slope.

Figure 8b,d,f display the actual capacity estimation during the verification test under different capacity starting values. Throughout the test, the four estimations converge around the same value with a maximum estimation error of 0.05 Ah for the cell aged at 25 ◦C. An insufficient rest time makes the algorithm over-valuate Δ*SOC* which results in an underestimation of the capacity. This test was limited to one hour rest time for practical reasons, however, longer relaxation periods are expected to reduce the gap in a real application.

**Figure 8.** SOC deviation measured at fully charge state (**a**) SOC deviation (35 ◦C aging), (**c**) SOC deviation (25 ◦C aging) and (**e**) SOC deviation (15 ◦C aging). Actual capacity estimation using the proposed method and different starting values (**b**) actual capacity estimation (35 ◦C aging), (**d**) actual capacity estimation (25 ◦C aging) and (**f**) actual capacity estimation (15 ◦C aging).

*Energies* **2020**, *13*, 1811

#### **6. Conclusions**

An improved coulomb counting method for estimating the SOC and SOH of Lithium-ion batteries is proposed in this work. The coulombic efficiency of charging and discharging processes of the NMC batteries used was studied for different working conditions, as well as the effect of the temperature on the OCV. The results of this analysis are the key to develop a simple but accurate estimation algorithm.

The use of the OCV-SOC relationship allows us to reset the SOC estimation more frequently and thus to reduce the accumulated error. Moreover, it provides an effective mechanism for those applications which never or rarely reach the low or high ends of the SOC range.

The relaxation period affects the estimation of the SOC and SOH. In this work the effectiveness of the proposed method was demonstrated for resting times as low as one hour, obtaining absolute errors below 3% in the SOC estimation. However, the results also reflect that the relaxation time depends on the operating conditions, requiring longer periods for lower temperatures. In future improvements of this algorithm, the use of dynamic conditions for setting the minimum relaxation time will be considered.

**Author Contributions:** Conceptualization, A.G., E.S. and D.-I.S.; methodology, A.G.; software, A.G.; validation, A.G.; formal analysis, A.G.; investigation, A.G.; resources, E.S. and D.-I.S.; data curation, A.G.; writing—original draft preparation, A.G.; writing—review and editing, E.S. and D.-I.S.; visualization, A.G.; supervision, E.S. and D.-I.S.; project administration, E.S. and D.-I.S.; funding acquisition, E.S. and D.-I.S. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by Electric Mobility Europe Call 2016 (ERA-NET COFUND) and Innovation Fund Denmark grant number 7064-00011B.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **Abbreviations**

The following abbreviations are used in this manuscript:


#### **References**


*Energies* **2020**, *13*, 1811


c 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

#### *Article*
