Power battery voltage sampling filtering method and device and vehicle

By calculating the incremental sampling value and setting a limit value to filter out erroneous sampling values, and establishing an array for data averaging and filtering, the problem of power battery voltage sampling error was solved, and the sampling accuracy and the accuracy of state reflection were improved.

CN116232321BActive Publication Date: 2026-04-21DEEPAL AUTOMOBILE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
DEEPAL AUTOMOBILE TECH CO LTD
Filing Date
2023-01-16
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing technologies for power battery voltage sampling contain errors, especially errors in the ADC module, resulting in insufficient sampling accuracy and an inability to accurately reflect the battery status.

Method used

By calculating the increment of sampled values ​​and setting threshold values ​​to filter out erroneous sampled values, an array is created for data averaging and filtering, and the averaging function is used to improve sampling accuracy.

Benefits of technology

It effectively reduces sampling errors, improves sampling accuracy, and can more accurately reflect the state of the power battery, overcoming pulse interference and random interference caused by accidental factors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116232321B_ABST
    Figure CN116232321B_ABST
Patent Text Reader

Abstract

The application discloses a power battery voltage sampling filtering method and device and a vehicle. The absolute value of the difference between the current sampling value and the sampling reference value is compared with a preset limit value LIMIT, so that the wrong sampling value can be filtered out, an array Array[N] with a length of N is established, and after the valid sampling value is obtained, the valid sampling value is added into the array Array[N] and then the data in the array Array[N] is averaged. The application can effectively overcome the pulse interference caused by accidental factors, eliminate the sampling value deviation caused by random interference, has a good inhibitory effect on periodic interference, and has high smoothing degree of filtering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of power batteries, specifically relating to a power battery voltage sampling and filtering method, device, and vehicle. Background Technology

[0002] In recent years, with the rapid development of new energy vehicles, power batteries have been widely used in the automotive industry. Compared with traditional fuel vehicles, new energy vehicles have advantages such as being green and environmentally friendly, saving energy, and providing convenient travel. However, new energy vehicles also have many problems, including slow battery charging, short driving range, and rapid battery depletion. To address these issues, improving the accuracy of power battery voltage sampling can more accurately reflect the state of the power battery, allowing for targeted analysis and corrective measures.

[0003] The sampling of the power battery voltage is primarily achieved by the ADC (Analog-to-Digital Converter) module integrated on the MCU (Microcontroller Unit). ADC sampling involves certain errors, which can be categorized into ADC intrinsic errors and ADC environmental errors. ADC intrinsic errors include offset error, gain error, and differential linearity error, while ADC environmental errors include reference voltage noise, reference power supply regulation, and analog input signal noise. These errors can be reduced using software methods, with filtering the sampled values ​​being a significant step.

[0004] Currently, the design of voltage sampling and filtering algorithms for power batteries is not comprehensive. Most methods focus on the design and modification of hardware circuits, with only a very few employing software methods to reduce sampling errors. For example, CN1291724A discloses an automatic calibration method for battery voltage sampling, which eliminates inherent errors in voltage sampling through computer software processing. However, its application is limited; it can only be used for voltage sampling of nickel-cadmium, nickel-metal hydride, and lithium-ion batteries using two-wire or three-wire clamps during the charging and discharging process. Summary of the Invention

[0005] The purpose of this invention is to provide a power battery voltage sampling and filtering method, device, and vehicle to reduce sampling errors and improve sampling accuracy.

[0006] The power battery voltage sampling and filtering method of the present invention includes the following steps:

[0007] S1. Obtain the current sampled value, and then execute S2.

[0008] S2. Determine whether the current sampling is the first (i.e., the first) sampling. If yes, execute S8; otherwise, execute S3.

[0009] S3. Using the formula: Δy=|current sampled value-sampled reference value|, calculate the sampled value increment Δy, and then execute S4. Here, the sampled reference value is equal to the previous sampled value.

[0010] S4. Determine whether the sample value increment Δy is greater than the preset limit value LIMIT. If yes, execute S5; otherwise, execute S6.

[0011] S5. Set the sampling reference value to equal the current sampling value (i.e., use the current sampling value as the sampling reference value when calculating the sampling value increment next time), and output the previous sampling result as the current sampling result, and then return to execute S1.

[0012] S6. Determine whether the number of data items m in the array Array[N] is equal to the array length N. If yes, execute S7; otherwise, execute S8.

[0013] S7. Make the sampling reference value equal to the current sampling value, discard the first data in array Array[N], shift the remaining m-1 data in array Array[N] one position forward, add the current sampling value to array Array[N] as the m-th data, and then execute S9.

[0014] S8. Set the sampling reference value to equal the current sampling value, increment the number of data m in array Array[N] by 1, add the current sampling value to array Array[N], and then execute S9; where the initial value of m is 0.

[0015] S9. Process the array Array[N] to obtain the current sampling result and output it, then return to execute S1.

[0016] Preferably, the method for processing the array Array[N] to obtain the current sampling result is as follows: the averaging function is called to calculate the average of the m data in the array Array[N], and the calculated average value Ave is used as the current sampling result. Averaging effectively suppresses periodic interference and provides good filtering results.

[0017] Preferably, the method for averaging the m data points in array Array[N] using the averaging function to obtain the average value Ave is as follows: If m is less than N, the sum of the m data points in array Array[N] divided by m is used as the average value Ave; if m equals N, the maximum and minimum values ​​are first removed from the m data points in array Array[N]; then the sum of the remaining m-2 data points (after removing the maximum and minimum values) divided by m-2 is used as the average value Ave. When the array Array[N] is full (i.e., m = N), the maximum and minimum values ​​are removed first, and then the average of the remaining data is calculated, resulting in higher smoothness of the filtering and better suppression of periodic interference.

[0018] Preferably, the array length N of the array Array[N] is obtained by querying a preset array length table based on the sampling frequency; wherein, the preset array length table is a table of correspondence between sampling frequency and array length obtained through calibration. As the sampling frequency changes, the array length N of the array Array[N] changes accordingly, the software adaptability is improved, and thus the smoothness of the filtering is higher.

[0019] Preferably, the array length N of the array Array[N] is in the range of 10 to 20. Considering the commonly used sampling frequency of power battery voltage, limiting the array length N to between 10 and 20 is more reasonable.

[0020] Preferably, the array length N of the array Array[N] is equal to 15.

[0021] Preferably, the preset limit value LIMIT is determined based on the sampling resolution. If the sampling resolution is set to n bits, then the preset limit value LIMIT = 2. n ×A, where A ranges from 8% to 12%. Determining the limit value based on the sampling resolution, and with A ranging from 8% to 12%, allows for a more reasonable limit value design, better overcomes pulse interference caused by accidental factors, and better eliminates sampling value deviations caused by random interference.

[0022] Preferably, the preset limit value LIMIT is determined based on the sampling resolution. If the sampling resolution is set to n bits, then the preset limit value LIMIT = 2. n ×10%.

[0023] The power battery voltage sampling and filtering device of the present invention includes an ADC module and a controller. The ADC module is connected to the controller and sends the collected current sampled value to the controller. The controller is programmed to execute the above-described power battery voltage sampling and filtering method.

[0024] The vehicle described in this invention includes the aforementioned power battery voltage sampling and filtering device.

[0025] The present invention has the following effects:

[0026] (1) By comparing the absolute value of the difference between the current sampled value and the previous sampled value (i.e. the sampled reference value) with the preset limit value LIMIT, erroneous (invalid) sampled values ​​can be filtered out, effectively overcoming pulse interference caused by accidental factors, eliminating sampled value deviation caused by random interference, reducing sampling error, and improving sampling accuracy.

[0027] (2) Create an array Array[N] with a length of N. After obtaining valid sample values, add them to the array Array[N] and then average the data in the array Array[N]. This has a good suppression effect on periodic interference, high smoothness of filtering, further reduces sampling error and improves sampling accuracy. Attached Figure Description

[0028] Figure 1 This is a flowchart of the power battery voltage sampling and filtering method in this embodiment.

[0029] Figure 2 This is a flowchart illustrating the implementation of the averaging function in this embodiment, which calculates the average of m data points in array Array[N]. Detailed Implementation

[0030] like Figure 1 , Figure 2 As shown, the power battery voltage sampling and filtering method in this embodiment includes the following steps:

[0031] S1. Obtain the current sampled value, and then execute S2.

[0032] S2. Determine whether the current sampling is the first (i.e., the first) sampling. If yes, execute S8; otherwise, execute S3.

[0033] The sampling flag First_Sample_Flag can be used to determine if the current sample is the first sample. First_Sample_Flag is initially set to 0. If First_Sample_Flag = 0, it indicates the current sample is the first sample; if First_Sample_Flag = 1, it indicates the current sample is not the first sample. After obtaining the current sample value and determining that First_Sample_Flag = 0, First_Sample_Flag will be set to 1.

[0034] S3. Using the formula: Δy=|current sampled value-sampled reference value|, calculate the sampled value increment Δy, and then execute S4. Here, the sampled reference value is equal to the previous sampled value.

[0035] S4. Determine if the sample value increment Δy is greater than the preset threshold LIMIT. If yes, proceed to S5; otherwise, proceed to S6. The preset threshold LIMIT is determined based on the sampling resolution. If the sampling resolution is set to n bits, then the preset threshold LIMIT = 2. n ×10%.

[0036] S5. Set the sampling reference value to equal the current sampling value (i.e., use the current sampling value as the sampling reference value when calculating the sampling value increment next time), and output the previous sampling result as the current sampling result, and then return to execute S1.

[0037] S6. Determine if the number of data items m in array Array[N] is equal to the array length N of array[N]. If yes, proceed to S7; otherwise, proceed to S8. The array length N of array[N] is obtained by looking up a preset array length table based on the sampling frequency; the preset array length table is a table showing the correspondence between sampling frequency and array length obtained through calibration. Alternatively, the array length N of array[N] can also be a fixed value, such as 15.

[0038] By comparing the absolute value of the difference between the current sampled value and the previous sampled value (i.e., the sampled reference value) with the preset limit value LIMIT, erroneous (invalid) sampled values ​​can be filtered out, effectively overcoming pulse interference caused by accidental factors and eliminating sampled value deviations caused by random interference.

[0039] S7. Set the sampling reference value to equal the current sampling value (i.e., use the current sampling value as the sampling reference value to be used in the next calculation of the sampling value increment), discard the first data in array[N], shift the remaining m-1 data in array[N] one position to the left, add the current sampling value to array[N] as the m-th data (i.e., adopt the first-in-first-out principle to ensure that there are at most N data in array[N]), and then execute S9.

[0040] S8. Set the sampling reference value to equal the current sampling value (i.e., use the current sampling value as the sampling reference value to calculate the sampling value increment in the next time), increment the number of data m in the array Array[N] by 1 (i.e., m = m + 1), add the current sampling value to the array Array[N], and then execute S9; where the initial value of m is 0.

[0041] S9. Process the array Array[N] to obtain the current sampling result and output it, then return to execute S1.

[0042] The method for processing the array Array[N] to obtain the current sampling result is as follows: the average value function is called to calculate the average of the m data in the array Array[N], and the calculated average value Ave is used as the current sampling result. An array Array[N] of length N is created. After obtaining valid sample values, they are first added to the array Array[N], and then the data in the array Array[N] are averaged. This method has a good suppression effect on periodic interference and high filtering smoothness.

[0043] like Figure 2 As shown, the specific steps of the average function to calculate the average value Ave by averaging m data points in array Array[N] include:

[0044] Step 1: Determine if m is less than N. If yes, proceed to step 2; otherwise (i.e., when m = N), proceed to step 3.

[0045] The second step is to take the sum of the m data in the array Array[N] and divide it by m to get the average value Ave, and then proceed to the fifth step.

[0046] The third step is to remove the maximum and minimum values ​​from the m data in the array Array[N], and then proceed to the fourth step.

[0047] Step 4: Take the sum of the m-2 data points after removing the maximum and minimum values, divide by m-2, and use the resulting value as the average value Ave. Then, proceed to step 5. When the array Array[N] is full (i.e., m=N), removing the maximum and minimum values ​​first, and then calculating the average of the remaining data, can improve the smoothness of the filtering and provide better suppression of periodic interference.

[0048] Step 5: Return the average value Ave, and then end.

[0049] This embodiment also provides a power battery voltage sampling and filtering device, including an ADC module and a controller. The ADC module is connected to the controller and sends the collected current sampled value to the controller. The controller is programmed to execute the above-described power battery voltage sampling and filtering method.

[0050] This embodiment also provides a vehicle that includes the aforementioned power battery voltage sampling and filtering device.

Claims

1. A method for sampling and filtering power battery voltage, characterized in that, Including the following steps: S1. Obtain the current sampled value, and then execute S2; S2. Determine whether the current sample is the first sample. If yes, execute S8; otherwise, execute S3. S3. Using the formula: △y = |current sampled value - sampled reference value|, calculate the sampled value increment △y, and then execute S4; S4. Determine whether the sample value increment Δy is greater than the preset limit value LIMIT. If yes, execute S5; otherwise, execute S6. S5. Set the sampling reference value to equal the current sampling value, output the previous sampling result as the current sampling result, and then return to execute S1; S6. Determine whether the number of data items m in the array Array[N] is equal to the array length N. If yes, execute S7; otherwise, execute S8. S7. Make the sampling reference value equal to the current sampling value, discard the first data in the array Array[N], shift the remaining m-1 data in the array Array[N] one position forward, add the current sampling value to the array Array[N] as the m-th data, and then execute S9; S8. Set the sampling reference value to equal the current sampling value, increment the number of data items m in array Array[N] by 1, add the current sampling value to array Array[N], and then execute S9; where the initial value of m is 0; S9. Process the array Array[N] to obtain the current sampling result and output it, then return to execute S1; The method for processing the array Array[N] to obtain the current sampling result is as follows: call the average value function to calculate the average of the m data in the array Array[N], and use the calculated average value Ave as the current sampling result.

2. The power battery voltage sampling and filtering method according to claim 1, characterized in that, The specific method for using the average function to calculate the average of m data points in array Array[N] and obtain the average value Ave is as follows: If m is less than N, then the sum of the m data in array Array[N] divided by m is taken as the average value Ave; If m equals N, first remove the maximum and minimum values ​​from the m data in the array Array[N]; then, add the m-2 data after removing the maximum and minimum values ​​and divide the sum by m-2 to get the average value Ave.

3. The power battery voltage sampling and filtering method according to claim 1 or 2, characterized in that: The array length N of the array Array[N] is obtained by querying a preset array length table based on the sampling frequency; wherein, the preset array length table is a table of correspondence between sampling frequency and array length obtained through calibration.

4. The power battery voltage sampling and filtering method according to claim 1 or 2, characterized in that: The array length N of the array Array[N] ranges from 10 to 20.

5. The power battery voltage sampling and filtering method according to claim 1 or 2, characterized in that: The array Array[N] has an array length N equal to 15.

6. The power battery voltage sampling and filtering method according to claim 1 or 2, characterized in that: The preset limit value LIMIT is determined based on the sampling resolution. If the sampling resolution is set to n bits, then the preset limit value LIMIT = 2. n ×A, where the value of A ranges from 8% to 12%.

7. The power battery voltage sampling and filtering method according to claim 1 or 2, characterized in that: The preset limit value LIMIT is determined based on the sampling resolution. If the sampling resolution is set to n bits, then the preset limit value LIMIT = 2. n ×10%.

8. A power battery voltage sampling and filtering device, comprising an ADC module and a controller, wherein the ADC module is connected to the controller and sends the acquired current sampled value to the controller, characterized in that: The controller is programmed to perform the power battery voltage sampling and filtering method as described in any one of claims 1 to 7.

9. A vehicle, characterized in that: Includes the power battery voltage sampling and filtering device as described in claim 8.

Citation Information

Patent Citations

  • AD sampling signal processing method and AD sampling signal device

    CN106603076A

  • Automatic sampling correction method for voltage of battery

    CN1291724A