Impedance spectra classification for determining the state of charge on a lithium iron phosphate cell using a support vector machine

An alternative method for determining the state of charge (SOC) on lithium iron phosphate cells by impedance spectra classification is given. Methods based on the electric equivalent circuit diagram (ECD), such as the Kalman Filter, the extended Kalman Filter and the state space observer, for instance, have reached their limits for this cell chemistry. The new method resigns on the open circuit voltage curve and the parameters for the electric ECD. Impedance spectra classification is implemented by a Support Vector Machine (SVM). The classes for the SVM-algorithm are represented by all the impedance spectra that correspond to the SOC (the SOC classes) for defined temperature and aging states. A divide and conquer based search algorithm on a binary search tree makes it possible to grade measured impedances using the SVM method. Statistical analysis is used to verify the concept by grading every single impedance from each impedance spectrum corresponding to the SOC by class with different magnitudes of charged error.


Introduction
The exact determination of the state of charge (SOC) of a cell, especially of a lithium iron phosphate cell, is a challenging task in signal processing.The requirements as regards the accuracy of the determined SOC are very significant in the automotive industry to ensure that the electrochemical storage device operates in a reliably and efficiently mode.
The exact SOC in automotive applications, for hybrid as well as conventional electrical supply systems on board a vehicle, is a very important information for the energy management system (EMS).The EMS needs to know how much energy is still left in the battery, and how much energy can be charged back.This essential knowledge of the energy level in the storage device defines the whole operational strategy of the EMS.The SOC indicates critical states such as deep discharge or overcharge.These levels of extremely high or low SOC can lead to irreversible damage in the battery (Piller et al., 2001).The task of the EMS is to avoid these critical states in any case to enable a high endurance.
In this context a specific definition of the SOC is needed.The most common definition for the SOC is the ratio between the difference of the rated capacity C n and the charge balance Q b to the rated capacity C n .The SOC is 1 when state of charge FULL is reached and 0 after a net discharge of the rated capacity (Sauer et al., 1999).
This definition ignores the problem of the battery aging, as the capacity that can be delivered by a battery may change in the course of its life due to problems such as the loss of charge acceptance of the active materials on either of the electrodes, changes in the physical properties of the electrolyte or corrosion on the current conductors (Piller et al., 2001).This aging behavior is called state of health (SOH).Together the temperature behavior and the SOH have the biggest influence on the SOC.
The aim of this work is to propose a method to determine the SOC of a lithium iron phosphate cell, in an automotive application under load conditions, with a specific SOH and a defined temperature from the frequency domain data.The reference cell used for the impedance spectroscopy was in mint condition, so the SOH was approximately 100 % when the impedance spectroscopy was carried out.Some of the methods are limited in their range of functionality.The discharge test and Ah balancing for instance are not suitable solutions for an automotive on-board application.The most common time domain based methods for on-board SOC determination are equivalent circuit diagram (ECD) (see Fig. 1) based methods such as the Kalman Filter, the extended Kalman Filter and the state space observer.The mathematical basis of those methods is a state space model from the ECD (Lee et al., 2007;Codeca et al., 2008;Plett, 2004).
In this model based on the ECD, the open circuit voltage (OCV) can be calculated to correct the SOC of the state space Ampere hour integrator to compensate for untraceable capacity losses.The quality of the model's dynamic behavior is important when it comes to the accuracy of the calculated OCV.That dynamic behavior depends on the number of RCcircuits of the ECD (see Fig. 1).The RC-circuits represent several different time based chemical reactions such as diffusion or the charge carrier movement.
The ECD based methods are suitable for many different types of chemistries but they reach their limits when it comes to lithium iron phosphate chemistry.There are two main reasons for this, in particular for lithium iron phosphate cells: the extremely smooth plateau of the OCV curve in the middle SOC range (see Fig. 2) and the accuracy of the ECD.The OCV calculated from the terminal voltage highly depends on the accuracy of the ECD parameters.For that reason OCV based methods are only capable of estimating the SOC in the middle range of the OCV curve with a monadic percentage precision with very substantial effort in terms of measurement.
1mV ∼ = 1 % SOC (4) Recent theoretical work on methods in the field of machine learning, use support vector Regression or support vector machine (SVM) on time domain based data such as voltage, current and temperature to determine the SOC (Weng et al., 2013;Álvarez Antón et al., 2013;Hu et al., 2014).Another approach in this case is to use the frequency domain data to determine the SOC.The basis of this method will be provided in this paper.

Principle and methodology
The SVM is a binary classifier from the field of machine learning theory.The SVM is a support vector learning algorithm for pattern recognition, with the aim of classifying quantities with certain attributes and grade unknown samples to one of two classes.There are other methods for classification problems such as the nearest neighbor decision (NND) and its derivatives such as the k n -nearest neighbor decision and the distance-weighted k n -nearest-neighbor decision.NND-methods use euclidean metrics to evaluate the distance between the sample and its classified single-nearest neighbor or k n -nearest neighbors.An a priori assumption of the underlying statistics of the training data as for a Bayes classifier is not necessary.Therefore the big advantages of this method are the simplicity and performance.A disadvantage in this regard is the fact that, as sets of training data increase, the classification probability decreases (Cover and Hart, 1967;Dudani , 1976).Compared to the SVM method, NND-methods have higher costs in terms of memory space to store the entire volume of training data and in terms of runtime because all the training data has to be evaluated to grade a single sample.SVMs on the other hand resign on the storage of the training data.Their aim is to detect a pattern within the training data via its class-specific attributes so that the data can be intersected by a hyperplane based on support vectors and the training data can be separated without errors (Cortes and Vapnik, 1995).

Support vector machine
A binary support vector classifier such as the SVM is based on a class of linear hyperplanes, to separate a number of elements into two specific classes, based on class specifying attributes -for instance color, shape or other metadata -using a hyperplane.The hyperplane is the shortest orthogonal line connecting the convex hulls of this two classes, and intersects them half way.The optimum hyperplane has a symmetrical maximum margin to both convex hulls.The normal vector w with a threshold b defines the linear hyperplane and its margin of the two classes, so that a grading of a new unknown element x is possible.The so-called support vectors x k are specific objects of the training data.That are the elements of the convex hulls closest to the margin (see Fig. 3).The SVM is also applicable to non linear separable data, by using the so-called "Kernel Trick" to transform the data into a high-dimensional feature space where the data is linear separable.The kernel depends on several usable funktions, for instance a polynomial or a radial basis function, to evaluate the hyperplane that separates the data in the feature space.A suitable kernel function has to be chosen specifically for the training data.
The training data is required as the basis for the classification, where every element x i of a quantity is affiliated to one class by its class label y i .
(x 1 , y 1 ), . .., (x l , y l ) The class label is defined by ±1, so that all elements of one class are labeled by +1, and all elements of the other class are labeled by −1.Based on this information in a first step the SVM classification function, based on a linear kernel, is capable of evaluating the optimal hyperplane to separate the two classes.
The corresponding SVM decision function for linear separable data leads in a second step to a grading of an new unknown element x to one of the classes with the return of its affiliation

{±1}.
In case of non linear separable data the normal vector w is a representation of a linear combination of support vectors x k from the training data, the corresponding class labels y k and the lagrange multipliers v k (Hearst et al., 1998).
As this efficient learning algorithm has simple correspondence to a linear method in a high-dimensional feature space  that is non-linearly related to its input space, it is straightforward to analyze it mathematically.We are dealing here with a classification algorithm, where a superset of elements is separated into two power sets or classes where single new elements are graded to one of those classes.A SVM is only capable of a single binary decision regarding whether the applicable element belongs to one power set or the other.

Impedance spectra classification
Determining the SOC via impedance spectra classification using SVM is an alternative method to achieve this aim.This method resigns an electric ECD with components such as the OCV curve and the element parameters of the electric network.
The task of determining the SOC of a lithium iron phosphate cell can be achieved with an optimal classifier such as the SVM by grading measured impedances to a certain class.The classes for the SVM are represented by all the impedance spectra for different SOC levels, corresponding to defined temperature and aging states, generated by an impedance spectroskopy, are the foundation of this classification method (see Fig. 4).The data of those spectra represents the training data of the SVM classification function -based on a polynomial kernel function -that is used to calculate the hyperplanes that separate all impedance spectra to their nearest neighbors.As noted above, the SVM is only capable of a binary decision, therefore with more than two classes a separation of every impedance spectra to its nearest neighbor has to be realized by a hyperplane via SVM.So n classes will yield to n − 1 hyperplanes to be evaluated by the SVM to separate all spectra from each other.
The SVM decision function can only make binary decisions so that all the SVM decisions have to be rated and contextualized.The most efficient way to do so is to create a graph to arrange the hyperplanes.The whole quantity of the impedance spectra elements or the superset, the root of the graph, is separated by the median of the hyperplanes repre- sented by their specific linear combinations, of lagrange multipliers v k,med , corresponding class labels y k and the support vectors x k,med of the represented SOC class The two new nodes of the graph represent the two roughly equal power sets of the above superset.The separation of the generated power sets can be repeated recursively down to the power set elements representing a single impedance spectrum or SOC class {c i }.The resulting graph corresponds to a binary search tree, where the root is the whole superset of all elements from the impedance spectra with the nodes as a power set of its parent superset and the leaves representing the single SOC classes (see Fig. 5).
This binary search tree can easily be parsed by a binary tree search algorithm where the edges of the graph represent the binary decisions of the SVM decision function.So a binary tree search algorithm such as the divide and conquer search algorithm, applied to the afore mentioned binary search tree, makes it possible to grade measured impedances Z i using the SVM decision function, where d indecates the degree of the used polynomial kernel function.

Impedance grading
The SOC of the cell can now be determined by grading at least one on-vehicle measured impedance Z from the cell under load conditions.The impedance spectra of the relevant defined SOC levels therefore have to be classified, as described above.The measured impedance now has to be graded to a single SOC class -SOC specific impedance spectrum -to determine the SOC of the cell.The binary decision of the SVM decision function can only prove for two classes to which class, separated by the hyperplane, the measured impedance belongs (see Fig. 6).By using a divide and conquer search algorithm on the binary search tree with the SVM decision function as a key criterion, the SOC can be determined by multiple binary decisions along the search tree.This divide and conquer algorithm starts at the median hyperplane of all separated impedance curves, that separates this superset into two roughly equal power sets.The binary decision, of the SVM decision function, whether the measured impedance belongs to the power set on one side of the hyperplane or the other decreases the quantity of relevant SVM decisions by half.The remaining power set after the decision containing the measured impedance will therefore also be divided by its median hyperplane into two subsidiary power sets.By continuing this recursive structure the SVM decisions on the binary search tree ultimately grade the measured impedance to a single dedicated SOC class.This class represents the SOC of the cell for the measured impedance.This implementation of this binary SVM based tree search algorithm makes an optimal execution time of O(logn) for the grading of one measured impedance possible.

Statistical Verification
Trials with measured impedance spectra have demonstrated that the new concept for grading impedances using SVM is effective for determining the SOC.After classifying the impedance spectra with the SVM classification function, an error , in both directions ( and ), consisting of normally distributed random noise X (ω) ∼ N µ, σ 2 charged with different magnitudes m, where ω is a random value, the mean value of µ = 0 and the variance of σ 2 = 1, where added to each impedance of a impedance spectrum.These error charged impedance objects are the specification for the SOC determination algorithm, to clarify that they would be graded correctly to their origin impedance spectrum.
The classification rate of this trial is highly dependent on two different factors.The first important factor is the polynomial degree of the kernel, which defines the separation accuracy of the hyperplanes between the impedance spectra.Another important aspect is the magnitude of the charged error of the original impedances of the spectra.
A linear representation of the hyperplanes is highly inefficient, because of the very low classification rates (see Fig. 7).The optimal polynomial degree would be around 5-8 as a trade-off between accuracy and execution time.Another feature is the high tolerance to the variance of error.The binary SVM based tree search algorithm is capable of grading impedances charged with a variance of error up to 10 %, with an accuracy of 60 %, for a single impedance.The statistical accuracy with 30 graded impedance objects of one SOC class rises up to 80 %.A classification rate of 90 % can then be achieved by decreasing the variance of error below 1 % (see Fig. 8).
Statistical evaluation demonstrates that the concept of a binary SVM based tree search is capable of determining the SOC of a lithium iron phosphate cell in the middle SOC range.

Conclusions and future work
The binary SVM based tree search approach is a new method for determining the SOC of a lithium iron phosphate cell in the middle SOC range.The trial data demonstrated that, that the SOC can be determined with a certainty of 60 % for one measured impedance, and a maximum error variance of 10 %.The accuracy of the classification rate can increase to 90 % depending on two factors, the variance of error of the measured impedance and the polynomial degree of the hyperplane function.Therefore the requirements for a on-board impedance spectrum measurement can be circumvented.For an in-vehicle application, it is important to be able to identify different impedances at certain frequencies.To calculate impedances for several frequencies out of the time domain by a Fast Fourier Transformation, would be one method for this application (Klotz et al., 2011).Taking the results of the impedance grading method into account, it is possible to identify the requirements for the impedance calculation.
Future topics for research in this regard are the analysis of impedances from time domain data for classification purposes to determine the on-board SOC and the comparison with other methods such as the ECD based Kalman Filter or the state space observer, NND and its derivatives and artificial neuronal networks for SOC determination to identify the advantages and disadvantages of the different methods to combine them into a hybrid SOC determination algorithm.It will also be important to incorporate aging detection to update the hyperplanes in an enhanced machine learning method based on the above binary SVM search tree algorithm.Updating the hyperplanes will ensure that the SOC is correctly determined as the cell ages over its lifetime.

P.
Jansen et al.: SOC determination using a support vector machine 2 Methods for determining the state of chargeThe following are existing methods for determining the SOC independent of the battery type:

Figure 7 .
Figure 7. Statistic analysis of positive classification rates for single impedances depending on polynomial degree and impedance error.

Figure 8 .
Figure 8. Statistic analysis of positive classification rates for the SOC determination.