CN104375085B - A kind of method, apparatus and terminal detecting battery capacity - Google Patents
A kind of method, apparatus and terminal detecting battery capacity Download PDFInfo
- Publication number
- CN104375085B CN104375085B CN201310350470.6A CN201310350470A CN104375085B CN 104375085 B CN104375085 B CN 104375085B CN 201310350470 A CN201310350470 A CN 201310350470A CN 104375085 B CN104375085 B CN 104375085B
- Authority
- CN
- China
- Prior art keywords
- current
- battery
- electric quantity
- voltage
- value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 78
- 230000005611 electricity Effects 0.000 claims abstract description 24
- 238000007600 charging Methods 0.000 claims description 74
- 238000007599 discharging Methods 0.000 claims description 50
- 230000009466 transformation Effects 0.000 claims description 43
- 238000010280 constant potential charging Methods 0.000 claims description 12
- 238000010277 constant-current charging Methods 0.000 claims description 12
- 230000008859 change Effects 0.000 claims description 8
- 238000003491 array Methods 0.000 claims description 4
- 230000010354 integration Effects 0.000 claims description 3
- 238000001514 detection method Methods 0.000 description 12
- 238000010586 diagram Methods 0.000 description 11
- 230000008569 process Effects 0.000 description 11
- 238000004364 calculation method Methods 0.000 description 10
- 238000012544 monitoring process Methods 0.000 description 9
- 230000003139 buffering effect Effects 0.000 description 6
- WHXSMMKQMYFTQS-UHFFFAOYSA-N Lithium Chemical compound [Li] WHXSMMKQMYFTQS-UHFFFAOYSA-N 0.000 description 4
- 229910052744 lithium Inorganic materials 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000005070 sampling Methods 0.000 description 4
- 230000003247 decreasing effect Effects 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 2
- 239000000446 fuel Substances 0.000 description 2
- 238000012827 research and development Methods 0.000 description 2
- 238000007792 addition Methods 0.000 description 1
- 230000032683 aging Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000009191 jumping Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000002035 prolonged effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R31/00—Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
- G01R31/36—Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC]
- G01R31/382—Arrangements for monitoring battery or accumulator variables, e.g. SoC
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Secondary Cells (AREA)
Abstract
The invention discloses a kind of method, apparatus and terminal for detecting battery capacity, wherein this method comprises: determining current operating current according to voltage difference, wherein voltage difference is the voltage value at load resistance both ends;Table is corresponded to voltage electricity according to operating current and carries out Interpolating transform, obtains the charge value of present battery, wherein voltage electricity corresponds to the respective value of voltage and electricity under table record charge or discharge state.By with the present invention, table progress Interpolating transform is corresponded to voltage electricity using interpolation method to obtain the charge value of battery, voltameter chip is not used, also available accurate charge value, terminal cost is reduced, and increases the electricity consumption duration of terminal, uses voltameter chip when solving prior art measuring electric quantity value, the use of voltameter chip will increase the cost of terminal, but also can reduce the use time of end cell.
Description
Technical Field
The present invention relates to the field of communications, and in particular, to a method, an apparatus, and a terminal for detecting battery power.
Background
With the use of terminal products becoming more and more widespread, the demand of broad users for terminal products is also getting larger and larger, but the competition of the terminal market is also getting stronger and stronger. This requires that we must make efforts on power consumption and cost to improve product competitiveness; the premise is that the functions of the terminal product must be complete, and the detection of the electric quantity is an indispensable function on the portable terminal.
At present, electric quantity detection methods on terminal products are generally divided into three types, namely a battery voltage monitoring method, a battery modeling method and a coulometer.
The battery voltage monitoring method comprises the following steps: this method is a method of estimating the amount of electricity by monitoring the voltage of the battery, and therefore, the method is low in accuracy, but is relatively easy to implement, and therefore, the method is widely used in terminal devices. However, in the discharge characteristic of the lithium battery, the voltage and the electric quantity of the battery are not simply linear, and as shown in fig. 1, the non-linear relationship directly causes high error of the voltage monitoring electric quantity, and the error of the final electric quantity estimated value exceeds 20%. Therefore, the precise electric quantity value cannot be displayed in percentage, and only in segment. The mobile phone user often finds that only one cell of electricity is displayed when the mobile phone receives the call, and after the call is made, the electric quantity of the battery jumps to two cells, namely the electric quantity jumps caused by the voltage jump.
The battery modeling method comprises the following steps: the method is that a discharge model is established according to a discharge curve of the lithium battery, and the corresponding battery electric quantity is checked in the model according to the voltage when measuring a voltage value. The method can effectively improve the estimation precision of the electric quantity, the error range reaches 5%, the initial estimation of the electric quantity of the battery is not needed, the method is simple and easy to use, but the establishment of the data table is relatively complex, particularly the influence of factors such as power supply ripples, ground bounce, simulated on-resistance, temperature drift and the like is considered, and the method cannot be well compatible with different types of batteries.
Coulometer: a current detection resistor is connected in series with the anode or the cathode of the battery, when current passes through the monitoring resistor, voltage difference is generated at two ends of the resistor, and the current flowing through the battery is calculated through the detection voltage difference. The integral of the current over time is the changing electric quantity value, so that the electric quantity change of the battery can be accurately calculated, and the precision can reach 1%. However, the method using integration has accumulated errors, and the longer the time is, the larger the accumulated error is. Although the coulometer has the problems of accumulated error and initial estimation of the battery, and the accuracy of the current detection resistor directly influences the accuracy of the electric quantity, some software algorithms can better reduce the influence of the factors such as initial estimation of the electric quantity of the lithium battery, the accumulated error, battery aging, the accuracy of the current detection resistor and the like on the measurement result by matching with the monitoring of the voltage and the temperature of the battery. So this method is the mainstream usage of the current electricity meter chip.
Some of the above-mentioned electricity quantity detection methods cannot accurately detect the electricity quantity value, and some detection methods can accurately detect the electricity quantity value, but all the detection methods need to use an electricity meter chip, and the use of the electricity meter chip increases the cost of the terminal and reduces the service time of the terminal battery.
Disclosure of Invention
The invention provides a method, a device and a terminal for detecting battery electric quantity, which are used for solving the problems that although an electric quantity value can be accurately detected by an electric quantity detection method in the prior art, an electric quantity meter chip is required to be adopted, the cost of the terminal is increased due to the use of the electric quantity meter chip, and the service time of a terminal battery is shortened.
To solve the above technical problem, in one aspect, the present invention provides a method for detecting battery power, including: determining the current working current according to a voltage difference value, wherein the voltage difference value is the voltage value at two ends of a load resistor; and carrying out interpolation transformation on the voltage-electric quantity correspondence table according to the working current to obtain the electric quantity value of the current battery, wherein the voltage-electric quantity correspondence table records the corresponding value of the voltage and the electric quantity in a charging or discharging state.
Further, before determining the current working current, the method further comprises: storing the voltage difference value to an array of instantaneous voltage difference values, and determining the voltage difference values or the average value of the voltage difference values recorded for a plurality of times in the array of instantaneous voltage difference values; and determining the current charging and discharging states of the battery according to the voltage difference value or the average value of the voltage difference value.
Further, determining the current charging and discharging states of the battery according to the average value of the voltage difference comprises: storing the average value of the voltage difference values for preset times; under the condition that the average values of the voltage difference values of the preset times are all larger than zero, determining that the battery is in a discharging state currently; and under the condition that the average values of the voltage difference values of the preset times are all smaller than zero, determining that the battery is in a charging state currently.
Further, acquiring the current battery electric quantity value comprises: performing primary interpolation transformation on the voltage and electric quantity correspondence table based on charging current by a Lagrange interpolation method to obtain the electric quantity value of the current battery, wherein the charging current is the current of the battery in a constant current charging stage; or, integrating the charging current with time to obtain the current electric quantity value of the battery, wherein the charging current is the current of the battery in a constant voltage charging stage; or, performing secondary interpolation transformation on the voltage and electric quantity corresponding table based on the discharge current through a Lagrange interpolation method to obtain the electric quantity value of the current battery.
Further, performing secondary interpolation transformation on the voltage-electric quantity correspondence table based on the discharge current through a lagrange interpolation method to obtain the electric quantity value of the current battery comprises: performing interpolation transformation on the voltage-electric quantity corresponding tables under different loads through the discharge current to obtain a voltage-electric quantity corresponding table under the current load; and carrying out primary interpolation transformation on the voltage and electric quantity corresponding table under the current load according to the voltage average value of the battery so as to obtain the electric quantity value of the current battery.
Further, after obtaining the current electric quantity value of the battery, the method further comprises: determining the minimum time interval when the electric quantity changes by 1% according to the counted maximum working current; and in the case that the change of the electric quantity value of the battery is determined, after the minimum time interval, displaying the determined electric quantity value.
Further, the formula for determining the minimum time interval when the electric quantity changes by 1% according to the statistical maximum working current is as follows: t = (C/Imax) × (60/100), where T is the time elapsed when the amount of electricity changes by 1%, C is the total battery capacity, and Imax is the maximum operating current.
Further, the method further comprises: when the switching between the charging state and the discharging state is detected to be currently generated, carrying out buffer replacement on the numerical values stored in the array of the instantaneous voltage difference value according to the preset times, wherein the preset times are the number of the arrays stored in the array of the instantaneous voltage difference value.
In another aspect, the present invention further provides a device for detecting battery power, including: the first determining module is used for determining the current working current according to a voltage difference value, wherein the voltage difference value is a voltage value at two ends of a load resistor; and the interpolation transformation module is used for carrying out interpolation transformation on the voltage and electric quantity corresponding table according to the working current to obtain the electric quantity value of the current battery, wherein the voltage and electric quantity corresponding table records the corresponding value of the voltage and the electric quantity in a charging or discharging state.
Further, the apparatus further comprises: the second determining module is used for storing the voltage difference value to an array of instantaneous voltage difference values and determining the voltage difference values or the average value of the voltage difference values recorded for a plurality of times in the array of instantaneous voltage difference values; and the third determining module is used for determining the current charging and discharging states of the battery according to the voltage difference value or the average value of the voltage difference values.
Further, the apparatus further comprises: the fourth determining module is used for determining the minimum time interval when the electric quantity changes by 1% according to the counted maximum working current; and the display module is used for displaying the determined electric quantity value after the minimum time interval is passed under the condition that the electric quantity value of the battery is determined to be changed.
Further, the interpolation transformation module comprises: the first interpolation transformation unit is used for carrying out primary interpolation transformation on the voltage and electric quantity correspondence table based on charging current through a Lagrange interpolation method so as to obtain the electric quantity value of the current battery, wherein the charging current is the current of the battery in a constant current charging stage; the second interpolation transformation unit is used for carrying out secondary interpolation transformation on the voltage and electric quantity correspondence table based on the discharge current through a Lagrange interpolation method so as to obtain the electric quantity value of the current battery; and the integration unit is used for integrating time according to the charging current to obtain the current electric quantity value of the battery, wherein the charging current is the current of the battery in a constant voltage charging stage.
In yet another aspect, the present invention provides a terminal, including: the device for detecting battery power of any one of the above.
According to the invention, the voltage and electric quantity corresponding table is subjected to interpolation conversion by adopting an interpolation method to obtain the electric quantity value of the battery, an accurate electric quantity value can be obtained without adopting an electric quantity meter chip, the terminal cost is reduced, the electricity consumption duration of the terminal is increased, the problems that the cost of the terminal is increased due to the use of the electric quantity meter chip when the electric quantity value is measured in the prior art and the service time of the terminal battery is reduced due to the use of the electric quantity meter chip are solved.
Drawings
FIG. 1 is a schematic diagram of the discharge characteristics of a prior art lithium battery;
FIG. 2 is a flow chart of a method for detecting battery charge in an embodiment of the present invention;
FIG. 3 is a schematic diagram of a basic circuit of a method for detecting battery power according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a first apparatus for detecting battery power according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a second apparatus for detecting battery power according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a third exemplary embodiment of an apparatus for detecting battery power;
FIG. 7 is a schematic structural diagram of an interpolation transformation module of the apparatus for detecting battery power according to the embodiment of the present invention;
FIG. 8 is a flow chart of a method for detecting battery charge in accordance with a preferred embodiment of the present invention;
FIG. 9 is a schematic circuit diagram of an apparatus for detecting battery charge using the principle of a fuel gauge in accordance with a second preferred embodiment of the present invention;
FIG. 10 is a flow chart of calculating the present operating current in the second preferred embodiment of the present invention;
FIG. 11 is a diagram illustrating a second exemplary interpolation according to the preferred embodiment of the present invention.
Detailed Description
In order to solve the problems that although the electric quantity value can be accurately detected by the electric quantity detection method in the prior art, an electric quantity meter chip is required to be adopted, the use of the electric quantity meter chip can increase the cost of a terminal, and the use time of a terminal battery can be reduced, the invention provides a method, a device and a terminal for detecting the electric quantity of a battery, and the invention is further described in detail by combining figures and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
An embodiment of the present invention provides a method for detecting battery power, and the flow of the method is shown in fig. 2, and includes steps S202 to S204.
Step S202, determining the current working current according to a voltage difference, where the voltage difference is a voltage value at two ends of the load resistor.
The basic circuit of the method is shown in fig. 3, a circuit with a load resistor is connected between a battery and a system circuit, the battery voltage and the system voltage are detected through the circuit, a voltage difference value is further obtained, and then the current working current is obtained according to the connected load, wherein the working current can comprise charging current and discharging current.
And S204, performing interpolation transformation on the voltage-electric quantity correspondence table according to the working current to obtain the electric quantity value of the current battery, wherein the voltage-electric quantity correspondence table records the corresponding value of the voltage and the electric quantity in a charging or discharging state.
In the above steps, a lagrange interpolation formula can be used as a basis, and then interpolation transformation is performed on the voltage and electric quantity correspondence table according to the current working current, so as to obtain the electric quantity value of the battery. In the embodiment, the electric quantity value of the battery is obtained by interpolating and converting the voltage and electric quantity corresponding table by adopting a Lagrange interpolation method, an accurate electric quantity value can be obtained without adopting an electric quantity meter chip, the terminal cost is reduced, the power consumption time of the terminal is prolonged, and the problems that the electric quantity value is measured by using the electric quantity meter chip and the power consumption of the terminal in the prior art is reduced are solved. Of course, those skilled in the art can select other formulas as the basis for the interpolation transformation according to actual requirements.
Before the step S202 is executed, the voltage difference value may be stored in the array of instantaneous voltage difference values, and an average value may be calculated according to the voltage difference values recorded in the array of instantaneous voltage difference values; and determining the current charging and discharging states of the battery according to the average value, wherein if the average value is larger than zero, the battery is determined to be in the discharging state, and if the average value is smaller than zero, the battery is determined to be in the charging state. The method for determining the current state of the battery through the average value of the voltage difference values has higher determination accuracy compared with the method for determining the current state of the battery only through the voltage difference values.
In practice, to further determine the current state, an average value of the voltage difference values may be saved for a preset number of times, where the preset number may be an empirical value, and a person skilled in the art may set the average value as needed, for example, 15 times. If the average values of the voltage difference values of 15 times are all larger than zero, the current discharging state of the battery can be determined; if the average of the voltage difference values of 15 times is less than zero, it can be determined that the battery is currently in a charged state. If the average value is not all larger or smaller than zero in the process of the other 15 times, the process of judging the battery state is abandoned, and the judgment is carried out when the next 15 times.
And if the current battery is in the constant current charging stage, performing primary interpolation transformation on the voltage and electric quantity correspondence table based on the charging current by a Lagrange interpolation method to obtain the electric quantity value of the current battery. If the present battery is in a constant voltage charging phase, the present value of the electric quantity can be obtained by using the integral of the current on the load resistance with respect to time. And if the current battery is in a discharging state, performing secondary interpolation transformation on the voltage and electric quantity corresponding table based on the discharging current by a Lagrange interpolation method to obtain the electric quantity value of the current battery.
For the process of obtaining the current electric quantity value of the battery in the discharging state of the battery, the voltage-electric quantity corresponding table under different loads can be subjected to one-time interpolation conversion through discharging current so as to obtain the voltage-electric quantity corresponding table under the current load; and performing interpolation transformation on the voltage-electric quantity corresponding table under the current load once through the voltage average value of the battery to obtain the electric quantity value of the current battery.
After the electric quantity value of the battery is determined at step S204, the electric quantity value may be directly displayed. However, there is some instability due to a certain jump in the battery's charge value. In order to solve the above problem, the present embodiment provides a process that can further buffer an electric quantity value, including: determining a minimum time interval when the electric quantity changes by 1% according to the statistical maximum working current, wherein the working current can be charging current or discharging current; in case that it is determined that the electric quantity value of the battery is changed, the determined electric quantity value is displayed after a minimum time interval elapses. The formula for determining the minimum time interval is as follows: t = (C/I)max) (60/100), wherein T is the time spent when the electricity changes by 1%, C is the total battery capacity, ImaxIs the maximum operating current. The statistical work of the maximum working current can be continuously collected and counted, and after each collection, the maximum value of the two latest working currents is recorded. For example, two operating currents are collected for the first time, the largest of the two operating currents is recorded, and this largest current is compared with one operating current collected for the second subsequent time. If the working current collected for the second time is larger than the maximum current determined before, determining the working current collected for the second time as the current maximum current; if the second measured operating current is less than the previously determined maximum current, the maximum current is unchanged.
In the implementation process of the method, if the switching between the charging state and the discharging state (from the charging state to the discharging state or from the discharging state to the charging state) is detected to currently occur, the stored numerical values in the array of the instantaneous voltage difference value are subjected to buffer replacement according to the preset times, wherein the preset times are the number of the stored arrays in the array of the instantaneous voltage difference value.
The embodiment also provides a device for detecting battery power, the structure of the device is schematically shown in fig. 4, and the device comprises:
the first determining module 10 is configured to determine a current working current according to a voltage difference, where the voltage difference is a voltage value at two ends of a load resistor; and the interpolation transformation module 20 is coupled to the first determination module 10, and configured to perform interpolation transformation on the voltage-electric quantity correspondence table according to the working current to obtain an electric quantity value of the current battery, where the voltage-electric quantity correspondence table is used to record a corresponding value of voltage and electric quantity in a charging or discharging state.
Fig. 5 is a schematic diagram illustrating a structure of the apparatus for detecting battery level, and based on the apparatus of fig. 4, the apparatus may further include:
a second determining module 30, configured to store the voltage difference value to an array of instantaneous voltage difference values, and determine a voltage difference value or an average value of the voltage difference values recorded in the array of instantaneous voltage difference values; and a third determining module 40, coupled to the second determining module 30 and the first determining module 10, for determining the current charging and discharging state of the battery according to the voltage difference value or the average value of the voltage difference values.
The third determining module 40 may further include: a unit for storing an average value of the voltage difference values for a preset number of times; the unit is used for determining that the battery is in a discharging state currently under the condition that the average values of the voltage difference values of the preset times are all larger than zero; and the unit is used for determining that the battery is in the charging state currently under the condition that the average values of the voltage difference values of the preset times are all smaller than zero.
Fig. 6 is a schematic view showing another structure of the device for detecting battery level, which may further include, based on the device of fig. 5: a fourth determining module 50, coupled to the third determining module 40, for determining a minimum time interval when the electric quantity changes by 1% according to the counted maximum working current; and a display module 60 coupled to the fourth determination module 50 for displaying the determined electric quantity value after a minimum time interval if it is determined that the electric quantity value of the battery has changed.
Fig. 7 is a schematic diagram illustrating a preferred structure of the interpolation transformation module 20 in the above apparatus for detecting battery power, wherein the interpolation transformation module 20 includes: the first interpolation transformation unit 202 is configured to perform primary interpolation transformation on the voltage-electric quantity correspondence table based on a charging current through a lagrange interpolation method to obtain an electric quantity value of the current battery, where the charging current is a current of the battery in a constant current charging stage; the second interpolation transformation unit 204 is configured to perform secondary interpolation transformation on the voltage and electric quantity correspondence table based on the discharge current by a lagrange interpolation method to obtain an electric quantity value of the current battery; the integrating unit 206 is configured to integrate the charging current with respect to time to obtain the current value of the battery, where the charging current is a current of the battery in a constant voltage charging phase.
The second interpolation transformation unit 204 determines the electric quantity value according to the following method: performing interpolation transformation on the voltage and electric quantity corresponding tables under different loads through the discharge current to obtain a voltage and electric quantity corresponding table under the current load; and performing interpolation transformation on the voltage and electric quantity corresponding table under the current load once according to the voltage average value of the battery so as to obtain the electric quantity value of the current battery.
The device can also comprise a module for carrying out buffer replacement on the numerical values stored in the array of the instantaneous voltage difference value according to the preset times when the switching between the charging state and the discharging state is detected to be currently generated, wherein the preset times are the number of the arrays stored in the array of the instantaneous voltage difference value.
PREFERRED EMBODIMENTS
The preferred embodiment provides a new method for detecting battery power on a terminal. For the terminal, the method can ensure that the terminal product does not use the electricity meter chip, thereby reducing the power consumption of the whole machine and reducing the cost caused by adopting the electricity meter chip; for developers, a complex battery model does not need to be established, the research and development period is shortened, electric quantity jumping caused by a simple voltage monitoring method can be avoided, and the electric quantity percentage of the battery with higher precision is obtained.
The method for detecting the electric quantity of the battery provided by the embodiment is to perform secondary interpolation on the electric quantity-voltage correspondence table under different loads by monitoring the voltage of the battery according to the load size of the terminal, and perform a series of optimization algorithms to realize accurate estimation of the electric quantity value during charging and discharging of the battery. The following is a description of specific embodiments. The flow of the method is shown in fig. 8, and includes steps S802 to S804. Step S802, estimating the initial electric quantity of the battery according to the voltage of the battery and the current system load during initialization; and step S804, in the operation process, the electric quantity value of the battery is accurately estimated through a Lagrange interpolation algorithm.
Wherein, step S802 includes:
sampling the initial voltage (V _ BATT) of the battery through an Analog-to-Digital Converter (ADC), and initializing an array for storing the instantaneous voltage value of the battery; sampling the initial voltage (V _ SYS) of the system through an ADC (analog-to-digital converter), solving a voltage difference value (V _ BATT-V _ SYS), and initializing an array for storing the instantaneous voltage difference value. And searching a voltage and electric quantity corresponding table according to the battery voltage, and calculating the initial electric quantity value of the battery.
Further, step S804 includes: (1) calculating the voltage; (2) calculating the electric quantity of the battery during charging and discharging; (3) and calculating the electric quantity buffer.
Wherein (1) the calculation of the voltage comprises:
sampling the instantaneous voltage (V _ BATT) of the battery through an ADC (analog to digital converter), storing an array of instantaneous voltage values of the battery in a circulating manner, and calculating an average value; sampling the instantaneous voltage (V _ SYS) of the system through an ADC (analog-to-digital converter), calculating a voltage difference value (V _ BATT-V _ SYS), circularly storing the voltage difference value into an array of the instantaneous voltage difference values, and calculating an average value. And judging the current charging and discharging state of the battery according to the average value of the voltage difference values, wherein the average value of the voltage difference values is stored for ten times, and the judgment is carried out, if the voltage difference values are greater than zero for 10 times, the battery is in the discharging state currently, and if the voltage difference values are less than zero for 10 times, the battery is in the charging state currently.
Wherein, (2) the calculation of electric quantity when charging and discharging the battery includes: buffering treatment is carried out when charging and discharging of the battery are switched; calculating the charging capacity of the battery; calculating the discharge electric quantity of the battery; and carrying out buffering treatment on the electric quantity value.
The buffering treatment when the charging and discharging of the battery are switched comprises the following steps: when the charging and discharging states of the battery are switched, buffering of an electric quantity calculation period is performed for 10 times, wherein during charging, full counting judgment is performed, and during discharging, empty counting judgment is performed.
Calculating the charge capacity of the battery, comprising: the battery is divided into a constant current charging stage and a constant voltage charging stage in the charging process, if the battery voltage reaches the charging limit voltage of the battery when the battery is in a charging state, the battery enters the constant voltage charging stage, and if the battery voltage does not reach the charging limit voltage of the battery, the battery is in the constant current charging stage. When the battery is in the constant current charging stage, one-time interpolation can be carried out according to the current charging current to obtain the current electric quantity value of the battery. When the battery is in a constant voltage charging stage, the current value on the current sensitive resistor (load resistor) is used for integrating the time, and the current electric quantity value of the battery is accumulated.
The calculation of the battery discharge capacity comprises the following steps: and performing secondary interpolation according to the current discharge current to obtain the current electric quantity value of the battery, wherein the process of performing secondary interpolation by using the working current comprises the following steps: according to the current discharging current, performing first interpolation on the voltage and electric quantity corresponding tables under different loads to obtain the voltage and electric quantity corresponding table under the current load, and then performing second interpolation on the voltage and electric quantity corresponding table by using the voltage average value of the battery to obtain the electric quantity value of the current battery.
Buffering the electric quantity value, comprising: calculating the minimum time interval when the electric quantity changes by 1% according to the maximum charging current or the maximum discharging current of the terminal, and using the following formula: t = (C/I)max) (60/100), wherein C represents the total cell capacity in mAh; i ismaxRepresents the maximum current in mA; t represents the time spent with 1% change in charge in minutes.
According to the embodiment, under the condition that no electricity meter chip is adopted, the electricity quantity of the battery under the charging and discharging condition is estimated through software, and the problems that the electricity meter chip is required to be adopted in the related technology, so that the interrupt power consumption is large and the cost is high are solved.
Preferred embodiment two
The preferred embodiment provides a mobile terminal, which includes a device for detecting battery power, wherein the device uses a circuit schematic diagram of a fuel gauge in a terminal product, as shown in fig. 9, a load resistor for detecting current is connected in series with the positive electrode of the battery, and two ends of the load resistor are respectively connected to one-out-of-multiple input pins of an ADC. The method for detecting the battery voltage implemented on the mobile terminal is described below with reference to the accompanying drawings.
Fig. 10 is a flowchart of calculating the present operating current. As shown in fig. 10, it includes the following flow (step S1002 to step S1014).
In step S1002, it is determined whether a battery is present. If so, step S1004 is executed, otherwise step S1014 is executed. Wherein, the process of judging whether the battery exists can be realized by reading the ID pin of the battery or judging the temperature of the battery.
In step S1004, the battery voltage (V _ BATT) and the system voltage (V _ SYS) are sampled by the ADC, respectively.
Step S1006, the battery voltage array is filled and the average value is obtained.
In step S1008, a voltage difference value (V _ BATT-V _ SYS) is obtained, and an average value processing is performed.
Step S1010, judging the charging and discharging state of the battery according to the voltage difference.
In the implementation process of the above steps, the voltage value sampled each time may be put into an array with a capacity of 10, and after the maximum value and the minimum value of the data in the array are removed, an average value is calculated. And then, judging the charging and discharging state of the battery, for example, storing the average value of the voltage difference values for ten times, and judging, wherein if the voltage difference values are greater than zero for 10 times, the battery is in the discharging state currently, and if the voltage difference values are less than zero for 10 times, the battery is in the charging state currently.
In step S1012, the current charge and discharge current of the battery is calculated using the average value of the voltage difference and the resistance value of the current detection resistor.
Step 1014, directly entering next scheduling.
After the current battery state and the charge state are judged and before the charge and discharge current is determined, the buffer processing of charge state switching can be carried out, namely, the buffer processing of 10 times of electric quantity calculation cycles is carried out when the charge and discharge state of the battery is switched. And when the battery is charged, the electric quantity calculation period is increased gradually, full counting judgment is carried out, and when the battery is discharged, the electric quantity calculation period is decreased gradually, and empty counting judgment is carried out. Then, electric quantity calculation is carried out, which comprises charging electric quantity calculation and discharging electric quantity calculation, and finally electric quantity buffering processing is carried out, namely: and calculating the minimum time interval when the electric quantity changes by 1% according to the maximum charging current and the maximum discharging current of the terminal.
In the execution of step S1012, it is necessary to determine the current state of the battery. The battery is in a non-passing state, and the process of calculating the electric quantity value is different.
And if the battery is in a charging state, judging whether the battery is in a constant current charging stage or a constant voltage charging stage. Wherein, the different stage division standards are as follows: when the voltage of the battery reaches the charging limiting voltage of the battery, the constant voltage charging stage is entered, otherwise, the constant current charging stage is entered. And if the current battery is in the constant current charging stage, performing primary interpolation according to the current charging current to obtain the current electric quantity value of the battery. If the charging device is in the constant voltage charging stage, the current charging current value is used for integrating the time, and the current electric quantity value of the battery is accumulated. Finally, when the battery is in the charging phase, the electric quantity is monotonically increased, namely: and comparing the calculated electric quantity percentage with the electric quantity percentage to be updated to enable the electric quantity value to be in an increasing state.
If the battery is in a discharging state, secondary interpolation is carried out according to the current discharging current to obtain the current electric quantity value of the battery, and when the battery is in a discharging stage, the electric quantity is monotonically decreased, so that the electric quantity value is finally monotonically decreased.
Specifically, according to the current discharge current, performing first interpolation on the voltage-electric quantity correspondence table under different loads to obtain a voltage-electric quantity correspondence table under the current load, and then performing second interpolation on the voltage-electric quantity correspondence table by using the voltage average value of the battery to obtain the electric quantity value of the current battery. Such as: the current working current is 80mA, as shown in fig. 11, the current voltage and electric quantity corresponding curves under the loads of 50mA and 100mA exist, firstly, the slope between current points is calculated to be (100-80)/(80-50), voltage values on different electric quantity points are calculated according to the slope, a new voltage and electric quantity corresponding curve is obtained, namely, the voltage and electric quantity corresponding curve under 80mA is obtained, finally, the voltage and electric quantity corresponding table under 80mA is searched by using the voltage average value of the current battery, and the final electric quantity value is obtained after interpolation.
The results of detecting the battery capacity when the system current is changed and the load is suddenly changed from 50mA to 1000mA when the load resistance is connected are shown in Table 1. As can be seen from the table, the battery voltage fluctuates with the load change, but the battery capacity is maintained at 88%, and the battery capacity is stably output without sudden change.
TABLE 1
Voltage (MV) | Electric quantity (%) |
3996 | 88 |
3995 | 88 |
4092 | 88 |
4101 | 88 |
4000 | 88 |
3958 | 88 |
3946 | 88 |
3936 | 88 |
3929 | 88 |
4074 | 88 |
4077 | 88 |
It can be seen from the table that the battery voltage fluctuates with the load change, but the battery capacity is maintained at 88%, and the battery capacity is stably output without sudden change.
The terminal product provided by the preferred embodiment does not need to adopt an electricity meter chip, thereby reducing the power consumption of the whole machine and reducing the cost caused by adopting the electricity meter chip; by adopting the technical scheme of the invention, developers can not only shorten the research and development period without establishing a complex battery model, but also avoid the electric quantity jump caused by a simple voltage monitoring method and obtain a battery electric quantity value with higher precision.
Although the preferred embodiments of the present invention have been disclosed for illustrative purposes, those skilled in the art will appreciate that various modifications, additions and substitutions are possible, and the scope of the invention should not be limited to the embodiments described above.
Claims (11)
1. A method of detecting battery charge, comprising:
storing the voltage difference value into an array of instantaneous voltage difference values, and determining the voltage difference values or the average value of the voltage difference values recorded in the array of instantaneous voltage difference values, wherein the voltage difference values are voltage values at two ends of a load resistor;
determining the current charging and discharging states of the battery according to the voltage difference value or the average value of the voltage difference value;
determining the current working current according to the voltage difference;
and carrying out interpolation transformation on the voltage-electric quantity correspondence table according to the working current to obtain the electric quantity value of the current battery, wherein the voltage-electric quantity correspondence table records the corresponding value of the voltage and the electric quantity in a charging or discharging state.
2. The method of claim 1, wherein determining the current charge and discharge state of the battery based on the average of the voltage difference values comprises:
storing the average value of the voltage difference values for preset times;
under the condition that the average values of the voltage difference values of the preset times are all larger than zero, determining that the battery is in a discharging state currently;
and under the condition that the average values of the voltage difference values of the preset times are all smaller than zero, determining that the battery is in a charging state currently.
3. The method of claim 1, wherein obtaining the current battery's charge value comprises:
performing primary interpolation transformation on the voltage and electric quantity correspondence table based on charging current by a Lagrange interpolation method to obtain the electric quantity value of the current battery, wherein the charging current is the current of the battery in a constant current charging stage; or,
integrating time according to the charging current to obtain the current electric quantity value of the battery, wherein the charging current is the current of the battery in a constant voltage charging stage; or,
and performing secondary interpolation transformation on the voltage and electric quantity corresponding table based on the discharge current by a Lagrange interpolation method to obtain the electric quantity value of the current battery.
4. The method of claim 3, wherein performing a quadratic interpolation transformation on the voltage-to-capacity correspondence table based on the discharge current by a Lagrangian interpolation method to obtain the current battery capacity value comprises:
performing interpolation transformation on the voltage-electric quantity corresponding tables under different loads through the discharge current to obtain a voltage-electric quantity corresponding table under the current load;
and carrying out primary interpolation transformation on the voltage and electric quantity corresponding table under the current load according to the voltage average value of the battery so as to obtain the electric quantity value of the current battery.
5. The method of any one of claims 1 to 4, wherein after obtaining the current battery's charge value, further comprising:
determining the minimum time interval when the electric quantity changes by 1% according to the counted maximum working current;
and displaying the determined electric quantity value after the minimum time interval is passed under the condition that the electric quantity value of the battery is determined to be changed.
6. The method of claim 5, wherein the minimum time interval for a 1% change in the charge is determined from the statistical maximum operating current by the formula:
T=(C/Imax) (60/100), wherein T is the time spent when the electricity changes by 1%, C is the total battery capacity, ImaxIs the maximum operating current.
7. The method of claim 5, wherein the method further comprises:
when the switching between the charging state and the discharging state is detected to be currently generated, carrying out buffer replacement on the numerical values stored in the array of the instantaneous voltage difference value according to the preset times, wherein the preset times are the number of the arrays stored in the array of the instantaneous voltage difference value.
8. An apparatus for detecting battery charge, comprising:
the first determining module is used for determining the current working current according to a voltage difference value, wherein the voltage difference value is a voltage value at two ends of a load resistor;
the interpolation transformation module is used for carrying out interpolation transformation on the voltage and electric quantity correspondence table according to the working current to obtain the electric quantity value of the current battery, wherein the voltage and electric quantity correspondence table records the corresponding value of the voltage and the electric quantity in a charging or discharging state;
the second determining module is used for storing the voltage difference value to an array of instantaneous voltage difference values and determining the voltage difference values or the average value of the voltage difference values recorded for a plurality of times in the array of instantaneous voltage difference values;
and the third determining module is used for determining the current charging and discharging states of the battery according to the voltage difference value or the average value of the voltage difference values.
9. The apparatus of claim 8, further comprising:
the fourth determining module is used for determining the minimum time interval when the electric quantity changes by 1% according to the counted maximum working current;
and the display module is used for displaying the determined electric quantity value after the minimum time interval is passed under the condition that the electric quantity value of the battery is determined to be changed.
10. The apparatus of claim 8, wherein the interpolation transform module comprises:
the first interpolation transformation unit is used for carrying out primary interpolation transformation on the voltage and electric quantity correspondence table based on charging current through a Lagrange interpolation method so as to obtain the electric quantity value of the current battery, wherein the charging current is the current of the battery in a constant current charging stage;
the second interpolation transformation unit is used for carrying out secondary interpolation transformation on the voltage and electric quantity correspondence table based on the discharge current through a Lagrange interpolation method so as to obtain the electric quantity value of the current battery;
and the integration unit is used for integrating time according to the charging current to obtain the current electric quantity value of the battery, wherein the charging current is the current of the battery in a constant voltage charging stage.
11. A terminal, comprising: the device for detecting battery charge of any one of claims 8 to 10.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310350470.6A CN104375085B (en) | 2013-08-13 | 2013-08-13 | A kind of method, apparatus and terminal detecting battery capacity |
PCT/CN2013/087794 WO2014161325A1 (en) | 2013-08-13 | 2013-11-25 | Method, device and terminal for detecting electric quantity of battery |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310350470.6A CN104375085B (en) | 2013-08-13 | 2013-08-13 | A kind of method, apparatus and terminal detecting battery capacity |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104375085A CN104375085A (en) | 2015-02-25 |
CN104375085B true CN104375085B (en) | 2019-03-26 |
Family
ID=51657513
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310350470.6A Active CN104375085B (en) | 2013-08-13 | 2013-08-13 | A kind of method, apparatus and terminal detecting battery capacity |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN104375085B (en) |
WO (1) | WO2014161325A1 (en) |
Families Citing this family (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103974323B (en) * | 2014-05-30 | 2019-01-15 | 努比亚技术有限公司 | Mobile terminal and its information uploading method |
CN106483462B (en) * | 2015-08-28 | 2019-09-17 | 炬芯(珠海)科技有限公司 | A kind of measurement method and device of battery charge |
CN105607006B (en) * | 2015-09-30 | 2019-04-12 | 宇龙计算机通信科技(深圳)有限公司 | Determination method, system and the terminal of battery capacity |
CN106569132A (en) * | 2015-10-13 | 2017-04-19 | 中兴通讯股份有限公司 | Power display method and apparatus |
CN105891722B (en) * | 2016-04-06 | 2017-11-17 | 广东欧珀移动通信有限公司 | The computational methods and device of a kind of terminal battery electricity quantity |
CN106501730A (en) * | 2016-12-06 | 2017-03-15 | 歌尔科技有限公司 | A kind of battery electric quantity processing method and equipment |
CN107436410A (en) * | 2017-07-19 | 2017-12-05 | 上海与德科技有限公司 | A kind of electric quantity controlling method, device, equipment and storage medium |
CN109813775A (en) * | 2017-11-20 | 2019-05-28 | 上海观流智能科技有限公司 | Specific ion detection method, system, computer readable storage medium and equipment |
CN109633459B (en) * | 2018-12-31 | 2021-04-09 | 浙江高泰昊能科技有限公司 | SOC interval dynamic curve correction method based on power battery application |
CN110297192B (en) * | 2019-07-04 | 2021-04-06 | 广东乐心医疗电子股份有限公司 | Method for estimating electric quantity during charging and discharging of battery and electric quantity correction method during starting |
CN110794315B (en) * | 2019-08-06 | 2022-07-12 | 厦门亿联网络技术股份有限公司 | Method for detecting electric quantity of rechargeable battery |
CN110716142A (en) * | 2019-10-16 | 2020-01-21 | 蔚复来(浙江)科技股份有限公司 | Low-power-consumption battery electric quantity detection method |
CN111426965B (en) * | 2020-05-15 | 2022-05-06 | 深圳英集芯科技股份有限公司 | Method for calculating electric quantity of battery |
CN111740464B (en) * | 2020-07-03 | 2022-07-22 | 歌尔科技有限公司 | Battery power compensation method, device, equipment and readable storage medium |
CN113533844A (en) * | 2021-08-17 | 2021-10-22 | 南昌黑鲨科技有限公司 | Electric quantity meter circuit, control method, electric quantity meter and terminal |
CN114062942A (en) * | 2021-10-12 | 2022-02-18 | 南京瀚元科技有限公司 | Measurement method for inhibiting jump of battery power calculation caused by charging and discharging |
CN117786363B (en) * | 2023-12-28 | 2024-06-21 | 成都时域半导体有限公司 | Data recording method for fuel gauge chip |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3392506B2 (en) * | 1994-02-24 | 2003-03-31 | 株式会社東芝 | Solar power generation simulator |
SE515398C2 (en) * | 1996-04-29 | 2001-07-30 | Emerson Energy Systems Ab | Battery Capacity Gauge |
CN2743892Y (en) * | 2004-09-24 | 2005-11-30 | 深圳市万拓电子技术有限公司 | External cell bag for portable notebook computer |
JP2006275549A (en) * | 2005-03-28 | 2006-10-12 | Seiko Epson Corp | Information terminal and calculation method of battery power |
CN103217651B (en) * | 2013-04-18 | 2015-09-23 | 中国科学院广州能源研究所 | A kind of evaluation method of storage battery charge state and system |
-
2013
- 2013-08-13 CN CN201310350470.6A patent/CN104375085B/en active Active
- 2013-11-25 WO PCT/CN2013/087794 patent/WO2014161325A1/en active Application Filing
Also Published As
Publication number | Publication date |
---|---|
CN104375085A (en) | 2015-02-25 |
WO2014161325A1 (en) | 2014-10-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104375085B (en) | A kind of method, apparatus and terminal detecting battery capacity | |
CN107870301B (en) | Method and device for detecting micro short circuit of battery | |
JP5466564B2 (en) | Battery degradation estimation method, battery capacity estimation method, battery capacity equalization method, and battery degradation estimation apparatus | |
CN106461732B (en) | Method for estimating state of health of battery | |
CN108957337B (en) | Method and device for determining state of health of battery, storage medium and electronic equipment | |
CN110506215A (en) | A kind of method and device of determining battery internal short-circuit | |
CN102375127B (en) | Method for displaying residual battery electricity quantity of mobile terminal | |
TWI420126B (en) | Device for battery capacity prediction and method for the same | |
CN104698388B (en) | The cell degradation detection method and its device of a kind of mobile terminal | |
CN106646256B (en) | Battery capacity calculating method | |
CN109991554B (en) | Battery electric quantity detection method and device and terminal equipment | |
CN102854471B (en) | Battery meter metering method and measuring apparatus | |
KR101402802B1 (en) | Apparatus and Method for cell balancing based on battery's voltage variation pattern | |
CN109991545B (en) | Battery pack electric quantity detection method and device and terminal equipment | |
CN102200568A (en) | Method of estimating remaining capacity and run-time of a battery device | |
US20140306712A1 (en) | Tracking aging effect on battery impedance and tracking battery state of health | |
CN102822690A (en) | Charge state estimation apparatus | |
CN111679206B (en) | Electric quantity detection method and device, and storage medium | |
CA2899239A1 (en) | Method for determining a state of charge and remaining operation life of a battery | |
CN102645571A (en) | Detection circuit and electronic terminal | |
JP2014025738A (en) | Residual capacity estimation device | |
CN111142032B (en) | Method, device and equipment for determining battery electric quantity and storage medium | |
TWI528043B (en) | Battery SOC/SOH estimation circuit | |
JP2022532545A (en) | Battery cell diagnostic device and method | |
CN103460063A (en) | Battery voltage measurement |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |