Battery SOC prediction method and system based on improved particle filter algorithm
By improving the particle filtering algorithm, combined with the advantages of traceless Kalman filtering and particle filtering, the limitations of traditional methods in nonlinear systems are solved, high-precision and stable battery state of charge estimation are achieved, the system's anti-interference ability and fast response ability are enhanced, and the battery management needs of high-precision and low-latency are met.
Patent Information
- Application Number
- CN202510468664.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-08-01
AI Technical Summary
The existing Kalman filtering method has limitations when dealing with strong nonlinear systems, especially poor adaptability to non-Gaussian noise, and particle filtering method has particle degradation, resulting in reduced battery state of charge estimation accuracy and reduced calculation efficiency, making it difficult to meet the high-precision and low-latency battery management needs.
Using an improved particle filtering algorithm, through adaptive resampling, traceless Kalman particle filtering technology, combined with the advantages of traceless Kalman filtering and particle filtering, we generate initial particle swarms, propagate Sigma points, calculate the predicted mean and covariance, update the particle weights and perform adaptive resampling, dynamically adjust the noise covariance matrix to suppress high-frequency noise and improve the battery state of charge estimation accuracy.
In complex power grid environments, the voltage detection accuracy is significantly improved, the system's anti-interference ability and robustness are enhanced, and the rapid response to battery abnormalities and high-precision SOC estimation is achieved, providing high-performance, low-latency battery management support.
Smart Images

Figure CN120405431A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of battery SOC prediction. Specifically, the present invention relates to a battery SOC prediction method and system based on an improved particle filter algorithm. Background Art
[0002] With the rapid development of electric vehicles and energy storage systems, as one of the core components, the performance of the battery management system (BMS) directly affects the safety, reliability, and service life of the battery. The estimation of the state of charge (SOC) of the power battery is one of the key functions of the BMS, and its accuracy and real-time performance are of great significance for the charge and discharge control, energy management, and life prediction of the battery. However, due to the nonlinear and time-varying characteristics of the battery system and complex external environmental interferences, traditional SOC estimation methods face many challenges in practical applications.
[0003] Currently, common SOC estimation methods include the open-circuit voltage method, the ampere-hour integration method, the Kalman filter method, etc. Among them, the Kalman filter method is widely used in battery state estimation because it can effectively handle the noise and nonlinear problems of the system. However, the traditional Kalman filter method has limitations in dealing with strongly nonlinear systems, especially its poor adaptability to non-Gaussian noise. In addition, although the particle filter method can handle nonlinear problems, there is a phenomenon of particle degradation, resulting in a decrease in estimation accuracy and computational efficiency. In recent years, the unscented Kalman particle filter (UKPF) method combines the advantages of the unscented Kalman filter (UKF) and the particle filter, and can improve the accuracy and robustness of SOC estimation to a certain extent. However, the existing UKPF methods still have problems such as low current and voltage detection accuracy and lagging overcurrent protection response in complex power grid environments, and it is difficult to meet the high-precision and low-latency battery management requirements.
[0004] Therefore, the present invention proposes a battery SOC prediction method and system based on an improved particle filter algorithm. Summary of the Invention
[0005] The present invention aims to overcome the deficiencies of the prior art and proposes a battery SOC prediction method and system based on an improved particle filter algorithm to achieve the following objectives: suppressing noise and accurately estimating SOC through the improved particle filter algorithm, improving the stability and robustness of the system; at the same time, enabling the system to quickly respond to and alarm for battery circuit abnormalities to ensure the safe operation of the system.
[0006] To achieve the above objectives, the technical solution adopted by the present invention is: a battery SOC prediction method based on an improved particle filter algorithm, the method comprising the following steps:
[0007] Step S1: Collect the voltage and current of the battery;
[0008] Step S2: Construct a battery equivalent model based on the voltage and current of the battery;
[0009] Step S3: Identify each model parameter in the battery equivalent model;
[0010] Step S4: Generate N particles in the state space, and these particles form a point set;
[0011] Step S5: Determine the initial values of each particle, including the initial SOC value represented by the particle;
[0012] Step S6: Perform SOC prediction through an improved particle filter algorithm, including: uniformly distributing the initial weights of each particle to generate an initial particle swarm; calculating the predicted mean and covariance through the Sigma point propagation of the nonlinear state equation; calculating the particle weights based on the observation equation and normalizing them; performing adaptive resampling according to the number of effective particles; and weighted-averaging the particle states to output the SOC estimation value.
[0013] Preferably, in the step S2, the battery equivalent model adopts a second-order RC equivalent circuit model, where the positive pole of the equivalent power supply is connected to the positive output terminal of the battery in series with the battery internal resistance R0, resistor R1, and resistor R2 in sequence; a capacitor C1 is connected in parallel across the two ends of the resistor R1; a capacitor C2 is connected in parallel across the two ends of the resistor R2; the negative pole of the equivalent power supply is connected to the negative output terminal of the battery; the equivalent power supply voltage is Uoc, the voltage across the resistor R1 is U1, the voltage across the resistor R2 is U2, the battery current is I, and the battery voltage is U.
[0014] Preferably, in the step S6, uniformly distributing the initial weights of each particle to generate an initial particle swarm specifically includes:
[0015] Performing a prior prediction of the system state at the current moment based on the state estimation value of the system at the previous moment:
[0016]
[0017] where f(·) represents the nonlinear state equation, and x k = [U1, U2, SOC] T is the state vector, representing the polarization voltages U1, U2, and SOC; I k is the charge and discharge current; v k is the process noise covariance, following a Gaussian distribution with a mean of 0 and a covariance of Q k ; y k is the battery terminal voltage; R0 is the ohmic internal resistance; w k is the observation noise covariance, following a Gaussian distribution with a mean of 0 and a covariance of R kGaussian distribution;
[0018] Generate an initial particle swarm, where each particle contains a state and a weight
[0019]
[0020] That is, the initial state x0 of the i-th particle follows a Gaussian distribution with a mean of x0 and a covariance of P0; among them, the initial state x0 and the covariance P0 are calibrated based on the open-circuit voltage when the battery is at rest.
[0021] Preferably, the predicted mean and covariance are calculated by propagating the Sigma points through the nonlinear state equation, including:
[0022] Perform unscented transformation on each particle:
[0023] Select a set of Sigma points, that is:
[0024]
[0025] Among them, n represents the state dimension; λ represents the scale parameter, which is used to control the distribution range of the Sigma points;
[0026] Propagate the Sigma points through the nonlinear state equation f(·), that is:
[0027]
[0028] Calculate the predicted mean and covariance
[0029]
[0030] Among them, and represent the weight coefficients of the mean and covariance respectively;
[0031] Obtain the particle swarm updated based on the unscented Kalman filter, that is:
[0032]
[0033] Among them, the initial state x of the i-th particle k follows a Gaussian distribution with a mean of and a covariance of
[0034] Preferably, calculate the particle weights based on the observation equation and normalize them, including: based on the updated particle swarm, calculate the observation likelihood and perform weight update and normalization, that is:
[0035]
[0036] Among them, the observation function
[0037] Normalized weight:
[0038]
[0039] Preferably, adaptive resampling is performed according to the effective number of particles. The calculation formula of the effective number of particles ESS is as follows:
[0040]
[0041] When ESS is greater than or equal to the preset threshold, resampling is not triggered, and at this time, the current particle swarm can be directly used for SOC estimation; when ESS is less than the preset threshold, resampling is triggered.
[0042] Preferably, when the system resampling is triggered, first, a cumulative distribution is constructed:
[0043]
[0044] Then a uniform starting point is generated:
[0045]
[0046] Among them, each u j corresponds to a particle, and u1 follows a uniform distribution within the interval [0, 1 / N];
[0047] Finally,
[0048] that is, the weight of any particle is reset.
[0049] Preferably, the weighted average particle state is used to output the SOC estimation value, that is:
[0050] Among them, represents the output SOC estimation value; represents the SOC value represented by the i-th particle.
[0051] The present invention also proposes a battery SOC prediction system based on an improved particle filter algorithm. The system includes a battery, a voltage detection module, a current detection module, a temperature detection module, a circuit on-off control module, an alarm module, an MCU, and a power supply module, where:
[0052] The circuit on-off control module includes a fixed relay, and the output end of the battery is fixedly connected to the MCU through the fixed relay;
[0053] The voltage detection module and the temperature detection module are respectively connected to the MCU, and are respectively used for collecting voltage and temperature and sending them to the MCU; the current detection module includes a shunt resistor, an RC low-pass filter, an EMI suppression circuit, an amplifier, and an ADC. The current signal collected by the shunt resistor is sent to the MCU after passing through the RC low-pass filter, the EMI suppression circuit, the amplifier, and the ADC in sequence;
[0054] The MCU is integrated with data communication interfaces for data communication with other devices through multiple data communication interfaces, and the data communication interfaces include I2C, SPI, GPIO, CAN, and PHY; the MCU is also integrated with a PWM driving unit, and the PWM driving unit is connected to the alarm module; the MCU is used for acquiring the voltage, current, and temperature collected in real time, comparing them with their respective preset thresholds, generating a PWM signal to drive the alarm module to alarm, and simultaneously generating a control signal to a fixed relay to control its on / off, and acquiring the battery voltage and current and estimating the battery SOC according to the deployed improved particle algorithm;
[0055] The power supply module includes a power supply, a DC-DC converter, and an RC filter. The voltage output by the power supply passes through the DC-DC converter and the RC filter in sequence and then outputs to the MCU to supply power to the MCU.
[0056] Preferably, the MCU uses NXP S32K344.
[0057] The technical effects of the present invention are as follows:
[0058] (1) An improved particle filter algorithm is designed. By dynamically adjusting the noise covariance matrix, the voltage detection accuracy is significantly improved. In a complex power grid environment, the algorithm can effectively suppress the high-frequency noise in the voltage signal, enhancing the anti-interference ability and robustness of the system. Specifically, the algorithm combines the advantages of the unscented Kalman filter (UKF) and the particle filter (PF) through the adaptive resampling unscented Kalman particle filter (AR-UKPF) technology, solving the limitations of traditional methods in nonlinear systems. Through steps such as generating an initial particle swarm, propagating Sigma points, calculating the predicted mean and covariance, updating particle weights, and adaptive resampling, the algorithm can accurately calculate the state of charge (SOC) of the battery and maintain high accuracy and stability in a complex environment.
[0059] (2) The system of the present invention has functions of real-time overcurrent, overvoltage, and overtemperature protection. Combining high-precision voltage, current, and temperature detection, it can quickly respond to battery anomalies and avoid system damage caused by overcurrent, overvoltage, and overtemperature. At the same time, the system of this embodiment realizes efficient data transmission and remote diagnosis. Combining with the controller based on NXP S32K344, it can efficiently run the adaptive Kalman filter algorithm and real-time overcurrent, overvoltage, and overtemperature protection functions, providing high-performance and low-latency hardware support for the power battery management system. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 It is a flowchart of a battery SOC prediction method based on an improved particle filter algorithm provided by an embodiment of the present invention;
[0061] Figure 2 It is a second-order RC equivalent circuit model diagram provided by an embodiment of the present invention;
[0062] Figure 3 It is a schematic diagram comparing the SOC estimated value curves before and after filtering based on the improved particle filter algorithm provided by an embodiment of the present invention;
[0063] Figure 4 It is a structural diagram of a battery SOC prediction system based on an improved particle filter algorithm provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0064] Next, with reference to the accompanying drawings, through the description of the embodiments, the specific embodiments of the present invention will be further described in detail. The purpose is to help those skilled in the art have a more complete, accurate, and in-depth understanding of the inventive concept and technical solution of the present invention, and to facilitate its implementation. It should be noted that the terms "first", "second", etc. used in this application are only for the convenience of describing the technical solution to distinguish different components, and do not limit this application. To make the technical solution of the present invention clearer, the present invention is explained and illustrated through the following embodiments.
[0065] This embodiment provides a method for predicting the state of charge (SOC) of a battery based on an improved particle filter algorithm. As Figure 1 shown, the method includes the following steps:
[0066] Step S1: Collect the voltage and current of the battery;
[0067] Step S2: Construct a battery equivalent model according to the voltage and current of the battery;
[0068] Step S3: Identify each model parameter in the battery equivalent model; [[ID=�9]]
[0069] Step S4: Generate N particles in the state space, and these particles form a point set;
[0070] Step S5: Determine the initial values of each particle, including the initial SOC value represented by the particle.
[0071] Step S6: Perform SOC prediction through an improved particle filter algorithm, including: evenly distributing the initial weights of each particle to generate an initial particle swarm; calculating the predicted mean and covariance through Sigma point propagation of the nonlinear state equation; calculating and normalizing the particle weights based on the observation equation; performing adaptive resampling according to the number of effective particles; and weighted-averaging the particle states to output the SOC estimated value.
[0072] Specifically, after obtaining the current and voltage data output by the battery, in this embodiment, a battery equivalent model is first established in step S2 to facilitate the estimation of SOC.
[0073] The battery equivalent model of this embodiment adopts a second-order RC equivalent circuit model, which has higher accuracy and the estimated SOC is more accurate. Specifically in implementation, other battery equivalent models can also be flexibly selected according to actual needs. As Figure 2 Shown is the diagram of the second-order RC equivalent circuit model of this embodiment. Among them, the positive pole of the equivalent power supply is sequentially connected to the positive output terminal of the battery after being connected in series with the battery internal resistance R0, resistor R1, and resistor R2; a capacitor C1 is connected in parallel across the two ends of resistor R1; a capacitor C2 is connected in parallel across the two ends of resistor R2. Capacitors C1 and C2 simulate different energy storage processes of the battery, while resistors R1 and R2 describe the current loss of the battery in different discharge stages; the negative pole of the equivalent power supply is connected to the negative output terminal of the battery; the equivalent power supply voltage is Uoc, the voltage across resistor R1 is U1, the voltage across resistor R2 is U2, the battery current is I, and the battery voltage is U.
[0074] After obtaining the battery equivalent model, it is also necessary to identify the model parameters. In the second-order RC equivalent circuit model of this embodiment, the parameters to be identified include the equivalent power supply voltage Uoc, voltage U1, voltage U2, battery internal resistance R0, resistors R1, R2, capacitors C1, and C2. The specific identification process is prior art and will not be elaborated in this embodiment. After the identification is completed, the second-order RC equivalent circuit model of the battery is finally obtained, which provides convenience for subsequent SOC estimation.
[0075] Based on the particle filter algorithm, in step S4 of this embodiment, N particles are randomly generated in the state space, and these particles form a point set; then, in step S5, the initial values of each particle are determined, including the initial SOC value represented by the particle.
[0076] Finally, in step S6 of this embodiment, SOC prediction is performed through an improved particle filter algorithm, and the following is a specific description with reference to Figure 1 for specific illustration.
[0077] First, based on the state estimate of the system at the previous moment (including the state vector and covariance matrix), a prior prediction of the system state at the current moment is made:
[0078]
[0079] Among them, f(·) represents the non-linear state equation, indicating the relationship between x k-1 and I k ; x k = [U1, U2, SOC] T is the state vector, representing the polarization voltages U1, U2, and SOC); I k is the charge and discharge current; v k is the process noise covariance, following a Gaussian distribution with a mean of 0 and a covariance of Q k ; y k is the battery terminal voltage; R0 is the ohmic internal resistance; w k is the observation noise covariance, following a Gaussian distribution with a mean of 0 and a covariance of R k .
[0080] Based on this, an improved scheme of the particle filter algorithm is proposed in this embodiment, that is, the adaptive resampling unscented Kalman particle filter (AR-UKPF) algorithm, and its process is as follows:
[0081] Step S61: Initialize, that is, uniformly distribute the initial weights of each particle to generate an initial particle swarm, specifically including:
[0082] Generate an initial particle swarm, and each particle contains a state and a weight
[0083]
[0084] That is: the initial state x0 of the i-th particle follows a Gaussian distribution with a mean of x0 and a covariance of P0; among them, the initial state x0 and the covariance P0 are calibrated based on the open-circuit voltage when the battery is at rest.
[0085] Step S62: Calculate the predicted mean and covariance by propagating the non-linear state equation through the Sigma points, that is, perform UKF prediction (time update) independently for each particle based on the unscented Kalman filter algorithm (UKF) and generate a particle swarm, including:
[0086] Perform an unscented (UT) transformation on each particle:
[0087] Select a set of Sigma points, that is:
[0088]
[0089] Among them, n represents the state dimension; λ represents the scale parameter, which is used to control the distribution range of Sigma points;
[0090] Propagate the Sigma points through the non - linear state equation f(·), that is:
[0091]
[0092] Calculate the predicted mean according to the propagated Sigma points And covariance
[0093]
[0094] Among them, And Represent the weight coefficients of the mean and covariance respectively;
[0095] At this time, the particle swarm updated based on the unscented Kalman filter can be obtained, that is:
[0096]
[0097] Among them, the initial state x of the i - th particle k Follows a Gaussian distribution with a mean of And a covariance of Gaussian distribution.
[0098] Step S63: Calculate and normalize the particle weights based on the observation equation, including: calculating the observation likelihood and performing weight update and normalization based on the updated particle swarm, that is:
[0099]
[0100] Among them, the observation function
[0101] Normalized weight:
[0102]
[0103] Step S64: Perform adaptive resampling according to the effective number of particles. The calculation formula for the effective number of particles ESS is as follows:
[0104]
[0105] In this embodiment, when ESS is greater than or equal to the preset threshold, resampling is not triggered. At this time, the current particle swarm can be directly used for SOC estimation; when ESS is less than the preset threshold, resampling is triggered. The preset threshold in this embodiment is set to 0.5N, and it can be flexibly selected according to actual needs during specific implementation.
[0106] When the system resampling is triggered, first, construct the cumulative distribution:
[0107]
[0108] By calculating the cumulative sum of the particle weights, a cumulative distribution function is formed for subsequent determination of the particle selection interval.
[0109] Then generate a uniform starting point to uniformly select particles:
[0110]
[0111] Among them, each corresponds to a particle, following a uniform distribution within the interval [0, 1 / N], and the spacing between different particles is equal;
[0112] Finally,
[0113] That is, reset the weight of any particle, and after sampling, the weights of each particle are equal, solving the particle degeneracy problem and improving the estimation accuracy.
[0114] Step S64, after adaptive resampling, perform weighted average of the particle states according to the current particle swarm to output the SOC estimation value, that is:
[0115] Among them, represents the output SOC estimation value; represents the SOC value represented by the i-th particle.
[0116] As Figure 3 shown is the curve graph of the SOC estimation values before and after the method based on this embodiment. Obviously, the filtered curve is smoother, suppressing high-frequency noise, enhancing the anti-interference ability and robustness of the system, and improving the estimation accuracy of SOC.
[0117] The present invention designs an improved particle filter algorithm, which significantly improves the voltage detection accuracy by dynamically adjusting the noise covariance matrix. In a complex power grid environment, this algorithm can effectively suppress high-frequency noise in the voltage signal, enhancing the anti-interference ability and robustness of the system. Specifically, the algorithm combines the advantages of the unscented Kalman filter (UKF) and the particle filter (PF) through the adaptive resampling unscented Kalman particle filter (AR-UKPF) technology, solving the limitations of traditional methods in nonlinear systems. Through steps such as generating the initial particle swarm, propagating the Sigma points, calculating the predicted mean and covariance, updating the particle weights, and adaptive resampling, the algorithm can accurately estimate the state of charge (SOC) of the battery and maintain high accuracy and stability in a complex environment.
[0118] Meanwhile, according to the above method, this embodiment also proposes a battery SOC prediction system based on an improved particle filter algorithm, as Figure 4 shown. The system includes a battery, a voltage detection module, a current detection module, a temperature detection module, a circuit on / off control module, an alarm module, an MCU, and a power supply module, where:
[0119] The circuit on / off control module includes a fixed relay, and the output terminal of the battery is connected to the GPIO interface (general-purpose input / output interface) of the MCU through the fixed relay. When the voltage, current, and temperature of the battery exceed their preset thresholds, for safety protection, the MCU generates a control signal to the fixed relay to control the relay to disconnect, thereby cutting off the entire battery circuit. The preset thresholds can be adjusted in real time according to the load type and historical battery data through sliding window statistics, so as to realize the dynamic adjustment of the thresholds, have strong adaptability in the case of load changes and noise environments, and can effectively reduce false alarms and missed alarms. This system uses a solid-state relay to replace the traditional MOSFET, with a response time < 1 μs, supports bidirectional overcurrent protection, and improves the system safety.
[0120] The voltage detection module and the temperature detection module are respectively connected to the MCU, and are respectively used to collect voltage and temperature and send them to the MCU. In this embodiment, the voltage detection module selects the MAX14921 multi-channel battery monitoring chip, which can synchronously collect the voltages of each monomer in the battery pack and send them to the MCU through interfaces such as CAN, SPI, and I2C. The temperature detection module selects an NTC thermistor and a dedicated temperature acquisition chip TMP117, with an accuracy of ±0.1 °C. The collected temperature data can be sent to the MCU through the I2C interface.
[0121] The current detection module includes a shunt resistor, an RC low-pass filter, an EMI suppression circuit, an amplifier, and an ADC. The current signal collected by the shunt resistor is sent to the MCU after passing through the RC low-pass filter, the EMI suppression circuit, the amplifier, and the ADC (analog-to-digital converter) in sequence. The shunt resistor uses a 0.02 mΩ ultra-low resistance shunt resistor, which has higher thermal stability and a temperature drift coefficient < 10 ppm / °C; the amplifier uses the TI INA240 high-precision current detection amplifier, which supports bidirectional current detection, has a programmable gain, a bandwidth of 1.1 MHz, and a common-mode rejection ratio of up to 140 dB; the ADC uses a 16-bit high-precision analog-to-digital converter AD7779, which reduces the noise of the analog link, increases the sampling rate to 50 kHz, and the collected current data can be sent to the MCU through the SPI interface, reducing the noise of the intermediate circuit.
[0122] The MCU is integrated with multiple data communication interfaces for data communication with other devices. The data communication interfaces include I2C, SPI, GPIO, CAN, PHY, etc. Among them, the CAN interface supports the MCU to transmit data such as SOC, voltage, current, and temperature collected by the MCU to the vehicle controller in real time through the CAN bus; the PHY interface supports the MCU for remote diagnosis and firmware upgrade. The MCU is also integrated with a PWM driving unit, and the PWM driving unit is connected to the alarm module. The MCU is used to obtain the voltage, current, and temperature collected in real time and compare them with their respective preset thresholds. When the voltage, current, and temperature of the battery exceed their preset thresholds, the MCU generates a PWM signal to drive the alarm module to alarm. The alarm module includes a digital piezoelectric buzzer, an RGB LED matrix (supporting dynamic color coding, for example, red flashing indicates overcurrent, and blue indicates communication failure), etc. At the same time, the MCU also generates a control signal and sends it to the fixed relay through the GPIO interface to control it to disconnect within 2 μs. After the data collection is completed on the premise that there is no alarm for battery safety, the MCU is used to obtain the battery voltage and current and estimate the battery SOC according to the improved particle algorithm deployed in the present invention.
[0123] The power supply module includes a power supply, a DC-DC converter, and an RC filter. The voltage output by the power supply passes through the DC-DC converter and the RC filter in sequence and then outputs to the MCU to supply power to the MCU. When the system starts to work, first connect the 36V DC power supply, convert it to a suitable voltage through the DC-DC converter and then output it to the GPIO interface of the MCU through RC filtering to supply power to the MCU. Subsequently, the MCU starts the crystal oscillator, synchronizes the sampling reference clock, starts data collection, and then performs SOC estimation.
[0124] The MCU in this embodiment uses NXP S32K344, and NXP S32K344 is based on -M series kernel, with a main frequency of 160 MHz, integrated with a hardware floating-point unit (FPU) and DSP instruction set, suitable for complex algorithm calculations, and has the characteristics of high scalability, high performance, and low power consumption.
[0125] The system in this embodiment has real-time overcurrent, overvoltage, and overtemperature protection functions. Combined with high-precision voltage, current, and temperature detection, it can quickly respond to battery abnormalities and avoid system damage caused by overcurrent, overvoltage, and overtemperature. At the same time, the system in this embodiment realizes efficient data transmission and remote diagnosis. Combined with the controller based on NXP S32K344, it can efficiently run the adaptive Kalman filter algorithm and real-time overcurrent, overvoltage, and overtemperature protection functions, providing high-performance and low-latency hardware support for the power battery management system.
[0126] The present invention has been described by way of example in conjunction with the accompanying drawings. Obviously, the specific implementation of the present invention is not limited by the above methods. As long as various non-substantive improvements are made by adopting the method concept and technical solution of the present invention; or without improvement, the above concept and technical solution of the present invention are directly applied to other occasions, they are all within the protection scope of the present invention.
Claims
1. A battery SOC prediction method based on an improved particle filter algorithm, characterized in that: The method includes the following steps: Step S1, collect the voltage and current of the battery; Step S2, construct a battery equivalent model according to the voltage and current of the battery; Step S3, identify each model parameter in the battery equivalent model; Step S4, generate N particles in the state space, and these particles form a point set; Step S5, determine the initial values of each particle, including the initial SOC value represented by the particle; Step S6, perform SOC prediction through an improved particle filter algorithm, including: evenly distributing the initial weights of each particle to generate an initial particle swarm; calculating the predicted mean and covariance through the Sigma point to propagate the nonlinear state equation; calculating the particle weights based on the observation equation and normalizing them; performing adaptive resampling according to the number of effective particles; weighted-averaging the particle states to output the SOC estimated value.
2. The battery SOC prediction method based on an improved particle filter algorithm according to claim 1, wherein: In the step S2, the battery equivalent model adopts a second-order RC equivalent circuit model, where the positive pole of the equivalent power supply is connected to the positive output terminal of the battery in series with the battery internal resistance R0, resistor R1, and resistor R2 in sequence; a capacitor C1 is connected in parallel across both ends of the resistor R1; a capacitor C2 is connected in parallel across both ends of the resistor R2; the negative pole of the equivalent power supply is connected to the negative output terminal of the battery; the equivalent power supply voltage is Uoc, the voltage across the resistor R1 is U1, the voltage across the resistor R2 is U2, the battery current is I, and the battery voltage is U.
3. A method for predicting the state of charge (SOC) of a battery based on an improved particle filter algorithm according to claim 2, wherein: In the step S6, evenly distribute the initial weights of each particle to generate an initial particle swarm, specifically including: Based on the state estimation value of the system at the previous moment, perform a prior prediction on the system state at the current moment: where f(·) represents the non-linear state equation, and x k = [U1, U2, SOC] T is the state vector, representing the polarization voltages U1, U2, and SOC); I k is the charge and discharge current; v k is the process noise covariance, following a Gaussian distribution with a mean of 0 and a covariance of Q k ; y k is the battery terminal voltage; R0 is the ohmic internal resistance; w k is the observation noise covariance, following a Gaussian distribution with a mean of 0 and a covariance of R k ; Generate an initial particle swarm, where each particle contains a state and a weight That is: the initial state x0 of the i-th particle follows a Gaussian distribution with a mean of x0 and a covariance of P0; among them, the initial state x0 and the covariance P0 are calibrated based on the open-circuit voltage when the battery is stationary.
4. A battery SOC prediction method based on an improved particle filter algorithm according to claim 3, characterized in that: Calculating the predicted mean and covariance through the Sigma point to propagate the nonlinear state equation includes: Perform unscented transformation on each particle: Select a set of Sigma points, that is: where n represents the state dimension; λ represents the scale parameter, which is used to control the Sigma point distribution range; Propagate the Sigma points through the nonlinear state equation f(·), that is: Calculate the predicted mean based on the propagated Sigma points and covariance Among them, and represent the weight coefficients of the mean value and the covariance respectively; Obtain the particle swarm updated based on the unscented Kalman filter, that is: Among them, the initial state \(x\) of the \(i\)-th particle k obeys a Gaussian distribution with a mean of and a covariance of .
5. A battery SOC prediction method based on an improved particle filter algorithm according to claim 4, characterized in that: Calculating the particle weights based on the observation equation and normalizing them includes: based on the updated particle swarm, calculating the observation likelihood and performing weight update and normalization, that is: Among them, the observation function Normalized weight:
6. The battery SOC prediction method based on an improved particle filter algorithm according to claim 5, characterized in that: Perform adaptive resampling according to the number of effective particles. The calculation formula for the number of effective particles ESS is as follows: When ESS is greater than or equal to the preset threshold, resampling is not triggered, and at this time, the current particle swarm can be directly used for SOC estimation; when ESS is less than the preset threshold, resampling is triggered.
7. A battery SOC prediction method based on an improved particle filter algorithm according to claim 6, characterized in that: When the system resampling is triggered, first, construct a cumulative distribution: Then generate a uniform starting point: where each u j corresponds to a particle, and u1 follows a uniform distribution within the interval [0, 1 / N]; Finally, That is, reset the weight of any particle.
8. A battery SOC prediction method based on an improved particle filter algorithm according to claim 7, characterized in that: The weighted average particle state is used to output the SOC estimation value, that is: Among them, represents the estimated SOC value of the output; represents the SOC value represented by the i-th particle.
9. A battery SOC prediction system based on an improved particle filter algorithm according to the method of any one of claims 1-8, characterized in that: The system includes a battery, a voltage detection module, a current detection module, a temperature detection module, a circuit on / off control module, an alarm module, an MCU, and a power supply module, where: The circuit on / off control module includes a fixed relay, and the output terminal of the battery is connected to the MCU through the fixed relay; The voltage detection module and the temperature detection module are respectively connected to the MCU, and are respectively used to collect voltage and temperature and send them to the MCU; the current detection module includes a shunt resistor, an RC low-pass filter, an EMI suppression circuit, an amplifier, and an ADC, and the current signal collected by the shunt resistor is sent to the MCU after passing through the RC low-pass filter, the EMI suppression circuit, the amplifier, and the ADC in sequence; The MCU is integrated with data communication interfaces for data communication with other devices through multiple data communication interfaces, and the data communication interfaces include I2C, SPI, GPIO, CAN, and PHY; the MCU is also integrated with a PWM driving unit, and the PWM driving unit is connected to the alarm module; the MCU is used to obtain the voltage, current, and temperature collected in real time, compare them with their respective preset thresholds, generate a PWM signal to drive the alarm module to alarm, and at the same time generate a control signal to the fixed relay to control its on / off, and obtain the battery voltage and current and estimate the battery SOC according to the deployed improved particle algorithm; The power supply module includes a power supply, a DC-DC converter, and an RC filter, and the voltage output by the power supply passes through the DC-DC converter and the RC filter in sequence and then outputs to the MCU to supply power to the MCU.
10. A battery SOC prediction system based on an improved particle filter algorithm according to claim 9, characterized in that: The MCU uses NXP S32K344.