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 FPGA, parallel computing of battery SOCs is realized, solving the problem of insufficient stability and response speed of SOC calculation in the existing battery management system, and improving the calculation accuracy and system reliability.
Patent Information
- Application Number
- CN202510761919.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2045-06-09
AI Technical Summary
During SOC calculation, data acquisition and system control are carried out simultaneously in the existing battery management system, resulting in reduced system reliability and untimely response of processors, which are problematic of insufficient stability and reliability.
The extended Kalman SOC optimization calculation method based on FPGA is adopted. Through the division of labor and cooperation 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 battery second-order RC equivalent model parameter update and covariance prediction. The parallel computing power and flexibility of FPGA are used to realize multi-step parallel processing.
It improves the accuracy and response speed of SOC calculations, improves the stability and reliability of the system, reduces power consumption, and meets real-time performance requirements.
Smart Images

Figure CN120275835A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of battery management, and particularly relates to an optimized calculation method and system for SOC based on FPGA using the Extended Kalman Filter. Background Art
[0002] In recent years, with the exponential growth of the battery industry, in order to ensure the reliability, safety, and extend the service life of batteries, it is necessary to manage and control batteries. Thereupon, the battery management system came into being. Among them, the SOC (State Of Charge) of the battery, as one of the most important parameters of the battery management system, the calculation methods of SOC mainly include the OCV (Open Circuit Voltage) method, the ampere-hour integration method, the model-based method, the artificial intelligence method, etc.
[0003] Currently, the hardware processors adopted by BMS (Battery Management System) mainly include single-chip microcomputers, DSPs (Digital Signal Processing chips), and battery management chips. The single-chip microcomputer has a small memory, slow processing speed, and poor computing power, resulting in poor stability and low reliability of the BMS, and it cannot use efficient SOC calculation methods; the BMS based on the DSP architecture mainly consists of a master control and a slave control, divided into data acquisition and system control and calculation. The DSP improves the processing ability of the system, but the segmentation of the system increases instability, and if there is a fault in the slave control, the master control DSP cannot calculate and control; some battery management chips have the SOC calculation function, but they need to be controlled by the master processor, reducing the real-time performance of the system.
[0004] In engineering applications, generally, MCU (Microcontroller Unit), DSP, and ASIC (Application-Specific Integrated Circuit) are used to implement the Extended Kalman Filter for SOC calculation. However, due to the sequential execution CPU (Central Processing Unit) architecture of the MCU and DSP, it is difficult to meet the engineering requirements for the real-time performance of SOC. Although the ASIC has a fast calculation speed and high reliability, it cannot be modified according to actual needs after the function is implemented, and its versatility is poor. 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), so as to solve the problem that when calculating the existing battery SOC, the data acquisition of the battery pack and the system control are carried out simultaneously. When a large amount of data is loaded and used for SOC estimation, the system reliability will be significantly reduced, the processor response is not timely enough, and there are problems of insufficient system reliability and stability.
[0006] To achieve the above object, the embodiments of the present invention provide the following technical solutions: According to the first aspect of the embodiments of the present invention, an extended Kalman SOC optimization calculation method based on FPGA is provided, which is implemented based on the PS (Processing System) end and the PL (Programmable Logic) end of the ZYNQ (ZYNQ is the chip model) chip. The PS end and the PL end establish communication. The method includes: Collect the voltage and current data of the battery through the PS end, calculate the SOC value based on the collected voltage and current data and the previous round of extended Kalman SOC calculation results, and send the calculation results to the PL end; Based on the calculation results of the PS end, the PL end updates the parameters of the battery second-order RC equivalent model according to the SOC fitting relationship, calculates the Jacobian matrix and the prior estimation calculation according to the updated results of the battery second-order RC equivalent model parameters, and performs the covariance prediction calculation of this round, and sends the calculation results to the PS end; Based on the calculation results of the PL end, the PS end performs the extended Kalman gain calculation, and performs the posterior estimation calculation according to the calculation results of the extended Kalman gain to obtain the extended Kalman SOC calculation results, and completes the calculation of this round.
[0007] Further, collecting the voltage and current data of the battery through the PS end, calculating the SOC value based on the collected voltage and current data and the previous round of extended Kalman SOC calculation results, and sending the calculation results to the PL end specifically includes: Perform front-end current and voltage acquisition at the PS end; select the extended Kalman SOC calculation results updated in the previous round As the initial value, calculate the SOC value by the ampere-hour integration method, then , where Is the rated capacity of the battery, Is the current Is the sampling time interval of Indicates the calculation of this round, Indicates the previous round of calculation; send the calculation result data And the collected current data to the PL end for use.
[0008] Further, the PL side updates the parameters of the battery second-order RC equivalent model according to the SOC fitting relationship, calculates the Jacobian matrix and the prior estimation based on the updated results of the battery second-order RC equivalent model parameters, and performs the covariance prediction calculation for this round, and sends the calculation results to the PS side, specifically including: Update of the battery second-order RC equivalent model parameters: According to the parameters of the battery second-order RC equivalent model and SOC k 7th-order polynomial fitting relationship: , update the parameters of the battery second-order RC equivalent model , where is the open-circuit voltage, is the ohmic internal resistance, and are the polarization internal resistances in the battery second-order RC equivalent model, and are the polarization capacitances in the battery second-order RC equivalent model; is the battery experimental parameter, representing the fitting relationship with each parameter 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 parameters of the battery second-order RC equivalent model; is the SOC value calculated by the PS side; Calculate the exponential and , , where represents the RC circuit time constant, is the updated polarization capacitance, is the updated polarization internal resistance, Δt represents the time interval, and x1 = 1 or 2; Jacobian matrix calculation: Calculate the Jacobian matrix A k , ; Calculate the Jacobian matrix B k , , is the updated polarization internal resistance; Calculate the Jacobian matrix H k partial derivative equation of , h k is used for the subsequent Kalman gain calculation by the PS side, and x1 = 1 or 2; Prior estimation calculation: State estimation at the current moment , where , are the RC loop voltages of the battery second-order RC equivalent model, is calculated by the PS side, , is calculated using the pipeline design; The calculated , , , h k is sent to the PS side for posterior estimation calculation; Covariance prediction: Calculate the covariance prediction matrix +Q, where the Jacobian matrix in the previous round , represents the transpose matrix, P k-1 is the covariance update result in the previous round, Q is the process noise, k represents the current round of calculation, and k - 1 represents the previous round of calculation; send the calculation result to the PS side for use.
[0009] Furthermore, based on the calculation result of the PL side, the extended Kalman gain is calculated through the PS side, and the extended Kalman SOC calculation result is obtained through posterior estimation calculation based on the extended Kalman gain calculation result, completing the current round of calculation, specifically including: Extended Kalman gain calculation: The extended Kalman gain k k The calculation formula is: , where the intermediate parameter ; The Jacobian matrix k represents the linear relationship between the system measurement value and the state vector, and is of one-dimensional array type ; The calculation is simplified to , h k is the Jacobian matrix H calculated by the PL side k partial derivative equation result, is the covariance prediction matrix calculated by the PL side, R k is the measurement noise, is the covariance prediction matrix the element in the i-th row and j-th column; Therefore, read from the memory by the PS side and directly complete the calculation of k k ; Posterior estimation: Calculate the calculated value of the battery voltage , where 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 side, is the voltage sensor acquisition value including measurement noise; The updated , is the RC loop voltage value of the updated battery second-order RC equivalent model, is the extended Kalman SOC calculation result obtained after update; Output the extended Kalman SOC calculation result of this round and use it for the next round of calculation; Covariance update: Read k k , H k , P k - parameters, calculate the covariance , and send the calculated to the PS side for the next round of calculation.
[0010] Furthermore, the update of the battery second-order RC equivalent model parameters specifically includes: Complete the calculation of each parameter of the second-order RC equivalent model by designing multiple parallel calculation pipelines. Each pipeline calculation is completed in 5 clock cycles, including: the input is value, and complete , , , calculation in the first clock cycle; complete , , calculation in the second clock cycle; complete , , calculation in the third clock cycle; complete calculation in the fourth clock cycle; complete calculation in the fifth clock cycle, and , , , and accumulate the five parameters.
[0011] Furthermore, the prior estimate calculation specifically includes: Design 2 parallel calculation pipelines to complete the calculation of U 1,k and U 2,k , and the calculation formula is: , where I is the collected current, and R x1,k is the polarization internal resistance in the battery second-order RC equivalent model, is the RC loop voltage value of the battery second-order RC equivalent model calculated in the previous round, and x1 = 1 or 2; Each pipeline calculation is completed in 4 clock cycles, including: complete , calculation in the first clock cycle, complete calculation in the second clock cycle, complete calculation in the third clock cycle, and output the calculation result in the fourth clock cycle.
[0012] Furthermore, the covariance prediction specifically includes: The covariance prediction calculation includes 3 Matrix multiplication: Optimize the covariance prediction matrix calculation by designing a systolic array matrix multiplier.
[0013] Furthermore, the method further includes: Design the finite state machine for the extended Kalman SOC calculation process on the PL side, including: The state idle is to wait for the PS side to calculate the SOC parameter update. If the SOC parameter update is completed, set the flag bit SOC_Parameter to 1 and enter the next stage; The state state_model is for updating and calculating the parameters of the battery second-order RC equivalent model, and enter the next stage after the calculation is completed; The state state_cal_rc is to call the IP core to calculate the exponent, and enter the next stage after the calculation is completed; The state state_jacobian is for calculating the Jacobian matrix. After the calculation is completed, set the flag bit Calculate_end to 1 and enter the next stage; The state state_prior is for prior estimation calculation, which is a total of 4 clock cycles for the RC loop voltage pipelining calculation of the second-order RC equivalent model. If the calculation is completed, set the flag bit Matrix_end to 1 and enter the next stage; The state state_err_covar is for covariance prediction; If the flag bit 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 estimation calculation is completed, and transfer the parameters to the PS side.
[0014] Furthermore, the method further includes: Establish communication between the PS side and the PL side using the AXI (Advanced eXtensible Interface) method.
[0015] According to the second aspect of the embodiments of the present invention, the embodiments of the present invention provide an extended Kalman SOC optimization calculation system based on FPGA. The system includes a PS side and a PL side based on the ZYNQ chip, and communication is established between the PS side and the PL side; The PS side is used to collect the voltage and current data of the battery, calculate the SOC value based on the collected voltage and current data and the previous round of extended Kalman SOC calculation results, and send the calculation results to the PL side; Based on the calculation results of the PS side, the PL side is used to update the parameters of the battery second-order RC equivalent model according to the SOC fitting formula, perform Jacobian matrix calculation, prior estimation calculation based on the updated results of the battery second-order RC equivalent model parameters, and perform the covariance prediction calculation of this round, and send the calculation results to the PS side; Based on the calculation results on the PL side, the PS side is further configured to calculate the extended Kalman gain, and perform posterior estimation calculation based on the extended Kalman gain calculation results to obtain the extended Kalman SOC calculation results.
[0016] Compared with the prior art, an extended Kalman SOC optimization calculation method and system based on FPGA provided by the present invention are implemented based on the PS side and the PL side of the ZYNQ chip. By using the FPGA chip of the ZYNQ series, the present invention places steps such as front-end data acquisition, SOC calculation, posterior estimation, and EKF gain calculation on the PS side for processing, and places steps such as battery second-order RC equivalent model parameter update, prior estimation, and covariance prediction on the PL side for parallel optimization processing. Parameter transfer and feedback are achieved by establishing communication between the PS side and the PL side. Utilizing the characteristics of the strong parallel computing ability and fast processing speed of the FPGA, the parallel computing ability of the FPGA can enable multiple calculation steps of calculating SOC by the EKF (Extended Kalman Filter) to be executed simultaneously. Taking advantage of the advantages of the PL side such as flexibility, configurability, fast execution speed, stable and reliable working performance, and large storage capacity, and taking advantage of the high-performance processing ability and rich software ecosystem of the PS side, real-time acquisition of sensing data, efficient execution of complex algorithms, and comprehensive monitoring of the system state are realized, thereby significantly improving the accuracy and response speed of SOC calculation. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings forming a part of this specification are used to provide a further understanding of the present invention. The schematic embodiments and descriptions thereof of the present invention are used to explain the present invention and do not constitute an improper limitation to the present invention. In the drawings: Figure 1 It is a schematic diagram of the overall working process of an extended Kalman SOC optimization calculation method based on FPGA provided by an embodiment of the present invention; Figure 2 It is a schematic diagram of the calculation process of the PS side and the PL side in an extended Kalman SOC optimization calculation method based on FPGA provided by an embodiment of the present invention; Figure 3 It is a schematic diagram of the pipeline calculation process of the battery second-order RC equivalent model parameters in an extended Kalman SOC optimization calculation method based on FPGA provided by an embodiment of the present invention; Figure 4 It is a schematic diagram of the pipeline calculation process of the RC loop voltage in an extended Kalman SOC optimization calculation method based on FPGA provided by an embodiment of the present invention; Figure 5 It is a schematic diagram of the process state machine of the PL side in an extended Kalman SOC optimization calculation method based on FPGA provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0018] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments. It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments may be combined with each other.
[0019] The following detailed descriptions are all exemplary descriptions, aiming to provide further detailed descriptions of the present invention. Unless otherwise specified, all technical terms adopted in the present invention have the same meaning as commonly understood by those of ordinary skill in the technical field 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.
[0020] The first embodiment of the present invention provides an optimized calculation method for an extended Kalman SOC based on FPGA. Utilizing the characteristics of strong parallel computing ability and fast processing speed of FPGA, an extended Kalman parallel computing SOC method based on ZYNQ chips is designed. This embodiment utilizes the advantages of high-speed parallelism of FPGA, and at the same time, by adopting methods such as pipeline computing, systolic array matrix multiplier computing, and finite state machine, the calculation method of EKF in the embedded system is optimized, greatly improving the calculation rate.
[0021] As Figure 1 shown, an optimized calculation method for an extended Kalman SOC based on FPGA according to an embodiment of the present invention is implemented based on the PS side and the PL side of the ZYNQ chip. The PS side and the PL side establish communication in the AXI manner. The PS side is mainly responsible for front-end data acquisition, SOC calculation, posterior estimation, EKF gain calculation, etc. The PL side is mainly responsible for updating the parameters of the battery second-order RC equivalent model, prior estimation, covariance prediction, etc. According to Figure 2 shown, the method specifically includes: S100, collect the voltage and current data of the battery through the PS side, calculate the SOC value based on the collected voltage and current data and the result of the previous round of extended Kalman SOC calculation, and send the calculation result to the PL side.
[0022] The above steps specifically include: performing front-end current and voltage acquisition on the PS side; selecting the result of the extended Kalman SOC calculation updated in the previous round as the initial value, calculating the SOC value through the ampere-hour integration method, then , where is the rated capacity of the battery, is the current is the sampling time interval, represents this round of calculation, represents the previous round of calculation; the calculation result data And the collected current data is sent to the PL side for use. In addition, the SOC value can also be calculated using the OCV (Open Circuit Voltage) look-up table method, that is, according to the OCV-SOC mapping table, the current SOC value is mapped based on the average value of the single-cell voltage (this method is not applicable to the battery platform voltage period).
[0023] S200, based on the calculation results of the PS side, the PL side updates the parameters of the second-order RC equivalent model of the battery according to the SOC fitting relationship, calculates the Jacobian matrix and the prior estimation calculation based on the updated results of the parameters of the second-order RC equivalent model of the battery, and performs the covariance prediction calculation for this round, and sends the calculation results to the PS side.
[0024] The above steps specifically include: S210, update of the parameters of the second-order RC equivalent model of the battery: The second-order RC equivalent circuit model of the battery is a commonly used circuit model for describing the dynamic characteristics of the battery during charge and discharge. The core structure consists of an open-circuit voltage source, an internal resistance, and two parallel RC (resistor-capacitor) circuits, which can simulate the polarization effect and voltage response of the battery under different working conditions.
[0025] According to the HPPC (Hybrid Pulse Power Characteristic) test, the parameters of the second-order RC equivalent model of the battery and show a 7th-order polynomial relationship: , and accordingly, the parameters of the second-order RC equivalent model of the battery are updated using the above 7th-order polynomial fitting relationship where is the open-circuit voltage, is the ohmic internal resistance, and are the polarization internal resistances in the second-order RC equivalent model of the battery, and are the polarization capacitances in the second-order RC equivalent model of the battery; is the battery experimental parameter, representing the fitting relationship with the parameters in the second-order RC equivalent model of the battery, the positive integer n = 1, 2, 3, 4, 5, 6, 7, 8, and x represents the specific parameters of the second-order RC equivalent model of the battery; is the SOC value calculated by the PS side.
[0026] Furthermore, in this embodiment, the calculation of each parameter of the second-order RC equivalent model is also completed by designing multiple parallel calculation pipelines. Each pipeline calculation is completed in 5 clock cycles, as Figure 3As shown, specifically including: calculating each parameter 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, and the calculation is completed in the first clock cycle , , , ; the calculation is completed in the second clock cycle , , ; the calculation is completed in the third clock cycle , , ; the calculation is completed in the fourth clock cycle ; the calculation is completed in the fifth clock cycle , and the accumulation of the five parameters of , , , and .
[0027] S220, calculating the exponents and , , where represents the RC circuit time constant, is the updated polarization capacitance, is the updated polarization internal resistance, Δt represents the time interval, and x1 = 1 or 2.
[0028] S230, Jacobian matrix calculation: Define a two-dimensional array to store the Jacobian matrix A k calculation results, ; define 2 groups of registers to store the calculation results of the Jacobian matrix B k , , is the updated polarization internal resistance, x1 = 1 or 2; define 1 group of registers to store the Jacobian matrix H k partial derivative equation , h k is used for the subsequent Kalman gain calculation on the PS side.
[0029] S240, prior estimate calculation: Define 3 groups of register arrays to store the calculation results , where , are the RC loop voltages of the battery second-order RC equivalent model calculated on the PS side and directly write the data assignment into the array, , Perform calculations using a pipeline design; send the , , , h k to the PS side for posteriori estimation calculations.
[0030] Furthermore, as Figure 4 shown, in this embodiment, 2 parallel computing pipelines are designed to complete the calculations of 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, is the RC loop voltage value of the second-order RC equivalent model of the battery in the previous calculation, x1 = 1 or 2; Each pipeline calculation is completed in 4 clock cycles, including: completing , calculation in the first clock cycle, calculation in the second clock cycle, calculation in the third clock cycle, and outputting the calculation result in the fourth clock cycle.
[0031] S250, Covariance Prediction: Define a two-dimensional array for the covariance prediction matrix +Q process calculation, where the previous Jacobian matrix , represents the transpose matrix, P k-1 is the previous covariance update result, Q is the process noise, k represents the current calculation, and k - 1 represents the previous calculation; optimize the covariance prediction matrix calculation by designing a systolic array matrix multiplier, and send the covariance prediction matrix calculation result to the PS side for use.
[0032] Furthermore, in this embodiment, the covariance prediction calculation includes 3 matrix multiplications ( ). Optimize the calculation process by designing a systolic array matrix multiplier, and only 1 PE (Portable Executable) resource is required. Each PE module consists of a multiplier and an accumulator, and the calculation is completed in 10 clock cycles (CLK1~CLK10). The calculation process of each clock cycle is shown in Table 1, where the element in the i-th row and j-th column of the A k-1 matrix is represented as Aij in Table 1, and P k-1The element in the \(i\)-th row and \(j\)-th column of the matrix is denoted as \(P_{ij}\) in Table 1, and \(P_1 - P_9\) respectively represent 9 PE resources. During the calculation, first calculate , and then introduce for calculation in the fourth clock cycle, that is, complete the calculation of \(A\) from clock cycle \(CLK1\) to \(CLK7\) in a systolic array manner k-1 * \(P\) k-1 calculation, and complete the multiplication calculation with \(A\) from clock cycle \(CLK4\) to \(CLK10\) k-1 T .
[0033] Table 1 Calculation content of each clock matrix in the systolic array matrix multiplier:
[0034] S300, based on the calculation result of the PL side, perform the extended Kalman gain calculation through the PS side, and perform the posterior estimation calculation according to the calculation result of the extended Kalman gain to obtain the extended Kalman SOC calculation result, thus completing this round of calculation.
[0035] The above steps specifically include: S310, extended Kalman gain calculation: The extended Kalman gain \(k\) k The calculation formula is , where the intermediate parameter ; the Jacobian matrix k represents the linear relationship between the system measurement value and the state vector, and is of one-dimensional array type ; the calculation is simplified to , \(h\) k is the result of the partial derivative equation of the Jacobian matrix \(H\) k calculated by the PL side, is the covariance prediction matrix calculated by the PL side, \(R\) k is the measurement noise, is the covariance prediction matrix the element in the \(i\)-th row and \(j\)-th column; therefore, directly complete the calculation of \(k\) after reading from the memory by the PS side, and represent the calculation result as a column vector in a structure k manner. Column vector calculation result.
[0036] S320, posterior estimation: Calculate the calculated value of the battery voltage , where is the collected current value; then further calculate the updated state estimate k at the current moment according to the calculated extended Kalman gain \(k\) , is the prior state estimation result for the PL side, is the acquisition value of the voltage sensor containing measurement noise; the updated , is the RC loop voltage value of the updated second-order RC equivalent model of the battery, is the extended Kalman SOC calculation result obtained after update; output the extended Kalman SOC calculation result of this round and use it for the next round of calculation.
[0037] S330, covariance update: read k k , H k , P k - parameters, calculate the covariance , and send the calculated to the PS side for the next round of calculation.
[0038] Furthermore, in this embodiment, since it involves the interaction between the PS side and the PL side, a finite state machine for the calculation process of the PL side is also designed, as Figure 5 shown, including: the state idle is waiting for the PS side to calculate the SOC parameter update. If the SOC parameter update is completed, the flag bit SOC_Parameter is set to 1 and enters the next stage; the state state_model is for the update calculation of the second-order RC equivalent model parameters of the battery. After the calculation is completed, it enters the next stage; the state state_cal_rc is for calling the IP core to calculate the exponent. After the calculation is completed, it enters the next stage; the state state_jacobian is for the Jacobian matrix calculation. After the calculation is completed, the flag bit Calculate_end is set to 1 and enters the next stage; the state state_prior is for the prior estimation calculation, which is a total of 4 clock cycles for the pipeline calculation of the RC loop voltage of the second-order RC equivalent model. If the calculation is completed, the flag bit Matrix_end is set to 1 and enters the next stage; the state state_err_covar is for covariance prediction; if the flag bit 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 estimation calculation is completed, and the parameters are passed to the PS side.
[0039] The specific implementation technical details of this embodiment: 1. Select the FPGA of ZYNQ xc7z020 model. The PS side communicates with the ADC (AD7490 chip, analog to digital converter) through SPI (Serial Peripheral Interface) communication to collect the voltage signal and current data of the 20Ah battery, and the PS side outputs the calculation result of SOC through RS232 (asynchronous transmission standard interface).
[0040] 2. The PS side and the PL side interact in the way of AXI - BRAM (Block Random Access Memory), and update the required parameters in the calculation process by addressing.
[0041] 3. The PL side involves exponential operations and calculates by calling the IP core (Intellectual Property core).
[0042] 4. The clock of the PL side is set to 50MHz, and it takes about 32.06us in total to complete the update of the second - order RC model parameters, the calculation of the Jacobian matrix, the prior estimation, and the covariance prediction calculation once.
[0043] 5. The resources consumed by the PL side are about 19% of LUT (Look Up Table), 37% of Flipflop (trigger), and 21% of DSP. The computing power consumption of the FPGA does not exceed 290mW.
[0044] An extended Kalman SOC optimization calculation method based on FPGA proposed in the embodiment of the present invention can make multiple calculation steps of EKF execute simultaneously by using the parallel computing power of FPGA, thus greatly improving the calculation efficiency; the multi - dimensional matrix calculation PE resources of the PL side can be shared by different matrix operations, thus reducing resource consumption; combined with the ARM (Advanced RISC Machine) kernel in ZYNQ, it enables better real - time performance for front - end data acquisition and prediction calculation; compared with the CPU - based embedded system, the solution of the present invention can achieve lower power consumption. When the CPU executes matrix operations, it needs to frequently call general - purpose registers and arithmetic and logic units (ALU), while the dedicated matrix calculation module of FPGA can directly complete data flow through hard - wiring, reducing the energy loss of ineffective operations.
[0045] Corresponding to an Extended Kalman SOC optimization calculation method based on FPGA disclosed in the above embodiments, an Extended Kalman SOC optimization calculation system based on FPGA is also disclosed in an embodiment of the present invention. The system includes a PS side and a PL side based on a ZYNQ chip, and communication is established between the PS side and the PL side. The PS side 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 previous round of Extended Kalman SOC calculation results, and send the calculation results to the PL side. Based on the calculation results of the PS side, the PL side is used to update the parameters of the battery second-order RC equivalent model according to the SOC fitting formula, perform Jacobian matrix calculation, prior estimate calculation based on the updated results of the battery second-order RC equivalent model parameters, and perform the covariance prediction calculation for this round, and send the calculation results to the PS side. Based on the calculation results of the PL side, the PS side is also used to perform Extended Kalman gain calculation, and perform posterior estimate calculation according to the Extended Kalman gain calculation results to obtain the Extended Kalman SOC calculation results.
[0046] It should be noted that for a detailed description of an Extended Kalman SOC optimization calculation system based on FPGA provided in an embodiment of the present invention, reference can be made to the relevant description of an Extended Kalman SOC optimization calculation method based on FPGA provided in an embodiment of the present invention, which will not be elaborated here.
[0047] As is known by those skilled in the art, the present invention can be implemented by other embodiments that do not deviate from its spirit or essential features. Therefore, the above-disclosed embodiments are illustrative in all aspects and are not the only ones. All changes within the scope of the present invention or equivalent to the scope of the present invention are encompassed by the present invention.
[0048] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) containing computer-usable program code.
[0049] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, and combinations of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices to produce a machine, such that the instructions executed by the processors of the computer or other programmable data processing devices produce means for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or in one block or multiple blocks.
[0050] These computer program instructions can 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, such that the instructions stored in the computer-readable memory produce a manufactured article including instruction means that implement the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or in one block or multiple blocks.
[0051] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operational steps are performed on the computer or other programmable device to produce a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or in one block or multiple blocks.
[0052] 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 them. Although the present invention has been described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that: modifications or equivalent substitutions can still be made to the specific embodiments of the present invention, and any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered by the protection scope of the claims of the present invention.
Claims
1. An optimized calculation method of extended Kalman SOC based on FPGA, characterized in that, Implementation based on the PS and PL sides of the ZYNQ chip, with communication established between the PS side and the PL side. The method includes: Collecting battery voltage and current data through the PS side, calculating the SOC value based on the collected voltage and current data and the previous round of extended Kalman SOC calculation results, and sending the calculation results to the PL side; Based on the calculation results of the PS side, the PL side updates the battery second-order RC equivalent model parameters according to the SOC fitting relationship, performs Jacobian 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, and sends the calculation results to the PS side; Based on the calculation results of the PL side, the PS side performs extended Kalman gain calculation, and performs posterior estimation calculation according to the extended Kalman gain calculation results to obtain the extended Kalman SOC calculation results, completing the calculation for this round.
2. The optimized calculation method of the extended Kalman SOC based on FPGA according to claim 1, wherein Collecting battery voltage and current data through the PS side, calculating the SOC value based on the collected voltage and current data and the previous round of extended Kalman SOC calculation results, and sending the calculation results to the PL side, specifically including: Collect the front-end current and voltage on the PS side; select the extended Kalman SOC calculation result obtained from the previous update as the initial value, and calculate the SOC value by the ampere-hour integration method, then , where is the rated capacity of the battery, is the current is the sampling time interval of indicating the current round of calculation, indicating the previous round of calculation; send the calculated result data and the collected current data to the PL side for use.
3. The optimized calculation method of the extended Kalman SOC based on FPGA according to claim 2, characterized in that The PL side updates the battery second-order RC equivalent model parameters according to the SOC fitting relationship, performs Jacobian 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, and sends the calculation results to the PS side, specifically including: Battery second-order RC equivalent model parameter update: According to the battery second-order RC equivalent model parameters and SOC k 7th-order polynomial fitting relationship: , update the battery second-order RC equivalent model parameters , where is the open-circuit voltage, is the ohmic internal resistance, and are the polarization internal resistances in the battery second-order RC equivalent model, and are the polarization capacitances in the battery second-order RC equivalent model; are the battery experimental parameters, representing the fitting relationships 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 parameters; is the SOC value calculated at the PS side; Calculation exponent and , , where represents the RC circuit time constant, is the updated polarization capacitance, is the updated polarization internal resistance, Δt represents the time interval, x1 = 1 or 2; Jacobian matrix calculation: Calculate the Jacobian matrix A k , ; Calculate the Jacobian matrix B k , , is the updated polarization internal resistance; Calculate the Jacobian matrix H k partial derivative equation of , h k is used for subsequent Kalman gain calculation on the PS side, x1 = 1 or 2; A priori estimation calculation: State estimation at the current moment , where 、 is the RC loop voltage of the battery second-order RC equivalent model, is calculated and completed on the PS side, 、 is calculated using a pipeline design; the calculated 、 、 、h k is sent to the PS side for a posteriori estimation calculation; Covariance prediction: Calculate the covariance prediction matrix + Q, where the Jacobian matrix of the previous round , represents the transpose 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, and k - 1 represents the previous round of calculation; Send the calculation result to the PS side for use.
4. The optimized calculation method of the extended Kalman SOC based on FPGA according to claim 3, wherein Based on the calculation results of the PL side, the PS side performs extended Kalman gain calculation, and performs posterior estimation calculation according to the extended Kalman gain calculation results to obtain the extended Kalman SOC calculation results, completing the calculation for this round, specifically including: Extended Kalman Gain Calculation: Extended Kalman gain k k The calculation formula is as follows: , where the intermediate parameter ; Jacobian matrix k represents the linear relationship between the system measurement value and the state vector, and is of one-dimensional array type ; The calculation is simplified to , h k is the Jacobian matrix H calculated by the PL side k partial derivative equation result, is the covariance prediction matrix calculated by the PL side, R k is the measurement noise, is the covariance prediction matrix the element in the i-th row and j-th column of; Therefore, after reading from the memory by the PS side directly complete the calculation of k k calculation; Posteriori estimation: Calculate the calculated value of the battery voltage , where 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 priori state estimation result of the PL side, is the voltage sensor acquisition value including measurement noise; the updated , is the RC loop voltage value of the updated second-order RC equivalent model of the battery, is the extended Kalman SOC calculation result obtained after update; output the extended Kalman SOC calculation result of this round and use it for the next round of calculation; Covariance update: Read k k , H k , P k - parameters, calculate the covariance , and send the calculated to the PS side for the next round of calculation.
5. A method for optimizing the calculation of an extended Kalman SOC based on FPGA according to claim 3, characterized in that Update of battery second-order RC equivalent model parameters, specifically including: The calculation of each parameter 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: the input is value, and the calculation of , , , is completed in the first clock cycle; the calculation of , , is completed in the second clock cycle; the calculation of , , is completed in the third clock cycle; the calculation of is completed in the fourth clock cycle; the calculation of is completed in the fifth clock cycle, and the accumulation of the five parameters of , , , and is performed.
6. The optimized calculation method of the extended Kalman SOC based on FPGA according to claim 3, characterized in that Prior estimation calculation, specifically including: Design two parallel computing pipelines to complete the calculations of U 1,k and U 2,k The calculation formula is: , where I is the collected current, and R x1,k is the polarization internal resistance in the second-order RC equivalent model of the battery, is the RC loop voltage value of the second-order RC equivalent model of the battery in the previous calculation, and x1 = 1 or 2; Each pipeline calculation is completed in 4 clock cycles, including: completed in the first clock cycle , calculation, completed in the second clock cycle calculation, completed in the third clock cycle calculation, and the calculation result is output in the fourth clock cycle.
7. A method for optimizing the calculation of an extended Kalman SOC based on FPGA according to claim 3, characterized in that, Covariance prediction, specifically including: The covariance prediction calculation involves three matrix multiplications: , and the covariance prediction matrix calculation is optimized by designing a systolic array matrix multiplier.
8. A method for optimizing the calculation of an extended Kalman SOC based on FPGA according to claim 3, characterized in that The method further includes: Designing a finite state machine for the extended Kalman SOC calculation process on the PL side, including: State idle is waiting for the PS side to calculate the SOC parameter update. If the SOC parameter update is completed, the flag bit SOC_Parameter is set to 1 and the next stage is entered; State state_model is for the update calculation of the battery second-order RC equivalent model parameters, and the next stage is entered after the calculation is completed; State state_cal_rc is for performing exponential calculation, and the next stage is entered after the calculation is completed; State state_jacobian is for Jacobian matrix calculation. After the calculation is completed, the flag bit Calculate_end is set to 1 and the next stage is entered; State state_prior is for prior estimation calculation, which is the RC loop voltage pipeline calculation of the second-order RC equivalent model. If the calculation is completed, the flag bit Matrix_end is set to 1 and the next stage is entered; State state_err_covar is for covariance prediction; If the flag bit Calculate_end or Matrix_end is 1, enter the state_axi state. The state_axi state indicates that the Jacobian matrix calculation or prior estimation calculation is completed, and the parameters are passed to the PS side.
9. A method for optimizing the calculation of an extended Kalman SOC based on FPGA according to claim 1, characterized in that, The method further includes: Establish communication between the PS side and the PL side in the AXI mode.
10. An extended Kalman SOC optimization calculation system based on FPGA, characterized in that, The system includes a PS side and a PL side based on the ZYNQ chip, and communication is established between the PS side and the PL side; The PS side is used to collect the voltage and current data of the battery, calculate the SOC value based on the collected voltage and current data and the previous round of extended Kalman SOC calculation results, and send the calculation results to the PL side; Based on the calculation results of the PS side, the PL side is used to update the parameters of the battery second-order RC equivalent model according to the SOC fitting formula, perform Jacobian matrix calculation, prior estimation calculation, and covariance prediction calculation for this round based on the updated results of the battery second-order RC equivalent model parameters, and send the calculation results to the PS side; Based on the calculation results of the PL side, the PS side is also used to perform extended Kalman gain calculation, and perform posterior estimation calculation according to the extended Kalman gain calculation results to obtain the extended Kalman SOC calculation results.
Citation Information
Patent Citations
SOC estimation method and equipment for lithium ion battery based on FPGA
CN104865535A
Multifunctional portable partial discharge online detecting instrument for power distribution device
CN109633391A
Adaptive optimization method for estimating SOC of battery based on Kalman filtering framework
CN110502778A
Novel intelligent optimization particle filter lithium battery SOE estimation method and system
CN118091428A
Differential positioning method and device based on 5G communication signal
CN118301734A