A voltage sampling ripple elimination method, device, equipment and storage medium

By acquiring the instantaneous voltage and current of the battery, the final internal resistance is determined and a compensation voltage is generated for feedforward correction. Combined with low-pass filtering, the problem of power frequency ripple interference in the battery management system is solved, achieving high-precision voltage sampling and reducing hardware costs and circuit area.

CN122131868APending Publication Date: 2026-06-02SHENZHEN POWEROAK NEWENER CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN POWEROAK NEWENER CO LTD
Filing Date
2026-04-30
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

In existing battery management systems, power frequency ripple interference leads to a decrease in voltage sampling accuracy. Traditional hardware filtering schemes increase costs and cannot effectively suppress ripple. At low sampling rates, spectral aliasing makes it difficult to separate ohmic and polarization internal resistances, resulting in inaccurate internal resistance estimation.

Method used

By acquiring instantaneous voltage, instantaneous current, and average current, the final internal resistance is determined, a compensation voltage is generated for feedforward correction, and a second-order Butterworth low-pass filter is used to eliminate ripple. Combined with first-order recursive filtering and confidence fusion, a robust estimation of the internal resistance is achieved.

Benefits of technology

Without increasing hardware costs, it effectively eliminates power frequency ripple interference, improves the accuracy and stability of voltage sampling, reduces hardware costs and circuit board area, and is suitable for battery management systems under low sampling rate conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122131868A_ABST
    Figure CN122131868A_ABST
Patent Text Reader

Abstract

This application provides a voltage sampling ripple elimination method, apparatus, device, and storage medium. The method includes: acquiring continuously sampled instantaneous voltage, instantaneous current, and average current; determining the final internal resistance at the same moment based on the instantaneous voltage, instantaneous current, and average current; generating a compensation voltage based on the difference between the instantaneous current and the average current and the final internal resistance; performing feedforward correction on the instantaneous voltage using the compensation voltage; and performing low-pass filtering on the feedforward corrected voltage to output a target voltage after ripple removal. This application can eliminate voltage sampling ripple using a software algorithm without adding any hardware filtering circuit, significantly reducing hardware costs and circuit board area. Simultaneously, it can effectively suppress power frequency ripple and its aliasing components under low sampling rate conditions, avoiding the problem of traditional frequency domain filters being unable to separate interference from the real signal due to spectral aliasing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of battery management technology, and in particular to a method, apparatus, device, and storage medium for eliminating voltage sampling ripple. Background Technology

[0002] One of the core functions of a Battery Management System (BMS) is to accurately acquire the terminal voltage of individual battery cells. The accuracy of this acquisition directly affects the reliability of battery state estimation (such as state of charge, SOC) and system safety. During charging, power frequency ripple (50Hz / 60Hz, rectified to 100Hz / 120Hz) introduced by the grid or charger can couple to the sampling signal, causing the voltage measurement to fluctuate periodically with the current, severely interfering with the BMS's judgment and control.

[0003] To reduce costs, the analog front-end (AFE) chips widely used in BMS currently employ lower sampling frequencies (such as 16Hz and 50Hz). Under these conditions, existing voltage ripple suppression technologies have the following main drawbacks: (1) Limitations of hardware filtering schemes. Although traditional hardware RC filter circuits can suppress ripple to a certain extent, they have inherent limitations. On the one hand, RC circuits introduce phase delay, which leads to a deterioration in the dynamic response of the system, especially when the current changes rapidly, making it impossible to accurately track the real voltage. On the other hand, this scheme requires adding an independent filter circuit for each cell, which significantly increases hardware costs and circuit board area. (2) Spectral aliasing problem at low sampling rates. When the sampling frequency of the AFE is less than twice the power frequency ripple frequency (not satisfying the Nyquist sampling theorem), power frequency interference will cause spectral aliasing. For example, a 60Hz ripple will alias into a 4Hz low-frequency component at a 16Hz sampling frequency. The aliasing frequency overlaps with the actual slowly varying dynamics of the battery voltage (usually below 0.1Hz) in the frequency band, causing traditional frequency domain digital filters to be unable to effectively filter out interference while retaining the real signal, thus falling into the dilemma of "filtering out interference inevitably damages the signal". (3) The ohmic-polarization internal resistance separation method based on the Thevenin model is difficult to implement in engineering. Most existing technical solutions are based on the battery Thevenin equivalent model, attempting to identify the ohmic internal resistance and polarization internal resistance separately through voltage and current differential calculation. However, under low sampling rate conditions, the system cannot effectively separate the ohmic response (instantaneous) and polarization response (millisecond to second level) in the time dimension, resulting in the calculated internal resistance value being a mixed internal resistance containing ohmic and polarization components, which is difficult to use for accurate compensation and limits its practical application effect in engineering. Summary of the Invention

[0004] The purpose of this invention is to provide a method, apparatus, device, and storage medium for eliminating voltage sampling ripple, thereby solving the problem of ripple interference in voltage sampling.

[0005] According to a first aspect of the present invention, a voltage sampling ripple elimination method is provided, comprising: Acquire instantaneous voltage, instantaneous current, and average current obtained from continuous sampling; The final internal resistance at the same moment is determined based on the instantaneous voltage, instantaneous current, and average current. A compensation voltage is generated based on the difference between the instantaneous current and the average current and the final internal resistance; The instantaneous voltage is feedforward corrected using the compensation voltage; The feedforward corrected voltage is low-pass filtered to output the target voltage after ripple removal.

[0006] In some possible implementations, determining the final internal resistance at the same moment based on instantaneous voltage, instantaneous current, and average current includes: The instantaneous internal resistance is obtained based on the instantaneous voltage and instantaneous current; The instantaneous internal resistance is filtered to generate a smooth internal resistance; Determine the total confidence level of the smoothed internal resistance; Based on the total confidence level, the smoothed internal resistance and the reference internal resistance are weighted and fused to obtain the final internal resistance.

[0007] In some possible implementations, the instantaneous internal resistance is obtained based on the instantaneous voltage and instantaneous current, including: The instantaneous internal resistance satisfies: ; in, V raw [ n [ ] is the instantaneous voltage at the current moment. I inst [ n [ ] is the instantaneous current at the current moment. V raw [ n [-1] is the instantaneous voltage at the previous moment. I inst [ n [-1] is the instantaneous current at the previous moment.

[0008] In some possible implementations, obtaining the instantaneous internal resistance based on the instantaneous voltage and instantaneous current further includes: Determine the difference between the instantaneous currents at two adjacent sampling times; When the absolute value of the instantaneous current difference is less than or equal to the preset current change threshold, the corresponding instantaneous internal resistance is determined to be invalid, and the previous valid instantaneous internal resistance is used or the instantaneous internal resistance obtained this time is discarded. When the absolute value of the instantaneous current difference is greater than the preset current change threshold, the corresponding instantaneous internal resistance is determined to be valid.

[0009] In some possible implementations, the instantaneous internal resistance is filtered to generate a smooth internal resistance, including: The instantaneous internal resistance is filtered by a first-order recursive filter to obtain the intermediate internal resistance. Based on the maximum physical rate of change of the smooth internal resistance and the sampling time interval, determine the maximum allowable amount of a single change in the smooth internal resistance; Based on the difference between the intermediate internal resistance and the smooth internal resistance at the previous moment, and in conjunction with the maximum allowable amount, the rate of change of the intermediate internal resistance is limited, and the current smooth internal resistance is output. Wherein, if the intermediate internal resistance is greater than the smoothing internal resistance at the previous moment, then: When the difference is less than the maximum allowable amount, the smoothed internal resistance at the current moment is the smoothed internal resistance at the previous moment plus the difference. When the difference is greater than the maximum allowable amount, the smoothed internal resistance at the current moment is the smoothed internal resistance at the previous moment plus the maximum allowable amount. If the intermediate internal resistance is equal to the smooth internal resistance at the previous moment, then the smooth internal resistance at the current moment is taken as the smooth internal resistance at the previous moment. If the intermediate internal resistance is less than the smoothing internal resistance at the previous moment, then: When the absolute value of the difference is less than the maximum allowable amount, the smoothing internal resistance at the current moment is taken as the smoothing internal resistance at the previous moment minus the absolute value of the difference. When the absolute value of the difference is greater than the maximum allowable amount, the smoothed internal resistance at the current moment is the smoothed internal resistance at the previous moment minus the maximum allowable amount.

[0010] In some possible implementations, determining the total confidence level of the smoothed internal resistance includes: Determine the confidence level of current difference, consistency confidence level, and range confidence level, wherein the values ​​of the current difference confidence level, the consistency confidence level, and the range confidence level are all in the range of 0-1; The total confidence level is obtained by multiplying the current difference confidence level, the consistency confidence level, and the range confidence level together. The confidence level of the current difference is determined based on the instantaneous current difference between the current moment and the previous moment and the magnitude of the average current. The larger the absolute value of the instantaneous current difference, the larger the confidence level of the current difference; the larger the absolute value of the average current, the smaller the confidence level of the current difference. The consistency confidence level is determined based on the difference between the instantaneous internal resistance and the smoothed internal resistance at the previous moment, and the greater the difference, the smaller the consistency confidence level. The range confidence level is determined based on whether the instantaneous internal resistance is within a preset reasonable range. When the instantaneous internal resistance is within the reasonable range, the range confidence level is at its maximum value; otherwise, the range confidence level is zero.

[0011] In some possible implementations, the confidence level of the current difference satisfies: ; in, ΔI inst [ n [This represents the instantaneous current difference between the current moment and the previous moment.] I eff [ n [This represents the average current.] k 1 and k 2 These are preset coefficients.

[0012] In some possible implementations, the consistency confidence level satisfies: ; in, R inst [ n ]for n Instantaneous internal resistance at a given moment ,R filtered [ n [-1] represents the smooth internal resistance at the previous moment.

[0013] In some possible implementations, the final internal resistance satisfies: ; in, R est [ n [This is the final internal resistance.] C [ n [This represents the total confidence level.] R filtered [ n [ ] represents the smooth internal resistance at the current moment. R base [ n [ ] is the reference internal resistance.

[0014] In some possible implementations, the compensation voltage satisfies: ; in, α [ n [] represents the preset compensation coefficient. I eff [ n [Average current] Iinst [ n [This refers to the instantaneous current.] R est [ n [This represents the final internal resistance.]

[0015] In some possible implementations, the instantaneous voltage is fed forward using the compensation voltage, including: When in a charging state, if the instantaneous current is greater than the average current, the compensation voltage is subtracted from the instantaneous voltage; if the instantaneous current is less than the average current, the compensation voltage is added to the instantaneous voltage. When in a discharge state, if the instantaneous current is greater than the average current, the compensation voltage is added to the instantaneous voltage; if the instantaneous current is less than the average current, the compensation voltage is subtracted from the instantaneous voltage.

[0016] In some possible implementations, the low-pass filter is a second-order Butterworth low-pass filter.

[0017] In some possible implementations, the cutoff frequency of the low-pass filter is lower than the frequency of the power frequency ripple caused by sampling aliasing.

[0018] According to a second aspect of the present invention, a voltage sampling ripple cancellation device is provided, comprising: The data acquisition module is used to acquire the instantaneous voltage, instantaneous current, and average current obtained from continuous sampling; An internal resistance determination module is used to determine the final internal resistance at the same moment based on the instantaneous voltage, the instantaneous current, and the average current. The compensation voltage generation module is used to generate a compensation voltage based on the difference between the instantaneous current and the average current and the final internal resistance. A feedforward correction module is used to perform feedforward correction on the instantaneous voltage using the compensation voltage; The low-pass filter module is used to perform low-pass filtering on the feedforward corrected voltage and output the target voltage after ripple removal.

[0019] According to a third aspect of the present invention, an electronic device is provided, comprising: an input unit, a memory, at least one processor, and an output interface, wherein the memory stores program instructions executable on the processor, and the processor can execute a voltage sampling ripple elimination method by invoking the program instructions.

[0020] According to a fourth aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements a voltage sampling ripple elimination method.

[0021] According to the present invention, instantaneous voltage, instantaneous current, and average current obtained through continuous sampling are acquired, and the final internal resistance at the same moment is determined based on these data. Then, a compensation voltage is generated based on the difference between the instantaneous current and the average current and the final internal resistance, and this compensation voltage is used to perform feedforward correction on the instantaneous voltage. Finally, the feedforward corrected voltage is low-pass filtered to output the target voltage after ripple removal. By estimating the battery's internal resistance in real time for feedforward compensation of the sampling voltage, most of the ripple influence is eliminated as much as possible before filtering. Then, a low-pass filter is used to maximize the elimination of the influence of power frequency ripple on the single-cell voltage sampling of the battery within a short delay, ultimately obtaining an interference-free and accurate single-cell voltage value. The present invention can eliminate voltage sampling ripple using software algorithms without adding any hardware filtering circuits, significantly reducing hardware costs and circuit board area. Meanwhile, by combining feedforward compensation and low-pass filtering, the power frequency ripple and its aliasing components can be effectively suppressed under low sampling rate conditions. This avoids the problem that traditional frequency domain filters cannot separate interference from the real signal due to spectral aliasing, thereby significantly improving the accuracy and stability of voltage sampling while preserving the true dynamic characteristics of battery voltage.

[0022] When determining the final internal resistance, the instantaneous internal resistance is calculated by the difference between the instantaneous voltage and the instantaneous current. A current change threshold is introduced for validity screening, avoiding divergence in internal resistance calculation caused by excessively small current changes, thus improving the robustness of internal resistance estimation. Simultaneously, taking advantage of the slow change and physical upper limit of battery internal resistance, a first-order recursive filter and rate-of-change limiting are applied to the instantaneous internal resistance to obtain a smooth internal resistance, effectively filtering out measurement noise and preventing abrupt changes in internal resistance. Based on this, the total confidence score is obtained by multiplying the current difference confidence score, consistency confidence score, and range confidence score. The smooth internal resistance is then weighted and fused with the HPPC reference internal resistance. This allows real-time measurements to be trusted to track dynamic changes when the signal is reliable, and automatically degrades to a physical model-dependent reference when the signal quality is poor, avoiding the risk of erroneous estimates. Furthermore, a second-order Butterworth low-pass filter is used after feedforward correction, with its cutoff frequency set below the frequency generated by sampling aliasing of the power frequency ripple, thereby completely eliminating residual low-frequency aliasing interference with minimal computation and the shortest settling time. This invention abandons the unattainable goal of "precisely separating ohmic and polarization resistance" at low sampling rates when performing real-time internal resistance estimation. Instead, it proposes a new paradigm of "robust estimation of total internal resistance - confidence fusion compensation." This paradigm acknowledges and utilizes the continuous and slowly varying nature of polarization resistance, incorporating it as a constraint into the algorithm to directly estimate a high-confidence total equivalent internal resistance suitable for feedforward compensation online. Compared to traditional solutions requiring high-order digital filters, this invention offers lower computational complexity, higher real-time performance, and lower sampling frequency requirements. It is compatible with most low-cost AFE chips or MCUs on the market and has broad engineering practical value. Attached Figure Description

[0023] Figure 1 This is a flowchart illustrating the steps of a voltage sampling ripple elimination method according to an embodiment of the present invention. Figure 2 This is a flowchart illustrating the steps for determining the final internal resistance at the same moment for instantaneous voltage, instantaneous current, and average current according to an embodiment of the present invention. Figure 3 This is a flowchart illustrating the steps for determining the effectiveness of obtaining instantaneous internal resistance based on instantaneous voltage and instantaneous current according to an embodiment of the present invention. Figure 4 This is a flowchart illustrating the steps of filtering instantaneous internal resistance to generate smooth internal resistance according to an embodiment of the present invention. Figure 5 This is a flowchart illustrating the steps for determining the total confidence level of smooth internal resistance according to an embodiment of the present invention; Figure 6 This is a detailed execution flow diagram of a voltage sampling ripple elimination method according to an embodiment of the present invention; Figure 7 This is a schematic diagram of a voltage sampling ripple elimination device according to an embodiment of the present invention; Figure 8 This is a block diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0025] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the application. The singular forms “a,” “said,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms, and “multiple” generally includes at least two unless the context clearly indicates otherwise.

[0026] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0027] It should be understood that although the terms first, second, third, etc., may be used in the embodiments of this application, these descriptions should not be limited to these terms. These terms are only used to distinguish the descriptions. For example, first may also be referred to as second without departing from the scope of the embodiments of this application, and similarly, second may also be referred to as first.

[0028] Depending on the context, the words “if” or “suppose” as used here can be interpreted as “when” or “in response to determination” or “in response to detection.” Similarly, depending on the context, the phrases “if determination” or “if detection (of the stated condition or event)” can be interpreted as “when determination” or “in response to determination” or “when detection (of the stated condition or event)” or “in response to detection (of the stated condition or event).”

[0029] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that an article or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such an article or device. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the article or device that includes said element.

[0030] It should be noted that any symbols and / or numbers present in the specification that are not marked in the accompanying drawings are not reference numerals.

[0031] The optional embodiments of this application are described in detail below with reference to the accompanying drawings.

[0032] Figure 1 A voltage sampling ripple elimination method is shown, comprising the following steps S10 to S50.

[0033] Step S10: Obtain the instantaneous voltage, instantaneous current, and average current obtained from continuous sampling; Instantaneous voltage refers to the battery terminal voltage value measured directly at a specific sampling moment. It includes the battery's true voltage as well as various noises and interferences superimposed on it, such as power frequency ripple. Instantaneous current refers to the battery charging and discharging current value measured at the same sampling moment as the instantaneous voltage, reflecting the battery's current state at that moment. Average current refers to the current value obtained by averaging the instantaneous current over a period of time. It can reflect the overall trend of the battery current and helps to distinguish between instantaneous fluctuations and actual current changes.

[0034] Step S20: Determine the final internal resistance at the same moment based on the instantaneous voltage, instantaneous current, and average current; The final internal resistance refers to the battery's equivalent internal resistance value obtained after a series of processing and optimizations. This internal resistance value includes the sum of ohmic resistance and polarization resistance, without distinguishing between the two.

[0035] For the process of determining the final internal resistance at the same moment based on instantaneous voltage, instantaneous current, and average current, such as Figure 2 As shown, it includes the following steps: S201, obtain the instantaneous internal resistance based on the instantaneous voltage and instantaneous current; Based on the equivalent circuit characteristics of the battery, such as the first-order Thevenin model, in the extremely short time interval between two adjacent samplings... Δt Within the battery, the total internal resistance can be considered constant. Therefore, the instantaneous internal resistance at the current moment... R inst [ n It can be calculated from the ratio of voltage difference to current difference: ; in, V raw [ n ] yes The instantaneous voltage at the current moment, I inst [ n [ ] is the instantaneous current at the current moment. V raw [ n -1] yes The instantaneous voltage at the previous moment, I inst [ n [-1] is the instantaneous current at the previous moment. Here, the direction of the current is defined as positive for charging and negative for discharging.

[0036] The instantaneous current difference between two adjacent sampling times ΔI When the voltage is close to zero, voltage sampling errors and voltage changes caused by other noises are amplified. To avoid the calculated internal resistance value deviating significantly from reality, an effectiveness judgment is introduced for obtaining the instantaneous internal resistance based on instantaneous voltage and instantaneous current, such as... Figure 3 As shown, it includes the following steps: S2011, determine the difference in instantaneous current between two adjacent sampling times; S2012, when the absolute value of the instantaneous current difference is less than or equal to the preset current change threshold, the corresponding instantaneous internal resistance is determined to be invalid, and the previous valid instantaneous internal resistance is used or the instantaneous internal resistance obtained this time is discarded. S2013: When the absolute value of the instantaneous current difference is greater than the preset current change threshold, the corresponding instantaneous internal resistance is determined to be valid.

[0037] The current change threshold can be set according to the noise level of the current sensor and the ripple amplitude of the battery's common charger to ensure that the calculation has a basic signal-to-noise ratio.

[0038] S202 filters the instantaneous internal resistance to generate a smooth internal resistance; The acquired instantaneous internal resistance contains measurement noise and transient disturbances, which need to be filtered. This filtering process leverages the slow, continuous change in battery internal resistance and the existence of a physical upper limit to remove noise while avoiding the introduction of unreasonable abrupt changes. This process is as follows: Figure 4 As shown, it includes the following steps: S2021, a first-order recursive filter is used to filter the instantaneous internal resistance to obtain the intermediate internal resistance; Based on the continuous change of internal resistance, a first-order recursive filter formula can be set: ; in, λ = Δt / ( τ + Δt ), where τ is the filter time constant, which depends on the maximum acceptable delay time and can be set to 0.2-0.5s. R temp [ n [This refers to] the intermediate internal resistance. R filtered [ n [-1] is the smoothed internal resistance obtained at the previous moment. When n=0, the filter calculation cannot be established. It is necessary to first sample one set of data as the initial value of the filter, that is, when n=0, R temp [0]= R filtered [0]= R inst [0].

[0039] S2022, Based on the maximum physical rate of change of the smooth internal resistance and the sampling time interval, determine the maximum allowable amount of a single change in the smooth internal resistance; There is a physical upper limit to the rate of change of the battery's internal resistance. ρ max (Unit: Ω / s), this parameter is determined by the battery's chemistry and materials and can be pre-calibrated using hybrid pulse power characteristic (HPPC) testing or electrochemical impedance spectroscopy (EIS) testing. Therefore, the maximum allowable variation between two adjacent filter outputs is: ; S2023: Based on the difference between the intermediate internal resistance and the smoothed internal resistance at the previous moment, and combined with the maximum allowable amount, limit the rate of change of the intermediate internal resistance, and output the current smoothed internal resistance. If the intermediate internal resistance is greater than the smoothing internal resistance at the previous moment, then: When the difference is less than the maximum allowable amount, the smoothing internal resistance at the current moment is the smoothing internal resistance at the previous moment plus the difference. When the difference is greater than the maximum allowable amount, the smoothing internal resistance at the current moment is the smoothing internal resistance at the previous moment plus the maximum allowable amount. If the intermediate internal resistance is equal to the smooth internal resistance at the previous moment, then the smooth internal resistance at the current moment is taken as the smooth internal resistance at the previous moment. If the intermediate internal resistance is less than the smoothing internal resistance at the previous moment, then: When the absolute value of the difference is less than the maximum allowable amount, the smoothing internal resistance at the current moment is taken as the smoothing internal resistance at the previous moment minus the absolute value of the difference. When the absolute value of the difference is greater than the maximum allowable value, the smoothed internal resistance at the current moment is the smoothed internal resistance at the previous moment minus the maximum allowable value.

[0040] Specifically, by combining formulas (2) and (3), the filtered output of the linearly changing internal resistance can be obtained, that is, the smooth internal resistance at the current moment is expressed as: ; in, R filtered [ n [ ] represents the smooth internal resistance at the current moment. R filtered [ n [-1] represents the smooth internal resistance at the previous moment. sign For symbolic functions, R temp [ n ]> R filtered [ n -1] sign ( R temp [ n ]- R filtered [ n The value of -1]) is 1. R temp [ n ]< R filtered [ n When -1 is equal, the value is -1; when equal, the value is 0.

[0041] S203, determine the total confidence level of the smoothing internal resistance; To characterize the reliability of the smoothed internal resistance at the current moment, a total confidence level is introduced to quantify the credibility of the estimated smoothed internal resistance. The specific process is as follows: Figure 5 As shown, it includes the following steps: S2031, determine the confidence level of current difference, consistency confidence level and range confidence level. The values ​​of current difference confidence level, consistency confidence level and range confidence level are all in the range of 0-1. S2032, multiply the current difference confidence, consistency confidence and range confidence to obtain the total confidence.

[0042] The confidence level of the current difference is determined based on the instantaneous current difference between the current moment and the previous moment and the magnitude of the average current. The larger the absolute value of the instantaneous current difference, the larger the confidence level of the current difference; the larger the absolute value of the average current, the smaller the confidence level of the current difference.

[0043] The consistency confidence level is determined based on the difference between the instantaneous internal resistance and the smoothed internal resistance at the previous moment, and the greater the difference, the lower the consistency confidence level.

[0044] The range confidence level is determined based on whether the instantaneous internal resistance is within a preset reasonable range. When the instantaneous internal resistance is within a reasonable range, the range confidence level is at its maximum value; otherwise, the range confidence level is zero.

[0045] The total confidence level is expressed as: ; Among them, C ΔI[n] C represents the confidence level of the current difference. consist For consistency confidence, C range For range confidence level.

[0046] The current difference confidence level satisfies: ; in, ΔI inst [ n [This represents the instantaneous current difference between the current moment and the previous moment.] I eff [ n [Average current] k 1 and k 2 These are preset coefficients.

[0047] Consistency confidence level is satisfied: ; in, R inst [ n ]for n Instantaneous internal resistance at a given moment ,R filtered [ n [-1] represents the smooth internal resistance at the previous moment.

[0048] Range confidence can be represented by a boundary; when the boundary is exceeded...R max and R min The confidence level for the time range is 0, otherwise it is 1. R max This is the maximum internal resistance. Typically, when the battery's state of equilibrium (SOH) is 0, the internal resistance indicates that the battery is damaged. R min This indicates the initial minimum internal resistance of the battery cell when it leaves the factory.

[0049] S204, based on the total confidence level, weighted and fused the smoothed internal resistance and the reference internal resistance to obtain the final internal resistance; The final internal resistance satisfies: ; in, R est [ n [This is the final internal resistance.] C [ n [This represents the total confidence level.] R filtered [ n [ ] represents the smooth internal resistance at the current moment. R base [ n The reference internal resistance is the DC internal resistance value of the battery obtained by HPPC testing, which includes ohmic internal resistance and polarization internal resistance.

[0050] Step S30: Generate a compensation voltage based on the difference between the instantaneous current and the average current and the final internal resistance; The compensation voltage satisfies: ; in, α [ n [] represents the preset compensation coefficient. I eff [ n [Average current] I inst [ n [This refers to the instantaneous current.] R est [ n [This represents the final internal resistance.]

[0051] Step S40: Feedforward correction of instantaneous voltage using compensation voltage; Depending on whether the battery is currently charging or discharging, different correction methods are used to apply the compensation voltage to the instantaneous voltage to obtain the feedforward corrected voltage. Specifically: When charging, if the instantaneous current is greater than the average current, the compensation voltage is subtracted from the instantaneous voltage; if the instantaneous current is less than the average current, the compensation voltage is added to the instantaneous voltage; expressed as: ; When in a discharge state, if the instantaneous current is greater than the average current, a compensation voltage is added to the instantaneous voltage; if the instantaneous current is less than the average current, the compensation voltage is subtracted from the instantaneous voltage; expressed as: ; in, V charge_pre [ n ]and V discharge_pre [ n These are the feedforward corrected voltages for charging and discharging states, respectively. V raw [ n [This refers to the instantaneous voltage.] I inst [ n [This refers to the instantaneous current.] I eff [ n [This represents the average current;] sign For symbolic functions, I inst [ n ] >I eff [ n ] when sign( I inst [ n ] -I eff [ n The value is 1; I inst [ n ]< I eff [ n ] when sign( I inst [ n ] -I eff [ n The value is -1 when they are equal, and 0 when they are equal.

[0052] Step S50: Perform low-pass filtering on the feedforward corrected voltage and output the target voltage after ripple removal. The second-order Butterworth low-pass filter has the flattest frequency response within its passband. Its amplitude-frequency characteristic remains flat up to the cutoff frequency, and decays at a slope of -12dB per octave (i.e., -40dB per decibel) after the cutoff frequency. The second-order filter requires the least amount of multiply-accumulate operations and state storage space, and has a short settling time (usually less than 1 second), making it suitable for the real-time computing requirements of a BMS.

[0053] Due to the voltage sampling frequency of the AFE (Analog Front End) chip f s Typically, the sampling frequency is low (e.g., 16Hz or 50Hz), which may not satisfy the Nyquist sampling theorem (i.e., the sampling frequency is less than twice the power frequency ripple frequency). In this case, spectral aliasing will occur in the power frequency ripple. Aliasing frequency f d Represented as: ; in, f a For signal frequency, f d For aliasing frequency, f s Sampling frequency ,K For integers, usually starting from 0, such that | f a - Kf s The smallest.

[0054] Since the feedforward correction module has eliminated most of the current-related ripple components, the residual interference mainly consists of aliased low-frequency components (2-4Hz) and other high-frequency noise. Therefore, the cutoff frequency of the second-order Butterworth low-pass filter is... f c Set below the aliasing frequency f d The value, such as 1Hz to 1.5Hz, can effectively attenuate 2-4Hz aliasing interference while preserving the true gradual dynamics of the battery voltage (usually below 0.1Hz), thus outputting a clean and stable voltage value within a short delay.

[0055] In practical applications, the specific sampling frequency of the AFE can be used as a reference. f s Calculate the aliasing frequency with the local power grid frequency (50Hz or 60Hz). f d And adjust the cutoff frequency accordingly to ensure the cutoff frequency is within acceptable limits. f c Below the aliasing frequency f d .

[0056] like Figure 6 A flowchart illustrating another method for eliminating voltage sampling ripple is shown below. A1: Obtain the instantaneous voltage at the current moment. V raw [ n Instantaneous current I inst [ nAverage current I eff [ n ], and the instantaneous voltage of the previous moment. V raw [ n-1 Instantaneous current I inst [ n-1 Smoothing internal resistance R filtered [ n-1 ], and execute A2; A2: Calculate the instantaneous internal resistance R inst [ n ], and execute A3; A3: Compare the instantaneous current difference ΔI inst The absolute value and the preset current change threshold ΔI min The size, if | ΔI inst |> ΔI min Execute A4; otherwise, if | ΔI |≤ ΔI min Next, A5; A4: Calculate the intermediate internal resistance R temp [ n Next step, A6; A5: Adjust the smoothing internal resistance from the previous moment. R filtered [ n-1 As the current intermediate internal resistance, the next step is to execute A6; A6: Based on the maximum physical rate of change ρ max and sampling interval Δt Calculate the maximum allowable amount for a single change. Δ R allowed Next step is to execute A7; A7: Calculate the difference D= R temp [ n ]- R filtered [n-1], when D > 0, execute A7a; when D = 0, execute A7b; when D < 0, execute A7c. A7a: If D < ΔR allowed ,but R filtered [n]= R filtered[n-1]+D, if D> ΔR allowed ,but R filtered [n]= R filtered [n-1]+ ΔR allowed Next step is to execute A8; A7b: R filtered [n]= R filtered [n-1], next step is to execute A8; A7c: If |D| < ΔR allowed ,but R filtered [n]= R filtered [n-1]-|D|, if |D|> ΔR allowed ,but R filtered [n]= R filtered [n-1]- ΔR allowed Next step is to execute A8; A8: Calculate the confidence level of the current difference C ΔI[n] Consistency confidence level C consist and range confidence level C range The next step is to execute A9; A9: Calculate the total confidence level C [n] The next step is to execute A10; A10: Weighted fusion to obtain the final internal resistance R est [ n Next step: A11; A11: Generate compensation voltage, proceed to A12; A12: Get the current current direction. If it is in charging state, execute A13; if it is in discharging state, execute A14. A13: Compare instantaneous currents I inst [ n [and average current] I eff [ n If the instantaneous current I inst [ n Average current I eff [ n If the instantaneous voltage is subtracted from the compensation voltage, and the instantaneous current is... Iinst [ n Average current I eff [ n If the instantaneous voltage is increased, a compensation voltage will be added, and the next step will be A15. A14: Compare instantaneous currents I inst [ n [and average current] I eff [ n If the instantaneous current I inst [ n Average current I eff [ n If the instantaneous voltage is increased by a compensation voltage, and the instantaneous current is increased... I inst [ n Average current I eff [ n If the instantaneous voltage is subtracted from the compensation voltage, then the next step is to execute A15; A15: Input the corrected voltage into a second-order Butterworth low-pass digital filter with preset coefficients to obtain the target voltage, end the current sampling cycle, and wait for the next sampling cycle to be triggered before executing A1.

[0057] like Figure 7 As shown, one embodiment of the present invention provides a voltage sampling ripple cancellation device, which includes: The data acquisition module 410 is used to acquire the instantaneous voltage, instantaneous current and average current obtained by continuous sampling; The internal resistance determination module 420 is used to determine the final internal resistance at the same moment based on the instantaneous voltage, the instantaneous current and the average current; The compensation voltage generation module 430 is used to generate a compensation voltage based on the difference between the instantaneous current and the average current and the final internal resistance. The feedforward correction module 440 is used to perform feedforward correction on the instantaneous voltage using the compensation voltage; The low-pass filter module 450 is used to perform low-pass filtering on the feedforward corrected voltage and output the target voltage after filtering out ripple.

[0058] Each module in the above-mentioned device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0059] like Figure 8 As shown, one embodiment of the present invention provides an electronic device 600. The electronic device 600 includes a memory 601, a processor 602, and an input / output (I / O) interface 603. The memory 601 is used to store instructions. The processor 602 is used to execute the voltage sampling ripple elimination method of the embodiments of this application by calling the instructions stored in the memory 601. The processor 602 is connected to both the memory 601 and the I / O interface 603, for example, via a bus system and / or other forms of connection mechanisms (not shown). The memory 601 can be used to store programs and data, including the program for the voltage sampling ripple elimination method involved in the embodiments of this application. The processor 602 executes various functional applications and data processing of the electronic device 600 by running the program stored in the memory 601.

[0060] In this embodiment, the processor 602 can be implemented using at least one of the following hardware forms: digital signal processor (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor 602 can be one or a combination of several of the following: central processing unit (CPU) or other processing units with data processing capability and / or instruction execution capability.

[0061] The memory 601 in this embodiment may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0062] In this embodiment, the I / O interface 603 can be used to receive input instructions (such as numeric or character information, and to generate key signal inputs related to user settings and function control of the electronic device 600), and can also output various information (such as images or sounds) to the outside. In this embodiment, the I / O interface 603 may include one or more of the following: a physical keyboard, function keys (such as volume control keys, power buttons, etc.), a mouse, a joystick, a trackball, a microphone, a speaker, and a touch panel.

[0063] In some embodiments, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described method embodiments.

[0064] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described; however, as long as the combinations of these technical features are not contradictory, they should be considered within the scope of this specification.

[0065] In some embodiments, this application provides a computer program product comprising a computer program that, when executed by a processor, performs any of the methods described above.

[0066] Although the operations are described in a specific order in the accompanying drawings, this should not be construed as requiring these operations to be performed in the specific order or serial order shown, or requiring all of the operations shown to obtain the desired result. In certain environments, multitasking and parallel processing may be advantageous.

[0067] The methods, apparatus, devices, and storage media of this application can be implemented using standard programming techniques, and various method steps can be implemented using rule-based logic or other logic. It should also be noted that the terms "apparatus" and "module" as used herein and in the claims are intended to include implementations using one or more lines of software code and / or hardware implementations and / or devices for receiving input.

[0068] Any step, operation, or procedure described herein may be performed or implemented using one or more hardware or software modules, either alone or in combination with other devices. In one embodiment, the software module is implemented using a computer program product comprising a computer-readable medium containing computer program code, which is executable by a computer processor to perform any or all of the described steps, operations, or procedures.

[0069] The foregoing description of implementations of this application has been provided for illustrative and descriptive purposes. The foregoing description is not exhaustive and is not intended to limit this application to the exact forms disclosed. Various modifications and variations may exist in accordance with the foregoing teachings, or may arise from practice of this application. These embodiments were chosen and described to illustrate the principles of this application and its practical application, enabling those skilled in the art to utilize this application in various implementations and modifications to suit the specific purpose of the concept.

[0070] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0071] It can be further understood that, unless otherwise specified, "connection" includes both direct connections where no other components exist between the two parties and indirect connections where other components exist between them.

[0072] It is further understood that although the operations are described in a specific order in the accompanying drawings in the embodiments of this application, this should not be construed as requiring these operations to be performed in the specific order or serial order shown, or requiring all the operations shown to be performed to obtain the desired result. In certain environments, multitasking and parallel processing may be advantageous.

[0073] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the field of this application that are not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0074] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

[0075] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for eliminating voltage sampling ripple, characterized in that: Acquire instantaneous voltage, instantaneous current, and average current obtained from continuous sampling; The final internal resistance at the same moment is determined based on the instantaneous voltage, instantaneous current, and average current. A compensation voltage is generated based on the difference between the instantaneous current and the average current and the final internal resistance; The instantaneous voltage is feedforward corrected using the compensation voltage; The feedforward corrected voltage is low-pass filtered to output the target voltage after ripple removal.

2. The voltage sampling ripple elimination method as described in claim 1, characterized in that, The determination of the final internal resistance at the same moment based on instantaneous voltage, instantaneous current, and average current includes: The instantaneous internal resistance is obtained based on the instantaneous voltage and instantaneous current; The instantaneous internal resistance is filtered to generate a smooth internal resistance; Determine the total confidence level of the smoothed internal resistance; Based on the total confidence level, the smoothed internal resistance and the reference internal resistance are weighted and fused to obtain the final internal resistance.

3. The voltage sampling ripple elimination method as described in claim 2, characterized in that, Obtaining the instantaneous internal resistance based on the instantaneous voltage and instantaneous current includes: The instantaneous internal resistance satisfies: ; in, V raw [ n [ ] is the instantaneous voltage at the current moment. I inst [ n [ ] is the instantaneous current at the current moment. V raw [ n [-1] is the instantaneous voltage at the previous moment. I inst [ n [-1] is the instantaneous current at the previous moment.

4. The voltage sampling ripple elimination method as described in claim 2, characterized in that, The method for obtaining the instantaneous internal resistance based on the instantaneous voltage and instantaneous current further includes: Determine the difference between the instantaneous currents at two adjacent sampling times; When the absolute value of the instantaneous current difference is less than or equal to the preset current change threshold, the corresponding instantaneous internal resistance is determined to be invalid, and the previous valid instantaneous internal resistance is used or the instantaneous internal resistance obtained this time is discarded. When the absolute value of the instantaneous current difference is greater than the preset current change threshold, the corresponding instantaneous internal resistance is determined to be valid.

5. The voltage sampling ripple elimination method as described in claim 2, characterized in that, The instantaneous internal resistance is filtered to generate a smooth internal resistance, including: The instantaneous internal resistance is filtered by a first-order recursive filter to obtain the intermediate internal resistance. Based on the maximum physical rate of change of the smooth internal resistance and the sampling time interval, determine the maximum allowable amount of a single change in the smooth internal resistance; Based on the difference between the intermediate internal resistance and the smooth internal resistance at the previous moment, and in conjunction with the maximum allowable amount, the rate of change of the intermediate internal resistance is limited, and the current smooth internal resistance is output. Wherein, if the intermediate internal resistance is greater than the smoothing internal resistance at the previous moment, then: When the difference is less than the maximum allowable amount, the smoothed internal resistance at the current moment is the smoothed internal resistance at the previous moment plus the difference. When the difference is greater than the maximum allowable amount, the smoothed internal resistance at the current moment is the smoothed internal resistance at the previous moment plus the maximum allowable amount. If the intermediate internal resistance is equal to the smooth internal resistance at the previous moment, then the smooth internal resistance at the current moment is taken as the smooth internal resistance at the previous moment. If the intermediate internal resistance is less than the smoothing internal resistance at the previous moment, then: When the absolute value of the difference is less than the maximum allowable amount, the smoothing internal resistance at the current moment is taken as the smoothing internal resistance at the previous moment minus the absolute value of the difference. When the absolute value of the difference is greater than the maximum allowable amount, the smoothed internal resistance at the current moment is the smoothed internal resistance at the previous moment minus the maximum allowable amount.

6. The voltage sampling ripple elimination method as described in claim 2, characterized in that, Determining the total confidence level of the smoothed internal resistance includes: Determine the confidence level of current difference, consistency confidence level, and range confidence level, wherein the values ​​of the current difference confidence level, the consistency confidence level, and the range confidence level are all in the range of 0-1; The total confidence level is obtained by multiplying the current difference confidence level, the consistency confidence level, and the range confidence level together. The confidence level of the current difference is determined based on the instantaneous current difference between the current moment and the previous moment and the magnitude of the average current. The larger the absolute value of the instantaneous current difference, the larger the confidence level of the current difference; the larger the absolute value of the average current, the smaller the confidence level of the current difference. The consistency confidence level is determined based on the difference between the instantaneous internal resistance and the smoothed internal resistance at the previous moment, and the greater the difference, the smaller the consistency confidence level. The range confidence level is determined based on whether the instantaneous internal resistance is within a preset reasonable range. When the instantaneous internal resistance is within the reasonable range, the range confidence level is at its maximum value; otherwise, the range confidence level is zero.

7. The voltage sampling ripple elimination method as described in claim 6, characterized in that: The confidence level of the current difference satisfies: ; in, ΔI inst [ n [This represents the instantaneous current difference between the current moment and the previous moment.] I eff [ n [Average current] k 1 and k 2 These are preset coefficients.

8. The voltage sampling ripple elimination method as described in claim 6, characterized in that: The consistency confidence level satisfies: ; in, R inst [ n ]for n Instantaneous internal resistance at a given moment ,R filtered [ n [-1] represents the smooth internal resistance at the previous moment.

9. The voltage sampling ripple elimination method as described in claim 2, characterized in that: The final internal resistance satisfies: ; in, R est [ n [This is the final internal resistance.] C [ n [This represents the total confidence level.] R filtered [ n [ ] represents the smooth internal resistance at the current moment. R base [ n [ ] is the reference internal resistance.

10. A voltage sampling ripple elimination method according to any one of claims 1-9, characterized in that: The compensation voltage satisfies: ; in, α [ n [ ] represents the preset compensation coefficient. I eff [ n [Average current] I inst [ n [This refers to the instantaneous current.] R est [ n [This represents the final internal resistance.] 11. The voltage sampling ripple elimination method as described in claim 10, characterized in that, The feedforward correction of the instantaneous voltage using the compensation voltage includes: When in a charging state, if the instantaneous current is greater than the average current, the compensation voltage is subtracted from the instantaneous voltage; if the instantaneous current is less than the average current, the compensation voltage is added to the instantaneous voltage. When in a discharge state, if the instantaneous current is greater than the average current, the compensation voltage is added to the instantaneous voltage; if the instantaneous current is less than the average current, the compensation voltage is subtracted from the instantaneous voltage.

12. The voltage sampling ripple elimination method as described in claim 11, characterized in that: The low-pass filter is a second-order Butterworth low-pass filter.

13. The voltage sampling ripple elimination method as described in claim 12, characterized in that: The cutoff frequency of the low-pass filter is lower than the frequency of the power frequency ripple caused by sampling aliasing.

14. A voltage sampling ripple elimination device, characterized in that, include: The data acquisition module is used to acquire the instantaneous voltage, instantaneous current, and average current obtained from continuous sampling; An internal resistance determination module is used to determine the final internal resistance at the same moment based on the instantaneous voltage, the instantaneous current, and the average current. The compensation voltage generation module is used to generate a compensation voltage based on the difference between the instantaneous current and the average current and the final internal resistance. A feedforward correction module is used to perform feedforward correction on the instantaneous voltage using the compensation voltage; The low-pass filter module is used to perform low-pass filtering on the feedforward corrected voltage and output the target voltage after ripple removal.

15. An electronic device, characterized in that, include: The device includes an input unit, a memory, at least one processor, and an output interface, wherein the memory stores program instructions that can be executed on the processor, and the processor can execute the voltage sampling ripple elimination method as described in any one of claims 1 to 13 by calling the program instructions.

16. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the voltage sampling ripple elimination method according to any one of claims 1 to 13.