Dual Kalman filter (KF-UKF) for SOC estimation considering battery aging

       This blog post introduces how to use Simulink to complete the construction of the unscented Kalman filter to estimate the SOC of the lithium battery nonlinear system.

       (1) KF estimates battery aging. The capacity of the battery will drop with each charge and discharge cycle, resulting in inaccurate SOC estimation. Use an event-based linear Kalman filter to estimate battery capacity as the battery transitions between charging and discharging. The estimated capacity is then used to reflect the health of the battery.

       (2) UKF estimates battery SOC. Based on the parameters identified by the second-order RC model, the UKF is used to estimate the SOC of the battery in real time.

1. Battery model

       Consider a battery model with the following equivalent circuit:

       Among them, Uoc is OCV, Ub is terminal voltage, I is current, T is temperature, R0 is internal resistance, R1 and R2 are polarization resistances, and C1 and C2 are polarization capacitances.

       Model overview:

        The state transition equation of the battery model is given by:

       Among them, U1 and U2 are the voltages of the two polarized terminals respectively, Cn is the capacity, and W is the process noise.

       The input current pulses randomly as the battery discharges and remains constant while charging.

         The measurement equation is as follows:

 2. SOC estimation

       To use the unscented Kalman filter module, you need to specify the state transition equation and measurement equation with the help of Matlab or function function. We use the function function here, as shown in the following figure:

       Since the unscented Kalman filter is a discrete-time filter, the state equation is discretized first. In this example, Euler discretization is used. Let the sampling time be constant. For general nonlinear systems, the system can be discretized as:

        The state vector of the nonlinear battery system is:

 Applying Euler discretization yields the following equation:

       The discrete state transition equation is implemented in the Simulink function batteryStateFcn. The function input x is the state vector, and the function output xNext is the state vector of the next step, calculated using the discrete state transition equation. In the function, the signal dimension and data type of x and xNext need to be specified. In this example, the signal dimension of x and xNext is 3 and the data type is double. Other inputs to batteryStateFcn are temperature, estimated capacity, and current. Note that the extra input is an input to the state transition equation and not required by the Unscented Kalman Filter block.

       Likewise, the measurement function is implemented in a Simulink function called batteryMeasurementFcn.

Configure the Unscented Kalman Filter block parameters as follows:

       Here we mainly talk about the determination process of covariance matrix, initial covariance and observation noise covariance. The tuning parameters are regular and can be calculated, rather than randomly set. This is also the dry part of this blog post.

       (1) Process noise.

       Based on the dynamic characteristics of the battery system, the process noise of the battery system is estimated. The batteries had a nominal capacity of 30Ah and were discharged or charged at an average current amplitude of 15A. Therefore, a discharge or charge process takes about 2 hours (7200 seconds). The maximum value of SOC is 100%, and the maximum value of U1 and U2 is 4V. The maximum change in each step of SOC and U1, U2 is

max(|d(SOC)|)=Ts*100%/3600*2;

max(|d(U1)|)=Ts*4/3600*2;

max(|d(U2)|)=Ts*4/3600*2;

       Where Ts is the sampling time of the filter. In this example, Ts is set to 1 second. Therefore, the process noise can be determined as:

       (2) Initial state. Set it to (1; 0; 0), there is nothing to worry about. The initial SOC value is set to 1, and the decibels of U1 and U2 are set to 0, because we do not have any prior information about U1 and U2.

       (3) Initial covariance. The initial covariance represents the accuracy and reliability of the initial guess. Assuming that the maximum initial guess error of SOC is 10%, and the initial guess errors of U1 and U2 are both 1V, the initial covariance can be set as: diag(0.1,1,1).

       (4) Unscented transformation parameters.

Alpha: Determines the spread of sigma points around x. Set Alpha to 1 for greater spread.

Beta: Used to combine prior knowledge of the distribution. Generally set to 2.

Kappa: Secondary scaling parameter. Generally set to 0.

       (5) Measurement noise. The measurement noise V is estimated from the accuracy of the measurement equipment. A voltmeter for battery voltage measurement has an accuracy of about 1%. The battery voltage is around 4V. Therefore, we can calculate the measurement noise as max(dEm)=1%*4V=0.04V, so V=(max(dEm))^2≈1e-3.

3. Estimate battery degradation

       Battery degradation is simulated by capacity decline. In this example, the battery capacity was set to decrease by 1 Ah per charge and discharge cycle to account for the effects of degradation. Due to the relationship of time, the detailed introduction of battery aging will be put in the next article.

4. Results

       At each simulation step, the Unscented Kalman filter provides an estimated SOC, based on voltage measurements. Plot the actual SOC versus the UKF predicted SOC, and the difference between them.

% Synchronize two time series
[RealSOC, EstimatedSOC] = synchronize(RealSOC, EstimatedSOC, 'intersection');

figure;
subplot(2,1,1)
plot(100*RealSOC,'b','LineWidth',1.5);
hold on
plot(100*EstimatedSOC,'r--','LineWidth',1);
title('State of Charge');
xlabel('Time (s)');
ylabel('SOC (%)');
legend('Actual','UKF estimate','Location','Best','Orientation','horizontal');
axis tight

subplot(2,1,2)
DiffSOC = 100*(RealSOC - EstimatedSOC);
plot(DiffSOC.Time, DiffSOC.Data, 'LineWidth', 1.5);
xlabel('Time(s)');
ylabel('\Delta SOC (%)','Interpreter','Tex');
legend('Difference between Real SOC and Estimated SOC','Location','Best')
axis tight

       After the initial estimation error, the SOC quickly converges to the actual SOC. The final estimation error is within 0.5%. Therefore, the Unscented Kalman filter gives an accurate SOC estimate.

       At each charge-discharge transition, the battery capacity is estimated to improve the estimation of the battery state of charge. The battery system outputs an indicator signal to inform the battery which process it is in. The discharge process is represented by -1 in the indicator light signal, and the charge process is represented by 1. In this example, the change in the indicator signal is used to determine when to enable or disable the Kalman filter for capacity estimation. We plot the actual and estimated capacity as well as the charging and discharging indicators.

figure;
subplot(2,1,1);
plot(RealCapacity,'b','LineWidth',1.5);
hold on
plot(EstimatedCapacity,'r--','LineWidth',1.5);
xlabel('Time (s)');
ylabel('Capacity (Ah)');
legend('Actual','KF estimate','Location','Best');

subplot(2,1,2);
plot(DischargeChargeIndicator.Time,DischargeChargeIndicator.Data,'b','LineWidth',1.5);
xlabel('Time(s)');
ylabel('Enable Signal');

        In general, Kalman filtering is able to track the actual capacity. There is a half cycle delay between estimated capacity and actual capacity. This is because when a full charge-discharge cycle ends, the battery capacity drops. Whereas Coulomb counting gives a measure of the capacity of the last discharge or charge cycle.

5. Summary

       This model shows how to use the Unscented Kalman filter block for SOC estimation of a lithium battery. Additionally, an event-based Kalman filter for battery capacity estimation is also developed. The newly estimated capacity is used to improve the SOC estimation of the unscented Kalman filter.

6. References

[1] Huria, Tarun, et al. "High fidelity electrical model with thermal dependence for characterization and simulation of high power lithium battery cells." Electric Vehicle Conference (IEVC), 2012 IEEE International. IEEE, 2012.

[2] Wan, Eric A., and Rudolph Van Der Merwe. "The unscented Kalman filter for nonlinear estimation." Adaptive Systems for Signal Processing, Communications, and Control Symposium 2000. AS-SPCC. The IEEE 2000. Ieee, 2000.

Guess you like

Origin blog.csdn.net/m0_60354177/article/details/131553699