Battery power calculation method, system and electronic device based on voltage compensation calibration

By setting a sampling resistor in the battery power supply circuit, the internal resistance voltage drop is calculated and compensated in real time, which solves the problem of inaccurate power estimation caused by load current changes and achieves higher accuracy in battery power calculation.

CN123176552APending Publication Date: 2026-11-27SHENZHEN TIANJIULONG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611585062.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-14
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Changes in load current during equipment operation cause voltage fluctuations at power supply nodes, affecting the accuracy of battery power estimation.

Method used

A sampling resistor with a known resistance value is set in the battery power supply circuit. The current when the load is turned on is calculated by sampling the voltage and resistance to determine the total internal resistance of the system. The voltage and current are collected in real time, and the internal resistance voltage drop is compensated to obtain the true battery voltage. The remaining battery capacity is determined by combining the voltage-capacity relationship table.

Benefits of technology

It eliminates measurement deviations caused by voltage drop in the power supply circuit, improving the accuracy of battery power estimation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123176552A_ABST
    Figure CN123176552A_ABST
Patent Text Reader

Abstract

The application provides a battery power calculation method and system based on voltage compensation calibration and an electronic device, and belongs to the technical field of battery power measurement. The method is characterized in that a sampling resistor with a known resistance value is connected in series in a battery power supply circuit, and the system total internal resistance is determined according to the power supply voltage difference between the load off and on states and the load current during power-on initialization; the sampling voltage of the sampling resistor and the power supply node voltage are collected in real time during system operation, the current charging and discharging current is calculated, the internal resistance voltage drop compensation amount is calculated in combination with the system total internal resistance, the compensation is performed to the power supply voltage according to the current direction, the real battery voltage is obtained, and the remaining power is determined by querying a pre-stored voltage-power relationship table. The system comprises a sampling resistor, an ADC module, a memory and an MCU, and can be integrated into an electronic device such as a portable handheld fan. The application can effectively eliminate the measurement error caused by the internal resistance voltage drop by using the existing resources of the MCU without a special power meter chip, and has low cost and high power estimation accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of battery power calculation technology, and in particular to a battery power calculation method, system and electronic device based on voltage compensation calibration. Background Technology

[0002] Currently, battery capacity calculation is widely used in various lithium-ion battery-powered consumer electronic devices, typically estimating remaining capacity by collecting the supply voltage. However, during device operation, the load current varies with operating conditions, causing voltage fluctuations at the supply nodes. This results in the collected supply voltage not accurately reflecting the actual battery voltage, leading to a decrease in the accuracy of capacity estimation due to voltage measurement deviations. Summary of the Invention

[0003] This application provides a battery capacity calculation method, system, and electronic device based on voltage compensation calibration, which can improve the accuracy of battery capacity estimation.

[0004] In a first aspect, embodiments of this application provide a battery capacity calculation method based on voltage compensation calibration, the method comprising: Set a sampling resistor with a known resistance value in the battery power supply circuit; During power-on initialization, the system acquires the first supply voltage when the load is off, the second supply voltage when the load is on, and the sampling voltage of the sampling resistor. Based on the known resistance values ​​of the sampling voltage and the sampling resistor, the system calculates the current when the load is on and determines the total internal resistance of the system based on the voltage difference between the first supply voltage and the second supply voltage and the current when the load is on. During system operation, the sampling voltage of the sampling resistor and the power supply voltage of the power supply node are collected in real time, and the current charging and discharging current is calculated based on the sampling voltage. Calculate the internal resistance voltage drop compensation based on the current charging / discharging current and the total internal resistance of the system. The internal resistance voltage drop compensation is adjusted to the supply voltage according to the current direction to obtain the compensated true battery voltage. The remaining battery power is determined by querying a pre-stored voltage-capacity relationship table based on the actual battery voltage.

[0005] In some embodiments, the total internal resistance of the system includes the battery internal resistance, sampling resistor, wire resistance, contact resistance, and battery protection circuit internal resistance.

[0006] In some embodiments, the formula for calculating the total internal resistance of the system is: R_internal=|V_power0-V_power1| / |I1|; Where V_power0 is the first power supply voltage, V_power1 is the second power supply voltage, and I1 is the current when the load is turned on; The current I1 when the load is turned on and the current charging / discharging current I are both calculated using the following formula: I=[(R11+R14)×V_sense-R14×V_power] / (R11×R1); Wherein, R16 is the sampling resistor, R11 and R14 are resistors in the voltage divider network, V_sense is the sampling voltage of the sampling resistor node, and V_power is the supply voltage of the power supply node; when I is greater than 0, it is determined to be charging, and when I is less than 0, it is determined to be discharging.

[0007] In some embodiments, the step of calculating the internal resistance voltage drop compensation based on the current charging / discharging current and the total internal resistance of the system includes: ΔV = I × R_internal, where ΔV is the internal resistance voltage drop compensation, I is the current charging / discharging current, and R_internal is the total internal resistance of the system; The step of compensating the internal resistance voltage drop to the supply voltage according to the current direction to obtain the compensated true battery voltage includes: when the current charging / discharging current is in the charging direction, V_battery = V_power - |ΔV|; when the current charging / discharging current is in the discharging direction, V_battery = V_power + |ΔV|; where V_battery is the compensated true battery voltage and V_power is the supply voltage.

[0008] In some embodiments, the MCU acquires the power supply voltage of the power supply node through a first ADC channel and acquires the sampling voltage of the sampling resistor node through a second ADC channel; a voltage divider network is provided between the sampling resistor node and the second ADC channel; The sampling resistor is connected in series between the system ground and the negative terminal of the battery, and is located between the system ground and the battery protection chip.

[0009] In some embodiments, the voltage-capacity relationship table is pre-calibrated according to the battery model and stored in the MCU's memory; The power-on initialization is performed each time power is supplied; when the internal resistance update condition is met, the step of determining the total internal resistance of the system is re-executed. The internal resistance update condition includes the battery temperature change exceeding a threshold, the current change exceeding a threshold, the charge change exceeding a threshold, and the elapsed time. The sampled voltage and the supply voltage are sampled multiple times, and then averaged and filtered.

[0010] In some embodiments, the battery is a lithium battery; The method is used for displaying battery power in consumer electronic devices; the load includes an MCU and a device functional load; in the state where the load is off, the current in the battery power supply circuit is less than a set threshold.

[0011] Secondly, embodiments of this application provide a battery power calculation system based on voltage compensation calibration, comprising: The sampling resistor is connected in series in the battery power supply circuit; The ADC module is used to acquire the sampling voltage, which characterizes the voltage across the sampling resistor, and the power supply voltage of the power supply node. The memory is used to store voltage-electricity relationship tables; The MCU is configured to perform a battery power calculation method based on voltage compensation calibration as described in any one of the embodiments of this application.

[0012] In some embodiments, the ADC module includes a first ADC channel and a second ADC channel. The first ADC channel is used to acquire the supply voltage of the power supply node, and the second ADC channel is used to acquire the sampling voltage of the sampling resistor node. A voltage divider network is provided between the second ADC channel and the sampling resistor node. The sampling resistor is connected in series between the system ground and the negative terminal of the battery, and is located between the system ground and the battery protection chip; the system also includes a battery protection chip, which is connected between the sampling resistor and the negative terminal of the battery; The system also includes a display module for displaying the remaining battery power determined by the MCU.

[0013] Thirdly, embodiments of this application provide an electronic device, including a battery, a load, and a battery power calculation system based on voltage compensation calibration as described in any one of the embodiments of this application; The electronic devices include portable handheld fans, power banks, Bluetooth headsets, and smart wearable devices.

[0014] This application provides a battery capacity calculation method based on voltage compensation calibration. The method includes: setting a sampling resistor with a known resistance value in the battery power supply circuit; during power-on initialization, acquiring a first supply voltage under load-off conditions, a second supply voltage under load-on conditions, and the sampling voltage of the sampling resistor; calculating the load-on current based on the sampling voltage and the known resistance value of the sampling resistor; determining the total system internal resistance based on the voltage difference between the first and second supply voltages and the load-on current; during system operation, real-time acquisition of the sampling voltage of the sampling resistor and the supply voltage of the power supply node; calculating the current charging / discharging current based on the sampling voltage; calculating the internal resistance voltage drop compensation amount based on the current charging / discharging current and the total system internal resistance; compensating the internal resistance voltage drop compensation amount to the supply voltage according to the current direction to obtain the compensated true battery voltage; and determining the remaining battery capacity by querying a pre-stored voltage-capacity relationship table based on the true battery voltage. In this method, the charging / discharging current is detected in real-time by the sampling resistor, and the total system internal resistance obtained during initialization is used to compensate the supply voltage for internal resistance voltage drop according to the current direction. After obtaining the true battery voltage, the capacity is determined by looking up the table, thereby eliminating measurement deviations caused by voltage drop in the power supply circuit and improving the accuracy of capacity estimation. Attached Figure Description

[0015] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 A schematic flowchart illustrating a battery capacity calculation method based on voltage compensation calibration provided in this application embodiment; Figure 2 A schematic circuit diagram of a voltage compensation acquisition circuit provided for an embodiment of this application; Figure 3 A schematic circuit diagram of a Type-C interface circuit provided for an embodiment of this application; Figure 4 A schematic circuit diagram of a charging management circuit provided for an embodiment of this application; Figure 5 A schematic circuit diagram of a main control chip and peripheral interface circuit provided for an embodiment of this application; Figure 6 This is a schematic circuit diagram of a boost converter and motor drive circuit provided for an embodiment of this application. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described below with reference to the accompanying drawings.

[0018] The terms "first" and "second," etc., used in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0019] The term "embodiment" as used herein means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0020] It should be understood that in this application, "at least one (item)" means one or more, "more than one" means two or more, "at least two (items)" means two or three or more, and "and / or" is used to describe the relationship between related objects, indicating that there can be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the related objects before and after are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0021] Please see Figure 1 , Figure 1 This is a schematic flowchart illustrating a battery capacity calculation method based on voltage compensation calibration, provided in an embodiment of this application. Figure 1 As shown, the specific steps of this battery power calculation method based on voltage compensation calibration include: S101-S106.

[0022] S101. Set a sampling resistor with a known resistance value in the battery power supply circuit.

[0023] For example, such as Figure 2As shown, the sampling resistor R16 is connected in series between the system ground and the battery protection chips U4 and U5, which are then connected to the negative terminal of the battery. The sampling resistor R16 can be... Figure 2 The resistor shown is 0.025Ω with a precision of 1%. The MCU acquires the voltage V_sense of the node closest to system ground via the sampling resistor R16 through the ADC channel, and acquires the voltage V_power of the power supply node to system ground via another ADC channel. A voltage divider network consisting of resistors R11 and R14 can be set between the sampling resistor R16 and the second ADC channel. Resistor R11 can be 100K / 1%, resistor R14 can be 30K / 1%, and resistor R15 can be 100R.

[0024] Since the sampling resistor R16 is connected in series in the battery power supply circuit and its resistance value is known, the circuit current generates a voltage V_sense when it flows through the sampling resistor R16. The MCU can calculate the current using this voltage and the resistance value of the sampling resistor R16, providing a basis for subsequent calculation of the total internal resistance of the system and detection of the current charging and discharging current.

[0025] S102. During power-on initialization, obtain the first supply voltage in the load off state, the second supply voltage in the load on state, and the sampling voltage of the sampling resistor. Calculate the current when the load is on based on the known resistance values ​​of the sampling voltage and the sampling resistor, and determine the total internal resistance of the system based on the voltage difference between the first supply voltage and the second supply voltage and the current when the load is on.

[0026] For example, after power-on, the system load is in a closed state. The MCU collects the current power supply node voltage as the first power supply voltage V_power0. At this time, the battery power supply circuit current is less than a set threshold, and V_power0 is basically equal to the battery voltage. Subsequently, the system load starts running and is turned on, generating an operating current I1. The MCU collects the current power supply node voltage as the second power supply voltage V_power1 and also collects the sampling voltage V_sense1 across the sampling resistor R16. Based on the sampling voltage V_sense1, the sampling resistor R16, and the voltage divider network resistors R11 and R14, the current I1 when the load is turned on is calculated. Then, the total internal resistance R_internal of the system is calculated according to R_internal = (V_power0 - V_power1) / I1. The total internal resistance R_internal of the system includes the battery internal resistance, the sampling resistor R16, the wire resistance, the contact resistance, and the internal resistance of the protection circuits such as the battery protection chips U4 and U5.

[0027] By utilizing the voltage difference and corresponding current of the power supply node in the two states of load off and on, the total internal resistance R_internal of the system can be calculated. There is no need to know the battery internal resistance parameters in advance or add a dedicated internal resistance measurement circuit. The total internal resistance of the current circuit can be obtained automatically every time the power is turned on, providing a numerical basis for subsequent internal resistance voltage drop compensation.

[0028] S103. During system operation, the sampling voltage of the sampling resistor and the power supply voltage of the power supply node are collected in real time, and the current charging and discharging current is calculated based on the sampling voltage.

[0029] For example, after the system enters its normal operating cycle, the MCU periodically collects the current power supply node voltage V_power and the sampled voltage V_sense across the sampling resistor R16. The current system operating current I2 is calculated using the formula I2 = [(R11 + R14) × V_sense - R14 × V_power] / (R11 × R16). When I2 is greater than 0, it is determined to be charging; when I2 is less than 0, it is determined to be discharging. This data collection and calculation process can be triggered by the MCU timer, and the sampling period can be set according to the device's operating conditions.

[0030] Because the sampling voltage V_sense and the supply voltage V_power are collected in real time and the current I2 is calculated accordingly, the charging and discharging status and current magnitude changes can be reflected in a timely manner. This allows the subsequent internal resistance voltage drop compensation to be updated according to the actual operating conditions, adapting to the impact of load changes on the supply voltage measurement.

[0031] S104. Calculate the internal resistance voltage drop compensation based on the current charging and discharging current and the total internal resistance of the system.

[0032] For example, the loss voltage ΔV across the system's internal resistance is calculated based on the current system operating current I2 and the total system internal resistance R_internal, i.e., ΔV = I2 × R_internal. I2 is a signed value; it is positive during charging and negative during discharging, and the sign of ΔV changes with the direction of I2. Alternatively, the absolute value of ΔV = I2 × R_internal can be taken, and the compensation polarity can be determined based on the direction of I2.

[0033] The internal resistance voltage drop compensation ΔV is calculated based on the current I2 and the total internal resistance R_internal of the system. This can quantify the voltage deviation generated in the power supply circuit when the current flows through the total internal resistance of the system, and provide a value for correcting the measured voltage of the power supply node to the true battery voltage.

[0034] S105. Compensate the internal resistance voltage drop to the supply voltage according to the current direction to obtain the actual battery voltage after compensation.

[0035] For example, the actual battery voltage Vbat is calculated as V_power + ΔV, where ΔV is a signed compensation amount determined by the current direction. When I2 is greater than 0 (charging), the voltage measured at the power supply node is higher than the actual battery voltage, Vbat = V_power - |ΔV|; when I2 is less than 0 (discharging), the voltage measured at the power supply node is lower than the actual battery voltage, Vbat = V_power + |ΔV|. The actual battery voltage Vbat is obtained through this compensation.

[0036] The internal resistance voltage drop compensation ΔV is added or subtracted according to the current direction to make the compensated battery voltage Vbat correspond to the actual output voltage of the battery, thereby reducing the voltage deviation caused by the measured value being too high during charging and the measured value being too low during discharging.

[0037] S106. Based on the actual battery voltage, query the pre-stored voltage-capacity relationship table to determine the current remaining battery capacity.

[0038] For example, the MCU memory pre-stores a voltage-capacity relationship table obtained from experimental calibration based on the battery model. This table records the correspondence between the actual battery voltage and the remaining capacity percentage. Using the compensated actual battery voltage Vbat as the lookup input, the current remaining battery capacity is obtained through lookup or linear interpolation and can be output through the display module. The voltage-capacity relationship table can be written into the MCU memory during production.

[0039] Since the voltage-capacity relationship table uses the compensated actual battery voltage Vbat, rather than the power supply node voltage V_power which is affected by the internal resistance voltage drop, the remaining capacity obtained from the table is closer to the actual remaining battery capacity, thus improving the accuracy of capacity estimation.

[0040] This application provides a battery capacity calculation method based on voltage compensation calibration. The method includes: setting a sampling resistor with a known resistance value in the battery power supply circuit; during power-on initialization, acquiring a first supply voltage under load-off conditions, a second supply voltage under load-on conditions, and the sampling voltage of the sampling resistor; calculating the load-on current based on the sampling voltage and the known resistance value of the sampling resistor; determining the total system internal resistance based on the voltage difference between the first and second supply voltages and the load-on current; during system operation, real-time acquisition of the sampling voltage of the sampling resistor and the supply voltage of the power supply node; calculating the current charging / discharging current based on the sampling voltage; calculating the internal resistance voltage drop compensation amount based on the current charging / discharging current and the total system internal resistance; compensating the internal resistance voltage drop compensation amount to the supply voltage according to the current direction to obtain the compensated true battery voltage; and determining the remaining battery capacity by querying a pre-stored voltage-capacity relationship table based on the true battery voltage. In this method, the charging / discharging current is detected in real-time by the sampling resistor, and the total system internal resistance obtained during initialization is used to compensate the supply voltage for internal resistance voltage drop according to the current direction. After obtaining the true battery voltage, the capacity is determined by looking up the table, thereby eliminating measurement deviations caused by voltage drop in the power supply circuit and improving the accuracy of capacity estimation.

[0041] To more clearly illustrate the technical solution of this application, the technical solution of this application will be described below through specific embodiments. It should be noted that the specific embodiments are used to expand the description of the technical solution of this application, and are not intended to limit this application.

[0042] Figure 3 The circuit for the Type-C interface shows the connection relationship between the TYPE-C_06P connector J1 and its CC1, CC2 resistors R22, R23 and VBUS, GND.

[0043] Figures 4 to 6 The main control circuit and peripheral functional circuits of the electronic device of this application are shown respectively, including the main control chip U2, boost voltage detection, boost PWM, charging management interface, buttons, encoder, fan control, cooling control, ADC sampling enable, current sampling, digital tube and flashlight control, etc. Figures 2 to 6 Together, they form the hardware foundation for portable handheld fans and other electronic devices, enabling the aforementioned battery power calculation method to run on this hardware platform.

[0044] In some embodiments, the total internal resistance of the system includes the battery internal resistance, sampling resistor, wire resistance, contact resistance, and battery protection circuit internal resistance.

[0045] like Figure 2As shown, the battery power supply circuit runs from BAT through battery protection chips U4 and U5 and sampling resistor R16 to GND. The load current flows through the battery's internal resistance, the protection chip's on-resistance, the wire resistance, the contact resistance, and R16. During power-on initialization, the ratio of the difference between V_power0 and V_power1 in the load off and on states to I1 reflects the total series resistance mentioned above. Its operating principle is to uniformly convert each series resistance in the circuit into the total internal resistance of the system. Compensation does not require individual measurement of each resistor, thus covering the voltage drop of the entire power supply circuit.

[0046] In some embodiments, the formula for calculating the total internal resistance of the system is: R_internal=|V_power0-V_power1| / |I1|; Where V_power0 is the first power supply voltage, V_power1 is the second power supply voltage, and I1 is the current when the load is turned on; The current I1 when the load is turned on and the current charging / discharging current I are both calculated using the following formula: I=[(R11+R14)×V_sense-R14×V_power] / (R11×R16); Where R16 is the sampling resistor, R11 and R14 are the resistors in the voltage divider network, V_sense is the sampling voltage of the sampling resistor node, and V_power is the supply voltage of the power supply node; when I is greater than 0, it is determined to be charging, and when I is less than 0, it is determined to be discharging.

[0047] like Figure 2 As shown, V_power is acquired by the MCU through the ADC channel of the power supply node, and V_sense is acquired by the ADC_C through the voltage divider network of R11 and R14. R16 is a known sampling resistor. Its operating principle is to deduce the current based on the node relationship of the voltage divider network and determine charging and discharging by the sign of I. Signed current can be obtained using only two ADC channels of the MCU, simplifying the sampling circuit and calculation process.

[0048] In some embodiments, the internal resistance voltage drop compensation is calculated based on the current charging / discharging current and the total internal resistance of the system, including: ΔV = I × R_internal, where ΔV is the internal resistance voltage drop compensation, I is the current charging / discharging current, and R_internal is the total internal resistance of the system; the internal resistance voltage drop compensation is then adjusted to the supply voltage according to the current direction to obtain the compensated true battery voltage, including: when the current charging / discharging current is in the charging direction, V_battery = V_power - |ΔV|; when the current charging / discharging current is in the discharging direction, V_battery = V_power + |ΔV|; where V_battery is the compensated true battery voltage, and V_power is the supply voltage.

[0049] During charging, current flows to the battery through the battery terminal (BAT), and the power supply node V_power is higher than the battery's actual voltage. During discharging, current flows from the battery to the load, and V_power is lower than the battery's actual voltage. Its operating principle is to adjust the voltage drop across the internal resistance according to the direction of the current. Through the above embodiment, a V_battery that is closer to the actual output voltage of the battery is obtained, reducing the voltage deviation caused by the voltage drop.

[0050] In some embodiments, the MCU acquires the power supply voltage of the power supply node through the first ADC channel and the sampling voltage of the sampling resistor node through the second ADC channel; a voltage divider network is provided between the sampling resistor node and the second ADC channel; the sampling resistor is connected in series between the system ground and the negative terminal of the battery, and is located between the system ground and the battery protection chip.

[0051] like Figure 2 As shown, the first ADC channel acquires V_power, and the second ADC channel acquires ADC_C via R11, R14, and R15. R16 is positioned between GND and U4 and U5. Its operating principle is that a voltage divider network adjusts the sampling node voltage to the ADC range, and the low-side sampling resistor ensures that the sampling reference ground is consistent with the MCU ground. Therefore, no high-side current detection chip is needed, reducing circuit cost and complexity.

[0052] In some embodiments, the voltage-capacity relationship table is pre-calibrated according to the battery model and stored in the MCU's memory; power-on initialization is performed each time power is supplied; when the internal resistance update conditions are met, the system's total internal resistance determination step is re-executed, including battery temperature change exceeding a threshold, current change exceeding a threshold, capacity change exceeding a threshold, and a set time elapsed; the sampled voltage and supply voltage are sampled multiple times and averaged and filtered.

[0053] like Figure 2 and Figure 6 As shown, the MCU memory stores a relationship table, and the main controller U2 can control ADC_EN and ADC_C to perform sampling. Its operating principle is that the internal resistance changes with temperature, aging, and current; updating R_internal maintains the accuracy of the compensation amount, and multiple sampling and averaging filtering reduce ADC noise. The technical effect is to improve the stability and accuracy of power estimation under different operating conditions.

[0054] In some embodiments, the battery is a lithium battery; the method is used for displaying battery power in a consumer electronic device; the load includes an MCU and a device functional load; and in the load-off state, the current in the battery power supply circuit is less than a set threshold.

[0055] like Figure 6As shown, the main controller U2 connects to loads such as fan control EN_F1, cooling control COLD_EN, digital display SIG, and flashlight Light_EN. Its operating principle is that after the functional loads are turned off, only the MCU is in standby mode, the loop current is less than a set threshold, and V_power0 is close to the battery's open-circuit voltage. The technical effect is that it is suitable for portable handheld fans and other lithium battery devices, making the power display more consistent with the actual remaining battery power.

[0056] As a separate embodiment, the operating principle of the battery capacity calculation method based on voltage compensation calibration provided in this application is as follows: (Combined with...) Figures 1 to 6 After the device is powered on, the MCU first enters the initialization phase. Figure 5 The main control chip U2 shown controls Figure 6 The boost converter and motor drive circuits, among other functional loads, are shut down. Only essential circuits such as the MCU operate in the battery power supply circuit. The circuit current is less than a set threshold, and the MCU acquires the current through the first ADC channel. Figure 2 The voltage from the power supply node to system ground is used as the first supply voltage V_power0. Since the load current is extremely small at this time, V_power0 is basically equal to the battery open-circuit voltage. Subsequently, the MCU enables the device's functional load, for example, through... Figure 6 The boost converter and motor drive circuit shown drives the fan motor, generating a working current I1 in the circuit. The MCU again collects the power supply node voltage through the first ADC channel as the second power supply voltage V_power1, and then transmits it through the second ADC channel. Figure 2The voltage divider network composed of resistors R11, R14, and R15 collects the voltage at node R16 as the sampling voltage V_sense1. Sampling resistor R16 is connected in series between system ground GND and battery protection chips U4 and U5, which are then connected to the negative terminal of the battery. Therefore, a voltage drop is generated across R16 when the load current flows through it. The MCU calculates the load-on current I1 based on the sampling voltage V_sense1, the supply voltage V_power1, and the voltage divider network resistors R11, R14, and sampling resistor R16, using the formula I1 = [(R11 + R14) × V_sense1 - R14 × V_power1] / (R11 × R16). Then, based on the voltage difference between the first and second supply voltages and the load... The current at startup determines the total internal resistance of the system, i.e., R_internal = |V_power0 - V_power1| / |I1|. This R_internal covers the internal resistance of the battery, the sampling resistor R16, the wire resistance, the contact resistance, and the internal resistance of the protection circuits such as the battery protection chips U4 and U5. After the system enters the normal operation phase, the MCU repeatedly performs sampling and calculation according to the set cycle, and collects the voltage V_power of the power supply node and the sampling voltage V_sense of the sampling resistor R16 node in real time. It calculates the current charging and discharging current I according to the same current calculation formula I = [(R11 + R14) × V_sense - R14 × V_power] / (R11 × R16). When I is greater than 0, it is determined to be charging; when I is less than 0, it is determined to be discharging. Figure 3 The Type-C interface circuit shown can be connected to an external charger. Figure 4 The charging management circuit shown controls the charging of the lithium battery. During charging, the current direction is opposite to that during discharging. The MCU calculates the internal resistance voltage drop compensation ΔV = I × R_internal based on the current current I and the determined total system internal resistance R_internal. This compensation is then applied to the supply voltage according to the current direction. When the current charging / discharging current is in the charging direction (I > 0), the measured voltage at the supply node is higher than the actual battery voltage: V_battery = V_power - |ΔV|. When the current charging / discharging current is in the discharging direction (I < 0), the measured voltage at the supply node is lower than the actual battery voltage: V_battery = V_power + |ΔV|. This yields the compensated actual battery voltage V_battery. Finally, the MCU uses V_battery to look up a voltage-capacity relationship table pre-stored in memory. This table is pre-calibrated based on the battery model and records the correspondence between the actual battery voltage and the remaining capacity percentage. The remaining battery capacity is determined by looking up the table or through linear interpolation. Figure 5 The peripheral interface connected to the main control chip U2 shown outputs to the display module or digital tube for power display. Through the above operation process, the MCU only utilizes... Figure 2 The sampling resistor R16, voltage divider network, and its own ADC resources shown can automatically obtain the total internal resistance of the system each time it is powered on, and detect the charging and discharging current in real time during system operation. The voltage drop compensation of the power supply node voltage is performed according to the current direction. Thus, without the need for a dedicated fuel meter chip, the voltage used to look up the voltage-capacity relationship table is closer to the actual output voltage of the battery, improving the accuracy of the capacity estimation.

[0057] This application also provides a battery power calculation system based on voltage compensation calibration, including: a sampling resistor connected in series in the battery power supply circuit; an ADC module for acquiring a sampling voltage characterizing the voltage across the sampling resistor and the power supply voltage of the power supply node; a memory for storing a voltage-power relationship table; and an MCU configured to execute the battery power calculation method based on voltage compensation calibration as described in any of the embodiments of this application.

[0058] In some embodiments, the ADC module includes a first ADC channel and a second ADC channel. The first ADC channel is used to acquire the supply voltage of the power supply node, and the second ADC channel is used to acquire the sampling voltage of the sampling resistor node. A voltage divider network is provided between the second ADC channel and the sampling resistor node. The sampling resistor is connected in series between the system ground and the negative terminal of the battery, and is located between the system ground and the battery protection chip. The system also includes a battery protection chip, which is connected between the sampling resistor and the negative terminal of the battery. The system also includes a display module for displaying the remaining power determined by the MCU.

[0059] This application also provides an electronic device, including a battery, a load, and a battery power calculation system based on voltage compensation calibration as described in any one of the embodiments of this application; the electronic device is a portable handheld fan, a power bank, a Bluetooth headset, and a smart wearable device.

[0060] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for calculating battery capacity based on voltage compensation calibration, characterized in that, The method includes: Set a sampling resistor with a known resistance value in the battery power supply circuit; During power-on initialization, the system acquires the first supply voltage when the load is off, the second supply voltage when the load is on, and the sampling voltage of the sampling resistor. Based on the known resistance values ​​of the sampling voltage and the sampling resistor, the system calculates the current when the load is on and determines the total internal resistance of the system based on the voltage difference between the first supply voltage and the second supply voltage and the current when the load is on. During system operation, the sampling voltage of the sampling resistor and the power supply voltage of the power supply node are collected in real time, and the current charging and discharging current is calculated based on the sampling voltage. Calculate the internal resistance voltage drop compensation based on the current charging / discharging current and the total internal resistance of the system. The internal resistance voltage drop compensation is adjusted to the supply voltage according to the current direction to obtain the compensated true battery voltage. The remaining battery power is determined by querying a pre-stored voltage-capacity relationship table based on the actual battery voltage.

2. The battery capacity calculation method based on voltage compensation calibration according to claim 1, characterized in that, The total internal resistance of the system includes the battery internal resistance, sampling resistor, wire resistance, contact resistance, and battery protection circuit internal resistance.

3. The battery capacity calculation method based on voltage compensation calibration according to claim 1, characterized in that, The formula for calculating the total internal resistance of the system is: R_internal=|V_power0-V_power1| / |I1|; Where V_power0 is the first power supply voltage, V_power1 is the second power supply voltage, and I1 is the current when the load is turned on; The current I1 when the load is turned on and the current charging / discharging current I are both calculated using the following formula: I=[(R11+R14)×V_sense-R14×V_power] / (R11×R16); Wherein, R16 is the sampling resistor, R11 and R14 are resistors in the voltage divider network, V_sense is the sampling voltage of the sampling resistor node, and V_power is the supply voltage of the power supply node; when I is greater than 0, it is determined to be charging, and when I is less than 0, it is determined to be discharging.

4. The battery capacity calculation method based on voltage compensation calibration according to claim 1, characterized in that, The step of calculating the internal resistance voltage drop compensation based on the current charging / discharging current and the total internal resistance of the system includes: ΔV = I × R_internal, where ΔV is the internal resistance voltage drop compensation, I is the current charging / discharging current, and R_internal is the total internal resistance of the system; The step of compensating the internal resistance voltage drop to the supply voltage according to the current direction to obtain the compensated true battery voltage includes: when the current charging / discharging current is in the charging direction, V_battery = V_power - |ΔV|; when the current charging / discharging current is in the discharging direction, V_battery = V_power + |ΔV|; where V_battery is the compensated true battery voltage and V_power is the supply voltage.

5. The battery capacity calculation method based on voltage compensation calibration according to claim 1, characterized in that, The MCU acquires the power supply voltage of the power supply node through the first ADC channel and the sampling voltage of the sampling resistor node through the second ADC channel; a voltage divider network is provided between the sampling resistor node and the second ADC channel; The sampling resistor is connected in series between the system ground and the negative terminal of the battery, and is located between the system ground and the battery protection chip.

6. The battery capacity calculation method based on voltage compensation calibration according to claim 1, characterized in that, The voltage-capacity relationship table is pre-calibrated according to the battery model and stored in the MCU's memory; The power-on initialization is performed each time power is supplied; when the internal resistance update condition is met, the step of determining the total internal resistance of the system is re-executed. The internal resistance update condition includes the battery temperature change exceeding a threshold, the current change exceeding a threshold, the charge change exceeding a threshold, and the elapsed time. The sampled voltage and the supply voltage are sampled multiple times, and then averaged and filtered.

7. The battery capacity calculation method based on voltage compensation calibration according to claim 1, characterized in that, The battery is a lithium battery; The method is used for displaying battery power in consumer electronic devices; the load includes an MCU and a device functional load; in the state where the load is off, the current in the battery power supply circuit is less than a set threshold.

8. A battery capacity calculation system based on voltage compensation calibration, characterized in that, include: The sampling resistor is connected in series in the battery power supply circuit; The ADC module is used to acquire the sampling voltage, which characterizes the voltage across the sampling resistor, and the power supply voltage of the power supply node. The memory is used to store voltage-electricity relationship tables; The MCU is configured to perform the battery power calculation method based on voltage compensation calibration as described in any one of claims 1-7.

9. The battery power calculation system based on voltage compensation calibration according to claim 8, characterized in that, The ADC module includes a first ADC channel and a second ADC channel. The first ADC channel is used to acquire the power supply voltage of the power supply node, and the second ADC channel is used to acquire the sampling voltage of the sampling resistor node. A voltage divider network is provided between the second ADC channel and the sampling resistor node. The sampling resistor is connected in series between the system ground and the negative terminal of the battery, and is located between the system ground and the battery protection chip; the system also includes a battery protection chip, which is connected between the sampling resistor and the negative terminal of the battery; The system also includes a display module for displaying the remaining battery power determined by the MCU.

10. An electronic device, characterized in that, Includes a battery, a load, and the battery power calculation system based on voltage compensation calibration as described in claim 8; The electronic devices include portable handheld fans, power banks, Bluetooth headsets, and smart wearable devices.