State-of-charge Estimation for Lithium-ion Batteries Using a Kalman Filter Based on Local Linearization

State of charge (SOC) estimation is of great significance for the safe operation of lithium-ion battery (LIB) packs. Improving the accuracy of SOC estimation results and reducing the algorithm complexity are important for the state estimation. In this paper, a zeroaxial straight line, whose slope changes along with SOC, is used to map the predictive SOC to the predictive open circuit voltage (OCV), and thus only one parameter is used to linearize the SOC-OCV curve near the present working point. An equivalent circuit model is used to simulate the dynamic behavior of a LIB, updating the linearization parameter in the measurement equation according to the present value of the state variables, and then a standard Kalman filter is used to estimate the SOC based on the local linearization. This estimation method makes the output equation of the nonlinear battery model contain only one parameter related to its dynamic variables. This is beneficial to simplify the algorithm structure and to reduce the computation cost. The linearization method do not essentially lose the main information of the dynamic model, and its effectiveness is verified experimentally. Fully and a partially charged battery experiments indicate that the estimation error of SOC is better than 0.5%.


Introduction
State of charge estimation is of great significance for the safe operation of a lithium-ion battery (LIB) pack.The efficiency and accuracy of the algorithm are two important indicators of its performance.The optimal estimation algorithm, represented by a Kalman filter, represents an obvious progress in terms of the LIB state estimation [1,2].The Kalman filter is suitable for linear systems, unfortunately LIBs show obvious nonlinear dynamic characteristics [2].For example, the SOC-OCV characteristics of a LIB have obvious nonlinearity [3][4][5]; some important parameters in the equivalent model, such as polarization resistance, capacitance, show some time-varying characteristics because of the changing working conditions [6].The Extended Kalman filter (EKF) [7][8][9][10], unscented Kalman filter (UKF) [5,11], which are algorithms developed based on the Kalman filter, better solve the state estimation problems for the nonlinear LIB [12], and can also obtain ideal estimation results.In order to further improve the accuracy of the LIB state estimation, some related technologies, such as observer theory [13][14][15], adaptive algorithms [16,17], bio-inspired algorithms [1,18] have been combined with the Kalman filter algorithm and obtained the expected effects.Furthermore, equivalent model parameter online identification algorithms [14,19] and LIB online state estimation algorithms, which aim to simplify the system structure and improve system operation efficiency, have been widely studied [20], and have also resulted in obvious progress on the basis of a number of studies.
The performance of a Kalman filter (including its derivative algorithm) depends on an accurate system model.There are many kinds of typical battery model, for example, the physics-based models, data-driven models, and equivalent circuit models.Among them equivalent circuit models [2,21,22] have the advantages of a simple structure and a clear physical concept.Considering the model precision and the complexity of the system, the first order and the second order equivalent circuit model have been widely used in the field of LIB state estimation based on the Kalman filter [1,23].
It is well known that OCV can accurately reflect SOC.In theory, if OCV could be observed accurately, it should be possible to very accurately estimate the SOC, but unfortunately, many factors may influence the OCV estimation results.If relying entirely on OCV to estimate the SOC, there would be too much model error in the SOC estimate results.Another kind of classical method is the Coulomb integral method (AH integral method).When there is an accurate integral initial value and the measured current value does not display a large deviation, this method is very accurate and easy to implement and it has an obvious advantage.By using a Kalman filter, the SOC estimation precision should be improved effectively if these two methods could be integrated using the following methods: (1) considering the OCV not as a state variable existing in dynamic equations but as an intermediate quantity existing in a measurement equation; therefore, a reasonably big measurement noise (covariance) can be chosen to make the filter not trust OCV excessively.This can appropriately weaken the function of the OCV, and make the OCV update the SOC slowly during the course of filtering.This helps reduce SOC prediction errors arising from short-term OCV observation errors.(2) Using the Coulomb integral equation (CIE) in the dynamic equations, and using the SOC as one of the state variables, thus, by the use of a smaller system noise (covariance), the filter partially uses the incremental SOC prediction produced by the CIE, and it also partially uses the OCV at the same time.By the use of OCV, it reduces SOC prediction errors that come from the accumulation of CIE errors.
The above two points have also more or less been used as the modeling methods in some literature.Still there is a problem, the obvious nonlinear of the SOC-OCV curve makes the model construction very difficult.Therefore, represented by the EKF method, complex methods are developing.Adopting these complex algorithms, the nonlinear problems are partially solved, and the problems of time varying parameters are also solved.However, along with the increasing computation cost it also increases the difficulty of system analysis and design.
In this paper, the SOC-OCV curve is linearized near the current working point, under the premise that the trend of the impact of CIE on the OCV estimation value is not lost.This linearization method maps the predictive SOC to the predictive OCV using a zeroaxial straight line, which has only one parameter related to the state variable.Then the SOC estimation model based on a standard Kalman filter is obtained.Both the CIE and the transient voltage equations are adopted to construct the filter system used for SOC estimation.Fully and a partially charged battery experiments are carried out to verify the validity of this method.

System Modeling
SOC is commonly defined as "the percentage of the maximum possible charge that is present inside a rechargeable battery" [24].For a LIB, during the discharge process its SOC can be defined as follows: where SOC 0 is the initial value of SOC, and SOCt is the present value of SOC.C is the total capacity of the battery.0 t idt  is the integral of discharge current during the discharge process.
Abundant research shows that there is an obvious correlation between the OCV and the SOC in a LIB.This relationship has nothing to do with the equivalent model.Using the method given in [25], eight LIBs connected in series are tested.After two full charge and discharge cycles, these batteries are fully charged and then fully discharged with C/10 current.The SOC values of each time point are calculated referencing Equation (1).Then two curves are obtained, the charge curve and the discharge curve.Calculating the average of the two curves, then the SOC-OCV relationship can be obtained, as shown in Figure 1.

Equivalent Circuit Model
The Dual Polarization (DP) model is adopted, which is a second order equivalent model as shown in Figure 2.
From Equations ( 1) and ( 2), the state-space equation of DP model can be written as: where According to the circuit shown in Figure 2, the output equation of the DP model is: Considering system noise and observation noise, From Equations ( 3) and (4) we can get the discrete state space equations: where (1 ) , k w is process noise, and k v is measurement noise.

Method
As shown in Figure 1, OCV and SOC have an obviously nonlinear relationship.A function of SOC-OCV [14] can be represented as: where  is the slope of the data point on the SOC-OCV curve.For different SOC values, the values of  and u b change accordingly.That is to say, u b in Equation ( 6) has a correlation with SOC, which is one of the state variables of dynamic equation.u b and SOC does not conform to a linear relationship.This leads to the difficulty in defining the system output matrix.
In Equation ( 6), bu is not a constant, then both of the two coefficients λ and bu should be identified online.If bu can be considered to be a constant, λ is the only coefficient that needs to be identified.In Figure 3a, the SOC-OCV curve is linearized separately near the point A and point B. In the case of linearization near point A, when bu is a zero constant, we use L1, which is a straight line through the origin of coordinates and point A.Moreover, when bu is a nonzero constant, we use L2.Obviously, the linearization accuracy of L2 is significantly higher than that of L1.However, L1 uses only one coefficient, and its compact expression is the most obvious advantage.Whether at point A or at point B, both L1 and L1′ can reflect the monotone increasing characteristic of the SOC-OCV curve.In addition, when using a Kalman filter to estimate the SOC, the incremental information of SOC can be mapped onto the observed quantity uL through the output equation Equation ( 5), and this ensure that the filter can accurately track the state variable of the equivalent model.Further illustration is shown in Section 2.4 based on the principle of the Kalman filter.6) can be rewritten as: using Equation ( 7) to linearize the SOC-OCV curve near the observation point.The output equation in Equation ( 5) can be reduced to the following expression: When we use Equation ( 7) to linearize the SOC-OCV curve, there is a correlation between the coefficients  and the SOC.That is to say, the output matrix parameters of Equation ( 5) are associated with dynamic variables.Obviously, this causes the nonlinearity of the system.The following function [26] can be used to fit the SOC-OCV curve: where z is the SOC.Equation (9) shows that the SOC-OCV curve contains obvious nonlinear components, and it is a typical nonlinear expression.All of the terms of Shepherd model, Unnewehr universal model and Nernst model are collected to make a "combined model" in [26], and the authors state that it performs better than any of the individual models alone.Finding a simple and accurate nonlinear function of the battery SOC-OCV curve is a hard task, and in many cases, the fitting accuracy is not high enough.Therefore, as an alternative method to the function fitting, the lookup table method is applied in many studies.Considering the accurate expression of the concept, still we adopt the function fitting to describe the linearization method in our manuscript.
At the current working point, suppose that Equation ( 9) is equivalent to Equation ( 7), then the following formula should be established: At the current working point, Equation (10) considers that the Equation ( 7) linearization method has the same effect as the non-linear curve Equation (9).In other words,  can map the current SOC estimation value onto an accurate OCV.Then, at the current working point, the general nonlinear model can be converted into a linear model.For the linearized model, it is reasonable as long as the linearization does not introduce obvious errors during the system state update process.This will be further described in Section 2.4.In this way, in the filter update process, we can directly use SOC- rather than SOC-OCV.Especially when we using a lookup table in the observation model, the parameters of the SOC- curve can be calculated off-line.This method can effectively reduce the number of state variable-related parameters in the observation model.Therefore, we think it is more computationally efficient.

Linearization Parameters Identification
Using Equation ( 9) to fit the SOC-OCV curve, the parameter  in Equation ( 9) defined as follows must be determined first: Ignoring the battery parameter differences during the process of charging and discharging, and ignoring the battery parameter changes affected by the load change and the change of SOC,  can be thought of as a constant matrix: where OCV = [OCV1,OCV2,…OCVN] T , N is the data point quantity of the SOC-OCV curve which is obtained through experiment.H = [h1,h2,…hN] T , hj = [1,1/zj,-z,ln(zj),ln(1-zj)], j = 1,2,…N.zj and OCVj are the data pairs of one of a data point in the SOC-OCV curve.Based on the SOC-OCV curve measured by the method introduced at the beginning of Section 2, the OCV and H in Equation ( 11) can be determined, and further the undetermined parameter  can be calculated: Used in the measurement equation, the OCV can be calculated by the use of the SOC-OCV curve and the SOC present forecast value.When using Equation (7) to linearize the curve, the present forecast SOC value can be used to calculate  , and then the  can be used to locally linearize the ( , ) k u SOC  in measurement equation.Through Equation (10), for a given SOC forecast value j z there is: Then Equation ( 13) can be used to calculate the local linearized parameter  of Equation ( 7) as soon as the SOC forecast value is calculated.

Kalman Filter Based on the Equivalent Circuit Model
A unified mathematical expression is adopted to describe the system introduced in Section 2.1: For a DP equivalent circuit model, its state space expression is Equation ( 5).Attention should be paid to the fact that the uk in Equation ( 14) represents the system input (load current) and also the k y represent the system output (load voltage).The filtering algorithm for the model shown in Equation ( 5) is shown in Figure 4. Compared with the classical algorithm, this algorithm has two supplementary parts, which are marked with a ▲.These supplementary parts use the local linearization method proposed in Section 2.2 to update the system parameters.
As important components of the algorithm, the steps marked with a ▲ in Figure 4 update the parameter of the filter, and they should be done in each time step.Through "linearization" and its input value SOC, which is a component of , either the SOC-curve expressed in Equation (10) or a lookup table can be used to obtain the value of .

Mechanism of Linearization
To linearize the SOC-OCV curve using Equation ( 13), the linearization method should accurately describe the actual nonlinearity from the mechanism, from which the SOC can be accurately mapped onto OCV at the current working point, and the increment of the state variables can be expressed correctly in the state update process: (1) Linearization does not change the mapping relationship between SOC and OCV.In Section 2.2, setting Equations ( 7) and ( 9) equal to each other, then Equations ( 10) and ( 13) are obtained.Therefore it can be concluded that this linearization method has the same effect as the nonlinearity curve expression Equation ( 9).The current OCV can be obtained accurately according to the current SOC estimate value using the linearization expression on the current working point.
(2) In the process of state estimate measurement update, the linearization method can correctly express the increment of state variables.The state estimate measurement updating equation , as shown in Figure 4, which indicates that the updated state ˆk x is the previous state 1 ˆk x  with an attached component: where has nothing to do with the linearization.
has a relationship with the linearization.Its expression of the state variable increment determines whether the linearization method can approximate the nonlinearity accurately.
can be rewritten as: At the current working point, using Equation ( 9) to estimate state variables, it can be thought that  in Equation ( 16) is a nonlinear function associated with SOC.However, when Equation ( 7) is used to estimate the state variables,  has a definite numerical value (at the current working point).As long as the filter system could eventually converge, it can be thought that v = Ksoc(λsoc − upa − upc) in Equation ( 16) can accurately express the state increment.The difference is that the linearization method has a different Ksoc value from the nonlinear expression.
Using the nonlinear expression Equation ( 9), which is line 3 in Figure 3b and is written as OCV = f(SOC), point D can be directly and accurately updated to the point F by the incremental v  and v  needn't any corrections of Ksoc, which is one component of the Kalman gain K and related to SOC.Similar results can also be obtained if the tangent line of point D is used to linearize the working point D.
If Equation ( 7) is used to linearize the working point D, that is line 1 in Figure 3b, point D should be updated to the point E by the incremental v  .It seems that there is an obvious state updating error because v v     .However, after filtering system convergence the OCV update value should be on account of Ksoc, which transforms line 1 into line 2 in Figure 3b.As long as the filter system can eventually converge, the linearization method can be thought to be valid.

Experiments and Results
The battery used in this experiment is a Li-ion phosphate battery (Model 14500, Viwipow, Shenzhen, China).A single battery has an actual measured capacity of 280 mAh and a rated voltage of 3.2 V, tested at room temperature (25 °C).The experimentally obtained SOC-OCV curve is shown in Figure 1.According to Equation ( 7), when 0 u b  , the SOC-OCV curve slope is calculated at every data point, with the result shown in Figure 5.The fitted curve we obtained, as shown in Figure 6, roughly has the same form as in [26].Nevertheless, there are obvious errors at some places, for example at the SOC values around 13%.The reason is that this curve was used for a lithium-ion polymer in [26], but we used lithium iron phosphate batteries in our studies, and the two kinds of batteries have different features.The identification results of are listed in Table 1.Goodness of fit between test and reference data is shown in Table 2.These identification results of  are complex numbers, and the imaginary parts are ignored in practical use.

Parameter Identification
The full charged battery is discharged in order to obtain the raw data.The load current used in this experiment is a square wave current with a period of 200 s, duty ratio 50%, and current value 0-250 mA.The sampling period is 200 ms, and the collected (and recorded) battery voltages and currents are shown in Figure 7.The dynamic response of the DP model can be deduced from Equations ( 2) and ( 4): A regression algorithm is used to identify piecewise the pulse load characteristics as shown in Figure 7. Equation ( 17) serves as the regression equation.Parameters such as 0 R , pa R , pa C , a  , pc R , pc C and c  serve as the regression parameters.Then the parameters of the battery equivalent circuit model shown in Figure 2 can be obtained.For the three different time segments Seg1, Seg2 and Seg3, which are marked in Figure 7, through the parameters identification these equivalent circuit model parameters are obtained and listed in Table 3.For an example of the Seg3 data in Figure 7, the transient characteristic identification results and their error is shown in Figure 8.  Generally, the battery parameters are changing slowly.Thus, the rate of update of battery parameters also including their identification algorithm need not be too fast.Two forms of battery parameter identification are performed in our experiments, in which the identification algorithm is run every 400 s or run only once.Accordingly, the battery parameters are updated every 400 s or only one time.
The regression algorithm is used to identify the battery parameters.Its amount of computations is a bit big, and it is difficult to obtain battery parameters in each run.Fortunately, considering the slowly rate of change of the battery parameters, the real-time requirements of the parameter identification algorithm is not very high, so in our experiments, battery parameters re not updated in each run but only a few times.

SOC Estimation
The Kalman filter based on local linearization and designed in Section 2.3 is used to estimate the SOC, and the result of the Coulomb integral method is selected as the reference to verify the accuracy of our SOC estimation.The raw data used in this estimation is the battery discharge data shown in Figure 7, and algorithm initial values are defined in Table 4.In addition, the terminal voltage and OCV estimation of the battery are shown in Figure 9, and SOC estimation results and its estimation errors are shown in Figure 10.With the assumption that the equivalent circuit parameters are unchanged during the battery discharge process, the OCV estimation result shown in Figure 9a uses the equivalent circuit parameters shown in Table 3 under the Seg1 heading.Other equivalent circuit parameters used in Figure 9b are a set of "approximate online" identification data.During the battery discharge process every 400 s, segment data, which are similar to the discharge transient characteristics shown in Figure 8a, is used to identify the model parameters.Then the identified parameters are used to immediately update the filter system parameters.In theory, the OCV shall show a continuous smooth change as the SOC changes.Obviously, the OCV estimation results shown in Figure 9 fail to meet this expectation.Both results shown in Figure 9 display obvious fluctuations and changes with the load current.Even so, the SOC estimate results still have a higher accuracy.SOC estimation results and their error are shown in Figure 10.After the estimation results converged from the initial 50% value, the SOC estimation precision is better than 0.5%.If OCV dominates the estimation results, its action should be that it directly obtains the results by the using of SOC-OCV curve in a form similar to a look-up table.This will lead to the fact that the SOC estimation result has an obvious fluctuation with the OCV fluctuation.In addition, the results are not completely dominated by the Coulomb counting method.Simply using the Coulomb counting method, it is impossible to form an obvious convergence process at the beginning of algorithm, as shown in Figures 9 and 12

Error Influence
Using the equivalent-circuit parameters shown in Table 3 Seg1, the SOC in the discharge process shown in Figure 7 is estimated.The SOC-OCV curve is artificially adjusted, as shown in Figure 11.Based on the original SOC-OCV curve Δu = 20 mV is added (or subtracted) to the OCV.The impact on SOC estimation results and their error is shown in Figure 12.As shown in Figures 9 and 10, the estimated OCV fluctuates up and down near its theoretical value, and this fluctuation is filtered by the Kalman filter in the estimation algorithm, so it does not constitute a significant effect on the SOC estimation results.In Figure 12, the OCV errors are introduced artificially (as shown in Figure 11), and they are fixed errors.These fixed errors always lead to the filter incorrectly using the estimated OCV that contains errors, and further leads to the SOC estimation results having the corresponding error components.These results show that this method lacks the effective ability to resist SOC-OCV curve errors, which usually come from the experimental measurements, so an accurate enough OCV-SOC curve is needed for this method.In addition, this shows that the precision of SOC estimation might be improved by compensation of the SOC-OCV curve according to the error characteristics of SOC estimation.

SOC Estimation for a Partly Charged Battery
For the normal use of a battery, after the estimation algorithm accurate convergence, the SOC value will not fluctuate rapidly.The filter uses the previous moment SOC value as the initial value of the present moment SOC estimation for iterative computation.However, under some unexpected working conditions such as a control system power down, or data processor reset, the estimation algorithm would lose an accurate SOC initial value.Moreover, it would use a preset SOC initial value to estimate the battery SOC.Such working conditions cause great difficulties for the Coulomb integral method due to the initial value dependence on the SOC estimation algorithm.To test the accuracy of the SOC estimation algorithm in the above cases, we use the battery discharge data as shown in Figure 7, the SOC estimation algorithm is started at 2000 s (SOC is about 75%) after the discharge started.The algorithm uses the Seg1 parameters listed in Table 3 and uses the initial values listed in Table 4.The estimated results and the corresponding error is shown in Figure 13.Referring to the Coulomb integral method result, as shown in Figure 13, under thse conditions, the estimation method achieves good results.

System Error and Noise
In this case the parameters given in Section 3.2 are still used to test the filtering system.The only difference is that the Q has a larger value.A set of typical SOC estimation results, obtained from this experiment, is shown in Figure 14.Obviously, with the increasing Q values the estimation errors are significantly increased, and the errors are obviously mixed with some fluctuations whose frequency are similar to the load current.

Principle of Linearization
Although the linearization method does not use the tangent of the current working point, the experimental results indicate that the basic information of SOC-OCV curve is not lost after linearization.Using the measurement equation, the Kalman filter calculates the generalized errors between the measurable value and the system dynamic variables (including the SOC).Then the Kalman gain is used to update the estimation values of the state variables.Its principle is shown in Figure 15.For the state variable SOC, it also means that the predicted value of

Influence of OCV Estimation
OCV estimation result noise should not have a serious impact on SOC estimation results.In Figure 9a, when the battery is nearly fully discharged (after 5000 s), the polarization phenomenon is obviously larger.However, the equivalent model parameters are not adjusted appropriately.At this point, the OCV estimation value is significantly related to the load current.More typically, in Figure 9b near 2600 s, the equivalent circuit parameter identification results have a gross error because the voltage measurement is mixed some noise.However, a short model error time does not constitute a significant effect on SOC estimation precision.The reason is that the information updating of SOC is more dependent on CIE, and with the appropriate values Q and R the Kalman filter can effectively filter the fluctuations of the OCV estimation results.The corresponding filter results and its errors from Figure 9b are shown in Figure 16.
Compared with the estimation result shown in Figure 10, whose model parameters have no gross error, the gross errors of the model parameters for a short period of time do not obviously influence the SOC estimation result, and only influence the SOC estimation error slightly when it is introduced near 2000 s.The estimation error can converge following the iteration of the estimation algorithm, and the estimation results in Figure 16 do not change essentially.
The slow convergence rate of SOC should not produce a significant impact on the estimation precision during the load transient.Larger initial value errors may lead to a longer SOC convergence cycle.However, during the battery charging and discharging processes, SOC is changing slowly and continuously, and the present SOC estimation always uses the last estimated result as its initial value.Therefore, this method can well meet the application requirements, as long as the convergence speed is not too slow.Although the OCV, which is reflected indirectly by the transient voltages of equivalent circuit model, influences the SOC estimate results only partially, however, the OCV estimate error is slightly larger in this paper, as shown in Figure 9.This error may be derived from the equivalent circuit model parameter identification.If the OCV estimate precision could be further improved, the influence of OCV on the SOC estimation result would be further strengthened, and the accuracy of SOC estimation should be improved.

Conclusions
This paper uses only one parameter to linearize the SOC-OCV curve of LIB, and this is beneficial to simplify the algorithm structure and to reduce the computation cost.From the perspective of system approximation, when we use only one parameter to linearize the SOC-OCV curve, although it seems too rough, the linearization method does not essentially lose the effect trend, which derives from CIE and acts on the increment of estimated SOC.Moreover, based on the linearization method, we adopt the second-order equivalent circuit model and a classical Kalman filter to construct the SOC estimation algorithm of LIB.Then the effectiveness of this algorithm is verified experimentally through fully and partially charged battery discharge experiments.The experimental results indicate that the SOC estimation error is better than 0.5%.

Figure 8 .
Figure 8.The equivalent model parameter identification results and their errors: (a) The measured transient voltage and its simulation result using the identified model parameters; (b) Simulation errors due to parameters identification errors.

Figure 9 .Figure 10 .
Figure 9. Battery terminal voltage and the OCV Identification result: (a) OCV Identification result using a specific set of model parameters; (b) OCV Identification result using "approximate online" model parameters identification results. .

Figure 13 .
Figure 13.SOC estimation results and its error for a partly charged battery: (a) SOC estimation results; (b) SOC estimation errors.

Figure 14 .
Figure 14.A large system noise worsens the filtering results.
multiplied by two parameters, which are the output matrix C = [λ − 1 − 1] and the Kalman gain K, respectively, and this influences its estimation value ŜOC .Before and after the linearization, even the values of the linearization parameter  in matrix C have an obvious error, for the estimation result ŜOC , as long as the action form (the monotone increase or monotone decrease) of dynamic variables in the measurement equation does not change in nature, the existence of the Kalman gain means the filter can still effectively utilize the increment information of the current integral to update the SOC.

Figure 15 .
Figure 15.Principle of SOC estimation method using Kalman filter based on local linearization.

Figure 16 .
Figure 16.The estimation results and their error: (a) SOC estimation results; (b) SOC estimation errors.

Table 1 .
The identification results of  .

Table 2 .
Goodness of fit between test and reference data.

Table 4 .
Preset initial values of the estimation algorithm.