A Novel Data-Driven Estimation Method for State-of-Charge Estimation of Li-Ion Batteries

: With the increasing proportion of Li-ion batteries in energy structures, studies on the estimation of the state of charge (SOC) of Li-ion batteries, which can effectively ensure the safety and stability of Li-ion batteries, have gained much attention. In this paper, a new data-driven method named the probabilistic threshold compensation fuzzy neural network (PTCFNN) is proposed to estimate the SOC of Li-ion batteries. Compared with other traditional methods that need to build complex battery models, the PTCFNN only needs data learning to obtain nonlinear mapping relationships inside Li-ion batteries. In order to avoid the local optimal value problem of traditional BP neural networks and the ﬁxed reasoning mechanism of traditional fuzzy neural networks, the PTCFNN combines the advantages of a probabilistic fuzzy neural network and a compensation fuzzy neural network so as to improve the learning convergence speed and optimize the fuzzy reasoning mechanism. Finally, in order to verify the estimation performance of the PTCFNN, a 18650-20R Li-ion battery was used to carry out the estimation test. The results show that the mean absolute error and mean square error are very small under the conditions of a low-current test and dynamic-current test, and the overall estimation error is less than 1%, which further indicates that this method has good estimation ability.


Introduction
With the increasingly serious problems of environmental pollution and energy shortage, related researchers all over the world are paying more and more attention to sustainable development [1][2][3]. Therefore, the existing energy structure is bound to change, and the proportion of clean energy in the energy structure will become higher and higher. A Li-ion battery is a typical application of clean energy because of its high energy density, small size, and good stability [4,5]. Especially in recent years, Li-ion batteries have been widely used in electric vehicles, various consumer electronics, microgrids and other fields [6][7][8]. State of charge (SOC) represents the remaining power of the battery, which can be defined as the ratio between the remaining capacity of the battery and the maximum capacity of the battery, and the SOC is an important basis for the safety control of the battery. In order to improve the safety performance and prolong the service life of a Li-ion battery, it is very important to estimate the SOC accurately.
At present, scholars have proposed various methods for the SOC estimation of Li-ion batteries, which can be summarized into two categories: the battery physical model prediction estimation method and data-driven estimation method [9][10][11][12][13]. Common methods of the former include ampere-hour integration and open-circuit voltage (OCV) [9,10]. The ampere-hour integral method is simple to calculate, and it only needs to integrate the current in the charging and discharging process of the Li-ion battery over time, so as to (a) The PTCFNN inherits the universal approximation property of the neural network and can obtain nonlinear mapping relations through data learning. (b) The PTCFNN inherits the advantages of a PFNN. By calculating and transmitting the input probability information, the ability of the PTCFNN to deal with uncertain disturbances is improved, and the problem of the local optimal solution of the BP neural network is avoided. (c) The PTCFNN contains a threshold design, so that only important network information is retained and useless network information is eliminated. (d) The PTCFNN adds a fuzzy compensation strategy. The fuzzy reasoning mechanism of the PTCFNN is optimized by introducing an extra degree of freedom.
The rest of this paper is arranged as follows: In Section 2, the overall strategy for the SOC estimation is introduced. In Section 3, the network structure of the PTCFNN is introduced in detail. In Section 4, the specific learning process and learning strategy of the SOC estimation based on the PTCFNN are introduced. In Section 5, simulation examples are designed to verify the effectiveness of the PTCFNN. In the last section, Section 6, a conclusion of the research in this paper is made.

Estimation Scheme of State of Charge
The SOC of Li-ion batteries refers to the remaining capacity of the battery, usually defined as (1) [5,13], and the SOC is a physical quantity that cannot be measured directly and only can be estimated by various measurable physical quantities (e.g., current, voltage, temperature, etc.) under the working state of Li-ion batteries. A number of model-based approaches have been proposed for this purpose, and a common RC equivalent circuit diagram of Li-ion batteries is shown in Figure 1, where V 0 represents terminal voltage, V 1 represents open circuit voltage, V 2 represents polarization voltage, R 1 represents equivalent resistance, R 2 represents diffusion resistance, C 2 represents capacitance, I represents loop current, and ∆d represents total disturbance [9][10][11]14].
where Q c is current capacity, and Q max is maximum capacity. However, it is not a simple problem to estimate the SOC through the equivalen model in Figure 1, because it is often necessary to set up several differential equations an consider the problem of unknown perturbation [25]. From the mathematical point of view the SOC and these observable physical quantities are a multivariate nonlinear functio relationship. In order to accurately obtain the nonlinear mapping relationship betwee these measurable physical quantities and the SOC, and avoid the establishment o additional complex physical and chemical models, this paper proposes a probabilisti threshold compensation fuzzy neural network, and the overall idea is shown in Figure 2 It should be noted that the PTCFNN is a data-driven method for the SOC estimation o lithium-ion batteries, and the nonlinear relationship inside the battery is learned throug a large number of sample data.  Figure 2, the PTCFNN module represents the SOC estimator that ha been learned, each measurable physical quantity is taken as the input of the PTCFNN, an the estimated value of the SOC is finally obtained through the nonlinear processing insid the PTCFNN. <!--MathType@Translator@5@5@MathML2 (no namespace).tdl@MathM 2.0 (no namespace)@ --> However, it is not a simple problem to estimate the SOC through the equivalent model in Figure 1, because it is often necessary to set up several differential equations and consider the problem of unknown perturbation [25]. From the mathematical point of view, the SOC and these observable physical quantities are a multivariate nonlinear function relationship. In order to accurately obtain the nonlinear mapping relationship between these measurable physical quantities and the SOC, and avoid the establishment of additional complex physical and chemical models, this paper proposes a probabilistic threshold compensation fuzzy neural network, and the overall idea is shown in Figure 2. It should be noted that the PTCFNN is a data-driven method for the SOC estimation of lithium-ion batteries, and the nonlinear relationship inside the battery is learned through a large number of sample data. However, it is not a simple problem to estimate the SOC through t model in Figure 1, because it is often necessary to set up several differential consider the problem of unknown perturbation [25]. From the mathematical the SOC and these observable physical quantities are a multivariate nonl relationship. In order to accurately obtain the nonlinear mapping relation these measurable physical quantities and the SOC, and avoid the est additional complex physical and chemical models, this paper proposes a threshold compensation fuzzy neural network, and the overall idea is show It should be noted that the PTCFNN is a data-driven method for the SOC lithium-ion batteries, and the nonlinear relationship inside the battery is le a large number of sample data.  Figure 2, the PTCFNN module represents the SOC estim been learned, each measurable physical quantity is taken as the input of the the estimated value of the SOC is finally obtained through the nonlinear pro the PTCFNN. <!--MathType@Translator@5@5@MathML2 (no namespace  As shown in Figure 2, the PTCFNN module represents the SOC estimator that has been learned, each measurable physical quantity is taken as the input of the PTCFNN, and the estimated value of the SOC is finally obtained through the nonlinear processing inside the PTCFNN. X k , (k = 1, 2, · · · , m) represents the kth measurable physical quantity, SÔC represents an estimate of the SOC obtained by the PTCFNN. The specific structure and data learning strategy of the PTCFNN will be introduced in the following two parts.

Probabilistic Threshold Compensation Fuzzy Neural Network (PTCFNN)
As the potential of neural networks to deal with nonlinear mapping has been developed, scholars have successfully applied neural networks to SOC estimation [12,13]. In this section, a probabilistic threshold compensation fuzzy neural network is introduced in detail. As shown in Figure 3, the PTCFNN has a total of eight layers of network structure, and each layer structure will be introduced in detail below. As shown in Figure 2, the PTCFNN module represents the SOC estimator that has been learned, each measurable physical quantity is taken as the input of the PTCFNN, and the estimated value of the SOC is finally obtained through the nonlinear processing inside the PTCFNN. represents an estimate of the SOC obtained by the PTCFNN. The specific structure and data learning strategy of the PTCFNN will be introduced in the following two parts.

Probabilistic Threshold Compensation Fuzzy Neural Network (PTCFNN)
As the potential of neural networks to deal with nonlinear mapping has been developed, scholars have successfully applied neural networks to SOC estimation [12,13]. In this section, a probabilistic threshold compensation fuzzy neural network is introduced in detail. As shown in Figure 3, the PTCFNN has a total of eight layers of network structure, and each layer structure will be introduced in detail below. This layer has m network nodes, which are used to transmit m measurable physical quantities. The specific input and output are defined as follows: x is the kth input of this layer, and 1 k f is the kth output of this layer.
2. Normalization layer. This layer has m network nodes, which are used to transmit m measurable physical quantities. The specific input and output are defined as follows: where x 1 k is the kth input of this layer, and f 1 k is the kth output of this layer. 2.
Normalization layer. In order to eliminate the adverse effects caused by singular sample data and improve the learning speed of the network, the normalization layer is introduced here, and its calculation method is as follows: where x 2 k is the kth input of this layer, f 2 k is the k-th output of this layer, and x 1 kmax and x 1 kmin are the maximum and minimum values of the kth measurable physical quantity, respectively.
The probabilistic layer adopts a Gaussian radial basis function, and n classification nodes are designed artificially according to actual problems, and the input and output of each node are given by (6) and (7), respectively [16]. The purpose of introducing this layer is to make training easy and avoid the local minimum problem of a BP neural network.
where c 3 kj and b 3 kj are, respectively, the center and width of the jth classification node corresponding to the kth normalized input. It should be pointed out that the input probability information calculated through (7) will be transmitted to the following layers.
Nodes in the threshold layer correspond to the nodes in the probability layer one by one. By setting the pass threshold, relatively important probability information can be retained, and the influence of secondary information can be reduced. The design idea is as follows: where th is the preset threshold.
In order to understand the influence of different inputs on the final output, a fuzzy rule is formulated as follows: the weighted sum of the outputs of a group of threshold layer is taken as the output of a node of fuzzy rule layer.
where w 4 kj is the output weight of kj node with threshold layer label, and wi 4 kj is the parameter of w 4 kj . It is important to note that the output weight w 4 kj must be positive and the previous probability information has to be summed up, otherwise it will cause errors in the later compensation layer. Compensation layer The compensation layer introduces a group of free variables to the network, the fuzzy reasoning mechanism is optimized, and the network performance is better than that of common FNNs. The fuzzy compensation strategy is given by (14), and the design of each node is as follows: where c j is the free variable named compensation degree, and ci j is the parameter of c j , which is strictly limited from 0 to 1 [18].
The output layer has only one output node, which is the predictive output of the SOC estimation, which is obtained by the following formula: where w 7 j is the output weight of the jth node in the compensation layer. It is worth noting that in order to accelerate the learning convergence speed of the PTCFNN, a normalized operation is applied to both the input and output of learning samples. Therefore, the SOC estimation results currently are normalized results, which need to be de-normalized at the next layer.

8.
Virtual layer The core structure of the PTCFNN is the first seven layers, and the existence significance of the virtual layer is only used for data processing to obtain the estimated value of the SOC. The calculation formula is given as follows: where Q min is the minimum Li-ion battery capacity of learning samples. The above is the introduction of the specific structure of the PTCFNN, and the strategy for the SOC estimation of the PTCFNN will be put forward in the next section.

SOC Estimation Based on the PTCFNN
In practical Li-ion battery applications, it is often difficult to establish an accurate battery model. The PTCFNN can overcome this shortcoming by building a nonlinear mapping model of measurable data characteristics and the SOC through a large amount of data learning, which is shown in Figure 2. The specific training process is shown in Figure 4 and can be summarized as follows: of data learning, which is shown in Figure 2. The specific training process is shown in Figure 4 and can be summarized as follows:
Step 3: Parameter adjustment Step 4: Complete sample cycle training.
Step Step 1: Initialize necessary network parameters, including , m, n and pre.
where pre is the training indicator, and the sum of absolute errors (SAE) is adopted in this paper; N is the number of training samples; S O C i is the reference output value of sample i; and Ŝ OC i is the estimated output value of sample i.
Step 2: Perform the SOC estimation. The SOC of sample i will be estimated by the PTCFNN proposed in the previous section.
Step 3: Parameter adjustment. The loss function was defined as (21), and parameters were adjusted by the gradient descent method.
It is worth noting here that only two groups of important parameters   Step 1: Initialize necessary network parameters, including where pre is the training indicator, and the sum of absolute errors (SAE) is adopted in this paper; N is the number of training samples; SOC i is the reference output value of sample i; and SÔC i is the estimated output value of sample i.
Step 2: Perform the SOC estimation. The SOC of sample i will be estimated by the PTCFNN proposed in the previous section.
Step 3: Parameter adjustment. The loss function was defined as (21), and parameters were adjusted by the gradient descent method.
It is worth noting here that only two groups of important parameters wi 4 kj and w 7 j are adjusted in this paper, and detailed adjustment formulas are given.
where η wi 4 ∈ (0, 1) and η w 7 ∈ (0, 1) are the learning rate, and e is the SOC estimation error of the ith sample Considering the influence of last weight variation, momentum factor α is introduced, and the final weight is as follows: where α 4 kj and α 7 j are momentum factors; wi 4 kj (k + 1) is the next wi 4 kj , wi 4 kj (k) is the current wi 4 kj , and wi 4 kj (k − 1) is the last wi 4 kj ; wi 7 j (k + 1) is the next wi 7 j , wi 7 j (k) is the current wi 7 j , and wi 7 j (k − 1) is the last wi 7 j .
Step 4: Judge whether a sample cycle training has been completed. If the sample number is N, go to the next step; otherwise, return to Step 2.
Step 5: Judge whether the current PTCFNN meets the set training indicator pre. If the current SAE is less than pre, the training ends; otherwise return to Step 2. If the PTCFNN model can be learned through the above steps, it can be applied to the SOC estimation of Li-ion batteries. In the next part, the PTCFNN model learned will be applied to SOC estimation.

Simulation Results
In order to verify the feasibility of the PTCFNN in SOC estimations, the 18650-20R Li-ion batteries were selected as test samples, and their specific parameters are listed in Table 1. This section carries out two tests, namely a low-current test and dynamic-current test. It is worth noting that the learning data and test data came from the public battery data of the CALCE Battery Research Group [26], which were obtained when the temperature was constant. Therefore, the data at 0 • C were selected for testing in this paper. Detailed procedures for the two tests mentioned above are described below.

Low-Current Test
The low-current test consists of charging and discharging processes, and the mean absolute error (MAE) and root mean square error (RMSE) are introduced as reference indexes.
During the charging process, the fully discharged battery was charged at a stable current of 0.1 A, and the estimated SOC from 0 to 0.8 was observed and recorded. Figures 5 and 6, respectively, show the result of the SOC estimation and the relative error of the SOC estimation in the process of low-current charging. It can be seen that the overall estimation result is very good, and the relative error is stable within 1%. Figures 7 and 8, respectively, show the current and voltage in the charging process. It can be seen that the During the discharge process, the discharge test was also carried out with a steady current of 0.1 A, and the estimated results of the SOC from 0.8 to 0.1 were observed and recorded. Figure 9 and Figure 10, respectively, show the result of the SOC estimation and the relative error of the SOC estimation in the process of low-current discharging. It can be seen that the overall estimation result is excellent, and the relative error is stable within 1%. Figures 11 and 12, respectively, show the current and voltage in the discharging process. It can be seen that the current is mostly stable at −0.1 A and the voltage shows a nonlinear decreasing trend. The MAE and RMSE of the test procedure were 0.0037and 0.0047, respectively.     During the discharge process, the discharge test was also carried out with a steady current of 0.1 A, and the estimated results of the SOC from 0.8 to 0.1 were observed and recorded. Figures 9 and 10, respectively, show the result of the SOC estimation and the relative error of the SOC estimation in the process of low-current discharging. It can be seen that the overall estimation result is excellent, and the relative error is stable within 1%. Figures 11 and 12, respectively, show the current and voltage in the discharging process. It can be seen that the current is mostly stable at −0.1 A and the voltage shows a nonlinear decreasing trend. The MAE and RMSE of the test procedure were 0.0037and 0.0047, respectively.       The above test results show that the PTCFNN can perform the SOC estimation well in the process of stable low-current charge and discharge

Dynamic-Current Test
Although the PTCFNN can perform SOC estimation well in the charging and discharging process of constant low current, the current is not constant in the actual The above test results show that the PTCFNN can perform the SOC estimation well in the process of stable low-current charge and discharge.

Dynamic-Current Test
Although the PTCFNN can perform SOC estimation well in the charging and discharging process of constant low current, the current is not constant in the actual battery charging and discharging process. For example, a new electric vehicle with a constant speed needs to provide a little more current when going uphill than when going downhill. To solve this problem, dynamic-current testing is performed in this section to observe and record the ability of the PTCFNN to estimate the SOC under dynamic current. The specific test process is to charge and discharge a lithium-ion battery with an SOC of 0.8 through dynamic current, and finally reduce its SOC to 0.1. Meanwhile, the SOC estimation result of a PFNN is compared with that of the PTCFNN. Figure 13 shows the SOC estimation results of the FNN, PFNN and PTCFNN. It can be seen from the figure that these three methods can estimate the SOC of Li-ion batteries well. Figure 14 shows the relative estimation error of the FNN, PFNN and PTCFNN. It can be seen from the figure that the estimation error of the PTCFNN is less than 1%, while that of the PFNN is less than 3% and that of the PFNN is less than 10%. Therefore, by optimizing the inference mechanism, the estimation model using the proposed PTCFNN is ultimately more accurate. Figures 15 and 16 show the current and voltage in the test process, respectively. It can be seen that both the current and voltage are changing dynamically. The MAE and RMSE of the FNN, PFNN and PTCFNN are listed during dynamic-current testing in Table 2, in which the SOC estimation performance of the PTCFNN is better than that of the FNN and PFNN.

Robustness Test
In order to verify the robustness of the PTCFNN, a 2% random relative error is added to the current measurement and voltage measurement, and the simulation results are shown in Figures 17-20. As can be seen from the simulation results, even when there are measurement errors, although a small part of the SOC estimation results have a deviation of more than 5%, the overall estimation error of the PTCFNN is less than 1%. The corresponding MAE and RMSE are 0.002 and 0.0032, respectively. Compared with the results without a measurement error, each indicator of the SOC estimation is not significantly damaged, so it can be considered that the proposed PTCFNN has good robustness.

Robustness Test
In order to verify the robustness of the PTCFNN, a 2% random relative error is added to the current measurement and voltage measurement, and the simulation results are shown in Figures 17-20. As can be seen from the simulation results, even when there are measurement errors, although a small part of the SOC estimation results have a deviation of more than 5%, the overall estimation error of the PTCFNN is less than 1%. The corresponding MAE and RMSE are 0.002 and 0.0032, respectively. Compared with the results without a measurement error, each indicator of the SOC estimation is not significantly damaged, so it can be considered that the proposed PTCFNN has good robustness. measurement errors, although a small part of the SOC estimation results have a deviat of more than 5%, the overall estimation error of the PTCFNN is less than 1%. T corresponding MAE and RMSE are 0.002 and 0.0032, respectively. Compared with results without a measurement error, each indicator of the SOC estimation is significantly damaged, so it can be considered that the proposed PTCFNN has go robustness.

Remark 1.
The initial parameter design of the PTCFNN is very important, and the initial parameters selected in this paper are as follows: The center c 3 kj of each node in the probability layer is n-section point from 0 to 1, the corresponding width b 3 kj is 1/n, and n = 100. The threshold is designed as th = 0.001, ci j is designed as 0.5, w 4 kj and w 7 j are random numbers from 0 to 1, and other weights are set as 1. The parameters used for network adjustment are designed as η wi 4 = 0.01, η w 7 = 0.01, α 4 kj = 0.001 and α 7 j = 0.001. It is worth explaining that the above parameters are obtained through trial and error, and unreasonable parameter design will lead to learning failure. Generally speaking, the center of probability layer should cover the entire input space, and the corresponding width should not be more than half of the distance between adjacent centers. The degree of compensation is determined by the number of inputs and is designed to be 1 /2 m.

Remark 2.
The data-driven method is a popular research direction of nonlinear estimation at present [12][13][14][15][16]. The proposed PTCFNN is a newly data-driven SOC estimation method. The nonlinear relationship between input and output is extracted through network training, and then used for the SOC estimation of the Li-ion battery. Experimental results show that the PTCFNN has a good performance in the SOC estimation. However, the parameter selection of the PTCFNN relies heavily on empirical knowledge. In the future, self-organizing fuzzy neural network with full adjustment of the structure and parameters can be considered to optimize the PTCFNN for reducing its dependence on empirical knowledge.

Remark 3.
When the SOC is more than 80%, the charge loss of the Li-ion battery is very high. Similarly, the Li-ion battery can over-discharge when the SOC is less than 10%. In order to ensure the efficient use of the Li-ion battery, the charge and discharge process of the Li-ion battery is often studied when the SOC is between 20% and 80%. Considering the above reason, research on SOC estimations in a certain range has become a mainstream direction [27][28][29][30][31]. Therefore, this paper studies the charge-discharge process of the SOC at 10% to 80%.

Conclusions
In this paper, a probabilistic threshold compensation fuzzy neural network is proposed to estimate the state of charge of Li-ion batteries. The PTCFNN is essentially a data-driven method. On the one hand, by introducing a PFNN structure, the PTCFNN can avoid the local minimum problem of a BP neural network and accelerate the convergence speed. On the other hand, by introducing a CFNN structure, the PTCFNN makes up for the deficiency of a traditional fuzzy neural network, optimizes the fuzzy reasoning mechanism, and greatly improves the success rate of learning. Finally, the PTCFNN is applied to estimate the state of charge of a 18650-20R Li-ion battery. The test results show that the SOC Energies 2022, 15, 3115 16 of 17 estimation effect is very good in a low current and dynamic current. At present, the SOC estimation studied in this paper is carried out under a constant temperature. In the future, we will further study the SOC estimation under the scenario of temperature change and Li-ion battery aging. To handle different practical conditions (e.g., variable temperature, noise, and aging cycle), transfer learning can be a good choice, such that the mechanism combining PTCFNN with transfer learning will be exploited in future.