Lithium battery SOC estimation method based on constraint optimization Kalman filtering

By adopting a Kalman filtering method based on constraint optimization in lithium battery SOC estimation, the cumulative error and nonlinear characteristic processing problems of SOC estimation in the prior art are solved, and higher estimation accuracy and system stability are achieved, and it is suitable for electric vehicle battery management systems.

CN119644147APending Publication Date: 2025-03-18SHANGHAI ZHUANGXIN ELECTRONIC TECH CO LTD
View PDF 0 Cites 7 Cited by

Patent Information

Application Number
CN202411439181.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

The existing lithium battery SOC estimation methods have cumulative errors, are sensitive to environmental changes, and are unable to effectively handle the nonlinear characteristics of the battery, making it difficult to meet the needs of high precision and high reliability.

Method used

The Kalman filtering method based on constraint optimization is adopted, and the RC equivalent circuit model is established and the Kalman algorithm is initialized, and the SOC estimation is performed in combination with the measured data, and the filtering parameters are dynamically adjusted through the error feedback mechanism to improve the accuracy and robustness of the estimation.

Benefits of technology

It significantly improves the accuracy and system stability of lithium battery SOC estimation, is suitable for electric vehicle battery management systems, and can be extended to other power management systems that require accurate battery status estimation, providing technical support for battery performance optimization and life extension.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119644147A_ABST
    Figure CN119644147A_ABST
Patent Text Reader

Abstract

The invention discloses a lithium battery SOC (State of Charge) estimation method based on constrained optimization Kalman filtering. The method comprises the following steps: building a battery RC (Resistance-Capacitance) model; establishing a Kalman filtering model and initializing parameters; processing the collected battery data; iteratively updating Kalman filtering parameters continuously through constraint optimization to obtain more accurate values; mSE and RMSE are used for a Kalman filter to evaluate the performance of the filter. In order to overcome the limitation of the Kalman filter on parameter setting and the sensitivity of the Kalman filter on model change, the parameter adjustment process of the Kalman filter is optimized by introducing constraint conditions, and the parameters of the filter are dynamically adjusted in combination with an advanced optimization algorithm, so that the filter can keep the optimal estimation performance under different working conditions. Meanwhile, through limitation of constraint conditions, it is ensured that the estimation result conforms to the physical characteristics and actual working conditions of the battery, and the accuracy and reliability of SOC estimation are further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a lithium battery SOC estimation method based on constrained optimal Kalman filtering, and belongs to the technical field of electrical engineering. Background Art

[0002] As the world pays more attention to environmental protection and sustainable development, electric vehicles, as representatives of new energy vehicles, are becoming more and more popular and widely used at an unprecedented rate. The performance of on-board lithium batteries, one of the core components of electric vehicles, is directly related to the endurance, driving stability and safety of electric vehicles. Among them, the battery SOC, as a key indicator to measure the remaining power of the battery, is crucial for the precise control of the battery management system and the intelligent management of electric vehicles.

[0003] However, due to the complex electrochemical reaction process inside lithium batteries, the changing working environment and the performance degradation during long-term use, accurate estimation of SOC has become an extremely challenging task. Traditional SOC estimation methods, such as the ampere-hour integration method and the voltage judgment method, can reflect the remaining power of the battery to a certain extent, but due to the existence of cumulative errors, strong sensitivity to environmental changes and inability to effectively handle the nonlinear characteristics of the battery, they are often difficult to meet the needs of high precision and high reliability.

[0004] In order to solve the above problems, researchers began to explore more advanced SOC estimation methods. Among them, Kalman filter, as an effective state estimation algorithm, is widely used in the field of battery SOC estimation because it can update the estimated value of the system state in real time and reduce the estimation error. However, the performance of Kalman filter is highly dependent on the accurate setting of process noise and observation noise parameters, which are often difficult to obtain accurately in practical applications and are easily affected by battery state changes and environmental factors, resulting in a decrease in the estimation accuracy of the filter. Summary of the invention

[0005] The purpose of the present invention is to provide a lithium battery SOC estimation method based on constrained optimization Kalman filtering to address the defects and shortcomings of the above-mentioned prior art, which solves the problems of inaccurate battery equivalent circuit model and large SOC prediction error. The present invention optimizes the filter parameters of the Kalman filter through constrained optimization to improve the accuracy and robustness of SOC estimation.

[0006] The technical solution adopted by the present invention to solve the technical problem is: a lithium battery SOC estimation method based on constrained optimization Kalman filtering, the method comprising the following steps:

[0007] Step 1: First, establish an RC equivalent circuit model based on the functional relationship between the battery model parameters.

[0008] Step 2: Initialize the Kalman algorithm using measured data, including setting the system state and observation equations. The state equation describes the state change, and the observation equation connects the observation value to the state. The initial state and variance matrix reflect the estimate and uncertainty of the system's initial state. The state and variance matrix of the next moment are predicted through the system state equation and control variables. Prepare the error covariance and Kalman gain coefficient to update the state parameters.

[0009] Step 3: Perform basic data processing based on the collected measured data of battery discharge, handle missing items and classify the data into three parts: charging, discharging, and pause. According to the experimental samples and the obtained system state equation and observation equation; calculate the cumulative discharge amount and the SOC of the lithium battery. Perform polynomial fitting simulation on the expression of the SOC of a single lithium battery as observation data, provide a prediction model for the Kalman filter, and set the Kalman filter observation noise and process noise according to the timestamp and SOC prediction value. By constructing Gaussian noise to simulate the uncertainty in actual observations, the state and variance matrix of the system are updated according to the observed values ​​and predicted values. The observation equation represents the relationship between the observed value and the state.

[0010] Step 4: Construct the Kalman filter prediction and update steps. In the update step, the control input variables are dynamically adjusted by error feedback, and the filter output prior variables are corrected by the least squares linear regression method. According to the recursive algorithm, the prediction and update steps are repeated to obtain a more accurate state estimate. The estimated value weight is adjusted by adjusting the difference between the predicted value and the observed value, thereby obtaining a more accurate state estimate.

[0011] Step 5: Use MSE and RMSE to evaluate the performance of the implemented Kalman filter. MSE and RMSE measure the difference between the estimated value and the true value. The smaller the value, the higher the estimation accuracy of the filter. Through the evaluation, we can fully understand the performance of the Kalman filter and optimize and improve it according to specific needs. And analyze the impact of the initial control variables on the smoothness of the filter.

[0012] Furthermore, the RC equivalent circuit model established in step 1 is:

[0013] U=U OCV -IR0-U1-U2

[0014] Where U OCV is the open circuit voltage of the battery; I is the current flowing through the battery; R0 is the ohmic internal resistance of the battery; U i is the voltage across the polarization resistor; where i=1, 2; U is the terminal voltage of the battery.

[0015] Furthermore, the method steps of step 2 are as follows:

[0016] Use measured data to initialize the Kalman filter algorithm and establish the system state equation and observation equation:

[0017]

[0018] Where: x k+1 represents the system state at time k+1, u k is the known input of the system at time k, also called the control signal, k is the time index, y k is the output measured at time k; w k and v k They are called process noise and measurement noise respectively. Here we simulate them by Gaussian white noise, and their covariances are the noise covariance matrix Q and the observation noise covariance matrix R respectively.

[0019]

[0020] Construct Kalman filter parameters, predict the state and variance matrix of the next moment through the system state equation and control variables, and update the state parameters.

[0021] By completing the derivation of the state equation and the output equation, the nonlinear equation is converted into the output form of a linear equation, which enables the Kalman filter of the linear equation to estimate the optimized state variable.

[0022] The prior state evaluation can be obtained by calculating the partial derivative matrix of the following formula for each time step:

[0023]

[0024] Construct the Kalman filter parameters and construct the function according to the above formula. The predicted state variables and error covariance are as follows:

[0025]

[0026] In the formula is the k-th step prior state estimate, is the k-th step prior error covariance matrix, and solves the Kalman gain update equation:

[0027]

[0028] It can be seen that K is determined by two types of variances, Q and R, and is determined by the variance of the previous estimate. If the variance is found to be large, it means that the estimate is unreliable. The K value will be close to 1 as the gait is updated. According to the Kalman gain parameter, the state estimation measurement update equation and the covariance measurement update equation can be obtained:

[0029]

[0030] Furthermore, the method steps of step 3 are as follows:

[0031] Data preprocessing, from the collected measured data of battery discharge, remove missing data and classify them. First load the data, check and process the missing values ​​in the data. Missing values ​​are marked as 0 and used as the basis for data segmentation.

[0032] In order to divide the data into three stages of charging, discharging and pausing, targeted analysis and processing are carried out. By traversing the processed data, the data is classified according to the positive and negative and size of the current value. When the current value is positive and greater than the discharge current, it is marked as the charging stage; when the current value is negative and the absolute value is equal to the discharge current, it is marked as the discharge stage; when the current value is close to 0, it is marked as the pause stage. The start and end indexes of each segment of data are recorded.

[0033] Cumulative discharge capacity calculation calculates the cumulative discharge capacity of the battery during the discharge process, providing a basis for SOC calculation. For the data in the discharge stage, the cumulative discharge capacity is calculated using the current value and timestamp. The calculation formula is as follows:

[0034] Q n =∑(I·Δt)

[0035] The battery SOC is calculated based on the cumulative discharge amount. The calculation method is based on the rated capacity of the battery and the cumulative discharge amount. The calculation formula is as follows:

[0036]

[0037] Polynomial fitting, in order to use the observed data for polynomial fitting, simulate the changing trend of the battery SOC, and provide a prediction model for the Kalman filter. Select an appropriate polynomial degree (such as 5) and use the least squares method to fit the SOC data. The obtained polynomial coefficients will be used to simulate the predicted value of SOC.

[0038] The Kalman filter parameters are set as Kalman filter observation noise and process noise to simulate the uncertainty in actual observations. There are three control variables that directly affect the filter fitting effect. The observation noise covariance R is set according to the variability of the observed data and reflects the size of the observation error; the process noise covariance Q is set according to the dynamic characteristics of the system and reflects the uncertainty of the model prediction.

[0039] In order to simplify the model and optimize the filter constraints, the two parameters are compared to find the optimal parameter solution.

[0040] Insufficient process noise Q: If the estimate of the process noise is too small, the filter may be too confident in the prior and fail to adapt to rapid changes in the data.

[0041] Observation noise R is too large or too small: If the observation noise is too large, the filter may rely too much on the observation value and ignore the model prediction; if it is too small, the filter may rely too much on the model prediction and not be sensitive enough to the observation value. Finally, according to the optimization performance comparison, the filter parameters with large Q and small R are selected to meet the performance analysis of the optimization filter.

[0042] Cumulative discharge and SOC calculation,In order to build an observation model, which represents the relationship between the,observation value and the system state, the observation model is defined as follows,where z is the observation value, x is the system state such as SOC,,is the observation function, and v is the observation noise.

[0043] z=h(x)+v

[0044] Furthermore, the method steps of step 4 are as follows:

[0045] The prediction and update steps of the Kalman filter are further optimized, and the control input variables are dynamically adjusted by introducing an error feedback mechanism, thereby achieving accurate correction of the filter output prior variables. In the update step, we use the least squares method to perform linear regression correction on the filter output to minimize the sum of squares of the errors to find the best function match for the data. In the present invention, we use the least squares method to adjust the prior estimate of the Kalman filter to ensure that the estimated value is as close as possible to the actual observed value.

[0046] Define the error function, which is defined as the sum of squares of the differences between the Kalman filter estimate and the true value.

[0047]

[0048] Among them, y k is the actual observation value at the kth time, is the predicted value calculated by the current state prediction and the noise covariance matrix. The goal is to minimize this error function by adjusting Q and R. In the optimization, some constraints are usually introduced to ensure that the selected Q and R are reasonable and feasible.

[0049] Calculate the objective function and use the current Q and R to calculate the predicted value in each iteration Calculation error e k And update the objective function J(Q,R).

[0050] After the update, check whether the new parameters meet the constraints. If not, they can be corrected to a reasonable range through the projection method.

[0051] When the change of the objective function is less than the set threshold ε or the number of iterations reaches the set maximum value, the iteration stops.

[0052] |J(Q new ,Rnew )-J(Q old ,R old )|<ε

[0053] After the optimization is completed, the optimized Q and R are used to perform EKF state estimation and compared with the unoptimized results to analyze the accuracy, stability and convergence of SOC estimation.

[0054] Furthermore, the method steps of step 5 are as follows:

[0055] To evaluate the performance of the Kalman filter, we used mean square error (MSE) and root mean square error (RMSE) as evaluation indicators. MSE is the average of the squares of the prediction errors, while RMSE is the square root of MSE, which can quantify the deviation between the filter prediction value and the actual observation value.

[0056]

[0057] Among them, x_est represents the final SOC prediction value, and y_noisy represents the data of the measured SOC under certain interference.

[0058] Beneficial effects:

[0059] 1. The present invention significantly improves the SOC estimation accuracy and system stability of the battery management system in complex environments.

[0060] 2. The present invention is not only applicable to various types of electric vehicle battery management systems, but can also be extended to any power management system that requires accurate battery status estimation, providing strong technical support for battery performance optimization and life extension.

[0061] 3. The present invention can analyze the performance of the filter by comparing the MSE and RMSE of the true value and the filter estimate, and adjust the filter parameters accordingly, such as controlling the input variables, the observation noise covariance and the process noise covariance, to further improve the estimation accuracy of the filter. In addition, by observing the consistency of the filter output with the polynomial fitting curve, the effectiveness of the filter in processing nonlinear systems can be verified. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is a flow chart of the steps of the present invention.

[0063] Figure 2 It is the RC equivalent circuit model diagram of the present invention.

[0064] Figure 3 This is a flow chart of the constrained optimization algorithm of the present invention. Specific implementation methods

[0066] The present invention is described in detail below in conjunction with specific implementation modes.

[0067] like Figure 1 The present invention is a lithium battery SOC estimation method based on constrained optimization Kalman filtering, and its parameter optimization includes the following:

[0068] Firstly, an RC equivalent circuit model is established based on the functional relationship between the battery model parameters;

[0069] Specifically, first derive the RC parallel connection. Assuming that the voltage across the RC parallel connection is U and the inflow current is I, the current equivalent relationship is as follows:

[0070]

[0071] Figure 2 Middle U OCV is the open circuit voltage of the battery; I is the current flowing through the battery; R0 is the ohmic internal resistance of the battery; R1 and R2 are polarization resistors; U1 and U2 are the voltages across the polarization resistors; C1 and C2 are polarization capacitors. Based on the model structure and Kirchhoff's voltage and current laws, the circuit equation of the battery model.

[0072] U=U OCV -IR0-U1-U2

[0073] Discretization is mainly to convert the differential equation in the continuous time domain into a difference equation in the discrete time domain. This is usually achieved by approximating the continuous time derivative at a fixed time step (sampling period).

[0074] For each polarization voltage V in the second-order RC equivalent circuit model pi (where i = 1, 2), its continuous time differential equation is:

[0075]

[0076] We can use first-order backward difference to approximate this derivative. Let the sampling period be T, then at the kth sampling time, the derivative is It can be approximated as:

[0077]

[0078] Among them, V pi [k] represents the polarization voltage value at the kth sampling moment. From the above formula, we can get:

[0079]

[0080] Solve for V pi [k]:

[0081]

[0082] The terminal voltage V[k] of the entire battery can be obtained by adding the open circuit voltage, the internal resistance voltage drop and all polarization voltages:

[0083] V[k]=V OCV [k]-I[k]R0-V p1 [k]-V p2 [k]

[0084] Initialize the Kalman algorithm using measured data, including setting the system state and observation equations. The state equation describes the state change, and the observation equation connects the observation value to the state. The initial state and variance matrix reflect the estimate and uncertainty of the system's starting state. Predict the state and variance matrix at the next moment through the system state equation and control variables. Prepare the error covariance and Kalman gain coefficient to update the state parameters.

[0085] Specifically, according to the basic principle of Kalman filter algorithm, the expressions of battery model related functions and battery SOC are analyzed to obtain the state equation and observation equation of the system, and then the Kalman filter algorithm is used to perform SOC optimization iterative calculation;

[0086] When calculating the battery SOC in the above case, the signal or system is expressed as follows:

[0087]

[0088] Where: x k+1 represents the system state at time k+1, u k is the known input of the system at time k, also called the control signal, k is the time index, y k is the output measured at time k; w k and v k They are called process noise and measurement noise respectively. Here we simulate them by Gaussian white noise, and their covariances are noise covariance matrix Q and observation noise covariance matrix R. The noise is shown below.

[0089]

[0090] The state equation f(x k ) and the observation equation h(x k ) is a nonlinear function. In this case, we assume that the state equation and prediction equation are as follows:

[0091] x k+1 =f(x k ,u k )+w k

[0092] yk =h(x k )+v k

[0093] In the linearized Kalman filter, we use a first-order Taylor series to expand the state equation and the output equation around the nominal state. Due to modeling errors, disturbances and other unforeseen effects, the Taylor series linearization of the nonlinear system equations and the output equation gives as follows:

[0094]

[0095] Its trajectory deviation can be expressed as follows:

[0096]

[0097] In the formula represents the prior state estimate and The same is collectively expressed as the nominal state, combined with the above we can get:

[0098]

[0099] By completing the derivation of the state equation and the output equation, the nonlinear equation is converted into the output form of a linear equation, which enables the Kalman filter of the linear equation to estimate the optimized state variable.

[0100] The prior state evaluation can be obtained by calculating the partial derivative matrix of the following formula for each time step:

[0101]

[0102] Construct the Kalman filter parameters and construct the function according to the above formula. The predicted state variables and error covariance are as follows:

[0103]

[0104] In the formula is the k-th step prior state estimate, is the k-th step prior error covariance matrix, and solves the Kalman gain update equation:

[0105]

[0106] You can see K k It is determined by two types of variances, Q and R, and by the variance of the last estimate. If the variance is found to be large, it means that the estimate is unreliable. The K value will be close to 1 as the gait is updated. According to the Kalman gain parameter, the state estimation measurement update equation and the covariance measurement update equation can be obtained:

[0107]

[0108] In order to simplify the model calculation, H k It can be assumed to be 1. Through the above formula, all parameter equations of the Kalman filter can be solved in order to prepare for the construction of the Kalman filter optimization.

[0109] Basic data processing is performed based on the collected measured data of battery discharge, missing items are processed and data is classified into three parts: charging, discharging and pausing. According to the experimental samples and the obtained system state equation and observation equation; the cumulative discharge amount and the SOC of the lithium battery are calculated. The expression of the SOC of a single lithium battery is simulated by polynomial fitting as observation data to provide a prediction model for the Kalman filter. The Kalman filter observation noise and process noise are set according to the timestamp and SOC prediction value. Gaussian noise is constructed to simulate the uncertainty in the actual observation, and the state and variance matrix of the system are updated according to the observed value and the predicted value. The observation equation represents the relationship between the observation value and the state.

[0110] Specifically, data preprocessing removes missing data from the collected measured data of battery discharge and classifies them. First, load the data, check and process the missing values ​​in the data. Missing values ​​are marked as 0 and used as the basis for data segmentation.

[0111] In order to divide the data into three stages of charging, discharging and pausing, targeted analysis and processing are carried out. By traversing the processed data, the data is classified according to the positive and negative and size of the current value. When the current value is positive and greater than the discharge current, it is marked as the charging stage; when the current value is negative and the absolute value is equal to the discharge current, it is marked as the discharge stage; when the current value is close to 0, it is marked as the pause stage. The start and end indexes of each segment of data are recorded.

[0112] Cumulative discharge capacity calculation: calculate the cumulative discharge capacity of the battery during the discharge process, providing a basis for SOC calculation. For the data in the discharge stage, the cumulative discharge capacity is calculated using the current value and timestamp.

[0113] Q n =∑(I·Δt)

[0114] The battery SOC is calculated based on the cumulative discharge amount. The calculation method is based on the rated capacity of the battery and the cumulative discharge amount. The calculation formula is as follows:

[0115]

[0116] Polynomial fitting, in order to use the observed data for polynomial fitting, simulate the changing trend of the battery SOC, and provide a prediction model for the Kalman filter. Select an appropriate polynomial degree (such as 5) and use the least squares method to fit the SOC data. The obtained polynomial coefficients will be used to simulate the predicted value of SOC.

[0117] The Kalman filter parameters are set as Kalman filter observation noise and process noise to simulate the uncertainty in actual observations. There are three control variables that directly affect the filter fitting effect. The observation noise covariance R is set according to the variability of the observed data and reflects the size of the observation error; the process noise covariance Q is set according to the dynamic characteristics of the system and reflects the uncertainty of the model prediction.

[0118] In order to simplify the model and optimize the filter constraints, the two parameters are compared to find the optimal parameter solution.

[0119] Insufficient process noise Q: If the estimate of the process noise is too small, the filter may be too confident in the prior and fail to adapt to rapid changes in the data.

[0120] Observation noise R is too large or too small: If the observation noise is too large, the filter may rely too much on the observation value and ignore the model prediction; if it is too small, the filter may rely too much on the model prediction and not be sensitive enough to the observation value. Finally, according to the optimization performance comparison, the filter parameters with large Q and small R are selected to meet the performance analysis of the optimization filter.

[0121] Cumulative discharge and SOC calculation,In order to build an observation model, which represents the relationship between the,observation value and the system state, the observation model is defined as follows,where z is the observation value, x is the system state such as SOC,,is the observation function, and v is the observation noise.

[0122] z=h(x)+v

[0123] The state estimate and covariance matrix of the system are updated using the observed data. Prediction step: Use the current state and control input to predict the next state and covariance. Update step: Combine the observed data and the prediction model to adjust the state estimate and covariance through the Kalman gain. Through the above steps, the present invention describes in detail how to use the Kalman filter to process battery charging and discharging data and accurately estimate the SOC of the battery. These steps not only demonstrate the process of data processing and model building, but also reflect how to improve the performance of the battery management system through algorithm optimization.

[0124] The present invention further optimizes the prediction and update steps of the Kalman filter, and dynamically adjusts the control input variables by introducing an error feedback mechanism, thereby achieving accurate correction of the filter output prior variables. In the update step, we use the least squares method to perform linear regression correction on the filter output to minimize the sum of squares of the errors to find the best function match for the data. In the present invention, we use the least squares method to adjust the prior estimate of the Kalman filter to ensure that the estimated value is as close as possible to the actual observed value.

[0125] Specifically, we first define the error function, which is defined as the sum of the squares of the differences between the Kalman filter estimate and the true value.

[0126]

[0127] Among them, y k is the actual observation value at the kth time, is the predicted value calculated by the current state prediction and the noise covariance matrix. The goal is to minimize this error function by adjusting Q and R.

[0128] The error model can be expressed as:

[0129]

[0130] Among them, e k is the error observed in the kth measurement. By minimizing the sum of squared errors, we can obtain the following objective function:

[0131]

[0132] It is usually necessary to introduce some constraints in optimization to ensure that the selected Q and R are reasonable and feasible. These constraints usually include:

[0133] Positive definiteness constraint: The covariance matrices Q and R must be positive definite matrices to ensure their physical meaning:

[0134] Q>0,R>0

[0135] Range limitation: According to the actual application requirements, the reasonable range of Q and R can be set:

[0136] Q min ≤Q≤Q max ,R min ≤R≤R max

[0137] When using the least squares method for optimization, we first need to set the initial parameters before optimization. We set a reasonable initial process noise covariance Q. Based on previous measurements and experience with process noise, we set the initial value of Q to 0.01 and set an initial observation noise covariance R, which can usually be estimated by the standard deviation of the measurement noise.

[0138] Calculate the objective function and use the current Q and R to calculate the predicted value in each iteration Calculation error e k And update the objective function J(Q,R).

[0139] By using the chain rule, we can calculate the partial derivatives of the objective function J(Q,R) with respect to Q and R and obtain the gradient:

[0140]

[0141] The Jacobian matrix needs to be calculated for each time step. and is the derivative of the state prediction model with respect to the covariance matrix.

[0142] After calculating the gradient, update Q and R, set an appropriate learning rate α to control the magnitude of each update. Update the parameters according to the calculated gradient:

[0143]

[0144] After the update, check whether the new parameters meet the constraints. If not, they can be corrected to a reasonable range through the projection method.

[0145] When the change of the objective function is less than the set threshold ε or the number of iterations reaches the set maximum value, the iteration stops.

[0146] |J(Q new ,R new )-J(Q old ,R old )|<ε

[0147] After the optimization is completed, the optimized Q and R are used to perform EKF state estimation and compared with the unoptimized results to analyze the accuracy, stability and convergence of SOC estimation. The optimized parameters are tested under different noise levels and dynamic conditions to ensure their robustness in various situations.

[0148] The MSE and RMSE are used to evaluate the performance of the implemented Kalman filter. MSE and RMSE measure the difference between the estimated value and the true value. The smaller the value, the higher the estimation accuracy of the filter. Through the evaluation, we can fully understand the performance of the Kalman filter and optimize and improve it according to specific needs. And analyze the impact of the initial control variables on the smoothness of the filter. The details are as follows:

[0149]

[0150] Where x_est represents the final SOC prediction value, and y_noisy represents the data of the measured SOC under certain interference. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. Those skilled in the art can change, modify, replace and modify the above embodiments within the scope of the present invention.

Claims

1. A lithium battery SOC estimation method based on constrained optimization Kalman filtering, characterized in that: The steps include: Step 1: First, establish an RC equivalent circuit model based on the functional relationship between the battery model parameters; Step 2: Initialize the Kalman algorithm using measured data, including setting the system state and observation equations; the state equation describes the state change, the observation equation connects the observation value and the state, the initial state and variance matrix reflect the estimation and uncertainty of the system's initial state, and the state and variance matrix of the next moment are predicted through the system state equation and control variables, and the error covariance and Kalman gain coefficient are prepared to update the state parameters; Step 3: Perform basic data processing based on the collected measured data of battery discharge, process missing items and classify the data into three parts: charging, discharging, and pause. According to the experimental samples and the obtained system state equation and observation equation; calculate the cumulative discharge amount and the SOC of the lithium battery, perform polynomial fitting simulation on the expression of the SOC of a single lithium battery as observation data, provide a prediction model for the Kalman filter, set the Kalman filter observation noise and process noise according to the timestamp and SOC prediction value, simulate the uncertainty in the actual observation by constructing Gaussian noise, and update the state and variance matrix of the system according to the observed value and the predicted value, where the observation equation represents the relationship between the observed value and the state; Step 4: Construct the Kalman filter prediction and update steps. In the update step, the control input variables are dynamically adjusted by error feedback, and the filter output prior variables are corrected by the least squares linear regression method. According to the recursive algorithm, the prediction and update steps are repeated to obtain a more accurate state estimate. The estimated value weight is adjusted by adjusting the difference between the predicted value and the observed value, thereby obtaining a more accurate state estimate. Step 5: Use MSE and RMSE to evaluate the performance of the implemented Kalman filter. MSE and RMSE measure the difference between the estimated value and the true value. The smaller the value, the higher the estimation accuracy of the filter. Through the evaluation, we can fully understand the performance of the Kalman filter, optimize and improve it according to specific needs, and analyze the impact of the initial control variables on the smoothness of the filter.

2. The lithium battery SOC estimation method based on constrained optimization Kalman filtering according to claim 1 is characterized in that: The RC equivalent circuit model established in step 1 is: U=U OCV -IR0-U1-U2 Where U OCV is the open circuit voltage of the battery; I is the current flowing through the battery; R0 is the ohmic internal resistance of the battery; U i is the voltage across the polarization resistor; Where i = 1, 2; U is the terminal voltage of the battery; Use measured data to initialize the Kalman filter algorithm and establish the system state equation and observation equation: Where: x k+1 represents the system state at time k+1, u k is the known input of the system at time k, also called the control signal, k is the time index, y k is the output measured at time k; w k and v k They are called process noise and measurement noise respectively, which are simulated here by Gaussian white noise, and their covariances are the noise covariance matrix Q and the observation noise covariance matrix R respectively; Construct Kalman filter parameters, predict the state and variance matrix of the next moment through the system state equation and control variables, and update the state parameters; By completing the derivation of the state equation and the output equation, the nonlinear equation is transformed into the output form of the linear equation, so that the Kalman filter of the linear equation is used to estimate the optimized state variable; For each time step, the partial derivative matrix of the following formula is calculated to obtain the prior state evaluation: Construct the Kalman filter parameters, and construct the function according to the above formula to predict the state variables and error covariance as follows: In the formula is the k-th step prior state estimate, is the k-th step prior error covariance matrix, and solves the Kalman gain update equation: We can see that K is determined by two types of variances, Q and R, which are determined by the variance of the previous estimate. If the variance is found to be large, it means that the estimate is unreliable. The K value will be close to 1 as the gait is updated. The state estimation measurement update equation and the covariance measurement update equation are obtained according to the Kalman gain parameter:

3. The lithium battery SOC estimation method based on constrained optimization Kalman filtering according to claim 1 is characterized in that: The data preprocessing in step 3 includes removing missing data from the collected measured data of battery discharge and classifying the data, loading the data, checking and processing the missing values ​​in the data, and marking the missing values ​​as 0, which is used as the basis for data segmentation; The data is divided into three stages: charging, discharging and pause, and targeted analysis and processing are carried out. By traversing the processed data, the data is classified according to the positive and negative and size of the current value; when the current value is positive and greater than the discharge current, it is marked as the charging stage; when the current value is negative and the absolute value is equal to the discharge current, it is marked as the discharge stage; when the current value is close to 0, it is marked as the pause stage, and the start and end indexes of each data segment are recorded; Cumulative discharge capacity calculation: calculate the cumulative discharge capacity of the battery during the discharge process to provide a basis for the calculation of SOC. For the data in the discharge stage, the current value and timestamp are used to calculate the cumulative discharge capacity. The calculation formula is as follows: Q n =∑(I·Δt) The battery SOC is calculated based on the cumulative discharge amount. The calculation method is based on the rated capacity of the battery and the cumulative discharge amount. The calculation formula is as follows: Polynomial fitting: use the observed data to perform polynomial fitting, simulate the change trend of the battery SOC, provide a prediction model for the Kalman filter, select an appropriate polynomial degree (such as 5), use the least squares method to fit the SOC data, and the obtained polynomial coefficients will be used to simulate the predicted value of SOC; The Kalman filter parameters are set as Kalman filter observation noise and process noise to simulate the uncertainty in actual observations. The following three control variables will directly affect the filter fitting effect: observation noise covariance R, set according to the variability of observation data, reflects the size of observation error; process noise covariance Q, set according to the dynamic characteristics of the system, reflects the uncertainty of model prediction; Simplify the model and optimize the filter constraints, compare the two parameters to find the optimal parameter solution; Insufficient process noise Q: If the estimate of process noise is too small, the filter is too confident in the prior and cannot adapt to rapid changes in the data; The observation noise R is too large or too small: If the observation noise is too large, the filter will rely too much on the observation value and ignore the model prediction; if it is too small, the filter will rely too much on the model prediction and will not be sensitive enough to the observation value. Finally, according to the optimization performance comparison, the filter parameters with large Q and small R are selected to meet the performance analysis of the optimization filter; The accumulated discharge amount and SOC are calculated, and an observation model is constructed to express the relationship between the observation value and the system state. The observation model is defined as follows: where z is the observation value, x is the system state such as SOC, is the observation function, and v is the observation noise; z=h(x)+v.

4. The lithium battery SOC estimation method based on constrained optimization Kalman filtering according to claim 1 is characterized in that: In step 4, the prediction and update steps of the Kalman filter are further optimized. The control input variables are dynamically adjusted by introducing an error feedback mechanism, thereby achieving accurate correction of the filter output prior variables. In the update step, the least squares method is used to perform linear regression correction on the filter output to minimize the sum of squares of the errors to find the best function match for the data; the least squares method is used to adjust the prior estimate of the Kalman filter to ensure that the estimated value is close to the actual observed value; Define the error function, which is defined as the sum of squares of the difference between the Kalman filter estimate and the true value; Among them, y k is the actual observation value at the kth time, It is the predicted value calculated by the current state prediction and the noise covariance matrix. The goal is to minimize this error function by adjusting Q and R. Some constraints need to be introduced in the optimization to ensure that the selected Q and R are reasonable and feasible. Calculate the objective function and use the current Q and R to calculate the predicted value in each iteration Calculation error e k And update the objective function J(Q,R); After the update, check whether the new parameters meet the constraints; if not, correct them to a reasonable range through the projection method; When the change of the objective function is less than the set threshold ε or the number of iterations reaches the set maximum value, the iteration is stopped; |J(Q new ,R new )-J(Q old ,R old )|<ε After the optimization is completed, the optimized Q and R are used to perform EKF state estimation and compared with the unoptimized results to analyze the accuracy, stability and convergence of SOC estimation.

5. The lithium battery SOC estimation method based on constrained optimization Kalman filtering according to claim 1 is characterized in that: In step 5, the performance of the Kalman filter is evaluated using mean square error (MSE) and root mean square error (RMSE) as evaluation indicators. MSE is the average of the square sum of the prediction errors, while RMSE is the square root of MSE, which can quantify the deviation between the filter prediction value and the actual observation value. Among them, x_est represents the final SOC prediction value, and y_noisy represents the data of the measured SOC under certain interference.

Citation Information

Cited By

  • Battery capacity online estimation method based on extended Kalman filtering

    CN118759388A

  • A battery capacity online estimation method based on extended Kalman filter

    CN118759388B

  • New energy battery load optimization system and method based on adaptive algorithm

    CN119872340A

  • Energy storage power station SOC / SOE joint correction method based on Kalman filtering fused with multi-parameter optimization

    CN120428119A

  • A joint correction method for SOC / SOE of energy storage power station based on Kalman filter fusion and multi-parameter optimization

    CN120428119B