Extended Kalman SOC optimization calculation method and system based on FPGA
Through the division of labor and cooperation between the PS and PL ends of the FPGA, efficient battery SOC calculation is achieved, which solves the problems of insufficient stability and response speed of the battery management system in the existing technology and improves the reliability and calculation accuracy of the battery management system.
Patent Information
- Application Number
- CN202510761919.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2045-06-09
AI Technical Summary
When calculating SOC, existing battery management systems perform data collection and system control simultaneously, resulting in reduced system reliability, untimely processor response, and insufficient stability and reliability.
An FPGA-based extended Kalman SOC optimization calculation method is adopted. Through the division of labor between the PS and PL ends of the ZYNQ chip, the PS end is responsible for data acquisition and posterior estimation, and the PL end is responsible for updating the battery second-order RC equivalent model parameters and covariance prediction. The parallel computing capability and flexibility of the FPGA are utilized to achieve efficient SOC calculation.
The accuracy and response speed of SOC calculation are improved, the stability and reliability of the system are enhanced, the power consumption is reduced, and the real-time performance requirements are met.
Smart Images

Figure CN120275835B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of battery management, and in particular to an extended Kalman SOC optimization calculation method and system based on FPGA. Background Art
[0002] In recent years, with the exponential growth of the battery industry, necessary management and control of batteries are required to ensure battery reliability and safety and extend battery life. Battery management systems have emerged as the times require. Among them, the battery's SOC (State of Charge) is one of the most important parameters of a battery management system. SOC calculation methods mainly include OCV (Open Circuit Voltage) method, ampere-hour integration method, model-based method, artificial intelligence method, etc.
[0003] Currently, the hardware processors used in BMSs (Battery Management Systems) are primarily categorized as single-chip microcontrollers (MCUs), digital signal processing (DSPs), and battery management chips. MCUs have limited memory, slow processing speeds, and poor computing power, resulting in poor stability and reliability for BMSs and the inability to utilize efficient SOC calculation methods. DSP-based BMSs primarily consist of a master and slave controllers, divided into data acquisition and system control and calculation. While DSPs improve system processing power, the system's partitioning increases instability. A failure in a slave controller can render the master DSP unable to perform calculations and control. Some battery management chips have SOC calculation capabilities, but these require control from the master processor, reducing system real-time performance.
[0004] In engineering applications, microcontroller units (MCUs), DSPs, and application-specific integrated circuits (ASICs) are commonly used to implement extended Kalman filter calculations in SOCs. However, because MCUs and DSPs employ a sequential CPU (Central Processing Unit) architecture, they struggle to meet engineering requirements for real-time SOC performance. While ASICs offer high computational speed and reliability, they cannot be modified to meet specific needs after implementation, limiting their versatility. Summary of the Invention
[0005] To this end, an embodiment of the present invention provides an extended Kalman SOC optimization calculation method and system based on FPGA (Field Programmable Gate Array) to address the problem that during existing battery SOC calculation, battery pack data acquisition and system control are performed simultaneously. When a large amount of data is loaded and used for SOC estimation, system reliability will be significantly reduced, the processor response will not be timely, and there will be insufficient system reliability and stability.
[0006] In order to achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0007] According to a first aspect of an embodiment of the present invention, an embodiment of the present invention provides an FPGA-based extended Kalman SOC optimization calculation method, which is implemented based on the PS (Processing System) side and PL (Programmable Logic) side of a ZYNQ (ZYNQ is a chip model) chip, and the PS side establishes communication with the PL side. The method includes:
[0008] The PS collects the battery voltage and current data, calculates the SOC value based on the collected voltage and current data and the results of the previous extended Kalman SOC calculation, and sends the calculation result to the PL.
[0009] Based on the calculation results of the PS side, the parameters of the battery's second-order RC equivalent model are updated through the PL side according to the SOC fitting relationship. The Jacobian matrix and prior estimation calculations are performed based on the updated results of the battery's second-order RC equivalent model parameters. The covariance prediction calculation for this round is also performed and the calculation results are sent to the PS side.
[0010] Based on the calculation results of the PL side, the extended Kalman gain calculation is performed through the PS side, and the posterior estimation calculation is performed according to the calculation results of the extended Kalman gain to obtain the extended Kalman SOC calculation results, completing this round of calculation.
[0011] Furthermore, the battery voltage and current data are collected through the PS end, and the SOC value is calculated based on the collected voltage and current data and the results of the previous round of extended Kalman SOC calculation, and the calculation results are sent to the PL end, specifically including:
[0012] Collect the front-end current and voltage at the PS end; select the extended Kalman SOC calculation result obtained from the last round of update As the initial value, the SOC value is calculated by the ampere-hour integration method, then ,in, is the rated capacity of the battery, Current The sampling time interval, Indicates the current round of calculation, Indicates the last round of calculation; the calculation result data And the collected current data is sent to the PL end for use.
[0013] Furthermore, the PL side updates the battery second-order RC equivalent model parameters according to the SOC fitting relationship, performs Jacob matrix calculation and prior estimation calculation based on the updated results of the battery second-order RC equivalent model parameters, and performs the covariance prediction calculation for this round. The calculation results are sent to the PS side, specifically including:
[0014] Battery second-order RC equivalent model parameter update: According to the battery second-order RC equivalent model parameters With SOC k The 7th-order polynomial fitting relationship is: , update the battery second-order RC equivalent model parameters ,in is the open circuit voltage, is the ohmic internal resistance, and is the polarization internal resistance in the second-order RC equivalent model of the battery, and is the polarization capacitance in the second-order RC equivalent model of the battery; is the battery experimental parameter, which represents the fitting relationship with the parameters in the battery second-order RC equivalent model. The positive integer n=1,2,3,4,5,6,7,8, and x represents the specific battery second-order RC equivalent model parameter; The SOC value calculated by the PS side;
[0015] Calculate index and , ,in represents the time constant of the RC circuit, is the updated polarized capacitance, is the updated polarization internal resistance, Δt represents the time interval, x1=1 or 2;
[0016] Jacob matrix calculation: Calculate the Jacob matrix A k , ; Calculate Jacob matrix B k , , is the updated polarization internal resistance; calculate the Jacobian matrix H k The partial derivative equation of , h k Used for subsequent PS end Kalman gain calculation, x1=1 or 2;
[0017] Prior estimation calculation: current state estimation ,in 、 is the RC loop voltage of the battery second-order RC equivalent model, The calculation is completed on the PS side. 、 Use pipeline design to calculate; 、 、 、h k Sent to the PS for posterior estimation calculation;
[0018] Covariance prediction: Calculate the covariance prediction matrix +Q, where the Jacobian matrix of the previous round , represents the transposed matrix, P k-1 is the covariance update result of the previous round, Q is the process noise, k represents the current round of calculation, k-1 represents the previous round of calculation; the calculation result Send to PS for use.
[0019] Furthermore, based on the calculation result of the PL side, the extended Kalman gain calculation is performed through the PS side, and the posterior estimation calculation is performed according to the calculation result of the extended Kalman gain to obtain the extended Kalman SOC calculation result, completing this round of calculation, which specifically includes:
[0020] Extended Kalman gain calculation: Extended Kalman gain k k The calculation formula is: , where the intermediate parameters ; Jacob matrix k Represents the linear relationship between the system measurement value and the state vector, which is a one-dimensional array type The calculation is simplified to , h k The Jacobian matrix H calculated by the PL side k The partial derivative equation results are: is the covariance prediction matrix calculated by the PL side, R k To measure noise, is the covariance prediction matrix The element in row i and column j in the memory is read by the PS end. Then directly complete k k calculate;
[0021] Posterior estimation: Calculate the battery voltage ,in, is the collected current value; then according to the calculated extended Kalman gain k k , further calculate the updated state estimate at the current moment , is the prior state estimation result of the PL end, Collecting values for voltage sensors that contain measurement noise; updated , is the RC loop voltage value of the updated battery second-order RC equivalent model, The extended Kalman SOC calculation result obtained after the update; output the extended Kalman SOC calculation result of this round And used for the next round of calculation;
[0022] Covariance update: read k k 、H k 、P k - Parameters, calculate covariance , and the calculated Sent to the PS side for the next round of calculation.
[0023] Furthermore, the battery second-order RC equivalent model parameters are updated, specifically including:
[0024] The calculation of the parameters of the second-order RC equivalent model is completed by designing multiple parallel computing pipelines. Each pipeline calculation is completed in 5 clock cycles, including: value, completed in the first clock cycle 、 、 、 Calculation; completed in the second clock cycle 、 、 Calculation; completed in the third clock cycle 、 、 Calculation; completed in the fourth clock cycle Calculation; completed in the fifth clock cycle Calculation, and 、 、 、 and The five parameters are accumulated.
[0025] Furthermore, the prior estimation calculation specifically includes:
[0026] Design two parallel computing pipelines to complete U 1,k and U 2,k The calculation formula is: , where I is the collected current, R x1,k is the polarization internal resistance in the second-order RC equivalent model of the battery, The RC loop voltage value of the battery second-order RC equivalent model calculated in the previous round, x1=1 or 2;
[0027] Each pipeline calculation is completed in 4 clock cycles, including: 、 Calculation, the second clock cycle is completed Calculation, the third clock cycle is completed Calculation is performed and the calculation result is output in the fourth clock cycle.
[0028] Furthermore, covariance prediction specifically includes:
[0029] The covariance forecast calculation includes 3 Matrix multiplication of : , the covariance prediction matrix calculation is optimized by designing a systolic array matrix multiplier.
[0030] Furthermore, the method further comprises:
[0031] Design the finite state machine of the extended Kalman SOC calculation process on the PL side, including: the idle state is waiting for the PS side to calculate the SOC parameter update. If the SOC parameter update is completed, the flag SOC_Parameter is set to 1 and enters the next stage; the state state_model is the battery second-order RC equivalent model parameter update calculation, and the next stage is entered after the calculation is completed; the state state_cal_rc is calling the IP core to calculate the index, and the next stage is entered after the calculation is completed; the state state_jacobian is the Jacobian matrix calculation. After the calculation is completed, the flag Calculate_end is set to 1 and enters the next stage; the state state_prior is the prior estimate calculation, which is the RC loop voltage pipeline calculation of the second-order RC equivalent model for a total of 4 clock cycles. If the calculation is completed, the flag Matrix_end is set to 1 and enters the next stage; the state state_err_covar is the covariance prediction; if the flag Calculate_end or Matrix_end is 1, enter the state_axi state. The state_axi state indicates that the Jacobian matrix calculation or the prior estimate calculation is completed, and the parameters are passed to the PS side.
[0032] Furthermore, the method further comprises:
[0033] The Advanced eXtensible Interface (AXI) protocol is used to establish communication between the PS and PL.
[0034] According to a second aspect of an embodiment of the present invention, an embodiment of the present invention provides an FPGA-based extended Kalman SOC optimization calculation system, wherein the system includes a PS end and a PL end based on a ZYNQ chip, and the PS end establishes communication with the PL end;
[0035] The PS terminal is used to collect voltage and current data of the battery, calculate the SOC value based on the collected voltage and current data and the results of the previous extended Kalman SOC calculation, and send the calculation result to the PL terminal;
[0036] Based on the calculation results of the PS side, the PL side is used to update the battery second-order RC equivalent model parameters according to the SOC fitting formula, perform Jacob matrix calculation and prior estimation calculation according to the updated results of the battery second-order RC equivalent model parameters, and perform covariance prediction calculation for this round, and send the calculation results to the PS side;
[0037] Based on the calculation result of the PL end, the PS end is further used to perform extended Kalman gain calculation, and perform a posteriori estimation calculation according to the extended Kalman gain calculation result to obtain the extended Kalman SOC calculation result.
[0038] Compared to existing technologies, the present invention provides an FPGA-based extended Kalman filter (EKF) SOC optimization calculation method and system, implemented on both the PS and PL sides of the ZYNQ chip. By utilizing ZYNQ series FPGA chips, this method places front-end data acquisition, SOC calculation, posterior estimation, and EKF gain calculation steps on the PS side for processing, while parallel optimization steps such as battery second-order RC equivalent model parameter update, prior estimation, and covariance prediction are placed on the PL side. Parameter transmission and feedback are achieved through communication between the PS and PL sides. This method leverages the FPGA's strong parallel computing capabilities and high processing speed, enabling simultaneous execution of multiple EKF (Extended Kalman Filter) SOC calculation steps. It also leverages the PL side's advantages of flexibility and configurability, fast execution, stable and reliable performance, and large storage capacity, as well as the high-performance processing capabilities and rich software ecosystem of the PS side to achieve real-time sensor data acquisition, efficient execution of complex algorithms, and comprehensive monitoring of system status, significantly improving the accuracy and response speed of SOC calculation. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The accompanying drawings, which constitute part of the present invention, are intended to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are intended to explain the present invention and do not constitute an undue limitation of the present invention. In the accompanying drawings:
[0040] Figure 1 A schematic diagram of the overall workflow of an FPGA-based extended Kalman SOC optimization calculation method provided by an embodiment of the present invention;
[0041] Figure 2A schematic diagram of the calculation flow of the PS and PL ends in an FPGA-based extended Kalman SOC optimization calculation method provided in an embodiment of the present invention;
[0042] Figure 3 A schematic diagram of the pipeline calculation process for battery second-order RC equivalent model parameters in an FPGA-based extended Kalman SOC optimization calculation method provided by an embodiment of the present invention;
[0043] Figure 4 A schematic diagram of the pipeline calculation process of the RC loop voltage in an FPGA-based extended Kalman SOC optimization calculation method provided by an embodiment of the present invention;
[0044] Figure 5 A schematic diagram of a process state machine at the PL end in an FPGA-based extended Kalman SOC optimization calculation method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0045] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that, in the absence of conflict, the embodiments and features of the embodiments of the present invention can be combined with each other.
[0046] The following detailed description is an exemplary description and is intended to provide further detailed description of the present invention. Unless otherwise indicated, all technical terms used in the present invention have the same meaning as those generally understood by those skilled in the art to which the present invention belongs. The terms used in the present invention are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention.
[0047] The first embodiment of the present invention provides an FPGA-based extended Kalman SOC optimization calculation method. This method leverages the FPGA's strong parallel computing capabilities and fast processing speed to design an extended Kalman parallel computing SOC method based on a Zynq chip. This embodiment leverages the FPGA's high-speed parallel computing capabilities and optimizes the EKF calculation method in embedded systems by employing pipeline computing, systolic array matrix multiplier computing, and finite state machines, significantly improving the calculation speed.
[0048] like Figure 1 As shown in the figure, an FPGA-based extended Kalman SOC optimization calculation method according to an embodiment of the present invention is implemented based on the PS and PL ends of the ZYNQ chip. The PS and PL ends establish communication using AXI. The PS end is mainly responsible for front-end data acquisition, SOC calculation, posterior estimation, EKF gain calculation, etc. The PL end is mainly responsible for battery second-order RC equivalent model parameter update, prior estimation, covariance prediction, etc. Figure 2 As shown, the method specifically includes:
[0049] S100 collects the battery voltage and current data through the PS end, calculates the SOC value based on the collected voltage and current data and the previous round of extended Kalman SOC calculation results, and sends the calculation result to the PL end.
[0050] The above steps specifically include: collecting the front-end current and voltage at the PS end; selecting the extended Kalman SOC calculation result obtained from the previous round of update; As the initial value, the SOC value is calculated by the ampere-hour integration method, then ,in, is the rated capacity of the battery, Current The sampling time interval, Indicates the current round of calculation, Indicates the last round of calculation; the calculation result data The collected current data is sent to the PL for use. Alternatively, the SOC value can be calculated using the OCV (Open Circuit Voltage) table lookup method. This involves mapping the current SOC value based on the average cell voltage using the OCV-SOC mapping table (this method is not applicable to battery platform voltages).
[0051] S200: Based on the calculation results of the PS side, the battery second-order RC equivalent model parameters are updated through the PL side according to the SOC fitting relationship. Jacob matrix calculation and prior estimation calculation are performed based on the updated results of the battery second-order RC equivalent model parameters, and the covariance prediction calculation of this round is performed, and the calculation results are sent to the PS side.
[0052] The above steps specifically include:
[0053] S210, battery second-order RC equivalent model parameter update:
[0054] The second-order RC equivalent circuit model for batteries is a commonly used circuit model for describing the dynamic characteristics of batteries during charge and discharge. Its core structure consists of an open-circuit voltage source, an internal resistor, and two parallel RC (resistance-capacitance) circuits. It can simulate the polarization effects and voltage response of batteries under different operating conditions.
[0055] According to the HPPC (Hybrid Pulse Power Characteristic) test, the battery second-order RC equivalent model parameters and It is a 7th order polynomial relationship: Based on this, the above 7th-order polynomial fitting relationship is used to update the battery second-order RC equivalent model parameters ,in is the open circuit voltage, is the ohmic internal resistance, and is the polarization internal resistance in the second-order RC equivalent model of the battery, and is the polarization capacitance in the second-order RC equivalent model of the battery; is the battery experimental parameter, which represents the fitting relationship with the parameters in the battery second-order RC equivalent model. The positive integer n=1,2,3,4,5,6,7,8, and x represents the specific battery second-order RC equivalent model parameter; The SOC value calculated by the PS side.
[0056] Furthermore, this embodiment also completes the calculation of various parameters of the second-order RC equivalent model by designing multiple parallel computing pipelines. Each pipeline calculation is completed in 5 clock cycles. Figure 3 As shown, it specifically includes: completing the calculation of various parameters of the second-order RC equivalent model by designing multiple parallel computing pipelines. Each pipeline calculation is completed in 5 clock cycles, including: the input is value, completed in the first clock cycle 、 、 、 Calculation; completed in the second clock cycle 、 、 Calculation; completed in the third clock cycle 、 、 Calculation; completed in the fourth clock cycle Calculation; completed in the fifth clock cycle Calculation, and 、 、 、 and The five parameters are accumulated.
[0057] S220, calculation index and , ,in represents the time constant of the RC circuit, is the updated polarized capacitance, is the updated polarization internal resistance, Δt represents the time interval, and x1=1 or 2.
[0058] S230, Jacob matrix calculation:
[0059] definition The two-dimensional array is used to store the Jacobian matrix A k Calculation results, ; Define 2 groups of registers to store Jacob matrix B k The calculation results are: , is the updated polarization internal resistance, x1=1 or 2; define a group of registers to store the Jacob matrix H k Partial derivative equation , h k Used for subsequent Kalman gain calculation on the PS side.
[0060] S240, prior estimate calculation:
[0061] Define 3 groups of register arrays to store calculation results ,in 、 is the RC loop voltage of the battery second-order RC equivalent model The calculation is completed on the PS side and the data is directly written into In the array, 、 Use pipeline design to calculate; 、 、 、h k Sent to the PS side for posterior estimation calculation.
[0062] Furthermore, if Figure 4 As shown, in this embodiment, two parallel computing pipelines are designed to complete U 1,k and U 2,k The calculation formula is: , where I is the collected current, R x1,k is the polarization internal resistance in the second-order RC equivalent model of the battery, The RC loop voltage value of the battery second-order RC equivalent model calculated in the previous round, x1=1 or 2;
[0063] Each pipeline calculation is completed in 4 clock cycles, including: 、 Calculation, the second clock cycle is completed Calculation, the third clock cycle is completed Calculation is performed and the calculation result is output in the fourth clock cycle.
[0064] S250, covariance prediction:
[0065] Define a A two-dimensional array of covariance prediction matrices +Q process calculation, where the Jacobian matrix of the previous round , represents the transposed matrix, P k-1is the covariance update result of the previous round, Q is the process noise, k represents the current round of calculation, and k-1 represents the previous round of calculation; by designing a systolic array matrix multiplier to optimize the covariance prediction matrix calculation, the covariance prediction matrix calculation result is converted to Send to PS for use.
[0066] Furthermore, the covariance prediction calculation in this embodiment includes three steps: Matrix multiplication of ), by designing a systolic array matrix multiplier to optimize the calculation process, only one Each PE module consists of a multiplier and an accumulator and completes the calculation in 10 clock cycles (CLK1~CLK10). The calculation process of each clock cycle is shown in Table 1, where A k-1 The element in the i-th row and j-th column of the matrix is represented as Aij in Table 1, P k-1 The element in the i-th row and j-th column of the matrix is represented as Pij in Table 1, and P1-P9 represent 9 PE resources respectively. , and then introduce it in the fourth clock cycle Calculation, that is, completing A from clock cycles CLK1 to CLK7 through a systolic array k-1 * P k-1 Calculation is completed from clock cycle CLK4~CLK10 with A k-1 T Multiplication calculation of .
[0067] Table 1. Calculation contents of each clock matrix in the systolic array matrix multiplier:
[0068]
[0069] S300: Based on the calculation result of the PL side, the extended Kalman gain calculation is performed through the PS side, and the posterior estimation calculation is performed according to the calculation result of the extended Kalman gain to obtain the extended Kalman SOC calculation result, completing this round of calculation.
[0070] The above steps specifically include:
[0071] S310, extended Kalman gain calculation:
[0072] Extended Kalman gain k k The calculation formula is , where the intermediate parameters ; Jacob matrix k Represents the linear relationship between the system measurement value and the state vector, which is a one-dimensional array type The calculation is simplified to , h k The Jacobian matrix H calculated by the PL side k The partial derivative equation results are: is the covariance prediction matrix calculated by the PL side, R k To measure noise, is the covariance prediction matrix The element in row i and column j in the memory is read by the PS end. Then directly complete k k Calculate and express it in structure Column vector of calculation results.
[0073] S320, posterior estimation:
[0074] Calculate battery voltage ,in, is the collected current value; then according to the calculated extended Kalman gain k k , further calculate the updated state estimate at the current moment , is the prior state estimation result of the PL end, Collecting values for voltage sensors that contain measurement noise; updated , is the RC loop voltage value of the updated battery second-order RC equivalent model, The extended Kalman SOC calculation result obtained after the update; output the extended Kalman SOC calculation result of this round And used for the next round of calculation.
[0075] S330, Covariance update: read k k 、H k 、P k - Parameters, calculate covariance , and the calculated Sent to the PS side for the next round of calculation.
[0076] Furthermore, in this embodiment, since the interaction between the PS side and the PL side is involved, a finite state machine for the calculation process of the PL side is also designed, such as Figure 5As shown, it includes: the idle state is waiting for the PS end to calculate the SOC parameter update. If the SOC parameter update is completed, the flag SOC_Parameter is set to 1 and enters the next stage; the state state_model is the battery second-order RC equivalent model parameter update calculation, and the next stage is entered after the calculation is completed; the state state_cal_rc is calling the IP core to calculate the index, and the next stage is entered after the calculation is completed; the state state_jacobian is the Jacobian matrix calculation. After the calculation is completed, the flag Calculate_end is set to 1 and enters the next stage; the state state_prior is the prior estimate calculation, which is the RC loop voltage pipeline calculation of the second-order RC equivalent model for a total of 4 clock cycles. If the calculation is completed, the flag Matrix_end is set to 1 and enters the next stage; the state state_err_covar is the covariance prediction; if the flag Calculate_end or Matrix_end is 1, it enters the state_axi state. The state_axi state indicates that the Jacobian matrix calculation or the prior estimate calculation is completed, and the parameters are passed to the PS end.
[0077] Specific technical details of this embodiment are as follows:
[0078] 1. A ZYNQ xc7z020 FPGA was used. The PS communicated with the analog-to-digital converter (AD7490) via SPI (Serial Peripheral Interface) to collect voltage and current data from a 20Ah battery. The PS output the SOC calculation results via RS232 (Asynchronous Transmission Standard Interface).
[0079] 2. The PS and PL sides interact using AXI-BRAM (Block Random Access Memory) to update the required parameters in the calculation process through address selection.
[0080] 3. The PL side involves exponential operations, which are calculated by calling the IP core (Intellectual Property core).
[0081] 4. The PL clock is set to 50 MHz. It takes about 32.06 μs to complete the second-order RC model parameter update, Jacob matrix calculation, prior estimation, and covariance prediction calculation in a single operation.
[0082] 5. The resources consumed by the PL side are approximately 19% for LUT (Look Up Table), 37% for Flipflop (Flip Flop), and 21% for DSP. The FPGA computing power consumption does not exceed 290mW.
[0083] An embodiment of the present invention proposes an FPGA-based extended Kalman SOC optimization calculation method. This method utilizes the parallel computing capability of the FPGA to simultaneously execute multiple EKF calculation steps, thereby significantly improving computational efficiency. The multi-dimensional matrix calculation PE resources on the PL side can be shared by different matrix operations, thereby reducing resource consumption. Combined with the ARM (Advanced RISC Machine, RISC microprocessor) core in ZYNQ, this method enables front-end data acquisition and predictive calculations to have better real-time performance. Compared with CPU-based embedded systems, the present invention can achieve lower power consumption. When performing matrix operations, the CPU needs to frequently call general registers and arithmetic and logic units (ALUs), while the FPGA's dedicated matrix calculation module can directly complete data flow through hardwiring, reducing energy loss from ineffective operations.
[0084] Corresponding to the FPGA-based extended Kalman SOC optimization calculation method disclosed in the above embodiment, an embodiment of the present invention further discloses an FPGA-based extended Kalman SOC optimization calculation system, the system including a PS end and a PL end based on a ZYNQ chip, the PS end establishing communication with the PL end;
[0085] The PS terminal is used to collect voltage and current data of the battery, calculate the SOC value based on the collected voltage and current data and the results of the previous extended Kalman SOC calculation, and send the calculation result to the PL terminal;
[0086] Based on the calculation results of the PS side, the PL side is used to update the battery second-order RC equivalent model parameters according to the SOC fitting formula, perform Jacob matrix calculation and prior estimation calculation according to the updated results of the battery second-order RC equivalent model parameters, and perform covariance prediction calculation for this round, and send the calculation results to the PS side;
[0087] Based on the calculation result of the PL end, the PS end is further used to perform extended Kalman gain calculation, and perform a posteriori estimation calculation according to the extended Kalman gain calculation result to obtain the extended Kalman SOC calculation result.
[0088] It should be noted that, for a detailed description of an FPGA-based extended Kalman SOC optimization calculation system provided in an embodiment of the present invention, reference can be made to the relevant description of an FPGA-based extended Kalman SOC optimization calculation method provided in an embodiment of the present invention, which will not be repeated here.
[0089] It is understood from common technical knowledge that the present invention may be implemented by other embodiments that do not depart from its spirit or essential features. Therefore, the embodiments disclosed above are, in all respects, merely illustrative and not exclusive. All modifications within the scope of the present invention or equivalent to the scope of the present invention are intended to be encompassed by the present invention.
[0090] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, optical storage, etc.) containing computer-usable program code.
[0091] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0092] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0093] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0094] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.
Claims
1. An extended Kalman SOC optimization calculation method based on FPGA, characterized in that: Based on the PS and PL ends of the ZYNQ chip, the PS end establishes communication with the PL end, and the method includes: The PS collects the battery voltage and current data, calculates the SOC value based on the collected voltage and current data and the results of the previous extended Kalman SOC calculation, and sends the calculation result to the PL. Based on the calculation results of the PS side, the parameters of the battery's second-order RC equivalent model are updated through the PL side according to the SOC fitting relationship. The Jacobian matrix and prior estimation calculations are performed based on the updated results of the battery's second-order RC equivalent model parameters. The covariance prediction calculation for this round is also performed and the calculation results are sent to the PS side. Based on the calculation results of the PL side, the extended Kalman gain calculation is performed through the PS side, and the posterior estimation calculation is performed based on the extended Kalman gain calculation results to obtain the extended Kalman SOC calculation results, completing this round of calculation; The battery voltage and current data are collected through the PS end, and the SOC value is calculated based on the collected voltage and current data and the results of the previous extended Kalman SOC calculation. The calculation results are sent to the PL end. Specifically, it includes: Collect the front-end current and voltage at the PS end; select the extended Kalman SOC calculation result obtained from the last round of update As the initial value, the SOC value is calculated by the ampere-hour integration method, then ,in, is the rated capacity of the battery, Current The sampling time interval, Indicates the current round of calculation, Indicates the last round of calculation; the calculation result data And the collected current data is sent to the PL end for use; The PL side updates the battery second-order RC equivalent model parameters according to the SOC fitting relationship. Based on the updated results of the battery second-order RC equivalent model parameters, the Jacobian matrix and prior estimation calculations are performed, and the covariance prediction calculations for this round are performed. The calculation results are sent to the PS side. Specifically, the following steps are performed: Battery second-order RC equivalent model parameter update: According to the battery second-order RC equivalent model parameters With SOC k The 7th-order polynomial fitting relationship is: , update the battery second-order RC equivalent model parameters ,in is the open circuit voltage, is the ohmic internal resistance, and is the polarization internal resistance in the second-order RC equivalent model of the battery, and is the polarization capacitance in the second-order RC equivalent model of the battery; is the battery experimental parameter, which represents the fitting relationship with the parameters in the battery second-order RC equivalent model. The positive integer n=1,2,3,4,5,6,7,8, and x represents the specific battery second-order RC equivalent model parameter; The SOC value calculated by the PS side; Calculate index and , ,in represents the time constant of the RC circuit, is the updated polarized capacitance, is the updated polarization internal resistance, Δt represents the time interval, x1=1 or 2; Jacob matrix calculation: Calculate the Jacob matrix A k , ; Calculate the Jacobian matrix B k , , is the updated polarization internal resistance; calculate the Jacobian matrix H k The partial derivative equation of , h k Used for subsequent PS end Kalman gain calculation, x1=1 or 2; Prior estimation calculation: current state estimation ,in 、 is the RC loop voltage of the battery second-order RC equivalent model, The calculation is completed on the PS side. 、 Use pipeline design to calculate; 、 、 、h k Sent to the PS for posterior estimation calculation; Covariance prediction: Calculate the covariance prediction matrix +Q, where the Jacobian matrix of the previous round , represents the transposed matrix, P k-1 is the covariance update result of the previous round, Q is the process noise, k represents the current round of calculation, k-1 represents the previous round of calculation; the calculation result Send to PS for use.
2. The FPGA-based extended Kalman SOC optimization calculation method according to claim 1, wherein: Based on the calculation results of the PL side, the extended Kalman gain calculation is performed on the PS side. The posterior estimation calculation is performed based on the calculation results of the extended Kalman gain to obtain the extended Kalman SOC calculation results, completing this round of calculations, specifically including: Extended Kalman gain calculation: Extended Kalman gain k k The calculation formula is: , where the intermediate parameters ; Jacob matrix k Represents the linear relationship between the system measurement value and the state vector, which is a one-dimensional array type The calculation is simplified to , h k The Jacobian matrix H calculated by the PL side k The partial derivative equation results are: is the covariance prediction matrix calculated by the PL side, R k To measure noise, is the covariance prediction matrix The element in row i and column j in the memory is read by the PS end. Then directly complete k k calculate; Posterior estimation: Calculate the battery voltage ,in, is the collected current value; then according to the calculated extended Kalman gain k k , further calculate the updated state estimate at the current moment , is the prior state estimation result of the PL end, Collecting values for voltage sensors that contain measurement noise; updated , is the RC loop voltage value of the updated battery second-order RC equivalent model, The extended Kalman SOC calculation result obtained after the update; output the extended Kalman SOC calculation result of this round And used for the next round of calculation; Covariance update: read k k 、H k 、P k - Parameters, calculate covariance , and the calculated Sent to the PS side for the next round of calculation.
3. The FPGA-based extended Kalman SOC optimization calculation method according to claim 1, wherein: The battery second-order RC equivalent model parameters are updated, including: The calculation of the parameters of the second-order RC equivalent model is completed by designing multiple parallel computing pipelines. Each pipeline calculation is completed in 5 clock cycles, including: value, completed in the first clock cycle 、 、 、 Calculation; completed in the second clock cycle 、 、 Calculation; completed in the third clock cycle 、 、 Calculation; completed in the fourth clock cycle Calculation; completed in the fifth clock cycle Calculation, and 、 、 、 and The five parameters are accumulated.
4. The FPGA-based extended Kalman SOC optimization calculation method according to claim 1, wherein: Prior estimation calculation, including: Design two parallel computing pipelines to complete U 1,k and U 2,k The calculation formula is: , where I is the collected current, R x1,k is the polarization internal resistance in the second-order RC equivalent model of the battery, The RC loop voltage value of the battery second-order RC equivalent model calculated in the previous round, x1=1 or 2; Each pipeline calculation is completed in 4 clock cycles, including: 、 Calculation, the second clock cycle is completed Calculation, the third clock cycle is completed Calculation is performed and the calculation result is output in the fourth clock cycle.
5. The FPGA-based extended Kalman SOC optimization calculation method according to claim 1, characterized in that: Covariance prediction, specifically including: The covariance forecast calculation includes 3 Matrix multiplication of : , the covariance prediction matrix calculation is optimized by designing a systolic array matrix multiplier.
6. The FPGA-based extended Kalman SOC optimization calculation method according to claim 1, characterized in that: The method further comprises: The extended Kalman SOC calculation process finite state machine of the PL side is designed, including: the idle state is waiting for the PS side to calculate the SOC parameter update. If the SOC parameter update is completed, the flag SOC_Parameter is set to 1 and enters the next stage; the state state_model is the battery second-order RC equivalent model parameter update calculation, and the next stage is entered after the calculation is completed; the state state_cal_rc is the exponential calculation, and the next stage is entered after the calculation is completed; the state state_jacobian is the Jacobian matrix calculation. After the calculation is completed, the flag Calculate_end is set to 1 and enters the next stage; the state state_prior is the prior estimate calculation, which is the RC loop voltage pipeline calculation of the second-order RC equivalent model. If the calculation is completed, the flag Matrix_end is set to 1 and enters the next stage; the state state_err_covar is the covariance prediction; if the flag Calculate_end or Matrix_end is 1, enter the state_axi state. The state_axi state indicates that the Jacobian matrix calculation or the prior estimate calculation is completed, and the parameters are passed to the PS side.
7. The FPGA-based extended Kalman SOC optimization calculation method according to claim 1, characterized in that: The method further comprises: AXI is used to establish communication between the PS and PL.
8. An extended Kalman SOC optimization calculation system based on FPGA, characterized in that: The system includes a PS end and a PL end based on a ZYNQ chip, and the PS end establishes communication with the PL end; The PS terminal is used to collect voltage and current data of the battery, calculate the SOC value based on the collected voltage and current data and the results of the previous extended Kalman SOC calculation, and send the calculation result to the PL terminal; Based on the calculation results of the PS side, the PL side is used to update the battery second-order RC equivalent model parameters according to the SOC fitting formula, perform Jacob matrix calculation and prior estimation calculation according to the updated results of the battery second-order RC equivalent model parameters, and perform covariance prediction calculation for this round, and send the calculation results to the PS side; Based on the calculation result of the PL end, the PS end is further used to perform extended Kalman gain calculation, and perform a posteriori estimation calculation according to the extended Kalman gain calculation result to obtain the extended Kalman SOC calculation result; Collect the battery voltage and current data, calculate the SOC value based on the collected voltage and current data and the results of the previous extended Kalman SOC calculation, and send the calculation results to the PL end, specifically including: Collect the front-end current and voltage at the PS end; select the extended Kalman SOC calculation result obtained from the last round of update As the initial value, the SOC value is calculated by the ampere-hour integration method, then ,in, is the rated capacity of the battery, Current The sampling time interval, Indicates the current round of calculation, Indicates the last round of calculation; the calculation result data And the collected current data is sent to the PL end for use; Update the battery second-order RC equivalent model parameters according to the SOC fitting relationship. Perform Jacob matrix calculation and prior estimation calculation based on the updated results of the battery second-order RC equivalent model parameters, and perform covariance prediction calculation for this round. Send the calculation results to the PS end, specifically including: Battery second-order RC equivalent model parameter update: According to the battery second-order RC equivalent model parameters With SOC k The 7th-order polynomial fitting relationship is: , update the battery second-order RC equivalent model parameters ,in is the open circuit voltage, is the ohmic internal resistance, and is the polarization internal resistance in the second-order RC equivalent model of the battery, and is the polarization capacitance in the second-order RC equivalent model of the battery; is the battery experimental parameter, which represents the fitting relationship with the parameters in the battery second-order RC equivalent model. The positive integer n=1,2,3,4,5,6,7,8, and x represents the specific battery second-order RC equivalent model parameter; The SOC value calculated by the PS side; Calculate index and , ,in represents the time constant of the RC circuit, is the updated polarized capacitance, is the updated polarization internal resistance, Δt represents the time interval, x1=1 or 2; Jacob matrix calculation: Calculate the Jacob matrix A k , ; Calculate the Jacobian matrix B k , , is the updated polarization internal resistance; calculate the Jacobian matrix H k The partial derivative equation of , h k Used for subsequent PS end Kalman gain calculation, x1=1 or 2; Prior estimation calculation: current state estimation ,in 、 is the RC loop voltage of the battery second-order RC equivalent model, The calculation is completed on the PS side. 、 Use pipeline design to calculate; 、 、 、h k Sent to the PS for posterior estimation calculation; Covariance prediction: Calculate the covariance prediction matrix +Q, where the Jacobian matrix of the previous round , represents the transposed matrix, P k-1 is the covariance update result of the previous round, Q is the process noise, k represents the current round of calculation, k-1 represents the previous round of calculation; the calculation result Send to PS for use.