Calibration method and device for gain error of battery detection circuit and electronic equipment
By obtaining the maximum voltage value in the battery detection circuit, determining the range and coefficient of voltage segmentation, and combined with the gain of the gain and the number of battery quantity calculation, the proportion of the battery quantity is calculated. The problem of accuracy has achieved high -precision battery detection.
Patent Information
- Application Number
- CN202411358487.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-09-27
AI Technical Summary
The existing battery detection circuit cannot take into account low cost and high accuracy when calibrating the battery voltage, resulting in the gain error being unable to be effectively calibrated.
By obtaining the input maximum voltage value of the battery detection circuit, the voltage segmentation range and segmentation coefficient of the voltage of its belonging, combined with the gain marker error value, the total number of battery that can access, and the current number of batteries, the calculation gain error correction correction correction The proportion is calculated by the formula to calculate the calibration of the gain error.
There is no need to perform additional detection after each measurement, reduce costs, and calculate the school's quotient value through the segment coefficient, gain co -mold error values and the number of batteries determined, improve the detection accuracy of the battery detection circuit, and achieve the battery voltage in the battery voltage Taking into account low cost and high accuracy at the time of calibration.
Smart Images

Figure CN119375804A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of battery technology, and in particular to a method for calibrating a gain error of a battery detection circuit, a device for calibrating a gain error of a battery detection circuit, an electronic device, a machine-readable storage medium and a computer program product. Background Art
[0002] In the existing battery detection circuit, the sampling method of the battery voltage is usually realized by adding a capacitor bridge and an operational amplifier for amplification. The circuit using the capacitor bridge for signal amplification is roughly as follows Figure 2 shown. Figure 2 The capacitor bridge formed by capacitors C1 and C2 is constantly switched on and off, and because of the existence of the operational amplifier, It can be seen that the voltage seen by capacitor C1 is input-input virtual ground. The voltage seen by capacitor C2 is input virtual ground-output common mode. The error curves of the two capacitor voltages as the common mode voltage changes are as follows Figure 3 As shown. Figure 3 As can be seen from the figure, the amplifier output may have an error of 0.25% with the common mode voltage. This is unacceptable in many situations. Therefore, the gain error of the battery detection circuit caused by the common mode voltage usually needs to be calibrated.
[0003] The first existing calibration scheme is to perform an additional common mode test after each measurement, and then perform a calibration calculation based on the gain error formula to eliminate the gain error. The advantage of this method is that the gain error can be accurately eliminated. The disadvantage is that each measurement requires a quadratic multiplication calculation, including multiple decimal calculations, which is also costly in terms of area and power consumption in the digital domain, increasing costs.
[0004] Another calibration scheme is to perform a measurement after leaving the factory and store the gain error in the memory. When actually measuring, the calculation is evenly distributed according to the order of the batteries being measured. The advantages of this method are simplicity, speed and low cost. However, the disadvantage is that it can only be applied within a very small voltage range. Once the battery voltage changes significantly, the error will increase greatly, and it is not suitable for high-precision occasions.
[0005] It can be seen that the existing solutions cannot achieve both low cost and high accuracy when calibrating battery voltage. Summary of the invention
[0006] The purpose of the embodiments of the present invention is to provide a method for calibrating the gain error of a battery detection circuit, a device for calibrating the gain error of a battery detection circuit, an electronic device, a machine-readable storage medium and a computer program product, so as to solve the defect that the existing solutions cannot take into account both low cost and high precision when calibrating the battery voltage.
[0007] In order to achieve the above object, an embodiment of the present invention provides a method for calibrating a gain error of a battery detection circuit, comprising:
[0008] Get the highest voltage value of the battery detection circuit input;
[0009] Determining a voltage segment range to which the highest voltage value belongs based on the highest voltage value, and determining a segment coefficient of the highest voltage value based on the voltage segment range;
[0010] Based on the segmentation coefficient, the gain common mode error value, the total number of batteries that can be connected, and the number of batteries currently connected, a gain error correction ratio is determined; wherein the gain common mode error value represents the error of the gain of the battery detection circuit as the common mode voltage changes;
[0011] Based on the voltage measurement value of the battery detection circuit, the offset voltage of the battery detection circuit and the gain error correction ratio, a calibration measurement value of the battery detection circuit after gain error calibration is determined.
[0012] Optionally, the gain error correction ratio is determined based on the segmentation coefficient, the gain common mode error value, the total number of batteries that can be connected, and the number of batteries currently connected, and is calculated by the following formula:
[0013] E=factor*GainVsVCM*CellNum / CellSum;
[0014] Among them, E represents the gain error correction ratio, factor represents the segmentation coefficient, GainVsVCM represents the gain common mode error value, CellNum represents the number of batteries currently connected, and CellSum represents the total number of batteries that can be connected.
[0015] Optionally, the calibration measurement value of the battery detection circuit after gain error calibration is determined based on the voltage measurement value of the battery detection circuit, the offset voltage of the battery detection circuit, and the gain error correction ratio, and is calculated by the following formula:
[0016] Vfinal=(Vmeasure-Vos)*(1-E);
[0017] Wherein, Vfinal represents the calibration measurement value, Vmeasure represents the voltage measurement value, Vos represents the offset voltage, and E represents the gain error correction ratio.
[0018] Optionally, the gain common-mode error value is calculated based on a first gain value, a second gain value and a preset common-mode voltage value; wherein the first gain value represents the gain value of the battery detection circuit when there is no voltage input, and the second gain value represents the gain value of the battery detection circuit when the preset common-mode voltage value is input.
[0019] Optionally, the gain common-mode error value is calculated based on the first gain value, the second gain value and a preset common-mode voltage value, and is calculated by the following formula:
[0020] GainVsVCM=(Gain2-Gain1) / Vcmhigh;
[0021] Wherein, GainVsVCM represents the gain common mode error value, Gain2 represents the second gain value, Vcmhigh represents the preset common mode voltage value, and Gain1 represents the first gain value.
[0022] Optionally, determining the voltage segment range to which the highest voltage value belongs based on the highest voltage value, and determining the segment coefficient of the highest voltage value based on the voltage segment range includes:
[0023] Based on the mapping relationship between voltage segment range and segment coefficient, the voltage segment range to which the highest voltage value belongs is determined, and the segment coefficient of the highest voltage value is determined; wherein the mapping relationship between voltage segment range and segment coefficient includes different voltage segment ranges, and the segment coefficients corresponding to the different voltage segment ranges.
[0024] On the other hand, an embodiment of the present invention further provides a device for calibrating a gain error of a battery detection circuit, comprising:
[0025] An acquisition module, used to obtain the highest voltage value inputted by the battery detection circuit;
[0026] A first determination module, configured to determine, based on the maximum voltage value, a voltage segment range to which the maximum voltage value belongs, and to determine, based on the voltage segment range, a segment coefficient of the maximum voltage value;
[0027] A second determination module is used to determine a gain error correction ratio based on the segmentation coefficient, the gain common mode error value, the total number of batteries that can be connected, and the number of batteries currently connected; wherein the gain common mode error value represents an error in the gain of the battery detection circuit as the common mode voltage changes;
[0028] The third determination module is used to determine the calibration measurement value of the battery detection circuit after gain error calibration based on the voltage measurement value of the battery detection circuit, the offset voltage of the battery detection circuit and the gain error correction ratio.
[0029] Optionally, the gain error correction ratio is determined based on the segmentation coefficient, the gain common mode error value, the total number of batteries that can be connected, and the number of batteries currently connected, and is calculated by the following formula:
[0030] E=factor*GainVsVCM*CellNum / CellSum;
[0031] Among them, E represents the gain error correction ratio, factor represents the segmentation coefficient, GainVsVCM represents the gain common mode error value, CellNum represents the number of batteries currently connected, and CellSum represents the total number of batteries that can be connected.
[0032] Optionally, the calibration measurement value of the battery detection circuit after gain error calibration is determined based on the voltage measurement value of the battery detection circuit, the offset voltage of the battery detection circuit, and the gain error correction ratio, and is calculated by the following formula:
[0033] Vfinal=(Vmeasure-Vos)*(1-E);
[0034] Wherein, Vfinal represents the calibration measurement value, Vmeasure represents the voltage measurement value, Vos represents the offset voltage, and E represents the gain error correction ratio.
[0035] Optionally, the gain common-mode error value is calculated based on a first gain value, a second gain value and a preset common-mode voltage value; wherein the first gain value represents the gain value of the battery detection circuit when there is no voltage input, and the second gain value represents the gain value of the battery detection circuit when the preset common-mode voltage value is input.
[0036] Optionally, the gain common-mode error value is calculated based on the first gain value, the second gain value and a preset common-mode voltage value, and is calculated by the following formula:
[0037] GainVsVCM=(Gain2-Gain1) / Vcmhigh;
[0038] Wherein, GainVsVCM represents the gain common mode error value, Gain2 represents the second gain value, Vcmhigh represents the preset common mode voltage value, and Gain1 represents the first gain value.
[0039] Optionally, determining the voltage segment range to which the highest voltage value belongs based on the highest voltage value, and determining the segment coefficient of the highest voltage value based on the voltage segment range includes:
[0040] Based on the mapping relationship between voltage segment range and segment coefficient, the voltage segment range to which the highest voltage value belongs is determined, and the segment coefficient of the highest voltage value is determined; wherein the mapping relationship between voltage segment range and segment coefficient includes different voltage segment ranges, and the segment coefficients corresponding to the different voltage segment ranges.
[0041] On the other hand, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a method for calibrating the gain error of the battery detection circuit when executing the program.
[0042] On the other hand, the present invention further provides a machine-readable storage medium having a computer program stored thereon, and the computer program, when executed by a processor, implements the method for calibrating the gain error of the battery detection circuit.
[0043] On the other hand, the present invention further provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method for calibrating the gain error of the battery detection circuit is implemented.
[0044] Through the above technical solution, the embodiment of the present invention determines the gain error correction ratio based on the segmentation coefficient determined by the highest voltage value output by the battery detection circuit, the gain common mode error value, the total number of batteries that can be connected, and the number of batteries currently connected; and determines the calibration measurement value of the battery detection circuit after gain error calibration based on the voltage measurement value of the battery detection circuit, the offset voltage of the battery detection circuit, and the gain error correction ratio. Therefore, the embodiment of the present invention does not need to perform an additional test on the common mode after each measurement, which reduces costs, and the embodiment of the present invention calculates the calibration measurement value based on the gain error correction ratio determined by the segmentation coefficient, the gain common mode error value, the total number of batteries that can be connected, and the number of batteries currently connected, thereby improving the detection accuracy of the battery detection circuit. Therefore, the present invention achieves both low cost and high precision when calibrating the battery voltage.
[0045] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0047] Figure 1 It is one of the flow charts of the method for calibrating the gain error of the battery detection circuit provided by the present invention;
[0048] Figure 2It is a circuit schematic diagram of an existing battery detection circuit;
[0049] Figure 3 yes Figure 2 Schematic diagram of error curves of two capacitor voltages in the battery detection circuit as the common mode voltage changes;
[0050] Figure 4 It is a curve diagram provided by the present invention between the number of connected batteries and the error between the voltages of two capacitors in the battery detection circuit when the voltage of a single battery is 2.5V;
[0051] Figure 5 It is a curve diagram provided by the present invention between the number of connected batteries and the error between the voltages of two capacitors in the battery detection circuit when the voltage of a single battery is 2.51V;
[0052] Figure 6 It is a curve diagram provided by the present invention between the number of connected batteries and the error between the voltages of two capacitors in the battery detection circuit when the voltage of a single battery is 3.8V;
[0053] Figure 7 It is a curve diagram provided by the present invention between the number of connected batteries and the error between the voltages of two capacitors in the battery detection circuit when the voltage of a single battery is 3.9V;
[0054] Figure 8 It is a curve diagram between the number of connected batteries and the error between the voltages of two capacitors in the battery detection circuit when the voltage of a single battery is 5.5V provided by the present invention;
[0055] Fig. 9 It is a structural schematic diagram of a device for calibrating a gain error of a battery detection circuit provided by the present invention;
[0056] Fig.10 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0057] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.
[0058] Method Embodiment
[0059] Please refer to Figure 1 , an embodiment of the present invention provides a method for calibrating a gain error of a battery detection circuit, comprising:
[0060] Step 100: Obtain the highest voltage value inputted by the battery detection circuit.
[0061] The electronic device obtains the highest voltage value input by the battery detection circuit. The battery detection circuit may be a circuit that uses a capacitor bridge to amplify the battery signal. For example, the battery detection circuit may refer to Figure 2 As shown, it is composed of capacitors C1, C3 and an operational amplifier. For the convenience of circuit design, the common-mode input voltage VCMin and the common-mode output voltage VCMout in the embodiment of the present invention are both low voltages, for example, both are half of the working voltage of the chip, that is, VDD / 2. The input voltage Vin of the battery detection circuit may be as high as 110V. When the battery detection circuit of the embodiment of the present invention is actually working, the voltage at the highest point of the input voltage is measured, and the electronic device obtains the highest voltage value of the battery detection circuit input, so as to subsequently determine the voltage segmentation range and segmentation coefficient corresponding to the highest voltage value of the battery detection circuit input.
[0062] Step 200: Determine a voltage segment range to which the highest voltage value belongs based on the highest voltage value, and determine a segment coefficient of the highest voltage value based on the voltage segment range.
[0063] In the embodiment of the present invention, segmentation is performed according to the highest voltage value input by the battery detection circuit. That is, the highest voltage value input by the battery detection circuit is divided into a plurality of voltage segment ranges, and a segment coefficient is allocated to each voltage segment range. Thus, the voltage segment range to which the highest voltage value belongs is determined based on the highest voltage value, and the segment coefficient of the highest voltage value is determined based on the voltage segment range.
[0064] In one embodiment, step 200, determining the voltage segment range to which the highest voltage value belongs based on the highest voltage value, and determining the segment coefficient of the highest voltage value based on the voltage segment range, includes: determining the voltage segment range to which the highest voltage value belongs based on a mapping relationship between voltage segment range and segment coefficient, and determining the segment coefficient of the highest voltage value.
[0065] Among them, the mapping relationship between the voltage segment range and the segment coefficient includes different voltage segment ranges, and the segment coefficients corresponding to the different voltage segment ranges. For example, if the highest voltage input to the battery detection circuit exceeds 70V, it belongs to the 2-stage voltage segment range Vth2; if the highest voltage is lower than 45V, it belongs to the 0-stage voltage segment range Vth0; otherwise, it belongs to the 1-stage voltage segment range Vth1. The embodiment of the present invention also allocates a coefficient factor for each voltage segment range. For example, if it belongs to the 2-stage voltage segment range Vth2, the segment coefficient is 0.9; if it belongs to the 1-stage voltage segment range Vth1, the segment coefficient is 0.58; if it belongs to the 0-stage voltage segment range Vth0, the coefficient is 0.3. It should be noted that the segmentation points between different voltage segment ranges and the segment coefficients of the modified voltage segment range are modified according to the first-order and second-order coefficients of the actual gain error. By reasonably selecting the segment coefficient and segment point, the corrected residual error can be minimized.
[0066] The segmentation coefficients of different voltage segmentation ranges can be stored in the memory in advance, that is, the three segmentation coefficients 0.3, 0.58 and 0.9 can be directly stored in decimal, which only takes up 3 bytes of storage space.
[0067] Therefore, when the highest voltage value inputted by the battery detection circuit is 100V, based on the mapping relationship between the voltage segmentation range and the segmentation coefficient, the voltage segmentation range to which the highest voltage value 100V belongs is the 2-stage voltage segmentation range Vth2, and the segmentation coefficient is 0.9.
[0068] Step 300: Determine a gain error correction ratio based on the segment coefficient, the gain common mode error value, the total number of connectable batteries, and the number of currently connected batteries.
[0069] Step 400: Determine a calibration measurement value of the battery detection circuit after gain error calibration based on the voltage measurement value of the battery detection circuit, the offset voltage of the battery detection circuit, and the gain error correction ratio.
[0070] Among them, the gain common-mode error value characterizes the error of the gain of the battery detection circuit as the common-mode voltage changes. The gain common-mode error value GainVsVcm can be stored in the memory in advance, usually only requiring an 8-bit byte of storage space. The total number of batteries that can be connected refers to the maximum number of batteries that can be connected, such as 18 batteries, and the number of batteries currently connected refers to the number of batteries currently connected, such as 6 batteries. The offset voltage of the battery detection circuit can be obtained by short-circuiting the common-mode input terminal of the operational amplifier of the battery detection circuit and detecting the output voltage at the common-mode output terminal of the operational amplifier. The voltage measurement value of the battery detection circuit refers to the output voltage of the operational amplifier in the battery detection circuit.
[0071] The embodiment of the present invention determines the gain error correction ratio based on the segmentation coefficient determined by the highest voltage value output by the battery detection circuit, the gain common mode error value, the total number of batteries that can be connected, and the number of batteries currently connected; and determines the calibration measurement value of the battery detection circuit after gain error calibration based on the voltage measurement value of the battery detection circuit, the offset voltage of the battery detection circuit, and the gain error correction ratio. Therefore, the embodiment of the present invention does not need to perform an additional test on the common mode after each measurement, which reduces costs, and the embodiment of the present invention calculates the calibration measurement value based on the gain error correction ratio determined by the segmentation coefficient, the gain common mode error value, the total number of batteries that can be connected, and the number of batteries currently connected, thereby improving the detection accuracy of the battery detection circuit. Therefore, the present invention achieves both low cost and high accuracy when calibrating the battery voltage.
[0072] In other aspects of the embodiments of the present invention, step 300 determines the gain error correction ratio based on the segmentation coefficient, the gain common mode error value, the total number of batteries that can be connected, and the number of batteries currently connected, and is calculated by the following formula:
[0073] E=factor*GainVsVCM*CellNum / CellSum;
[0074] Among them, E represents the gain error correction ratio, factor represents the segmentation coefficient, GainVsVCM represents the gain common mode error value, CellNum represents the number of batteries currently connected, and CellSum represents the total number of batteries that can be connected.
[0075] The gain common mode error value can be calculated based on the gain value of the battery detection circuit under a preset common mode voltage value and the gain value under no voltage input. The gain common mode error value GainVsVcm can be stored in the memory in advance. CellNum / CellSum represents the ratio of the number of currently connected batteries to the total number of batteries that can be connected. For example, the total number of batteries that can be connected is 18 batteries, and the number of batteries currently connected is 6 batteries, then CellNum / CellSum=6 / 18=1 / 3.
[0076] The present invention implements the method of calculating the gain error correction ratio through the gain common mode error value, the segmentation coefficient of the input maximum voltage value of the battery detection circuit, the total number of connectable batteries, and the number of currently connected batteries. The gain error correction ratio is determined by comprehensively considering the gain common mode error value, the segmentation coefficient, and the ratio of the number of currently connected batteries to the total number of connectable batteries, thereby improving the detection accuracy of the battery detection circuit.
[0077] In other aspects of the embodiments of the present invention, step 400, based on the voltage measurement value of the battery detection circuit, the offset voltage of the battery detection circuit and the gain error correction ratio, determines the calibration measurement value of the battery detection circuit after gain error calibration, and calculates it by the following formula:
[0078] Vfinal=(Vmeasure-Vos)*(1-E);
[0079] Wherein, Vfinal represents the calibration measurement value, Vmeasure represents the voltage measurement value, Vos represents the offset voltage, and E represents the gain error correction ratio.
[0080] The offset voltage of the battery detection circuit can be obtained by short-circuiting the common mode input terminal of the operational amplifier of the battery detection circuit and detecting the output voltage at the common mode output terminal of the operational amplifier. The voltage measurement value of the battery detection circuit refers to the output voltage of the operational amplifier in the battery detection circuit.
[0081] Since an offset voltage exists in an actual operational amplifier, the embodiment of the present invention obtains a calibration measurement value of the battery detection circuit after gain error calibration by comprehensively calculating the output voltage of the operational amplifier in the battery detection circuit, the offset voltage of the battery detection circuit, and the gain error correction ratio, thereby improving the detection accuracy of the battery detection circuit.
[0082] In other aspects of the embodiments of the present invention, the gain common-mode error value is calculated based on a first gain value, a second gain value and a preset common-mode voltage value; wherein the first gain value represents the gain value of the battery detection circuit when there is no voltage input, and the second gain value represents the gain value of the battery detection circuit when the preset common-mode voltage value is input.
[0083] Specifically, the gain common-mode error value is calculated based on the first gain value, the second gain value and the preset common-mode voltage value, and is calculated by the following formula:
[0084] GainVsVCM=(Gain2-Gain1) / Vcmhigh;
[0085] Wherein, GainVsVCM represents the gain common mode error value, Gain2 represents the second gain value, Vcmhigh represents the preset common mode voltage value, and Gain1 represents the first gain value.
[0086] The preset common mode voltage value may be the battery voltage in various scenarios, such as 50V, 100V, etc. The embodiment of the present invention calculates the gain error of the battery detection circuit as the common mode voltage changes in advance, which facilitates the subsequent calculation of the gain error correction ratio and the calculation of the final calibration measurement value.
[0087] The following is an example of the calibration method of the gain error of the battery detection circuit according to the embodiment of the present invention, using an 18-cell battery, the voltage detection of a single cell from 2V to 5.5V, the simulation results for optimizing the first type of capacitance (including the first and second terms) are as follows: Figures 4 to 8 As shown. Among them, Figure 4 A graph showing the error between the number of connected batteries and the voltage of two capacitors (C1, C2) in the battery detection circuit when the voltage of a single battery is 2.5V. Figure 4 This time belongs to the 0-stage voltage segment range Vth0, wherein the dotted line represents the error before correction, and the solid line represents the error after correction. Figure 5 A graph showing the error between the number of connected batteries and the voltage of two capacitors (C1, C2) in the battery detection circuit when the voltage of a single battery is 2.51V. Figure 5 This time it belongs to the 1st stage voltage segment range Vth1, wherein the dotted line represents the error before correction, and the solid line represents the error after correction. Figure 6 A graph showing the error between the number of connected batteries and the voltage of two capacitors (C1, C2) in the battery detection circuit when the voltage of a single battery is 3.8V. Figure 6 This is the maximum value in the voltage segment range Vth1 of stage 1, where the dotted line represents the error before correction and the solid line represents the error after correction. Figure 7 A graph showing the error between the number of connected batteries and the voltage of two capacitors (C1, C2) in the battery detection circuit when the voltage of a single battery is 3.9V. Figure 7 This time it belongs to the 2-stage voltage segment range Vth2, wherein the dotted line represents the error before correction, and the solid line represents the error after correction. Figure 8 A graph showing the error between the number of connected batteries and the voltage of two capacitors (C1, C2) in the battery detection circuit when the voltage of a single battery is 5.5V. Figure 8 This time it belongs to the 2-stage voltage segment range Vth2, wherein the dotted line represents the error before correction, and the solid line represents the error after correction.
[0088] from Figures 4 to 8 It can be seen that after applying the gain error calibration method of the battery detection circuit of the embodiment of the present invention, the error of the capacitor voltage in the battery detection circuit can be corrected to a value less than 0.02% in theory under all different configurations and working conditions. It can be seen that the embodiment of the present invention achieves both low cost and high precision in battery voltage calibration.
[0089] Device Embodiment
[0090] Please refer to Fig. 9 On the other hand, an embodiment of the present invention further provides a device for calibrating a gain error of a battery detection circuit, comprising:
[0091] An acquisition module 901 is used to acquire the maximum voltage value inputted by the battery detection circuit;
[0092] A first determining module 902, configured to determine, based on the maximum voltage value, a voltage segment range to which the maximum voltage value belongs, and to determine, based on the voltage segment range, a segment coefficient of the maximum voltage value;
[0093] The second determination module 903 is used to determine the gain error correction ratio based on the segmentation coefficient, the gain common mode error value, the total number of batteries that can be connected, and the number of batteries currently connected; wherein the gain common mode error value represents the error of the gain of the battery detection circuit as the common mode voltage changes;
[0094] The third determination module 904 is used to determine a calibration measurement value of the battery detection circuit after gain error calibration based on the voltage measurement value of the battery detection circuit, the offset voltage of the battery detection circuit and the gain error correction ratio.
[0095] Optionally, the gain error correction ratio is determined based on the segmentation coefficient, the gain common mode error value, the total number of batteries that can be connected, and the number of batteries currently connected, and is calculated by the following formula:
[0096] E=factor*GainVsVCM*CellNum / CellSum;
[0097] Among them, E represents the gain error correction ratio, factor represents the segmentation coefficient, GainVsVCM represents the gain common mode error value, CellNum represents the number of batteries currently connected, and CellSum represents the total number of batteries that can be connected.
[0098] Optionally, the calibration measurement value of the battery detection circuit after gain error calibration is determined based on the voltage measurement value of the battery detection circuit, the offset voltage of the battery detection circuit, and the gain error correction ratio, and is calculated by the following formula:
[0099] Vfinal=(Vmeasure-Vos)*(1-E);
[0100] Wherein, Vfinal represents the calibration measurement value, Vmeasure represents the voltage measurement value, Vos represents the offset voltage, and E represents the gain error correction ratio.
[0101] Optionally, the gain common-mode error value is calculated based on a first gain value, a second gain value and a preset common-mode voltage value; wherein the first gain value represents the gain value of the battery detection circuit when there is no voltage input, and the second gain value represents the gain value of the battery detection circuit when the preset common-mode voltage value is input.
[0102] Optionally, the gain common-mode error value is calculated based on the first gain value, the second gain value and a preset common-mode voltage value, and is calculated by the following formula:
[0103] GainVsVCM=(Gain2-Gain1) / Vcmhigh;
[0104] Wherein, GainVsVCM represents the gain common mode error value, Gain2 represents the second gain value, Vcmhigh represents the preset common mode voltage value, and Gain1 represents the first gain value.
[0105] Optionally, determining the voltage segment range to which the highest voltage value belongs based on the highest voltage value, and determining the segment coefficient of the highest voltage value based on the voltage segment range includes:
[0106] Based on the mapping relationship between voltage segment range and segment coefficient, the voltage segment range to which the highest voltage value belongs is determined, and the segment coefficient of the highest voltage value is determined; wherein the mapping relationship between voltage segment range and segment coefficient includes different voltage segment ranges, and the segment coefficients corresponding to the different voltage segment ranges.
[0107] The device for calibrating the gain error of the battery detection circuit includes a processor and a memory. The acquisition module 901, the first determination module 902, the second determination module 903 and the third determination module 904 are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
[0108] The processor includes a kernel, which calls the corresponding program unit from the memory. There can be one or more kernels.
[0109] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0110] Fig.10 An example of a physical structure diagram of an electronic device is shown in FIG. Fig.10As shown, the electronic device may include: a processor (processor) 1010, a communication interface (Communications Interface) 1020, a memory (memory) 1030 and a communication bus 1040, wherein the processor 1010, the communication interface 1020, and the memory 1030 communicate with each other through the communication bus 1040. The processor 1010 can call the logic instructions in the memory 1030 to execute the calibration method of the gain error of the battery detection circuit, which method includes: obtaining the highest voltage value input to the battery detection circuit; determining the voltage segment range to which the highest voltage value belongs based on the highest voltage value, and determining the segment coefficient of the highest voltage value based on the voltage segment range; determining the gain error correction ratio based on the segment coefficient, the gain common mode error value, the total number of batteries that can be connected, and the number of batteries currently connected; wherein the gain common mode error value represents the error of the gain of the battery detection circuit as the common mode voltage changes; based on the voltage measurement value of the battery detection circuit, the offset voltage of the battery detection circuit and the gain error correction ratio, determining the calibration measurement value of the battery detection circuit after gain error calibration.
[0111] In addition, the logic instructions in the above-mentioned memory 1030 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
[0112] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a machine-readable storage medium. When the computer program is executed by a processor, the computer can execute a method for calibrating the gain error of a battery detection circuit, the method including: obtaining the highest voltage value input to the battery detection circuit; determining the voltage segment range to which the highest voltage value belongs based on the highest voltage value, and determining the segment coefficient of the highest voltage value based on the voltage segment range; determining the gain error correction ratio based on the segment coefficient, the gain common mode error value, the total number of batteries that can be connected, and the number of batteries currently connected; wherein the gain common mode error value characterizes the error of the gain of the battery detection circuit as the common mode voltage changes; based on the voltage measurement value of the battery detection circuit, the offset voltage of the battery detection circuit and the gain error correction ratio, determining the calibration measurement value of the battery detection circuit after gain error calibration.
[0113] On the other hand, the present invention also provides a machine-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform a method for calibrating the gain error of a battery detection circuit, the method comprising: obtaining the highest voltage value input to the battery detection circuit; determining the voltage segment range to which the highest voltage value belongs based on the highest voltage value, and determining the segment coefficient of the highest voltage value based on the voltage segment range; determining the gain error correction ratio based on the segment coefficient, the gain common-mode error value, the total number of connected batteries, and the number of currently connected batteries; wherein the gain common-mode error value characterizes the error of the gain of the battery detection circuit as the common-mode voltage changes; and determining the calibration measurement value of the battery detection circuit after gain error calibration based on the voltage measurement value of the battery detection circuit, the offset voltage of the battery detection circuit, and the gain error correction ratio.
[0114] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0115] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0116] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for calibrating the gain error of a battery detection circuit, characterized in that: include: Get the highest voltage value of the battery detection circuit input; Determining a voltage segment range to which the highest voltage value belongs based on the highest voltage value, and determining a segment coefficient of the highest voltage value based on the voltage segment range; Based on the segmentation coefficient, the gain common mode error value, the total number of batteries that can be connected, and the number of batteries currently connected, a gain error correction ratio is determined; wherein the gain common mode error value represents the error of the gain of the battery detection circuit as the common mode voltage changes; Based on the voltage measurement value of the battery detection circuit, the offset voltage of the battery detection circuit and the gain error correction ratio, a calibration measurement value of the battery detection circuit after gain error calibration is determined.
2. The method for calibrating the gain error of the battery detection circuit according to claim 1, characterized in that: The gain error correction ratio is determined based on the segment coefficient, the gain common mode error value, the total number of batteries that can be connected, and the number of batteries currently connected, and is calculated by the following formula: E=factor*GainVsVCM*CellNum / CellSum; Among them, E represents the gain error correction ratio, factor represents the segmentation coefficient, GainVsVCM represents the gain common mode error value, CellNum represents the number of batteries currently connected, and CellSum represents the total number of batteries that can be connected.
3. The method for calibrating the gain error of a battery detection circuit according to claim 1, characterized in that: The calibration measurement value of the battery detection circuit after gain error calibration is determined based on the voltage measurement value of the battery detection circuit, the offset voltage of the battery detection circuit, and the gain error correction ratio, and is calculated by the following formula: Vfinal=(Vmeasure-Vos)*(1-E); Wherein, Vfinal represents the calibration measurement value, Vmeasure represents the voltage measurement value, Vos represents the offset voltage, and E represents the gain error correction ratio.
4. The method for calibrating the gain error of a battery detection circuit according to claim 1, characterized in that: The gain common-mode error value is calculated based on a first gain value, a second gain value and a preset common-mode voltage value; wherein the first gain value represents the gain value of the battery detection circuit when there is no voltage input, and the second gain value represents the gain value of the battery detection circuit when the preset common-mode voltage value is input.
5. The method for calibrating the gain error of the battery detection circuit according to claim 4, characterized in that: The gain common mode error value is calculated based on the first gain value, the second gain value and the preset common mode voltage value, and is calculated by the following formula: GainVsVCM=(Gain2-Gain1) / Vcmhigh; Wherein, GainVsVCM represents the gain common mode error value, Gain2 represents the second gain value, Vcmhigh represents the preset common mode voltage value, and Gain1 represents the first gain value.
6. The method for calibrating the gain error of a battery detection circuit according to claim 1, characterized in that: The determining, based on the highest voltage value, a voltage segment range to which the highest voltage value belongs, and determining, based on the voltage segment range, a segment coefficient of the highest voltage value, comprises: Based on the mapping relationship between voltage segment range and segment coefficient, the voltage segment range to which the highest voltage value belongs is determined, and the segment coefficient of the highest voltage value is determined; wherein the mapping relationship between voltage segment range and segment coefficient includes different voltage segment ranges, and the segment coefficients corresponding to the different voltage segment ranges.
7. A device for calibrating the gain error of a battery detection circuit, characterized in that: include: An acquisition module, used to obtain the highest voltage value inputted by the battery detection circuit; A first determination module, configured to determine, based on the maximum voltage value, a voltage segment range to which the maximum voltage value belongs, and to determine, based on the voltage segment range, a segment coefficient of the maximum voltage value; A second determination module is used to determine a gain error correction ratio based on the segmentation coefficient, the gain common mode error value, the total number of batteries that can be connected, and the number of batteries currently connected; wherein the gain common mode error value represents an error in the gain of the battery detection circuit as the common mode voltage changes; The third determination module is used to determine the calibration measurement value of the battery detection circuit after gain error calibration based on the voltage measurement value of the battery detection circuit, the offset voltage of the battery detection circuit and the gain error correction ratio.
8. The device for calibrating the gain error of the battery detection circuit according to claim 7, characterized in that: The gain error correction ratio is determined based on the segment coefficient, the gain common mode error value, the total number of batteries that can be connected, and the number of batteries currently connected, and is calculated by the following formula: E=factor*GainVsVCM*CellNum / CellSum; Among them, E represents the gain error correction ratio, factor represents the segmentation coefficient, GainVsVCM represents the gain common mode error value, CellNum represents the number of batteries currently connected, and CellSum represents the total number of batteries that can be connected.
9. The device for calibrating the gain error of the battery detection circuit according to claim 7, characterized in that: The calibration measurement value of the battery detection circuit after gain error calibration is determined based on the voltage measurement value of the battery detection circuit, the offset voltage of the battery detection circuit, and the gain error correction ratio, and is calculated by the following formula: Vfinal=(Vmeasure-Vos)*(1-E); Wherein, Vfinal represents the calibration measurement value, Vmeasure represents the voltage measurement value, Vos represents the offset voltage, and E represents the gain error correction ratio.
10. The device for calibrating the gain error of a battery detection circuit according to claim 7, characterized in that: The gain common-mode error value is calculated based on a first gain value, a second gain value and a preset common-mode voltage value; wherein the first gain value represents the gain value of the battery detection circuit when there is no voltage input, and the second gain value represents the gain value of the battery detection circuit when the preset common-mode voltage value is input.
11. The device for calibrating the gain error of the battery detection circuit according to claim 10, characterized in that: The gain common mode error value is calculated based on the first gain value, the second gain value and the preset common mode voltage value, and is calculated by the following formula: GainVsVCM=(Gain2-Gain1) / Vcmhigh; Wherein, GainVsVCM represents the gain common mode error value, Gain2 represents the second gain value, Vcmhigh represents the preset common mode voltage value, and Gain1 represents the first gain value.
12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method for calibrating the gain error of the battery detection circuit according to any one of claims 1 to 6 is implemented.
13. A machine-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for calibrating the gain error of the battery detection circuit according to any one of claims 1 to 6 is implemented.
14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for calibrating the gain error of the battery detection circuit according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Multifunctional single-phase electric energy measuring circuit and automatic ammeter calibrating method thereof
CN102998525A
ADC error automatic correction method and device, analog-to-digital conversion circuit and storage medium
CN112583405A
Ratiometric gain error calibration schemes for delta-sigma adcs with programmable gain amplifier input stages
CN113853747A
Digital-to-analog conversion error correction method and related device
CN114567324A
Calibration method of common-mode voltage
CN114839580A