Introduction

Energy storage system plays an important role in electric vehicle and micro-grid smooth power supply. Lithium-ion batteries have advantages of high energy density, long life, and environmental protection, and are considered as one of the most promising and dominant energy storage options [1]. An excellent battery management system (BMS) can increase battery efficiency and prolong battery life [2]. One of the key issues of BMS is to find an effective method for the SOC estimation since SOC cannot be measured directly under dynamic operation conditions. In this case, the SOC can be estimated by using some model-based linear parameter and nonlinear parameter identification methods such as the gradient algorithms [3], the least squares algorithms, and Newton recursive or iterative algorithms [4, 5] for linear models [6, 7] and nonlinear models [8,9,10]. Some methods are based on the input-output representations and the others are based on the state space models [11,12,13]. The SOC defines the remaining charge as the percentage of the battery stored in a fully charged battery [14]. The accurate estimation of SOC can avoid the over-discharge or over-charge of the battery and help to protect the battery from explosion or fire and improve the battery performance [15].

Many methods have been proposed to estimate SOC, such as the Coulomb counting method and the open-circuit voltage (OCV) method [16, 17]. Some shortcomings may occur when using a single estimation method. The Coulomb counting method will be more accurate with well-chosen initial value; however, the accumulation of measurement errors will lead to inaccurate estimation as time increases [18, 19]. The OCV method requires a long period of battery rest and is not suitable for online identification [20]. A third choice falls on model-based method which builds proper mathematical models for battery circuit and many state estimation algorithms can be used to improve the accuracy of the SOC estimation. Extended Kalman filter (EKF) is one of the popular algorithms that can estimate SOC effectively which takes the minimum mean square error as the best criterion [21, 22]. However, the EKF may fail to reduce violation of the local linear assumption, resulting in divergence for strongly nonlinear systems. In that case, adaptive extended Kalman filter and fading Kalman filter have been proposed [23,24,25]. Furthermore, the artificial neural network algorithm [26,27,28] is suitable for complex nonlinear systems which does not require detailed structure of battery systems. However, large sample size of data and multiple data training methods are a challenge for battery test [29].

The sliding mode observer based state of the charge estimation technique which diminished the modeling error, interference, and measurement noise was introduced in [30]. The introduction of the sliding mode observer inevitably brings about the chattering problem and affects the accuracy of estimation [31]. To decrease the chattering effects and improve the estimation performance, an adaptive sliding mode observer is proposed to estimate SOC based on the established battery model with uncertainties [32]. With the switching characteristic, the choice of different parameters also affects the accuracy and convergence of the estimation [33]. By adjusting the sliding mode gain, adaptive gain sliding mode observer can reduce the chatter to a lower level when estimating SOC [34].

Inspired by the data filtering [35, 36] and the particle filtering [37], the different weights are added to the innovation terms to modify the EKF filter, resulting in the merits of the sliding mode observer, this paper proposes an algorithm which combines the weighted innovation extended Kalman filter with the discrete sliding mode observer (DSMO) to solve two problems. (1) The abilities of minishing noise interference and estimating SOC are enhanced by constructing equivalent circuit model, taking advantage of the knowledge of parameter identification, and introducing DSMO to EKF. (2) An improved discrete sliding mode observer with a saturation function is introduced to remit the chattering problem to better estimate SOC when applying a general one.

The rest of this paper is organized as follows. Section “The battery model and parameter identification” introduces the establishment of equivalent circuit model and the process of model parameter identification. Section “The weighted innovation extended Kalman filtering estimation algorithm” proposes the SOC estimation algorithm based on the strength of EKF. Section “The modified WI-EKF algorithm with DSMO” proposes a sliding mode based EKF algorithm to estimate SOC. The effectiveness of the method is validated in Section “Experimental results and analysis”. Finally, some conclusions are given in Section “Conclusions”.

The battery model and parameter identification

A reasonable circuit model with accurate parameters is beneficial to improve the accuracy of the SOC estimation [38].

The establishment of the battery model

To accurately estimate the SOC, the second-order RC model which can describe the electrochemical polarization and concentration polarization processes is utilized as shown in Fig. 1 in consideration of the complexity and accuracy, where Uo is the open-circuit voltage, UT is the terminal voltage of battery, U1 and U2 are the polarization voltages and concentration voltages respectively in the circuit model. Romc is the ohmic resistance. R1 and R2 are the electrochemical polarization resistance and concentration polarization resistance, respectively. C1 and C2 are the electrochemical polarization capacitance and concentration polarization capacitance, respectively. I is the current flowing through the battery.

Fig. 1
figure 1

The second-order RC equivalent circuit model

From Fig. 1, Kirchhoff’s law and differential criterion show that output can be expressed as follows:

$$ \begin{array}{@{}rcl@{}} U_{T}&=&U_{o}-U_{1}-U_{2}-I R_{0} \end{array} $$
(1)
$$ \begin{array}{@{}rcl@{}} \dot{U}_{1}&=&\frac{-U_{1}}{R_{1} C_{1}}+\frac{I}{C_{1}} \end{array} $$
(2)
$$ \begin{array}{@{}rcl@{}} \dot{U}_{2}&=&\frac{-U_{2}}{R_{2} C_{2}}+\frac{I}{C_{2}} \end{array} $$
(3)

Equations (1)–(3) can be transformed by frequency domain transformation,

$$ U_{T}(s)-U_{o}(s) = -I(s)\left( R_{omc} + \frac{R_{1}}{1 + R_{1}C_{1} s} + \frac{R_{2}}{1 + R_{2}C_{2} s}\right) $$
(4)

The actual SOC value can be obtained by Coulomb-counting method,

$$ SOC(t)= SOC(t_{1})-\frac{{\int}_{t_{1}}^{\textit{t}}\xi i(\textit{t})\mathrm{d}\textit{t}}{C_{n}} $$
(5)

where Cn is the rated capacity of the battery, ξ is coulomb efficiency which refers to the ratio of the discharge capacity of the battery to the charging capacity in the same cycle.

The discrete state space expressions of the battery model are obtained by discretizing (1)–(5) as follows:

$$ \begin{array}{@{}rcl@{}} \left( \begin{array}{c} U_{1} (k)\\U_{2} (k)\\SOC(k) \end{array}\right)&=& \left( \begin{array}{ccc}e^{\frac{-{\Delta} T}{\tau_{1}}} & 0 & 0 \\ 0 & e^{\frac{-{\Delta} T}{\tau_{2}}} & 0 \\ 0 & 0 & 1 \end{array}\right)\left( \begin{array}{c} U_{1} (k-1)\\U_{2}(k-1)\\SOC(k-1) \end{array}\right)\\ && +\left( \begin{array}{c}R_{1}(1-e^{\frac{-{\Delta} T}{\tau_{1}}})\\R_{2}(1-e^{\frac{-{\Delta} T}{\tau_{2}}})\\ \frac{-\xi{\Delta} T}{C_{n}} \end{array}\right) I(k-1)\\ &&+\omega(k-1) \end{array} $$
(6)
$$ \begin{array}{@{}rcl@{}} U_{T} (k)&=&\left( \begin{array}{ccc} -1 & -1 & \frac{\partial U_{o}}{\partial SOC} \end{array}\right) \left( \begin{array}{c} U_{1} (k) \\ U_{2} (k) \\ SOC(k) \end{array}\right)\\ &&-R_{omc}I(k)+\nu(k) \end{array} $$
(7)

where ΔT is the sampling period, τ1 = R1C1,τ2 = R2C2. ω(k − 1), and ν(k − 1) are process noise and measurement noise at time k − 1, respectively. Uo is the estimated function with respect to SOC.

Model parameter identification

The parameters of the model are affected by aging of the battery, self-discharge factors, and ambient temperature. To identify variable parameters and estimate the experimental results accurately, the recursive least squares method with a forgetting factor (FFRLS) method is selected.

By bilinear transformation \(s=\frac {2}{T} \cdot \frac {1-z^{-1}}{1+z^{-1}}\) in Eq. 4, we have

$$ G\left( z^{-1}\right)=\frac{U_{T}\left( z^{-1}\right)-U_{o}\left( z^{-1}\right)}{-I\left( z^{-1}\right)}=\frac{\vartheta_{3}+\vartheta_{4} z^{-1}+\vartheta_{5} z^{-2}}{1-\vartheta_{1} z^{-1}-\vartheta_{2} z^{-2}} $$
(8)

𝜗1,𝜗2,𝜗3,𝜗4, and 𝜗5 are unknown coefficients. A discretized recursive form of the Eq. 4 is given as follows:

$$ \begin{array}{@{}rcl@{}} {\Delta} U(k)&=& \vartheta_{1} {\Delta} U(k-1)+\vartheta_{2} {\Delta} U(k-2)+\vartheta_{3} I(k)\\ &&+\vartheta_{4} I(k-1)+\vartheta_{5} I(k-2) \end{array} $$
(9)

where ΔU(k) = UT(k) − Uo(k).

Equation 9 can be expressed as:

$$ {\Delta} U(k) = \varphi^{T}(k) \theta(k) $$
(10)

where

$$ \begin{array}{@{}rcl@{}} \varphi(k)\!&=&\![{\Delta} U(k - 1), {\Delta} U(k - 2), I(k), I(k - 1), I(k - 2)]^{\mathrm{T}},\\ \theta(k) \!&=&\![\vartheta_{1}, \vartheta_{2}, \vartheta_{3}, \vartheta_{4}, \vartheta_{5}]^{\mathrm{T}}. \end{array} $$
(11)

It is difficult for the new data to play a correction role with the accumulation of old data and the time-varying characteristics of battery when employing the recursive least square method. The forgetting factor λ which makes the identification algorithm respond quickly and converge to the actual value with the changes of the system is introduced.

The FFRLS method is summarized as follows:

$$ \begin{array}{@{}rcl@{}} \hat{\theta}(k) &=&\hat{\theta}(k-1)+L(k)\left[{\Delta} U(k)-\varphi^{\mathrm{T}}(k) \hat{\theta}(k-1)\right] \\ L(k) &=&P(k-1) \varphi(t)\left( \lambda+\varphi^{T}(k) P(k-1) \varphi(k)\right)^{-1} \\ P(k) &=&\left[I-L(k) \varphi^{T}(k)\right] P(k-1) \lambda^{-1} \end{array} $$
(12)

where \(\hat {\theta }\) represents the estimation of 𝜃 at time k, L(k) is innovation vector, φ(k) is covariance matrix. UT(k) and Uo(k) can be measured by experimental equipment. Considering 𝜗i(i = 1,2,3,4,5) which are related to battery model and can be identified by the FFRLS method. Thus, the resistance and capacitance of the second-order RC equivalent circuit model can be obtained.

The weighted innovation extended Kalman filtering estimation algorithm

The EKF algorithm is widely used in state estimation of nonlinear systems. The core idea of the EKF algorithm is to expand the nonlinear function into Taylor series at the filter value x to obtain an approximate linear model [39]. Consider the state space model as follows:

$$ \left\{\begin{array}{l} x(k) = A(k-1)x(k-1) + B(k-1)u(k-1) + {{\omega}}(k-1)\\ y(k) = C(k)x(k)+D(k)u(k)+\nu(k) \end{array}\right. $$
(13)

where x(k) = [U1(k),U2(k),SOC(k)]T is three-dimensional state vector, u(k) = I(k) and y(k) = UT(k) are the input current and output terminal voltage of battery system, respectively. {A(k),B(k),C(k),D(k)} can be derived from Eqs. 6 and 7. Process noise ω(k) and measurement noise ν(k) are treated as Gaussian white noise with a mean of 0 and covariances of Q and R, respectively. The recursive EKF algorithm is summarized as follows:

$$ \begin{array}{@{}rcl@{}} \hat{x}(0|0)&=&E[x(0)] \end{array} $$
(14)
$$ \begin{array}{@{}rcl@{}} P(0|0)&=&E\{[x(0) - E[x(0)]][x(0) - E[x(0)]]^{\mathrm{T}}\} \end{array} $$
(15)
$$ \begin{array}{@{}rcl@{}} \hat{x}(k|k-1)&=&A(k-1)\hat{x}(k-1|k-1)\\ &&+B(k-1)u(k-1) \end{array} $$
(16)
$$ \begin{array}{@{}rcl@{}} P(k|k-1)&=&A(k-1)P(k-1|k-1)A^{\mathrm{T}}(k-1)\\&&+Q(k-1) \end{array} $$
(17)
$$ \begin{array}{@{}rcl@{}} G(k)&=&P(k|k-1)C^{\mathrm{T}}(k)[C(k)P(k|k-1)C^{\mathrm{T}}(k)\\&&+R(k)]^{-1} \end{array} $$
(18)
$$ \begin{array}{@{}rcl@{}} \hat{x}(k|k)&=&\hat{x}(k|k-1)+G(k) (y(k) - \hat{y}(k|k - 1)) \end{array} $$
(19)
$$ \begin{array}{@{}rcl@{}} P(k|k)&=&[I-G(k)C(k)]P(k|k-1) \end{array} $$
(20)

where P(k|k − 1) is a third-order prediction covariance matrix, P(k|k) is a third-order updated covariance matrix, and G(k) which adjusts priori state estimation as a conditioning factor is a three-dimensional Kalman filter gain vector.

To improve the estimation accuracy of SOC, weighted innovation extended Kalman filter (WI-EKF) is proposed which makes full use of the data of the previous time and assigns weights according to the importance of innovation at different time in Eq. 19. The innovation term \(o(k):=y(k)-\hat {y}(k|k-1)\) which affects the size of G(k) does not contain information about previous moments. By extending innovation o(k) and the filter gain vector G(k), the innovation vector O(m,k) and the gain matrix G(m,k) can be defined as follows:

$$ \begin{array}{@{}rcl@{}} O(m,k)&=&[o(k), o(k-1), \cdots, o(k-m+1)]^{\mathrm{T}}\in{\mathbb R}^{m},\\ \end{array} $$
(21)
$$ \begin{array}{@{}rcl@{}} G(m,k)&=&[G(k), G(k-1), \cdots, G(k-m+1)]\in{\mathbb R}^{3\times m}\\ \end{array} $$
(22)

Then Eq. 19 can be expressed as:

$$ \hat{x}(k|k)=\hat{x}(k|k-1)+G(m,k)O(m,k) $$
(23)

The weight \(\bar \beta \) is introduced to calculate the weights to the innovations because the importance of innovation at different times is different. The weighted innovation vector \(\bar {O}(m,k)\) is as follows:

$$ \begin{array}{@{}rcl@{}} \bar{O}(m,k)&=&[\bar{\beta}(k) o(k), \bar{\beta}(k-1) o(k-1), \cdots,\\ &&\bar{\beta}(k-m+1) o(k-m+1)]^{\mathrm{T}}\in{\mathbb R}^{m} \end{array} $$
(24)

The weight of each innovation can be computed by Gaussian function of o(k) when considering the innovations as particles. The weight β(kj + 1) (j = 1,2,⋯ ,m) is computed as follows:

$$ \begin{array}{@{}rcl@{}} o(k\!-j+1)\!&=&\!y(k-j+1)- \hat y(k-j+1|k-j) \end{array} $$
(25)
$$ \begin{array}{@{}rcl@{}} \beta(k\!-j+1)\!&=&\!\frac{1}{\sqrt{2\pi}\sigma}e^{\frac{-(e(k-j+1))^{2}}{2\sigma^{2}}}, j=1,2,\cdots,m. \end{array} $$
(26)

where o(kj + 1) is the j th innovation in the innovation vector O(m,k), β(kj + 1) is the weight of j th innovation, and σ2 is the noise variance.

Normalizing β(kj + 1) yields:

$$ \begin{array}{@{}rcl@{}} \tilde{\beta}(k - j + 1)\!&=&\!\frac{\beta(k-j+1)}{{\sum}_{j=1}^{m}\beta(k-j+1)}, j = 1,2,\cdots,m. \end{array} $$
(27)

Since the weight of each innovation in the standard algorithm is equal to 1, we can consider the sum of the weights of all innovations as the innovation length m, so it is more reasonable to take the innovation weight as:

$$ \bar{\beta}(k-j+1)=m\tilde{\beta}(k-j+1), j=1,2,\cdots,m. $$
(28)

The WI-EKF algorithm can be as follows:

$$ \begin{array}{@{}rcl@{}} G(k)&=&P(k|k-1)C^{\mathrm{T}}(k)[C(k)P(k|k-1)C^{\mathrm{T}}(k)\\ &&+R(k)]^{-1} \end{array} $$
(29)
$$ \begin{array}{@{}rcl@{}} O(m,k)&=&[o(k), o(k-1), \cdots, o(k-m+1)]^{\mathrm{T}}\in{\mathbb R}^{m}\\ \end{array} $$
(30)
$$ \begin{array}{@{}rcl@{}} G(m,k)&=&[G(k), G(k-1), \cdots, G(k-m+1)]\in{\mathbb R}^{3\times m}\\ \end{array} $$
(31)
$$ \begin{array}{@{}rcl@{}} \hat{x}(k|k)&=&\hat{x}(k|k-1)+G(m,k)\bar{O}(m,k) \end{array} $$
(32)
$$ \begin{array}{@{}rcl@{}} P(k|k)&=&[I-G(m,k)C(k)]P(k|k-1) \end{array} $$
(33)

The modified WI-EKF algorithm with DSMO

The sliding mode observer is a nonlinear state observer. Compared with other state observers, the sliding mode observer has better robustness and estimation accuracy. Standard form of first-order sliding mode observer is as follows:

$$ \begin{array}{@{}rcl@{}} x(k+1)&=&A(k)x(k)+B(k)u(k)+H(y(k)-\hat{y}(k))\\&&+J\text{sgn}\left[\frac{y(k)-\hat{y}(k)}{\chi}\right] \end{array} $$
(34)
$$ \begin{array}{@{}rcl@{}} y(k)&=&C(k)x(k)+D(k)u(k) \end{array} $$
(35)

where \(\hat {y}(k)\) is the predicted value at time k, H is the gain matrix, J is the saturation gain function, sgn(⋅) is the symbolic function, and χ is the boundary layer. The sliding mode observer can filter the signal noise, but also brings the chattering problem into the algorithm; thus, a saturation function sat(x) is introduced.

$$ \text{sat}(x)=\left\{\begin{array}{l}{x,-1 \leqslant x \leqslant 1} \\ {\text{sgn}(x), x<-1 \text { or } x>1} \end{array}\right. $$
(36)

The iterative process of sliding mode observer based on WI-EKF is shown below:

$$ \begin{array}{@{}rcl@{}} \hat{x}(k|k-1)&=&A(k-1)\hat{x}(k-1|k-1)+B(k - 1)u(k - 1)\\ &&+H\left( y(k-1)-\hat{y}(k-1)\right)\\ &&+J \text{sat}\left[\frac{y(k)-\hat{y}(k)}{\chi}\right] \end{array} $$
(37)
$$ \begin{array}{@{}rcl@{}} P(k|k-1)&=&A(k-1)P(k-1|k-1)A^{\mathrm{T}}(k-1)\\ &&+Q(k-1) \end{array} $$
(38)
$$ \begin{array}{@{}rcl@{}} G(k)&=&P(k|k-1)C^{\mathrm{T}}(k)[C(k)P(k|k-1)C^{\mathrm{T}}(k)\\ &&+R(k)]^{-1} \end{array} $$
(39)
$$ \begin{array}{@{}rcl@{}} O(m,k)&=&[o(k), o(k-1), \cdots, o(k-m+1)]^{\mathrm{T}}\\ &&\in{\mathbb R}^{m} \end{array} $$
(40)
$$ \begin{array}{@{}rcl@{}} G(m,k)&=&[G(k), G(k-1), \cdots, G(k-m+1)]\\ &&\in{\mathbb R}^{3\times m} \end{array} $$
(41)
$$ \begin{array}{@{}rcl@{}} \hat{x}(k|k)&=&\hat{x}(k|k-1)+G(m,k)\bar{O}(m,k) \end{array} $$
(42)
$$ \begin{array}{@{}rcl@{}} P(k|k)&=&[I-G(m,k)C(k)]P(k|k-1) \end{array} $$
(43)

The estimation of the SOC of lithium-ion batteries by sliding mode observer based on the extended Kalman filter is divided into online part and offline part. The offline part mainly includes the acquisition of the OCV-SOC curve and the design of the DSMO parameters. The OCV-SOC curve is obtained by open-circuit voltage test, and the parameters H and J in Eq. 37 are assumed by authors’ experience. The online part mainly includes online parameter identification of the second-order RC model and state estimation of lithium-ion batteries.

The advantage of online parameter identification is that the model parameters can change with the change of external environment, and the accuracy is high. The disadvantage lies that the algorithm is a little complicated. Based on extended Kalman filter, this section uses the sliding mode observer to recursively estimate the SOC of lithium-ion batteries. In fact, one may use other iterative identification schemes [40,41,42,43,44,45,46,47], and the recursive identification schemes [48,49,50,51,52] to design the state observers and state filtering algorithms. These deserve further study.

Experimental results and analysis

In our experiment, IFP36130155D-36Ah lithium-ion battery is tested with rated voltage 3.2 V and rated capacity 36 Ah. The main parameters of the lithium-ion battery are shown in Table 1. Lithium ions embedded in the carbon layer of the negative electrode come out and move back to the positive electrode when discharging the battery. The more lithium ions return to the positive electrode, the higher the discharge capacity.

Table 1 IFP36130155D-36Ah battery parameters

In order to verify the effectiveness of the proposed algorithm, it is necessary to obtain the real value of SOC by combining the function relationship between open-circuit voltage and SOC with the ampere hour integration method. The battery is discharged for 18 min with a discharge rate of 0.3 C (12 A), and then internally stabilized for 40 min, during which the open-circuit voltage reaches to the terminal voltage. This process is repeated until the SOC reaches to 0%. Figure 2 shows the OCV-SOC curve in the discharging process. Considering the accuracy of curve fitting, a seven-order polynomial equation which derives from Curve Fitting Toolbox in MATLAB is as follows:

$$ \begin{array}{@{}rcl@{}} U_{o c d}&=& 142.3903 SOC^{7}-503.4641 SOC^{6}\\ &&+721.6340 SOC^{5}-540.5293 SOC^{4}\\ &&+227.4628 SOC^{3}-53.7642 SOC^{2}\\ &&+6.8097 SOC +2.471 \end{array} $$
(44)
Fig. 2
figure 2

The OCV-SOC curve under intermittent discharge test

Intermittent discharge test with negative discharge current is used to verify the accuracy of the proposed SOC estimation algorithm at the 25 C environment temperature. The fully charged battery experienced 11 discharge cycles. The battery is discharged at a discharge rate of 0.3 C (12 A) for 18 min, and then placed for 40 min to a steady state in each cycle. At the 12th cycle time, the battery is discharged to the discharge cut-off voltage and the whole test is completed.

In the SOC estimation experiment, EKF, WI-EKF, and the combination of DSMO and WI-EKF are used for the experiment. From the system stability analysis, φ = 0.1, H = [0.000015;0.000015;0.000015], J = [0.000015;0.000015;0.000015]. The comparison between the experimental results and the real results is shown in Fig. 3. The error of SOC estimation is shown in Fig. 4 and Table 2. Figures 3 and 4 indicate that the improved algorithm can make SOC estimation more accurate and acquire smaller estimation error. Figure 5 manifests that SOC can converge to the actual value eventually in spite of the selected initial SOC. Process noise and observation noise should be set according to experience, not too large or too small. Thus, the initial SOC value is 1, the process noise is 10− 7, and the observation noise is 0.1 in the experiment. The discharge low current which reduces external interference and prolongs the lifetime of the battery is 0.3 C (12 A) to improve the stability and safety of the experiment when estimating SOC.

Fig. 3
figure 3

The SOC estimation under intermittent discharge test

Fig. 4
figure 4

The error of SOC estimation under intermittent discharge test

Table 2 Comparison of algorithms
Fig. 5
figure 5

The comparison of different initial SOC by EKF under intermittent discharge test

The experimental results show that the addition of the sliding mode observer into WI-EKF makes SOC estimation closer to the real value and improves the accuracy of SOC estimation compared with WI-EKF.

Conclusions

In this paper, an effective SOC estimation method is proposed by combining the second-order RC equivalent circuit model of lithium-ion battery with the combination of WI-EKF and DSMO. The proposed method improves the accuracy of estimation by introducing DSMO into the WI-EKF. Experimental results show that the proposed algorithm is effective and can improve the accuracy of SOC estimation. To better suppress the chattering problem and improve the stability, the second-order or multi-order sliding mode observer is the focus of future research. Selecting more suitable saturated gain function is also one of the key points in the future research. The basic idea of the proposed algorithm in this paper can be extended and applied to other fields.