Lithium battery SOC estimation method based on POD-LNN fusion model
By fusing P2D and LNN models in the lithium battery SOC estimation method and using the UKF algorithm integration, the problems of high computing cost, poor generalization and poor interpretability in the prior art are solved, and the accurate online estimation of lithium battery SOC is achieved.
Patent Information
- Application Number
- CN202411964038.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2044-12-30
AI Technical Summary
The existing lithium battery SOC estimation method has high calculation cost, poor generalization and poor interpretability, making it difficult to achieve online accurate estimation.
The lithium battery SOC estimation method based on the P2D-LNN fusion model is adopted. By constructing a P2D model, the electrochemical dynamics inside the battery is captured, and time series prediction is carried out in combination with the LNN model. The UKF algorithm is integrated to establish an online SOC prediction model.
The accurate online estimation of lithium battery SOC is realized, which reduces the calculation cost, improves the generalization and interpretability, and avoids the time-consuming partial differential equation calculation in traditional methods.
Smart Images

Figure CN119902083A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a lithium battery SOC estimation method based on a P2D-LNN fusion model, and belongs to the technical field of lithium battery management. Background Art
[0002] As the penetration rate of electric vehicles continues to increase, the importance of energy issues in electric vehicles is increasing, which makes electrochemical energy storage technology particularly critical. Compared with lead-acid batteries, nickel-cadmium batteries, etc., lithium-ion batteries are widely used in energy storage battery technology due to their excellent characteristics such as low self-discharge rate, high energy density, long service life, no memory and high environmental tolerance. Lithium-ion batteries will produce battery degradation during the charging and discharging process. This will bring about a series of safety and reliability issues such as battery performance degradation, and even cause system failures and fire accidents. Therefore, accurate battery health status estimation is of great significance to extending the battery life, reducing system maintenance costs and ensuring safe system operation.
[0003] The goal of the Battery Management System (BMS) is to ensure the safety, efficiency and durability of lithium batteries and avoid extreme conditions. In BMS, SOC is the basis of all other functions. SOC reflects the remaining power of the battery, and its accurate estimation is extremely important for extending the battery life and improving energy utilization.
[0004] Problems with existing technologies: the open-circuit voltage method requires obtaining an open-circuit voltage value in a certain SOC state by standing still, and cannot be used for online SOC estimation; the ampere-hour integration method is an open-loop method, which will produce cumulative errors and is easily affected by external interference, resulting in low accuracy in practical applications; the physical model-based method is complex and computationally intensive to establish and solve accurate electrochemical models, and has a strong dependence on parameters; the data-driven method requires a large number of data sets for training to establish the relationship between various variables, and its accuracy depends on the quality of the training data set and requires a large amount of computation. Summary of the invention
[0005] In order to solve the problems of high computational cost, poor versatility and poor interpretability in the existing lithium battery SOC estimation method, the present invention further proposes a lithium battery SOC estimation method based on the P2D-LNN fusion model.
[0006] The technical solution adopted by the present invention to solve the above problems is: the present invention comprises:
[0007] Step 1: Collect lithium-ion battery data and establish a lithium-ion battery test database;
[0008] Step 2: Construct a P2D model to capture the electrochemical dynamics inside the lithium battery in the lithium-ion battery test database based on the P2D model;
[0009] Step 3: Perform parameter identification on the lithium-ion battery test database, and calibrate the P2D model parameters based on the parameters obtained by parameter identification;
[0010] Step 4: Input the actual current data under the working condition into the corrected P2D model, and output the simulated voltage, temperature, and c ss and c s,bulk data;
[0011] Step 5: Use the BPTT algorithm to optimize the LNN model, establish a CNN-LNN model, and use the CNN-LNN model to predict the time series of lithium-ion battery status;
[0012] Step 6: Integrate the P2D model and the CNN-LNN model through the UKF algorithm to establish an online SOC prediction model, and complete the accurate estimation of the lithium battery SOC through the online SOC prediction model.
[0013] Preferably, step 2 specifically includes:
[0014] Step 2.1: Use power transmission to describe the relationship between lithium ion concentration and battery current, and obtain the control equation between lithium ion concentration and battery current and its boundary conditions;
[0015] Step 2.2: Calculate the potential in the solid electrode and electrolyte, and substitute the exchange current into the Butler-Volmer equation to calculate the exchange flux j n ;
[0016] Step 2.3: Substitute the potential formula in the solid electrode and electrolyte and the exchange flux j n The battery terminal voltage V(t) is obtained by combining the calculation formula of
[0017] The regulation equation between lithium ion concentration and battery current is:
[0018]
[0019] The boundary condition expression of the control equation is:
[0020]
[0021] In formulas (1) and (2), c s (x, r, t) is the concentration of lithium in the solid phase at a distance r from the center of the spherical particle located at x in the solid electrode at time t, c e (x, t) is the concentration of electrolyte, D s and D e are the effective diffusion coefficients of the solid electrode and electrolyte, respectively, F is the Faraday constant, εe is the volume fraction of electrolyte, is the transfer number of anions, R P is the microscopic scale of cathode lithium ions, j n is the molar flux of lithium ions;
[0022] The formula for measuring the potential in a solid electrode and electrolyte is:
[0023]
[0024] In formula (3), Φ s With Φ e are the potentials in the solid electrode and electrolyte, respectively, R is the universal gas constant, f ca is the average molar coefficient in the electrolyte, κ is the ionic conductivity in the electrolyte, is the transfer number of the cation;
[0025] Exchange flux j n The calculation formula is:
[0026]
[0027] In formula (4), η is the polarization overpotential, i0 is the exchange current;
[0028] The calculation formula of polarization overpotential η and exchange current i0 is:
[0029]
[0030] In formula (5), c s,max is the maximum solid phase concentration, c ss is the solid phase lithium ion concentration on the particle surface, r eff and α are both constants;
[0031] The calculation formula of battery terminal voltage V(t) is:
[0032] V(t)=Φ s (0 + ,t)-Φ s (0 - ,t)(6).
[0033] Preferably, step 3 specifically includes:
[0034] Step 3.1: Preprocess the data in the lithium-ion battery test database;
[0035] Step 3.2: Extract the current I(k), voltage U(k), temperature T(k) and battery terminal voltage V(t) from the preprocessed data, and use the current I(k), voltage U(k), and temperature T(k) as the input feature vector The battery terminal electron pressure V(t) is used as the target vector y(k), and the forgetting factor recursive least squares method is used to iterate to obtain the parameter vector
[0036] Step 3.3: Using parameter vector Correcting the parameters of the P2D model to obtain corrected P2D model parameters;
[0037] The expression of the forgetting factor recursive least squares method is:
[0038]
[0039] In formula (7), is the parameter to be estimated, is the data vector, K is the gain, P is the covariance, and I is the identity matrix.
[0040] Preferably, step 3.2 specifically includes:
[0041] Step 3.2.1: P(k) and forgetting factor λ are initialized;
[0042] Step 3.2.2: For each time step k, get the feature vector of the current time step and the target vector y(k);
[0043] Step 3.2.3: Calculate the prediction error
[0044] Step 3.2.4: Calculate the gain vector K(k);
[0045] Step 3.2.5: Update parameter vector
[0046] Step 3.2.6: Update the error covariance matrix P(k);
[0047] Step 3.2.7: Repeat steps 3.2.2 to 3.2.6 until all time steps are iterated and the parameter vector is obtained.
[0048] Preferably, the step of optimizing the LNN model using the BPTT algorithm in step 5 includes:
[0049] Step 5.1.1: Set the initial parameters θ0, learning rate α, and initial hidden state x0;
[0050] Step 5.1.2: For each time step T, calculate the hidden state x(t) and output Perform forward propagation;
[0051] Step 5.1.3: At the last time step T, calculate the forward propagation loss through the loss function;
[0052] Step 5.1.4: Starting from the last time step T, combine the calculated loss, use the chain rule to recursively calculate the error gradient of each time step, and perform back propagation;
[0053] Step 5.1.5: Calculate the gradient of the parameter θ and use the gradient descent method to update the parameter to complete the optimization of the LNN model; the expression of the loss function is:
[0054]
[0055] In formula (8), yr is the final actual output, is the model prediction output, and L is the forward propagation loss;
[0056] The error gradient at each time step is calculated as:
[0057]
[0058] The gradient of the parameter θ is calculated as:
[0059]
[0060] The expression for updating parameters by the gradient descent method is:
[0061]
[0062] In formula (11), α is the learning rate.
[0063] Preferably, the step of performing time series analysis of the lithium-ion battery state by using the CNN-LNN model in step 5 includes:
[0064] Step 5.2.1: Perform a convolution operation on the input ion battery test data through the convolution layer of the CNN network to extract the spatial features of the ion battery test database, where CNN is a convolutional neural network;
[0065] Step 5.2.2: Perform dimensionality reduction processing on the extracted spatial features through the pooling layer, where the dimensionality reduction processing includes downsampling and feature compression;
[0066] Step 5.2.3: Input the spatial features after dimensionality reduction into the LNN model. The LNN network is a liquid neural network, the LNN network is a recurrent neural network, and the LSTM network is a long short-term memory network. Combined with the time series information in the input ion battery test data, a model is built. A fully connected layer is added after the LNN model to output the time series prediction results of the lithium-ion battery status.
[0067] The expression of the convolution operation is:
[0068]
[0069] In formula (12), is the ith eigenvector of the mth layer, W l is the weight matrix of the i-th filter in the m-th layer, X m-1 is the output of the m-1th layer, is the bias value;
[0070] The expression of dimensionality reduction processing is:
[0071]
[0072] In formula (13), is the i-th feature matrix element of the m+1-th layer after processing by the pooling layer, is the i-th feature matrix element of the m-th layer, D j is the jth pooling region.
[0073] Preferably, the step of modeling in step 5.2.3 in combination with the timing information in the input ion battery test data includes:
[0074] Step 5.2.3.1: Convert the hidden state in the reduced-dimensional space feature into a linear ordinary differential equation;
[0075] Step 5.2.3.2: Substitute the nonlinear term determined by the nonlinear function f into the linear ordinary differential equation to obtain the dynamic equation of the LNN model, and control the flow of the hidden state through the linear coupling gate f to complete the modeling;
[0076] The linear ordinary differential equation is:
[0077]
[0078] In formula (14), x(t) is the hidden state, τ is the time constant, and S(t) is the nonlinear term determined by the nonlinear function f;
[0079] The expression of the nonlinear term determined by the nonlinear function f is:
[0080] S(t)=f(x(t),In(t),t,θ)(Ax(t)) (15);
[0081] In formula (15), f is a neural network parameterized by θ, In(t) is the input, and A is the bias vector;
[0082] The expression of the dynamic equation of the LNN model is:
[0083]
[0084] The expression that controls the flow of hidden states is:
[0085] τ sys =τ1+τ f(x(t),In(t),t,θ) (17);
[0086] In formula (17), τ1 is the initial time constant, τ f(x(t),In(t),t,θ) is a nonlinear function parameterized by a neural network, which determines the adjustment amplitude of the time constant.
[0087] Preferably, step 6 specifically includes:
[0088] Step 6.1: Output the optimized P2D model [c ss ,c s,bulk ] as a given state vector x, combined with the state covariance matrix P, generates a set of sigma points [χ i ];
[0089] Step 6.2: Calculate the weighting coefficient corresponding to the sigma point;
[0090] Step 6.3: Based on the CNN-LNN model, a nonlinear mapping is established between the unknown electrochemical state and the measured voltage, and the measurement function h of the electrochemical state estimation is obtained through the CNN-LNN neural network, and the state transfer equation f is obtained through the optimized P2D model equation;
[0091] Step 6.4: Combine the measurement function h and the state transfer equation f to calculate the next moment prediction mean and covariance matrix of the state quantity and the measurement mean and covariance matrix;
[0092] Step 6.5: Calculate the Kalman gain and update the state;
[0093] Step 6.6: Repeat steps 6.2 to 6.5 until the maximum number of iterations is reached, and output the estimated value of the lithium battery SOC;
[0094] Step 6.7: Calculate the error between the estimated value of the lithium battery voltage and the true value of the lithium battery voltage using the root mean square error function, the mean absolute error function, and the relative error rate function. If the error is greater than a preset value, repeat steps 6.2 to 6.5 until the error is less than the preset value.
[0095] Sigma point [χ i The expression of ] is:
[0096]
[0097] In formula (18), L = n + λ0, coefficient a = 1, n is 2 in the single cell, λ0 is the corresponding proportional coefficient, is the square root of the i-th column of the covariance matrix;
[0098] The calculation formula of the weighted coefficient corresponding to the sigma point is:
[0099] λ0=a 2 (n+mn)(19);
[0100]
[0101] In formulas (19) and (20), the proportional coefficient m = 1, and β = 2 in the Gaussian white noise system;
[0102] The calculation formulas for the next moment predicted mean and covariance matrix of the state quantity and the measured mean and covariance matrix are as follows:
[0103]
[0104] In formulas (21) and (22), Q is the process noise covariance matrix, R is the measurement noise covariance matrix, f() is the state transfer equation, and h() is the state transfer equation and the measurement equation;
[0105] The expression of Kalman gain is:
[0106]
[0107] In formula (23), P xz is the covariance matrix between the state vector and the measurement vector;
[0108] The expression for state update is:
[0109]
[0110] The calculation formula for the error between the estimated value of the battery SOC and the true value of the lithium battery SOC is:
[0111]
[0112] In formulas (25) and (26), N is the number of predictions, RMSE is the root mean square error function, MAE is the mean absolute error function, RER is the relative error rate function, and V i is the actual voltage at time i, is the predicted voltage, and N is the total number of data.
[0113] The beneficial effects of the present invention are:
[0114] 1. The present invention innovatively integrates P2D and LNN to construct an efficient lithium battery state of charge estimation method. The P2D model is constructed to accurately capture the electrochemical dynamics inside the lithium battery. At the same time, the LNN model is introduced to model the complex nonlinear behavior of the lithium battery using its liquid time constant and nonlinear coupling gate characteristics, thereby realizing time series analysis of the battery state. The physical basis of the P2D model is combined with the data-driven capability of the LNN model, and through the integration of the UKF algorithm, a nonlinear mapping between the unknown electrochemical state inside the lithium battery and the measured voltage is established to achieve accurate estimation of the lithium battery SOC.
[0115] 2. The present invention accurately describes the dynamic behavior of battery input and output through P2D combined with the forgetting factor least squares method, provides physical explanations for internal electrochemical reactions, and integrates measurable variables and unknown internal electrochemical variables to train and adjust the parameters of LNN. By integrating the above-mentioned P2D and LNN fusion model with UKF, a hybrid physical and data-driven electrochemical state estimation method is established to predict voltage response online. The traditional electrochemical state estimation method is improved to solve the problems of high computational cost, poor versatility, and poor interpretability in existing estimation methods. It can not only provide physical explanations, but also avoid time-consuming partial differential equation calculations. BRIEF DESCRIPTION OF THE DRAWINGS
[0116] Figure 1 A flow chart of a lithium battery SOC estimation method based on a P2D-LNN fusion model provided by the present invention;
[0117] Figure 2 A framework diagram of the LNN model provided by the present invention;
[0118] Figure 3 The framework diagram of the CNN-LNN model provided by the present invention;
[0119] Figure 4 The flowchart of the UKF algorithm provided by the present invention. DETAILED DESCRIPTION
[0120] Combination Figure 1-4 To illustrate this embodiment, Figure 1 As shown, the steps of the lithium battery SOC estimation method based on the P2D-LNN fusion model described in this embodiment include:
[0121] S1: Collect lithium-ion battery data and establish a lithium-ion battery test database;
[0122] S2: Construct a P2D model to capture the electrochemical dynamics inside lithium batteries in the lithium-ion battery test database based on the P2D model;
[0123] In order to obtain the accurate electrochemical state inside the battery, the present embodiment selects the P2D model as the electrochemical model. The P2D model is the most basic electrochemical model of lithium-ion batteries, which is suitable for the electrochemical model of constant current and adiabatic systems. The lithium-ion battery is equivalent to a sandwich structure composed of electrodes (positive and negative electrodes) composed of countless spherical solid particles, a diaphragm and an electrolyte. It can comprehensively and systematically describe the working characteristics of the battery during charging and discharging, so the P2D model is adopted.
[0124] The P2D model is based on two key points: material transfer and charge transfer. Material transfer occurs in the electrolyte and inside the material particles. The movement of lithium ions in the electrolyte is the diffusion and migration of the liquid phase; the movement of lithium ions inside the material particles is the diffusion of the solid phase. Charge transfer occurs on the surface of material particles, and its core is to analyze the exchange current density through the Butler-Volmer equation. The P2D model can be described as 4 parts: ion transport kinetics, current density and Ohm's law, potential and overpotential, and the Butler-Volmer equation, specifically including:
[0125] S201: Ion diffusion flow and current i due to concentration gradient e The lithium ion concentration in the electrolyte and the electrode will change accordingly. Therefore, this embodiment uses ion transport kinetics to describe the relationship between concentration and battery current. The control equation and its boundary conditions are as follows:
[0126]
[0127] In formulas (1) and (2), c s (x, r, t) is the concentration of lithium in the solid phase at a distance r from the center of the spherical particle located at x in the solid electrode at time t, c e (x, t) is the concentration of electrolyte, D s and D e are the effective diffusion coefficients of the solid electrode and electrolyte, respectively, F is the Faraday constant, ε e is the volume fraction of electrolyte, is the transfer number of anions, R P is the microscopic scale of cathode lithium ions, j n is the molar flux of lithium ions;
[0128] S202: Considering the solid phase and the electrolyte phase, the potential in the solid electrode and the electrolyte can be expressed as:
[0129]
[0130] In formula (3), Φ s With Φ e are the potentials in the solid electrode and electrolyte, respectively, R is the universal gas constant, fca is the average molar coefficient in the electrolyte, κ is the ionic conductivity in the electrolyte, is the transfer number of the cation;
[0131] S203: The Butler-Volmer equation determines the exchange flux j by establishing a relationship with the exchange current n :
[0132]
[0133] In formula (4), η is the polarization overpotential, i0 is the exchange current, and the calculation formula of polarization overpotential η and exchange current i0 is:
[0134]
[0135] In formula (5), c s,max is the maximum solid phase concentration, c ss is the solid phase lithium ion concentration on the particle surface, r eff and α are both constants;
[0136] S204: Combining the above formulas, the battery terminal voltage V(t) can be obtained:
[0137] V(t)=Φ s (0 + ,t)-Φ s (0 - ,t)(6).
[0138] S3: Perform parameter identification on the lithium-ion battery test database, calibrate the P2D model parameters based on the parameters obtained by parameter identification, input the actual current data under the working conditions into the calibrated P2D model, and output the simulated voltage, temperature, and c ss and c s,bulk data;
[0139] The internal chemical reactions of lithium-ion batteries during charging and discharging are relatively complex and time-varying and nonlinear, so it is very difficult to obtain the model parameters through theoretical analysis. Although the fitting method can identify the model parameters, due to the time-varying nature of the battery system, as the battery SOC, external temperature, cycle times and other factors change, the model parameters will also change significantly. Therefore, in order to improve the estimation accuracy of SOC and enhance the adaptability of the system, it is necessary to identify the battery model parameters online and make real-time corrections.
[0140] The least square method is a mathematical optimization technique. It finds the best function match for the data by minimizing the sum of squares of the errors. The least square method can be used to easily obtain unknown data and minimize the sum of squares of the errors between the obtained data and the actual data. However, online observation saves all observation values and uses the classical least square method to solve them, which consumes a lot of computing resources and memory. Therefore, a recursive method similar to dynamic programming is needed to update the parameters of the linear model online. At the same time, the Forgetting Factor Recursive Least Square (FFRLS) algorithm is used to perform real-time online identification of open circuit voltage and ohmic internal resistance, which improves the data saturation problem of the least squares algorithm.
[0141] The forgetting factor recursive least squares method is an improved least squares algorithm. It introduces the forgetting factor λ to weaken the effect of old data and enhance the effect of new data, thereby improving the algorithm's ability to identify time-varying parameters. This algorithm continuously updates the covariance matrix P(k) during system operation to converge the parameters. The forgetting factor λ usually ranges from 0.95 to 0.99. The smaller the value, the stronger the algorithm's ability to track time-varying parameters, but the greater the fluctuation of the identification results; conversely, the larger the λ value, the smaller the fluctuation of the identification results, but the ability to track time-varying parameters is weakened. When λ=1, the algorithm becomes an ordinary recursive least squares method. The formula for the recursive least squares method with forgetting factor λ is as follows:
[0142]
[0143] In formula (7), is the parameter to be estimated, is the data vector, K is the gain, P is the covariance, and I is the identity matrix.
[0144] The parameter identification step includes: S301: preprocessing data in a lithium-ion battery test database;
[0145] S302: Extract the current I(k), voltage U(k), temperature T(k) and battery terminal voltage V(t) from the preprocessed data, and use the current I(k), voltage U(k), and temperature T(k) as input feature vectors The battery terminal electron pressure V(t) is used as the target vector y(k), and the forgetting factor recursive least squares method is used to iterate to obtain the parameter vector
[0146] S30201: Yes P(k) and forgetting factor λ are initialized;
[0147] S30202: For each time step k, obtain the feature vector of the current time step and the target vector y(k);
[0148] S30203: Calculate prediction error
[0149] S30204: Calculate the gain vector K(k);
[0150] S30205: Update parameter vector
[0151] S30206: Update the error covariance matrix P(k);
[0152] S30207: Repeat S30202-S30206 until all time steps are iterated and the parameter vector is obtained.
[0153] S303: Using parameter vector The parameters of the P2D model are corrected, such as Ds, De, the conductivity σ of the electrode material, etc., to obtain the corrected P2D model parameters: wait.
[0154] S4: Use BPTT algorithm to optimize the LNN model, establish a CNN-LNN model, and use the CNN-LNN model to predict the time series of lithium-ion battery status;
[0155] The LNN network is a liquid neural network. Its core lies in modeling time series data by designing dynamic time constants and combining the timing information in the input ion battery test data.
[0156] LNN is a new type of time-continuous recurrent neural network model, which is constructed by combining linear first-order dynamic systems and nonlinear coupling gates. LNN is inspired by the dynamics and adaptability of biological neural systems, especially the concept of liquid computing. In liquid computing, the state change of the network is driven by the input signal, and each input causes a change in the state of the network, and these changes affect future decisions. LNN draws on this idea by building a network whose state changes continuously over time steps, allowing the model to process and adapt to new data in a dynamic way.
[0157] Compared with traditional recurrent neural networks (RNN) and long short-term memory networks (LSTM), LNN has enhanced its ability to capture complex data patterns by expanding the possible function space of the model, especially when dealing with nonlinear and dynamic systems. LNN's real-time decision-making ability gives it a clear advantage in scenarios that require rapid response. At the same time, LNN's rapid adaptability to variable data distribution improves its generalization performance in different data environments.
[0158] The working mechanism of LNN involves two key parts: linear dynamic system and nonlinear coupling gate. The linear dynamic system is responsible for maintaining the state of the network, while the nonlinear coupling gate adjusts the time constant according to the input and current state, thereby affecting the update speed of the state. This design allows LNN to respond to different input features at different time points and achieve dynamic adaptation to time series data.
[0159] The core feature of LNN is the dynamic time constants, which can change independently at each time point according to the input features, thus providing a dedicated dynamic system for each hidden state element. This design makes LNN more flexible and expressive when processing time series data.
[0160] S401: The structure of the LNN model is as follows Figure 2 As shown in Figure 1, the core idea of LNN is to declare the flow of hidden states as a system of linear ordinary differential equations, as follows:
[0161]
[0162] Where x(t) is the hidden state, τ is the time constant, and S(t) represents the nonlinear term determined by the nonlinear function f:
[0163] S(t)=f(x(t),In(t),t,θ)(Ax(t)) (9);
[0164] Where f is a neural network parameterized by θ, In(t) is the input, and A is the bias vector.
[0165] By substituting into the hidden state equation, the present embodiment obtains the dynamic equation of the LNN:
[0166]
[0167] In formula (10), the nonlinear coupling gate f not only determines the derivative of the hidden state x(t), but also controls the flow of the hidden state as the input-dependent change time constant:
[0168] τ sys =τ1+τ f(x(t),In(t),t,θ) (11);
[0169] In formula (11), τ1 is the initial time constant, τ f(x(t),In(t),t,θ) is a nonlinear function parameterized by a neural network, which determines the adjustment amplitude of the time constant.
[0170] S402: LNN model optimization: LNN implements the parameterization of hidden state derivatives, transforming discrete computational graphs into continuous time graphs, so it can be trained using gradient-based optimization algorithms. It is optimized using the Backpropagation through time (BPTT) algorithm, rather than an optimization method based on the adjoint method. The steps for optimizing LNN using the BPTT algorithm are as follows:
[0171] S40201: Initialization: Set the initial parameters θ0, learning rate α, and initial hidden state x0;
[0172] S40202: Forward propagation: For each time step t, calculate the hidden state x(t) and output
[0173] S40203: Calculate loss: Calculate the loss function L at the last time step T: Where yr is the final actual output, is the model prediction output;
[0174] S40204: Backward propagation: Starting from the last time step T, recursively calculate the error gradient at each time step using the chain rule:
[0175]
[0176] S40205: Parameter update: Calculate the gradient of parameter θ: Use gradient descent to update parameters: θ = θ - α ▽ θ L, where α is the learning rate.
[0177] Based on the LNN model, Convolutional Neural Networks (CNN) are used to combine and optimize LNN. The CNN-LNN model combines the advantages of CNN and LNN. CNN is used to extract spatial features from input data, while LNN is used to process long-term dependencies in sequence data.
[0178] S403: Take lithium-ion battery data as input sequence and extract features through one or more convolution layers. The convolution layer is a key part of CNN. It reduces the dimension and extracts features of data through convolution operation, providing more representative and distinguishing feature representation for subsequent layers. The calculation formula of convolution operation is as follows:
[0179]
[0180] In formula (13), is the ith eigenvector of the mth layer, W l is the weight matrix of the i-th filter in the m-th layer, X m-1 is the output of the m-1th layer, is the bias value;
[0181] S404: After the convolution layer, the pooling layer reduces the dimension of the features, retains key information, reduces redundancy, and simplifies the computational complexity. The pooling layer processes the data by downsampling and feature compression to reduce overfitting. The calculation process of the pooling layer is as follows:
[0182]
[0183] In formula (14), is the i-th feature matrix element of the m+1-th layer after processing by the pooling layer, is the i-th feature matrix element of the m-th layer, D j is the jth pooling area;
[0184] LNN can use the spatial features extracted by the convolutional layer and the temporal information of the sequence data to build a model and learn the temporal pattern in the data. A fully connected layer can be added after the LNN hidden state to output the final prediction result. For the specific framework, see Figure 3 .
[0185] S5: The P2D model and CNN-LNN model are integrated through the UKF algorithm to establish an online SOC prediction model, and the accurate estimation of the lithium battery SOC is completed through the online SOC prediction model.
[0186] The UKF algorithm combines the unscented transform (UT) with the Kalman filter algorithm to address the limitations of the EKF in dealing with nonlinear systems. As the core and premise of the UKF algorithm, the UT algorithm calculates the statistical values of nonlinear variables to obtain multiple variable values that conform to statistical laws. Nonlinear variables are obtained by simulating the sampling points according to a certain probability distribution. According to the statistical characteristics of the variables, a limited number of sampling points are selected following a specific method to ensure that the selected reference points are close to the probability distribution characteristics of the known variables. By determining the mean and variance of the estimated quantity, taking the estimated quantity as the basic data, and using the stacked sampling strategy to obtain the corresponding number of reference points, while considering that the reference points have the same mean and variance as the estimated quantity, this process is called sigma-ization of the estimated quantity.
[0187] The core idea of UKF is to use a set of sampling points called sigma points to approximately propagate the state distribution of the system. These sigma points are propagated under nonlinear functions through unscented transformations to more accurately capture the mean and covariance of the state distribution, such as Figure 4 As shown, the steps of the UKF algorithm are as follows:
[0188] S501: The value output by the P2D model [c ss ,c s,bulk ] is defined as the state vector x in UKF. It can be observed that the fusion model can establish a nonlinear mapping between the unknown electrochemical state and the measured voltage. The measurement function h of the electrochemical state estimation can be obtained through the LSTM neural network. At the same time, the state transfer equation f can be obtained through the P2D model equation;
[0189] S502: Based on the given state vector x and the state covariance matrix P, a set of sigma points [χ i ]:
[0190]
[0191] In formula (15), L = n + λ0, coefficient a = 1, n is 2 in the single cell, λ0 is the corresponding proportional coefficient, is the square root of the i-th column of the covariance matrix;
[0192] S502: Calculate the weighting coefficient corresponding to the sigma point:
[0193] λ0=a 2 (n+mn) (16);
[0194]
[0195] In formulas (16) and (17), the proportional coefficient m = 1, and β = 2 in the Gaussian white noise system;
[0196] S503: Calculate the predicted mean and covariance matrix of the state quantity at the next moment and the measured mean and covariance matrix:
[0197]
[0198] In formulas (18) and (19), Q is the process noise covariance matrix, R is the measurement noise covariance matrix, f() is the state transfer equation, and h() is the state transfer equation and the measurement equation;
[0199] S504: Calculate Kalman gain and state update;
[0200] The expression of Kalman gain is:
[0201]
[0202] In formula (20), P xz is the covariance matrix between the state vector and the measurement vector;
[0203] The expression for state update is:
[0204]
[0205] S606: The accuracy evaluation index of the final SOC estimation value can be expressed by RMSE, and the loss function in the BPTT training process can also be replaced by RMSE:
[0206]
[0207] In formula (22), V i is the actual voltage at time i, is the predicted voltage, N is the total number of data. In addition, the accuracy of the predicted value can also be reflected by the mean absolute error (MAE) and relative error rate (RER), which are defined as follows:
[0208]
[0209] In summary, the present invention innovatively integrates P2D and LNN to construct an efficient lithium battery state of charge estimation method. By constructing a P2D model to accurately capture the electrochemical dynamics inside the lithium battery, the LNN model is introduced to model the complex nonlinear behavior of the lithium battery using its liquid time constant and nonlinear coupling gate characteristics, thereby realizing time series analysis of the battery state. The physical basis of the P2D model is combined with the data-driven capability of the LNN model, and through the integration of the UKF algorithm, a nonlinear mapping between the unknown electrochemical state inside the lithium battery and the measured voltage is established to achieve accurate estimation of the SOC of the lithium battery.
[0210] The above is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technician familiar with this profession can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent replacement and improvement made to the above embodiments without departing from the content of the technical solution of the present invention, based on the technical essence of the present invention, within the spirit and principles of the present invention, still fall within the protection scope of the technical solution of the present invention.
Claims
1. A lithium battery SOC estimation method based on a P2D-LNN fusion model, characterized in that: The steps of the lithium battery SOC estimation method based on the P2D-LNN fusion model include: Step 1: Collect lithium-ion battery data and establish a lithium-ion battery test database; Step 2: Construct a P2D model to capture the electrochemical dynamics inside the lithium battery in the lithium-ion battery test database based on the P2D model; Step 3: Perform parameter identification on the lithium-ion battery test database, and calibrate the P2D model parameters based on the parameters obtained by parameter identification; Step 4: Input the actual current data under the working condition into the corrected P2D model, and output the simulated voltage, temperature, and c ss and c s,bulk data; Step 5: Use the BPTT algorithm to optimize the LNN model, establish a CNN-LNN model, and use the CNN-LNN model to predict the time series of lithium-ion battery status; Step 6: Integrate the P2D model and the CNN-LNN model through the UKF algorithm to establish an online SOC prediction model, and complete the accurate estimation of the lithium battery SOC through the online SOC prediction model.
2. The lithium battery SOC estimation method based on the P2D-LNN fusion model according to claim 1 is characterized in that: Step 2 specifically includes: Step 2.1: Use power transmission to describe the relationship between lithium ion concentration and battery current, and obtain the control equation between lithium ion concentration and battery current and its boundary conditions; Step 2.2: Calculate the potential in the solid electrode and electrolyte, and substitute the exchange current into the Butler-Volmer equation to calculate the exchange flux j n ; Step 2.3: Substitute the potential formula in the solid electrode and electrolyte and the exchange flux j n The battery terminal voltage V(t) is obtained by combining the calculation formula of The regulation equation between lithium ion concentration and battery current is: The boundary condition expression of the control equation is: In formulas (1) and (2), c s (x, r, t) is the concentration of lithium in the solid phase at a distance r from the center of the spherical particle located at x in the solid electrode at time t, c e (x, t) is the concentration of electrolyte, D s and D e are the effective diffusion coefficients of the solid electrode and electrolyte, respectively, F is the Faraday constant, ε e is the volume fraction of electrolyte, is the transfer number of anions, R P is the microscopic scale of cathode lithium ions, j n is the molar flux of lithium ions; The formula for measuring the potential in a solid electrode and electrolyte is: In formula (3), Φ s is the potential of the solid electrode, Φ e is the potential in the electrolyte, R is the universal gas constant, and f ca is the average molar coefficient in the electrolyte, κ is the ionic conductivity in the electrolyte, is the transfer number of the cation; Exchange flux j n The calculation formula is: In formula (4), η is the polarization overpotential, i0 is the exchange current; The calculation formula of polarization overpotential η and exchange current i0 is: In formula (5), c s,max is the maximum solid phase concentration, c ss is the solid phase lithium ion concentration on the particle surface, r eff and α are both constants; The calculation formula of battery terminal voltage V(t) is: V(t)=Φ s (0 + ,t)-Φ s (0 - ,t)(6)。 3. The lithium battery SOC estimation method based on the P2D-LNN fusion model according to claim 1 is characterized in that: Step 3 specifically includes: Step 3.1: Preprocess the data in the lithium-ion battery test database; Step 3.2: Extract the current I(k), voltage U(k), temperature T(k) and battery terminal voltage V(t) from the preprocessed data, and use the current I(k), voltage U(k), and temperature T(k) as the input feature vector The battery terminal electron pressure V(t) is used as the target vector y(k), and the forgetting factor recursive least squares method is used to iterate to obtain the parameter vector Step 3.3: Using parameter vector Correcting the parameters of the P2D model to obtain corrected P2D model parameters; The expression of the forgetting factor recursive least squares method is: In formula (7), is the parameter to be estimated, is the data vector, K is the gain, P is the covariance, and I is the identity matrix.
4. The lithium battery SOC estimation method based on the P2D-LNN fusion model according to claim 3 is characterized in that: Step 3.2 specifically includes: Step 3.2.1: P(k) and forgetting factor λ are initialized; Step 3.2.2: For each time step k, get the feature vector of the current time step and the target vector y(k); Step 3.2.3: Calculate the prediction error Step 3.2.4: Calculate the gain vector K(k); Step 3.2.5: Update parameter vector Step 3.2.6: Update the error covariance matrix P(k); Step 3.2.7: Repeat steps 3.2.2 to 3.2.6 until all time steps are iterated and the parameter vector is obtained.
5. The lithium battery SOC estimation method based on the P2D-LNN fusion model according to claim 1 is characterized in that: The steps of using the BPTT algorithm to optimize the LNN model in step 5 include: Step 5.1.1: Set the initial parameters θ0, learning rate α, and initial hidden state x0; Step 5.1.2: For each time step T, calculate the hidden state x(t) and output Perform forward propagation; Step 5.1.3: At the last time step T, calculate the forward propagation loss through the loss function; Step 5.1.4: Starting from the last time step T, combine the calculated loss, use the chain rule to recursively calculate the error gradient of each time step, and perform back propagation; Step 5.1.5: Calculate the gradient of the parameter θ and use the gradient descent method to update the parameter to complete the optimization of the LNN model; The expression of the loss function is: In formula (8), yr is the final actual output, is the model prediction output, and L is the forward propagation loss; The error gradient at each time step is calculated as: The gradient of the parameter θ is calculated as: The expression for updating parameters by the gradient descent method is: In formula (11), α is the learning rate.
6. The lithium battery SOC estimation method based on the P2D-LNN fusion model according to claim 1 is characterized in that: The steps of performing time series analysis of lithium-ion battery status by using the CNN-LNN model in step 5 include: Step 5.2.1: Perform a convolution operation on the input ion battery test data through the convolution layer of the CNN network to extract the spatial features of the ion battery test database, where CNN is a convolutional neural network; Step 5.2.2: Perform dimensionality reduction processing on the extracted spatial features through the pooling layer, where the dimensionality reduction processing includes downsampling and feature compression; Step 5.2.3: Input the spatial features after dimensionality reduction into the LNN model, where the LNN network is a liquid neural network, the LNN network is a recurrent neural network, and the LSTM network is a long short-term memory network. Combined with the time series information in the input ion battery test data, a model is built. A fully connected layer is added after the LNN model to output the time series prediction results of the lithium-ion battery status. The expression of the convolution operation is: In formula (12), is the ith eigenvector of the mth layer, W l is the weight matrix of the i-th filter in the m-th layer, X m-1 is the output of the m-1th layer, is the bias value; The expression of dimensionality reduction processing is: In formula (13), is the i-th feature matrix element of the m+1-th layer after processing by the pooling layer, is the i-th feature matrix element of the m-th layer, D j is the jth pooling region.
7. The lithium battery SOC estimation method based on the P2D-LNN fusion model according to claim 6 is characterized in that: The steps of modeling in step 5.2.3 in combination with the timing information in the input ion battery test data include: Step 5.2.3.1: Convert the hidden state in the reduced-dimensional space feature into a linear ordinary differential equation; Step 5.2.3.2: Substitute the nonlinear term determined by the nonlinear function f into the linear ordinary differential equation to obtain the dynamic equation of the LNN model, and control the flow of the hidden state through the linear coupling gate f to complete the modeling; The linear ordinary differential equation is: In formula (14), x(t) is the hidden state, τ is the time constant, and S(t) is the nonlinear term determined by the nonlinear function f; The expression of the nonlinear term determined by the nonlinear function f is: S(t)=f(x(t),In(t),t,θ)(Ax(t)) (15); In formula (15), f is a neural network parameterized by θ, In(t) is the input, and A is the bias vector; The expression of the dynamic equation of the LNN model is: The expression that controls the flow of hidden states is: t sys =τ1+τ f(x(t),In(t),t,θ) (17); In formula (17), τ1 is the initial time constant, τ f(x(t),In(t),t,θ) is a nonlinear function parameterized by a neural network, which determines the adjustment amplitude of the time constant.
8. The lithium battery SOC estimation method based on the P2D-LNN fusion model according to claim 1 is characterized in that: Step 6 specifically includes: Step 6.1: Output the optimized P2D model [c ss ,c s,bulk ] as a given state vector x, combined with the state covariance matrix P, generates a set of sigma points [χ i ]; Step 6.2: Calculate the weighting coefficient corresponding to the sigma point; Step 6.3: Based on the CNN-LNN model, a nonlinear mapping is established between the unknown electrochemical state and the measured voltage, and the measurement function h of the electrochemical state estimation is obtained through the CNN-LNN neural network, and the state transfer equation f is obtained through the optimized P2D model equation; Step 6.4: Combine the measurement function h and the state transfer equation f to calculate the next moment prediction mean and covariance matrix of the state quantity and the measurement mean and covariance matrix; Step 6.5: Calculate the Kalman gain and update the state; Step 6.6: Repeat steps 6.2 to 6.5 until the maximum number of iterations is reached, and output the estimated value of the lithium battery SOC; Step 6.7: Calculate the error between the estimated value of the lithium battery voltage and the true value of the lithium battery voltage using the root mean square error function, the mean absolute error function, and the relative error rate function. If the error is greater than a preset value, repeat steps 6.2 to 6.5 until the error is less than the preset value. Sigma point [χ i The expression of ] is: In formula (18), L = n + λ0, coefficient a = 1, n is 2 in the single cell, λ0 is the corresponding proportional coefficient, is the square root of the i-th column of the covariance matrix; The calculation formula of the weighted coefficient corresponding to the sigma point is: λ0=a 2 (n+mn)(19); In formulas (19) and (20), the proportional coefficient m = 1, and β = 2 in the Gaussian white noise system; The calculation formulas for the next moment predicted mean and covariance matrix of the state quantity and the measured mean and covariance matrix are as follows: In formulas (21) and (22), Q is the process noise covariance matrix, R is the measurement noise covariance matrix, f() is the state transfer equation, and h() is the state transfer equation and the measurement equation; The expression of Kalman gain is: In formula (23), P xz is the covariance matrix between the state vector and the measurement vector; The expression for state update is: The calculation formula for the error between the estimated value of the battery SOC and the true value of the lithium battery SOC is: In formulas (25) and (26), RMSE is the root mean square error function, MAE is the mean absolute error function, RER is the relative error rate function, and V i is the actual voltage at time i, is the predicted voltage, and N is the total number of data.
Citation Information
Patent Citations
Lithium battery SOH estimation and RUL prediction method based on AST-LSTM neural network
CN110824364A
Power battery SOC and SOH estimation method based on data and model fusion
CN117148162A
Lithium battery thermal runaway multistage early warning method based on attention mechanism
CN118209873A
Industrial robot fault prediction method based on Lagrange convolution long short-term memory network
CN118990492A
Device and method for the local determination of characteristic values of a battery cell
DE102020210148A1
Cited By
Heavy-duty gas turbine compressor scale deposition detection method based on liquid neural network
CN120086539A
Intelligent fault diagnosis method for thruster of on-orbit service aircraft
CN120103820A
Lithium ion battery multi-state joint estimation method based on electrochemical model and machine learning
CN120595176A
A Joint Estimation Method for Multi-State Lithium-ion Batteries Based on Electrochemical Models and Machine Learning
CN120595176B
Lithium battery digital twin online state estimation method and system
CN121613341A