An adaptive Kalman filtering algorithm suitable for lithium battery SOC estimation
Patent Information
- Application Number
- CN202410178802.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-16
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2044-02-16
AI Technical Summary
然而,由于锂电池的SOC特性曲线的非线性特性严重,采用卡尔曼滤波算法,或是扩展卡尔曼滤波算法,在拐点处容易造成较大的估计误差,影响上位机对于电池SOC值的监控结果,进而误导其他设备进入错误运行工况中
[0040]1、本发明从SOC-OCV特性曲线出发,对EKF算法进行改进,从而使改进后的自适应卡尔曼滤波算法更适用于锂电池SOC估计过程,在实时SOC估计时,将会产生更小的误差,并且通过自动校正策略修正内部参数,从而修改算法惯性,在SOC-OCV曲线拐点处不会产生较大误差值。
Smart Images

Figure CN117907843B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of lithium battery technology, and specifically relates to an adaptive Kalman filter algorithm suitable for lithium battery SOC estimation. Background Technology
[0002] As a significant symbol of modern industrial civilization, automobiles, incorporating the most advanced industrial technologies, play an indispensable role in daily life and production. To further conserve fossil fuels, countries worldwide are focusing on developing pure electric vehicles or hybrid electric vehicles powered by lithium batteries. For electric vehicles, state of charge (SOC) estimation is a crucial indicator for assessing their driving range. Inaccurate SOC estimation directly impacts the driver's and the vehicle's driver assistance systems' estimations of the driving range, severely negatively affecting the user experience.
[0003] Currently, depending on the computing power of the core processor, traditional algorithms such as the Ampere-hour Integrate (AHI) method and the lookup table method are mainly used to estimate the SOC of lithium batteries, while prediction algorithms such as the Extended Kalman Filter (EKF) and the Particle Filter (PF) method are used. However, since the SOC curve is a non-linear curve, the voltage value and slope are different at different SOC values, and both types of algorithms have certain limitations. The Ampere-hour Integrate method is widely used in industrial fields. If the initial SOC value of the lithium battery, the battery capacity, and the battery operating current can be accurately measured, a relatively accurate real-time SOC value of the battery can be obtained through the Ampere-hour Integrate method. The corresponding formula is shown in the following equation:
[0004] ;
[0005] In the formula, SOC0 is the initial SOC value, I is the battery operating current value during the time dt. When I>0, the battery is discharging; when I<0, the battery is charging; and η is the battery's charging and discharging efficiency.
[0006] The advantage of the ampere-hour integration method lies in its simple calculation equations and ease of portability to different platforms. However, the ampere-hour integration method is highly dependent on the initial SOC value and the battery's real-time maximum capacity, and the sampling error generated during the digital chip's current sampling process cannot be eliminated.
[0007] Kalman filtering is another algorithm that can estimate battery SOC. This type of algorithm provides more accurate SOC estimation and effectively mitigates the error accumulation problem caused by capacity decay. However, due to the severe nonlinearity of the SOC characteristic curve of lithium batteries, using Kalman filtering, or extended Kalman filtering, can easily lead to significant estimation errors at inflection points. This affects the monitoring results of the host computer on the battery SOC value, and may mislead other devices into incorrect operating conditions.
[0008] Therefore, from the perspective of the SOC characteristics of lithium batteries, it is necessary to invent an adaptive Kalman filter algorithm suitable for lithium battery SOC estimation to solve the above problems. Summary of the Invention
[0009] To address the aforementioned problems, this invention provides an adaptive Kalman filter algorithm suitable for lithium battery SOC estimation, thereby solving the issues raised in the background section.
[0010] To achieve the above objectives, the present invention provides the following technical solution: an adaptive Kalman filter algorithm suitable for lithium battery SOC estimation, comprising the following steps:
[0011] S1. Establish an equivalent circuit model for a lithium battery;
[0012] S2. Based on the equivalent circuit model of the lithium battery, establish the state equation of the lithium battery;
[0013] S3. Set the weighting matrix. Based on the SOC estimation results in the previous iteration, update the covariance matrix in the EKF algorithm through the weighting matrix to obtain the AEKF algorithm.
[0014] S4. Calculate the lithium battery based on the AEKF algorithm.
[0015] Furthermore, in step S1, the equivalent circuit model includes a resistor R0 connected in series, a first RC element consisting of a resistor R1 and a capacitor C1 connected in parallel, a second RC element consisting of a resistor R2 and a capacitor C2 connected in parallel, and a resistor R... L Lithium battery voltage U OC .
[0016] Furthermore, the state equation of the lithium battery is:
[0017] (1);
[0018] (2);
[0019] Where k is the order of the previous iteration, k+1 is the order of the current iteration, V1 and V2 are the voltage values of the first and second RC stages in the equivalent circuit of the lithium battery, R0 is the equivalent resistance value inside the lithium battery, R1 and C1 are the resistance and capacitance values in the first RC stage, R2 and C2 are the resistance and capacitance values in the second RC stage, Δt is the sampling period, and w k and v k These are process noise and observation noise, respectively, during the calculation process.
[0020] Furthermore, the defining coefficients of the lithium battery state equation are:
[0021] (3);
[0022] (4);
[0023] (5);
[0024] (6).
[0025] Furthermore, regarding the lithium battery voltage U OC Tests were conducted, and the SOC-OCV relationship of the lithium battery was obtained as "OCV".
[0026] By differentiating the SOC-OCV relationship, we can obtain the slope judgment formula "OCV" in the iterative process under different SOCs during the EKF calculation.
[0027] Taking the second derivative of the SOC-OCV curve of a lithium battery yields "OCV". Calculating the absolute value of "OCV" gives y, where... (7).
[0028] Furthermore, the weighting matrix is:
[0029] R=R1(1-y / y max )+R2(y / y max (8);
[0030] Q = Q2(1-y / y) max )+Q1(y / y max (9);
[0031] Where R and Q are the observation noise covariance matrix and the process noise covariance matrix, respectively; R1 and Q1 are the observation noise covariance matrix and the process noise covariance matrix with high fitting goodness, respectively; and R2 and Q2 are the observation noise covariance matrix and the process noise covariance matrix with strong filtering ability, respectively.
[0032] Furthermore, step S3 also includes the following steps:
[0033] Based on the previous SOC value, i.e. the result of the kth time, the y value is obtained through "OCV";
[0034] Substitute the obtained y value into equations (8) and (9) to calculate the corresponding values of R and Q.
[0035] Furthermore, the process in step S4 is as follows:
[0036] The initial SOC value of the lithium battery is obtained by looking up a table;
[0037] Collect the real-time battery port voltage and current values of the lithium battery, and update the observation noise covariance matrix and process noise covariance matrix values in the EKF calculation process according to Equations (8) and (9);
[0038] The real-time SOC value of the AEKF output is calculated based on the updated Q and R matrices.
[0039] The technical effects and advantages of this invention are as follows:
[0040] 1. This invention improves the EKF algorithm based on the SOC-OCV characteristic curve, making the improved adaptive Kalman filter algorithm more suitable for the lithium battery SOC estimation process. It will produce smaller errors during real-time SOC estimation, and the internal parameters are corrected through an automatic correction strategy, thereby modifying the algorithm's inertia and preventing large error values from being generated at the inflection point of the SOC-OCV curve.
[0041] 2. By modifying the size of the two covariance matrices in the EKF algorithm, the degree of fit of the EKF algorithm to the SOC-OCV curve can be modified. When the SOC value is close to 20% or 80%, the degree of fit will be higher, avoiding the error amplification caused by differentiation at the inflection point; when the SOC value is far from 20% or 80%, it is in a low-fit state and has a better filtering effect. Attached Figure Description
[0042] Figure 1 This is an equivalent circuit diagram of a lithium battery according to an embodiment of the present invention;
[0043] Figure 2 This is a SOC-OCV curve of the lithium battery according to an embodiment of the present invention;
[0044] Figure 3 This is a flowchart of an adaptive Kalman filter algorithm for lithium battery SOC estimation according to an embodiment of the present invention;
[0045] Figure 4This invention presents the true SOC value of a lithium battery and the estimated SOC value curve of a lithium battery obtained through three algorithms in a constant current discharge (noise-free) experiment.
[0046] Figure 5 This is a schematic diagram illustrating the absolute value of the error between the SOC estimate and the actual SOC achieved through three algorithms in a constant current discharge (noise-free) experiment according to an embodiment of the present invention.
[0047] Figure 6 This invention presents the true SOC value of a lithium battery and the estimated SOC value curve of a lithium battery obtained through three algorithms in a constant current discharge (noise environment) experiment according to an embodiment of the invention.
[0048] Figure 7 This is a schematic diagram illustrating the absolute value of the error between the SOC estimate and the actual SOC achieved through three algorithms in a constant current discharge (noise environment) experiment according to an embodiment of the present invention.
[0049] Figure 8 This is a graph showing the actual SOC value of a lithium battery and the estimated SOC value of a lithium battery obtained through three algorithms in the HPPC experiment according to an embodiment of the present invention.
[0050] Figure 9 This is a schematic diagram illustrating the absolute value of the error between the SOC estimate and the true SOC achieved through three algorithms in the HPPC experiment according to an embodiment of the present invention. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments.
[0052] This invention provides an adaptive Kalman filter algorithm suitable for lithium battery SOC estimation, comprising the following steps:
[0053] like Figure 1 As shown, S1, establish the equivalent circuit model of the lithium battery.
[0054] To characterize the electrical characteristics of lithium batteries, a second-order RC model is used to establish the equivalent circuit model of the lithium battery. In step S1, the equivalent circuit model includes a resistor R0 connected in series, a first RC element consisting of a resistor R1 and a capacitor C1 connected in parallel, a second RC element consisting of a resistor R2 and a capacitor C2 connected in parallel, and a resistor R... L Lithium battery voltage U OC .
[0055] S2. Based on the equivalent circuit model of the lithium battery, establish the state equation of the lithium battery.
[0056] The state equation of the lithium battery is:
[0057] (1);
[0058] (2);
[0059] Where k is the order of the previous iteration, k+1 is the order of the current iteration, V1 and V2 are the voltage values of the first and second RC stages in the equivalent circuit of the lithium battery, R0 is the equivalent resistance value inside the lithium battery, R1 and C1 are the resistance and capacitance values in the first RC stage, R2 and C2 are the resistance and capacitance values in the second RC stage, Δt is the sampling period, and w k and v k These are process noise and observation noise, respectively, during the calculation process.
[0060] The defining coefficients of the lithium battery state equation are:
[0061] (3);
[0062] (4);
[0063] (5);
[0064] (6).
[0065] S3. Set the weighting matrix, update the EKF algorithm through the weighting matrix to obtain the AEKF algorithm, and calculate the real-time SOC value based on the AEKF algorithm.
[0066] The EKF algorithm is updated to derive an AEKF algorithm with variable values for the observation noise covariance matrix and the process noise covariance matrix, thereby ensuring that the SOC estimation algorithm can achieve SOC estimation with small errors in different SOC value ranges.
[0067] The update process of the AKEF algorithm is as follows:
[0068] The lithium battery voltage UOC was tested, and the SOC-OCV relationship of the lithium battery was obtained as "OCV". The derivative of the SOC-OCV relationship was then obtained, leading to the slope judgment formula "OCV'" in the iterative process for different SOCs during EKF calculations. The second derivative of the lithium battery's SOC-OCV curve was obtained as "OCV". The absolute value of "OCV" was then calculated to obtain y, where... (7).
[0069] exist Figure 2For example, when setting the SOC range to 0 to 100 and testing the UOC of a lithium battery, a Panasonic 18650 battery is used as an example. The test is conducted at different SOCs. Figure 1 Based on the model shown, after testing, the SOC-Open Circuit Voltage (OCV) relationship of the Panasonic 18650 battery is as follows:
[0070] ;
[0071] Differentiating the expression “OCV”, we get “OCV’”:
[0072] ;
[0073] Taking the second derivative of the SOC-OCV curve of a lithium battery, we obtain the equation "OCV":
[0074] ;
[0075] Equation “OCV '” describes the rate of change of the slope of the SOC-OCV curve during the change of SOC. Differentiating equation “OCV '” yields “OCV”.
[0076] Depend on Figure 2 It can be seen that the SOC-OCV curve of lithium batteries will have inflection points with large slope changes when the SOC value is about 20% and 80%. When the SOC value is in the range of (20%, 80%), the SOC-OCV curve is relatively stable and the slope value is relatively stable. Otherwise, the slope value will change significantly.
[0077] The slope value is limited by setting a weighting matrix, which is:
[0078] R=R1(1-y / y max )+R2(y / y max (8);
[0079] Q = Q2(1-y / y) max )+Q1(y / y max (9);
[0080] Where R and Q are the observation noise covariance matrix and the process noise covariance matrix, respectively; R1 and Q1 are the observation noise covariance matrix and the process noise covariance matrix values with high goodness of fit, respectively; and R2 and Q2 are the observation noise covariance matrix and the process noise covariance matrix values with strong filtering ability, respectively. After calculating the absolute value of "OCV", y can be obtained, where... y max It is the maximum value of y.
[0081] Based on the previous SOC value, i.e. the result of the kth time, the y value is obtained through "OCV";
[0082] Substitute the obtained y value into equations (8) and (9) to calculate the corresponding values of R and Q. Based on this, set the initial SOC value of the lithium battery, the initial value of the error covariance _0, the process noise covariance Q, and the measurement noise covariance R. The SOC can be estimated in real time using the observable battery voltage U and battery current I of the lithium battery.
[0083] By modifying the size of the two covariance matrices in the EKF algorithm, the degree of fit of the EKF algorithm to the SOC-OCV curve can be modified. When the SOC value is close to 20% or 80%, the degree of fit will be higher, avoiding the error amplification caused by differentiation at the inflection point; when the SOC value is far from 20% or 80%, it is in a state of underfit, and has a better filtering effect.
[0084] S4. Calculate the lithium battery based on the AEKF algorithm.
[0085] The process in step S4 is as follows:
[0086] The real-time SOC value output by AEKF is calculated based on the updated Q and R matrices, and this output SOC value will be used as the initial value for the next iteration. The calculation formula using the AEKF algorithm is shown in equation (10).
[0087] (10).
[0088] For example, the algorithm of the present invention is verified by building EKF, UKF and EKF models for lithium battery SOC estimation in a simulation environment, respectively. The proposed AEKF algorithm for lithium battery SOC estimation is also used to implement a lithium battery SOC estimation model. Three operating conditions are designed: constant current discharge (noise-free), constant current discharge (noisy environment), and hybrid power pulse characteristic (HPPC) condition.
[0089] exist Figure 4 and Figure 5 In the constant current discharge (noise-free) experiment, the actual SOC value of the lithium battery and the estimated SOC curves of the lithium battery obtained through three algorithms are shown below. Figure 4 As shown, the absolute values of the errors between the SOC estimates and the actual SOC achieved by the three algorithms are as follows: Figure 5 As shown.
[0090] In the absence of noise interference, the algorithm proposed in this invention can effectively reduce the SOC estimation error at different stages and get closer to the true SOC value. When the SOC approaches 0, the algorithm proposed in this invention can correct the internal parameters, thereby reducing the premature convergence problem caused by the accumulation of errors in the early stage.
[0091] exist Figure 6 and Figure 7 In the constant current discharge (noise environment) experiment, the actual SOC value of the lithium battery and the estimated SOC curves of the lithium battery obtained through three algorithms are shown below. Figure 6 As shown, the absolute values of the errors between the SOC estimates and the actual SOC achieved by the three algorithms are as follows: Figure 7 As shown.
[0092] In noisy environments, the algorithm proposed in this patent can effectively suppress noise interference during the SOC estimation process, demonstrating strong anti-interference capabilities. Furthermore, when the SOC value approaches the inflection point, the difference between the proposed algorithm and the true SOC becomes smaller. Figure 7 The results show that the SOC value obtained by the algorithm proposed in this invention has higher reliability at the end of the discharge.
[0093] exist Figure 8 and Figure 9 In the figure, the actual SOC value of the lithium battery and the SOC estimation curve of the lithium battery achieved through three algorithms are shown in the figure. Figure 8 As shown, the absolute values of the errors between the SOC estimates and the actual SOC achieved by the three algorithms are as follows: Figure 9 As shown.
[0094] Under HPPC conditions, compared with the EKF and UKF algorithms, the algorithm proposed in this invention has less inertia in the SOC value estimation process, corresponding to a relatively low SOC error, more stable performance, and higher reliability of the results.
[0095] exist Figures 4 to 9 By comparing the SOC estimation waveforms and errors, the superior performance of the algorithm proposed in this patent in estimating the SOC of lithium batteries is clearly evident. To quantify the results, the following five evaluation metrics are used to compare and evaluate the SOC estimation performance of the three algorithms under three operating conditions. The five evaluation metrics include: maximum error (Error(Max)), mean error (Mean Error, ME), mean absolute error (Mean Absolute Error, MAE), root mean square error (RMSE), and coefficient of determination (R-squared, R²).
[0096] Based on five evaluation indicators, a comparison table of ME, MAE, RMSE and R2 for the three algorithms was established, resulting in Table 1.
[0097] Table 1
[0098]
[0099] Comparing the results shown in Table 1, under different working conditions, the AEKF algorithm of this invention has strong robustness, good convergence, and high fitting degree. The results obtained under the three test conditions are significantly better than the EKF algorithm and the UKF algorithm.
[0100] Reference Figures 1 to 9 As shown, this invention improves the EKF algorithm based on the SOC-OCV characteristic curve, making the improved EKF algorithm more suitable for lithium battery SOC estimation. In real-time SOC estimation, it produces smaller errors and modifies the algorithm's inertia through an automatic correction strategy to avoid large error values at the inflection points of the SOC-OCV curve. Compared to other adaptive EKF algorithms, the algorithm in this invention, starting from the SOC-OCV application perspective, improves the EKF algorithm based on summarizing the changing patterns of the SOC-OCV curve, proposing a new adaptive AEKF algorithm.
[0101] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it.
Claims
1. An adaptive Kalman filter algorithm suitable for lithium battery SOC estimation, characterized in that: Includes the following steps: S1. Establish an equivalent circuit model of the lithium battery. The equivalent circuit model includes a resistor R0 connected in series, a first RC circuit consisting of a resistor R1 and a capacitor C1 connected in parallel, a second RC circuit consisting of a resistor R2 and a capacitor C2 connected in parallel, and a resistor R... L Lithium battery voltage U OC ; S2. Based on the equivalent circuit model of the lithium battery, establish the state equation of the lithium battery. The state equation of the lithium battery is as follows: (1); (2); Where k is the order of the previous iteration, k+1 is the order of the current iteration, V1 and V2 are the voltage values of the first and second RC stages in the equivalent circuit of the lithium battery, R0 is the equivalent resistance value inside the lithium battery, R1 and C1 are the resistance and capacitance values in the first RC stage, R2 and C2 are the resistance and capacitance values in the second RC stage, Δt is the sampling period, and w k and v k These are process noise and observation noise during the calculation process, respectively. For lithium battery voltage U OC Tests were conducted, and the SOC-OCV relationship of the lithium battery was obtained as "OCV". By differentiating the SOC-OCV relationship, we can obtain the slope judgment formula "OCV" in the iteration process under different SOCs during the EKF calculation. Taking the second derivative of the SOC-OCV curve of a lithium battery yields "OCV". Calculating the absolute value of "OCV" gives y, where... (3); S3. Set the weighting matrix. Based on the SOC estimation results from the previous iteration, update the covariance matrix in the EKF algorithm using the weighting matrix to obtain the AEKF algorithm. The weighting matrix is: R=R1(1-y / y max )+R2(y / y max ) (4); Q=Q2(1-y / y max )+Q1(y / y max ) (5); Where R and Q are the observation noise covariance matrix and the process noise covariance matrix, respectively; R1 and Q1 are the observation noise covariance matrix and the process noise covariance matrix with high fitting goodness, respectively; and R2 and Q2 are the observation noise covariance matrix and the process noise covariance matrix with strong filtering ability, respectively. S4. Calculate the lithium battery based on the AEKF algorithm.
2. The adaptive Kalman filter algorithm for lithium battery SOC estimation according to claim 1, characterized in that: Step S3 also includes the following steps: Based on the previous SOC value, i.e. the result of the kth time, the y value is obtained through "OCV". Substitute the obtained y value into equations (4) and (5) to calculate the corresponding values of R and Q.
3. The adaptive Kalman filter algorithm for lithium battery SOC estimation according to claim 1, characterized in that: The process in step S4 is as follows: The initial SOC value of the lithium battery is obtained by looking up a table; Collect the real-time battery port voltage and current values of the lithium battery, and update the observation noise covariance matrix and process noise covariance matrix values in the EKF calculation process according to Equations (4) and (5); The real-time SOC value of the AEKF output is calculated based on the updated Q and R matrices.
Citation Information
Patent Citations
Lithium battery charge state estimation method based on characteristic curve optimization
CN113109717A