CN115728641A - OCV electric quantity calculation method with self-learning and self-calibration functions - Google Patents

OCV electric quantity calculation method with self-learning and self-calibration functions Download PDF

Info

Publication number
CN115728641A
CN115728641A CN202211418491.2A CN202211418491A CN115728641A CN 115728641 A CN115728641 A CN 115728641A CN 202211418491 A CN202211418491 A CN 202211418491A CN 115728641 A CN115728641 A CN 115728641A
Authority
CN
China
Prior art keywords
ocv
vbat
self
cap
charge
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.)
Granted
Application number
CN202211418491.2A
Other languages
Chinese (zh)
Other versions
CN115728641B (en
Inventor
卓明锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuhai Yingji Semiconductor Co ltd
Original Assignee
Zhuhai Yingji Semiconductor Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Zhuhai Yingji Semiconductor Co ltd filed Critical Zhuhai Yingji Semiconductor Co ltd
Priority to CN202211418491.2A priority Critical patent/CN115728641B/en
Publication of CN115728641A publication Critical patent/CN115728641A/en
Application granted granted Critical
Publication of CN115728641B publication Critical patent/CN115728641B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E60/00Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation
    • Y02E60/10Energy storage using batteries

Landscapes

  • Charge And Discharge Circuits For Batteries Or The Like (AREA)

Abstract

The invention provides an OCV electric quantity calculation method with self-learning and self-calibration functions, which comprises the steps of starting to enter a charging self-calibration mode when a system is charged, collecting battery voltage and battery current during charging at intervals of a period T, and storing data of an OCV voltage VBAT _ OCV _ TMP into an array at intervals of the period T; judging whether the electric quantity is 100, if so, obtaining total charging time T1 and charging time T2 of each electric quantity by counting accumulated N values of CHARGE _ CAP _ TMP [ N ], obtaining an updated CHARGE-voltage meter CHARGE _ CAP _ TMP [ N ], and updating the value of the table to a preset CHARGE-voltage meter CHARGE _ CAP [ N ] [ M ]; when the system is in a discharging state, starting to enter a discharging self-calibration mode; and after the charging self-calibration and the discharging self-calibration are completed each time, a charging self-learning process and a discharging self-learning process are carried out. The invention has the function of calculating the electric quantity by the self-learning and self-calibration OCV, and the electric quantity can smoothly change when charging and discharging are switched, so that the charging and discharging electric quantity can be calculated more accurately.

Description

OCV electric quantity calculation method with self-learning and self-calibration functions
Technical Field
The invention relates to the technical field of battery electric quantity measurement, in particular to an OCV electric quantity calculation method with self-learning and self-calibration functions.
Background
Batteries are now used in many electronic devices in life, as small as consumer electronics and as large as energy storage power sources such as inverters, which require batteries to provide energy. Therefore, it is very important to divide the energy of the battery reasonably so that the user can predict the energy of the battery accurately, and accurate calculation of the battery capacity becomes an important research direction.
Currently, there are two main methods for calculating the battery capacity, one is coulomb meter, i.e. the capacity is calculated by integrating the current in real time, and the other is the battery voltage after compensation by using OCV.
At present, most methods for calculating electric quantity by using OCV adopt a single table lookup to calculate the electric quantity, the electric quantity calculation has errors under different charging and discharging conditions, and the electric quantity mutation is easy to occur when the voltage of a battery is mutated, so that the electric quantity cannot be smoothly converted, and in addition, when the battery is used and the battery is lost, the longer the service time of the battery is, the less accurate the electric quantity calculation is, and the function of self-calibration of the electric quantity is not realized. Further, since the OCV varies with different discharge currents and charge currents, a self-learning function is required.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention aims to provide the OCV electric quantity calculation method with the self-learning and self-calibration functions, the method can solve the problems that in the prior art, the calculation error is large, the electric quantity conversion is not smooth enough, the electric quantity calculation is not accurate, the self-calibration and self-learning functions are not realized, and the like.
In order to solve the problems, the technical scheme adopted by the invention is as follows:
the OCV electric quantity calculation method with the self-learning and self-calibration functions is applied to an OCV electric quantity calculation system with the self-learning and self-calibration functions, the system comprises a charging calculation model, a charging-discharging calculation model, a discharging calculation model and a discharging-charging calculation model, and the method comprises the following steps:
the method comprises the following steps that a system starts to operate, when the system is charged, the system starts to enter a charging self-calibration mode, battery voltage and battery current during charging are collected every period T, the OCV voltage during charging is determined to be VBAT _ OCV _ TMP, data of the OCV voltage VBAT _ OCV _ TMP are stored into an array CHARGE _ CAP _ TMP [ N ] every period T, and data of the battery current are stored into an array CHARGE _ IBAT _ TMP [ N ];
judging whether the electric quantity is 100, if so, obtaining the total charging time T1 and the charging time T2 of each electric quantity by counting the accumulated N value of the CHARGE _ CAP _ TMP [ N ], obtaining an updated CHARGE-voltage meter CHARGE _ CAP _ TMP [ N ], and updating the value of the table to a preset CHARGE-voltage meter CHARGE _ CAP [ N ] [ M ];
when the system discharges, starting to enter a discharge self-calibration mode;
after charging self-calibration and discharging self-calibration are completed each time, the average battery current of each charging self-calibration and the average battery current of each discharging self-calibration are obtained, and a charging self-learning process and a discharging self-learning process are completed.
According to the OCV electric quantity calculation method with the self-learning and self-calibration functions, when the electric quantity is 0 and the OCV electric quantity is charged, the OCV electric quantity calculation method starts to enter a charging self-calibration mode.
According to the OCV electric quantity calculation method with the self-learning and self-calibration functions, when the electric quantity is 100 and discharging occurs, a discharging self-calibration mode is started to enter.
According to the OCV electric quantity calculation method with the self-learning and self-calibration functions, after the OCV electric quantity calculation method enters a discharging self-calibration mode, an OCV voltage VBAT _ OCV _ TMP during discharging is recorded every other period T, data of the OCV voltage VBAT _ OCV _ TMP are stored in a plurality of groups of BOOST _ CAP _ TMP [ N ], and data of battery current are recorded in the plurality of groups of BOOST _ IBAT _ TMP [ N ];
starting discharging until the battery power is reduced to 0, obtaining the total discharging time T3 and the discharging time T4 of each battery power by counting the accumulated N values of the BOOST _ CAP _ TMP [ N ], obtaining an updated BOOST _ CAP _ TMP [ N ], and updating the table values to the preset discharging-battery-voltage table BOOST _ CAP [ N ] [ M ], wherein the latter M value in the two-dimensional array of the discharging-battery-voltage table BOOST _ CAP [ N ] [ M ] represents self-learning information, and the N value in the BOOST _ CAP _ NUMBER [ N ] corresponds to the N value in the BOOST _ CAP _ TMP [ N ], that is, when updating the table, the system can know which self-calibration is under the condition of self calibration of the average battery current, and when the system is running, according to the battery current when the discharging battery power is equal to 100, firstly checks which one of the BOOST _ CAP [ N ] is close to the average battery current value, and then the average battery current of the battery-battery current table is determined by the discharging time.
According to the OCV electric quantity calculation method with the self-learning and self-calibration functions, after charging self-calibration is completed, the average battery current IBAT _ AVE of the charging self-calibration is obtained through an array CHARGE _ IBAT _ TMP [ N ], and is expressed as a formula (11):
IBAT_AVE=(CHARGE_IBAT_TMP[1]+...+CHARGE_IBAT_TMP[N])/N (1)
if this time is the first charging self-calibration, starting to store the value into the array CHARGE _ CAP _ NUMBER [ M ], then there is formula (12):
CHARGE_CAP_NUMBER[1]=IBAT_AVE (12)
if the current time is the second-time charging self-calibration, and the difference between the average battery current IBAT _ AVE of the second time and the average battery current IBAT _ AVE of the first time is out of the error range, the charging self-calibration data and the previous self-calibration data are different, and the data of the charging self-calibration data are recorded to be valid, so that the formula (13) is provided:
CHARGE_CAP_NUMBER[2]=IBAT_AVE (13)
if the difference between the second average battery current IBAT _ AVE and the first average battery current IBAT _ AVE is not outside the error range, the data in the array CHARGE _ CAP _ NUMBER [ M ] which is closest to the second average battery current IBAT _ AVE is covered.
According to the OCV electric quantity calculation method with the self-learning and self-calibration functions, after the discharge self-calibration is completed, the average battery current IBAT _ AVE of the discharge self-calibration is obtained through the array BOOST _ IBAT _ TMP [ N ], and is expressed as a formula (21):
IBAT_AVE=(BOOST_IBAT_TMP[1]+...+BOOST_IBAT_TMP[N])/N (21)
if this time is the first discharge self-calibration, starting to store the value into the array BOOST _ CAP _ NUMBER [ M ], then there is formula (22):
BOOST_CAP_NUMBER[1]=IBAT_AVE (22)
if the discharging self-calibration is performed for the second time, and the difference between the average battery current IBAT _ AVE of the second time and the average battery current IBAT _ AVE of the first time is out of the error range, the discharging self-calibration is considered to be different from the previous self-calibration data, the discharging self-calibration data is recorded to be valid, and the formula (23) is provided
BOOST_CAP_NUMBER[2]=IBAT_AVE (23)
If the difference between the second average battery current IBAT _ AVE and the first average battery current IBAT _ AVE is not outside the error range, the data in the array BOOST _ CAP _ NUMBER [ M ] which is closest to the second average battery current IBAT _ AVE is covered.
According to the OCV electric quantity calculation method with the self-learning and self-calibration functions, if the CHARGE _ CAP _ NUMBER [ M ] or the BOOST _ CAP _ NUMBER [ M ] has more than two data, the CHARGE _ CAP _ NUMBER [ M ] or the BOOST _ CAP _ NUMBER [ M ] needs to be sequenced, namely, the values in the CHARGE _ CAP _ NUMBER [ M ] or the BOOST _ CAP _ NUMBER [ M ] are sequenced from small to large.
According to the OCV electric quantity calculation method with the self-learning and self-calibration functions, the charging calculation model is used for:
the battery voltage VBAT and the battery current IBAT are sampled every period T, and assuming that the present charge amount is CAP, the OCV voltage VBAT _ OCV _ TMP at the time of charging is expressed as formula (1):
VBAT_OCV_TMP=VBAT- IBAT* R_charge[M] (1)
the comparison value VBAT _ OCV is set, expressed as equation (2):
VBAT_OCV=CHARGE_CAP[T2*(CAP+1)][M] (2)
VBAT _ OCV is the compensated battery voltage, VBAT is the collected battery voltage, IBAT is the collected battery current, and R _ charge is the internal resistance during charging;
when charging continues until VBAT _ OCV _ TMP is greater than VBAT _ OCV, the charge is increased by 1 and the next comparison value is updated.
According to the OCV electric quantity calculation method with the self-learning and self-calibration functions, the charge-to-discharge calculation model is used for:
when the charging is converted into the discharging, the processing enters a charging-discharging calculation model, and the processing comprises the following steps:
if the discharge light load state is kept all the time, the system enters a standby state after a specified time, and the electric quantity is kept unchanged;
if the load is detected to be inserted for discharging at the moment, the decrement of the electric quantity is carried out according to the BOOST _ CAP [ N ] [ M ], and the method comprises the following steps:
assuming that the current capacity is CAP, the current OCV voltage is VBAT _ OCV _ TMP, expressed as formula (3):
VBAT_OCV_TMP=VBAT+ IBAT* R_boost[M] (3)
wherein, R _ boost is the internal resistance during charging;
the comparison value VBAT _ OCV is set, expressed as equation (4):
VBAT_OCV=BOOST_CAP[T4*(CAP-1)][M] (4)
if VBAT _ OCV _ TMP is less than VBAT _ OCV, after every period T5, the power is reduced by 1, and whether VBAT _ OCV _ TMP is less than VBAT _ OCV is continuously judged: if the VBAT _ OCV _ TMP is larger than the VBAT _ OCV, entering a discharging calculation model;
if VBAT _ OCV _ TMP is larger than VBAT _ OCV, the discharge calculation model is directly entered.
According to the OCV electric quantity calculation method with the self-learning and self-calibration functions, the discharge calculation model is used for:
the battery voltage VBAT and the battery current IBAT are sampled every period T, and assuming that the present charge amount is CAP, the OCV voltage VBAT _ OCV _ TMP at the time of discharge is expressed as formula (3):
VBAT_OCV_TMP=VBAT+ IBAT* R_boost[M] (3)
the comparison value VBAT _ OCV is set, expressed as equation (4):
VBAT_OCV=BOOST_CAP[T4*(CAP-1)][M] (4)
when discharging continues until VBAT _ OCV _ TMP is less than VBAT _ OCV, the charge is decremented by 1 and the next comparison value is updated.
According to the OCV electric quantity calculation method with the self-learning and self-calibration functions, the discharge-to-charge calculation model is used for:
when the discharge is converted into the charge, the discharge-to-charge calculation model processing is carried out, and the processing comprises the following steps:
assuming that the current capacity is CAP, the current OCV voltage is VBAT _ OCV _ TMP, expressed as equation (1):
VBAT_OCV_TMP=VBAT- IBAT* R_charge[M] (1)
the comparison value VBAT _ OCV is set, expressed as equation (2):
VBAT_OCV=CHARGE_CAP[T2*(CAP+1)][M] (2)
if VBAT _ OCV _ TMP is greater than VBAT _ OCV, after every period T6, the power is increased by 1, and the power CAP is updated, and it is continuously determined whether VBAT _ OCV _ TMP is greater than VBAT _ OCV: if the VBAT _ OCV _ TMP is smaller than the VBAT _ OCV, entering a charging calculation model;
if VBAT _ OCV _ TMP is less than VBAT _ OCV, then the charging calculation model is entered directly.
According to the OCV electric quantity calculation method with the self-learning and self-calibration functions, the following steps are further executed: obtaining internal resistance compensation values under different currents according to actual measurement, and calling according to different battery currents when calling is needed, wherein the internal resistance compensation values comprise:
assuming that the BAT terminal voltage of the board is VBAT1 and the real cell terminal voltage is VBAT2, the internal resistance of the charging current I is formula (5):
R_charge=(VBAT2-VBAT1)/I (5)
assuming that the BAT terminal voltage VBAT1 and the real cell terminal voltage VBAT2 are present, the internal resistance of the discharge current I is formula (6):
R_boost=(VBAT1-VBAT2)/I (6)
according to the formulas (5) and (6), the internal resistance of the battery under different battery currents during charging and discharging can be calculated, the calculated values are put into internal resistance tables R _ charge [ M ] and R _ boost [ M ], and a waiting program calls the two tables according to different battery currents.
Therefore, the invention discloses a method with the functions of self-learning and self-calibration, OCV double-check electric quantity-voltmeter and voltage abrupt change smooth change and the like, and the method is applied to a system with the functions of self-learning and self-calibration for calculating the electric quantity by the OCV. The system is divided into four models for calculating the electric quantity: the system comprises a charging calculation model, a charging-to-discharging calculation model, a discharging calculation model and a discharging-to-charging calculation model. The charging-discharging calculation model and the discharging-charging calculation model are used for realizing smooth switching of electric quantity during charging and discharging switching, and avoiding the situation that the electric quantity is suddenly changed due to sudden change of voltage during charging and discharging switching; the charging calculation model and the discharging calculation model are independent in the used electric quantity-voltage meter, namely, CHARGE _ CAP [ N ] [ M ] and BOOST _ CAP [ N ] [ M ] respectively, so that the calculation of the electric quantity can be more accurate.
Therefore, the method is simple and feasible, has high speed and high OCV electric quantity calculation efficiency, and can effectively save time cost and equipment use cost; the method has high calculation accuracy, and the error between the OCV obtained by the method and the OCV obtained by the conventional method is smaller under the same charge amount.
The present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
Drawings
Fig. 1 is a schematic circuit diagram of an embodiment of an OCV electric quantity calculation method with self-learning and self-calibration functions according to the present invention.
Fig. 2 is a flow chart of a method implemented in an embodiment of the OCV electrical quantity calculation system with self-learning and self-calibration functions according to the present invention.
Fig. 3 is a flow chart of charge self calibration in an embodiment of an OCV charge calculation method with self-learning and self-calibration functions according to the present invention.
Fig. 4 is a flow chart about discharge self-calibration in an embodiment of the OCV electric quantity calculation method with self-learning and self-calibration functions of the present invention.
Fig. 5 is a flow chart of a calculation model for charging in an embodiment of the OCV charge calculation system with self-learning and self-calibration functions according to the present invention.
Fig. 6 is a flow chart of a discharge calculation model in an embodiment of the OCV charge calculation system with self-learning and self-calibration functions according to the present invention.
Fig. 7 is a flow chart of a calculation model for charge-to-discharge in an embodiment of the OCV charge calculation system with self-learning and self-calibration functions according to the present invention.
Fig. 8 is a flow chart of a calculation model for charging to discharging in an embodiment of the OCV capacity calculation system with self-learning and self-calibration functions according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1 and fig. 2, the present invention provides an OCV electric quantity calculation method with self-learning and self-calibration functions, which is applied to the OCV electric quantity calculation system with self-learning and self-calibration functions, and the system includes a charging calculation model, a charging-to-discharging calculation model, a discharging calculation model, and a discharging-to-charging calculation model, and the method includes the following steps:
step S1, the system starts to operate, when the electric quantity is 0 and the system is charged, the system starts to enter a charging self-calibration mode, the battery voltage and the battery current during charging are collected every other period T, the OCV voltage during charging is determined to be VBAT _ OCV _ TMP, the data of the OCV voltage VBAT _ OCV _ TMP is stored into an array CHARGE _ CAP _ TMP [ N ] every other period T, and the data of the battery current IBAT is stored into an array CHARGE _ IBAT _ TMP [ N ];
step S2, judging whether the electric quantity is 100, if so, obtaining the total charging time T1 and the charging time T2 of each electric quantity by counting the accumulated N value of the CHARGE _ CAP _ TMP [ N ], obtaining an updated electric quantity-voltmeter CHARGE _ CAP _ TMP [ N ], and updating the value of the table to a preset CHARGE-electric quantity-voltmeter CHARGE _ CAP [ N ] [ M ];
step S3, when the electric quantity is 100 and the battery is discharged, starting to enter a discharge self-calibration mode, collecting the battery voltage and the battery current during charging every period T, determining that the OCV voltage during charging is VBAT _ OCV _ TMP, storing data of the OCV voltage VBAT _ OCV _ TMP into a data group BOOST _ CAP _ TMP [ N ] every period T, and storing data of the battery current into a data group BOOST _ IBAT _ TMP [ N ];
step S4, starting discharging until the electric quantity is reduced to 0, obtaining total discharging time T3 and discharging time T4 of each electric quantity by counting the N value of the accumulated BOOST _ CAP _ TMP [ N ], obtaining an updated electric quantity-voltmeter BOOST _ CAP _ TMP [ N ], and updating the value of the table to a preset discharging-electric quantity-voltmeter BOOST _ CAP [ N ] [ M ];
s5, obtaining the average battery current of each charging self-calibration or discharging self-calibration according to CHARGE _ IBAT _ TMP [ N ] and BOOST _ IBAT _ TMP [ N ], thereby completing the charging self-learning process and the discharging self-learning process and determining the M value of the electric quantity-voltmeter;
and S6, the system determines the M values in the CHARGE _ CAP [ N ] [ M ] and BOOST _ CAP [ N ] [ M ] tables according to the CHARGE _ CAP [ N ] [ M ] and BOOST _ CAP [ N ] [ M ] tables obtained by self-calibration and self-learning, wherein the charging electric quantity is 0 or the discharging electric quantity is 100 each time, and the M values are determined according to the battery current of the system at the time and the battery current which is closest to the CHARGE _ CAP _ NUMBER [ M ] and the BOOST _ CAP _ NUMBER [ M ] tables, so that which table is adopted for calculating the battery electric quantity is determined.
In the CHARGE-voltage meter CHARGE _ CAP [ N ] [ M ] two-dimensional array, the M value represents self-learning information, corresponds to the M value in CHARGE _ CAP _ NUMBER [ M ], and the N value corresponds to the N value in CHARGE _ CAP _ TMP [ N ], that is, when updating the table, it can be known that the self-calibration is self-calibrated under the condition of average battery current, when the system operates, according to the battery average current when the CHARGE capacity is equal to 0, the system firstly checks the battery current which is closest to the CHARGE _ CAP _ NUMBER [ M ] at the moment, records the M value in CHARGE _ CAP _ NUMBER [ M ] at the moment, and the M value is the CHARGE-voltage meter which is used.
In the two-dimensional array of the discharge-charge-voltage meter BOOST _ CAP [ N ] [ M ], the M value represents self-learning information, corresponds to the N value in the BOOST _ CAP _ NUMBER [ N ], and corresponds to the N value in the BOOST _ CAP _ TMP [ N ], that is, when updating the table, it can be known that the self-calibration is self-calibrated under the condition of average battery current, when the system operates, according to the battery average current when the discharge charge is equal to 100, the system firstly checks the average battery current in the BOOST _ CAP _ NUMBER [ N ] closest to the current time, records the M value in the BOOST _ CAP _ NUMBER [ M ] at the current time, and the M value is to determine which discharge-charge-voltage meter to adopt.
After the charging self-calibration is completed, obtaining the average battery current IBAT _ AVE of the charging self-calibration through an array CHARGE _ IBAT _ TMP [ N ], and expressing the average battery current IBAT _ AVE as the formula (11):
IBAT_AVE=(CHARGE_IBAT_TMP[1]+...+CHARGE_IBAT_TMP[N])/N (1)
if this time is the first charging self-calibration, starting to store the value into the array CHARGE _ CAP _ NUMBER [ M ], then there is formula (12):
CHARGE_CAP_NUMBER[1]=IBAT_AVE (12)
if the charging self-calibration is performed for the second time, and the difference between the average battery current IBAT _ AVE of the second time and the average battery current IBAT _ AVE of the first time is out of the error range, the charging self-calibration is considered to be different from the previous self-calibration data, and the data of the charging self-calibration is recorded to be valid, so that the formula (13) is provided:
CHARGE_CAP_NUMBER[2]=IBAT_AVE (13)
if the difference between the second average battery current IBAT _ AVE and the first average battery current IBAT _ AVE is not outside the error range, the data in the array CHARGE _ CAP _ NUMBER [ M ] which is closest to the second average battery current IBAT _ AVE is covered.
After the discharge self-calibration is completed, obtaining the average battery current IBAT _ AVE of the discharge self-calibration through an array BOOST _ IBAT _ TMP [ N ], which is expressed as a formula (21):
IBAT_AVE=(BOOST_IBAT_TMP[1]+...+BOOST_IBAT_TMP[N])/N (21)
if this time is the first discharge self-calibration, starting to store the value into the array BOOST _ CAP _ NUMBER [ M ], then there is formula (22):
BOOST_CAP_NUMBER[1]=IBAT_AVE (22)
if the discharging self-calibration is performed for the second time, and the difference between the average battery current IBAT _ AVE of the second time and the average battery current IBAT _ AVE of the first time is out of the error range, the discharging self-calibration is considered to be different from the previous self-calibration data, and the data of the discharging self-calibration is recorded to be valid, so that the formula (23) is provided:
BOOST_CAP_NUMBER[2]=IBAT_AVE (23)
if the difference between the second average battery current IBAT _ AVE and the first average battery current IBAT _ AVE is not outside the error range, the data in the array BOOST _ CAP _ NUMBER [ M ] which is closest to the second average battery current IBAT _ AVE is covered.
If the CHARGE _ CAP _ NUMBER [ M ] or the BOOST _ CAP _ NUMBER [ M ] has more than two data, the CHARGE _ CAP _ NUMBER [ M ] or the BOOST _ CAP _ NUMBER [ M ] needs to be sorted, that is, the values in the CHARGE _ CAP _ NUMBER [ M ] or the BOOST _ CAP _ NUMBER [ M ] are sorted from small to large.
In this embodiment, the system respectively calculates the increase or decrease of the electric quantity during charging and discharging according to the electric quantity-voltmeter CHARGE _ CAP [ N ] [ M ] and BOOST _ CAP [ N ] [ M ], self-calibrates the data corresponding to the N value in the decision table, and self-learns the M value in the decision table; the self-calibration means that a charging or discharging cycle curve is recorded completely each time, the battery current and the battery voltage in the whole cycle are collected in real time, the total charging and discharging time is obtained, 100 parts are divided equally, the battery voltage corresponding to each part of time is obtained, the electric quantity of the system is calculated according to the battery voltage, and the electric quantity corresponds to the data corresponding to the N value in the table; the self-learning means that: after each self-calibration, it is recorded at how much battery current this is self-calibrated, corresponding to the value of M in the table.
In this embodiment, the charge calculation model is used to:
the battery voltage VBAT and the battery current IBAT are sampled every period T, and assuming that the present charge amount is CAP, the OCV voltage VBAT _ OCV _ TMP at the time of charging is expressed as formula (1):
VBAT_OCV_TMP=VBAT- IBAT* R_charge[M] (1)
the comparison value VBAT _ OCV is set, expressed as equation (2):
VBAT_OCV=CHARGE_CAP[T2*(CAP+1)][M] (2)
VBAT _ OCV is the compensated battery voltage, VBAT is the collected battery voltage, IBAT is the collected battery current, and R _ charge is the internal resistance during charging;
when charging continues until VBAT _ OCV _ TMP is greater than VBAT _ OCV, the charge is increased by 1 and the next comparison value is updated.
Specifically, as shown in fig. 5, the charging calculation model is used to perform:
sampling the battery voltage VBAT and the battery current IBAT once every period T, assuming that the current electric quantity is CAP, then VBAT _ OCV _ TMP is formula (1), the value to be compared is VBAT _ OCV, if the self-learning function exists, then finding the value which is closest to IBAT in CHARGE _ CAP _ NUMBER [ M ] according to the current battery current IBAT, and then obtaining the M value in CHARGE _ CAP _ NUMBER [ M ], then obtaining formula (2):
VBAT_OCV=CHARGE_CAP[T2*(CAP+1)][M] (2)
the reason why the charge amount in the above equation is increased by 1 is that the next charge amount is compared, and the battery voltage is only increased during charging, so that when charging is continued until VBAT _ OCV _ TMP is greater than VBAT _ OCV, the charge amount is increased by 1, and the next comparison value is updated.
In this embodiment, the charge-to-discharge calculation model is used to:
when the charging is converted into the discharging, the processing enters a charging-discharging calculation model, and the processing comprises the following steps:
if the discharge light load state is kept all the time, the system enters a standby state after a specified time, and the electric quantity is kept unchanged;
if the load is detected to be inserted for discharging at the moment, the decrement of the electric quantity is carried out according to the BOOST _ CAP [ N ] [ M ], and the method comprises the following steps:
assuming that the current capacity is CAP, the current OCV voltage is VBAT _ OCV _ TMP, expressed as formula (3):
VBAT_OCV_TMP=VBAT+ IBAT* R_boost[M] (3)
wherein, R _ boost is the internal resistance during charging;
the comparison value VBAT _ OCV is set, expressed as equation (4):
VBAT_OCV=BOOST_CAP[T4*(CAP-1)][M] (4)
if VBAT _ OCV _ TMP is less than VBAT _ OCV, after every period T5, the power is reduced by 1, and whether VBAT _ OCV _ TMP is less than VBAT _ OCV is continuously judged: if VBAT _ OCV _ TMP is larger than VBAT _ OCV, entering a discharging calculation model;
if VBAT _ OCV _ TMP is larger than VBAT _ OCV, the discharge calculation model is directly entered.
Specifically, as shown in fig. 6, the charge-to-discharge calculation model is used to perform:
when charging is changed into discharging, the method enters into a charging-discharging calculation model for processing, and the processing is divided into a plurality of cases corresponding to different processing:
1. if the discharging light load state is kept all the time, the system enters a standby state after a period of time, so that the electric quantity is kept unchanged;
2. if the load is inserted for discharging at this time, the decrement of the electric quantity is carried out according to the BOOST _ CAP [ N ] [ M ], but different treatment needs to be carried out in several cases:
assuming that the current capacity is CAP, the current OCV voltage is VBAT _ OCV _ TMP, and the sampled battery voltage VBAT and battery current IBAT are expressed as formula (3):
VBAT_OCV_TMP=VBAT+ IBAT* R_boost[M] (3)
the VBAT _ OCV value to be compared is given by equation (4):
VBAT_OCV=BOOST_CAP[T4*(CAP-1)][M] (4)
the power is reduced by 1 because the value of the next power is compared.
Firstly, the method comprises the following steps: if VBAT _ OCV _ TMP is less than VBAT _ OCV, after interval T5, the charge is decremented by 1, after which it continues to be determined: if VBAT _ OCV _ TMP is smaller than VBAT _ OCV, after the interval period T5, the electric quantity continues to be reduced by 1, if VBAT _ OCV _ TMP is larger than VBAT _ OCV, the electric quantity enters a discharge calculation model, and the electric quantity can be smoothly transited through the process;
II, secondly: if VBAT _ OCV _ TMP is greater than VBAT _ OCV, the discharge calculation model is entered.
In this embodiment, the discharge calculation model is used to:
the battery voltage VBAT and the battery current IBAT are sampled every period T, and assuming that the present charge amount is CAP, the OCV voltage VBAT _ OCV _ TMP at the time of discharge is expressed as formula (3):
VBAT_OCV_TMP=VBAT+ IBAT* R_boost[M] (3)
the comparison value VBAT _ OCV is set, expressed as equation (4):
VBAT_OCV=BOOST_CAP[T4*(CAP-1)][M] (4)
when discharging continues until VBAT _ OCV _ TMP is less than VBAT _ OCV, the charge is decremented by 1 and the next comparison value is updated.
Specifically, as shown in fig. 7, the discharge calculation model is used to perform:
the battery voltage VBAT and the battery current IBAT are sampled once every period T, and if the current capacity is CAP, VBAT _ OCV _ TMP is formula (3):
VBAT_OCV_TMP=VBAT+IBAT*R_boost[M](3)
if the self-learning function exists, the value closest to IBAT in the BOOST _ CAP _ NUMBER [ N ] needs to be found according to the battery current IBAT at the moment, and then the M value in the BOOST _ CAP _ NUMBER [ M ] closest to the IBAT value is determined, so that the VBAT _ OCV value needing to be compared is the formula (4):
VBAT_OCV=BOOST_CAP[T4*(CAP-1)][M] (4)
the power of the above equation is decreased by 1 because the next power value is compared, and the battery voltage is only decreased during discharging, so when discharging is continued until VBAT _ OCV _ TMP is less than VBAT _ OCV, the power is decreased by 1, and the next comparison value is updated.
In this embodiment, the discharge-to-charge calculation model is used to:
when the discharge is converted into the charge, the discharge-to-charge calculation model processing is carried out, and the processing comprises the following steps:
assuming that the current capacity is CAP, the current OCV voltage is VBAT _ OCV _ TMP, expressed as formula (1):
VBAT_OCV_TMP=VBAT- IBAT* R_charge[M] (1)
the comparison value VBAT _ OCV is set, expressed as equation (2):
VBAT_OCV=CHARGE_CAP[T2*(CAP+1)][M] (2)
if VBAT _ OCV _ TMP is greater than VBAT _ OCV, after every period T6, the power is increased by 1, and the power CAP is updated, and it is continuously determined whether VBAT _ OCV _ TMP is greater than VBAT _ OCV: if the VBAT _ OCV _ TMP is smaller than the VBAT _ OCV, entering a charging calculation model;
if VBAT _ OCV _ TMP is smaller than VBAT _ OCV, the charging calculation model is directly entered.
Specifically, as shown in fig. 8, the discharge-to-charge calculation model is used to perform:
when the discharge is converted into the charge, the discharge-to-charge calculation model processing is carried out, and the processing is carried out according to different conditions:
every period T, the battery voltage VBAT and the battery current IBAT are sampled, and if the current electric quantity is CAP, VBAT _ OCV _ TMP is formula (1):
VBAT_OCV_TMP=VBAT- IBAT* R_charge[M] (1)
the VBAT _ OCV value to be compared is given by equation (2):
VBAT_OCV=CHARGE_CAP[T2*(CAP+1)][M] (2)
firstly, the following steps: if VBAT _ OCV _ TMP is greater than VBAT _ OCV, after interval T6, the power is increased by 1, the power CAP is updated, and then the determination continues: if VBAT _ OCV _ TMP is greater than VBAT _ OCV, after an interval period T6, the electric quantity continues to be added by 1, if VBAT _ OCV _ TMP is less than VBAT _ OCV, a charging calculation model is entered, and the electric quantity can be smoothly transited through the processing;
II, secondly: if VBAT _ OCV _ TMP is less than VBAT _ OCV, then the charge calculation model is entered directly.
In this embodiment, the method further performs: obtaining internal resistance compensation values under different currents according to actual measurement, and calling according to different battery currents when calling is needed, wherein the internal resistance compensation values comprise:
assuming that the BAT terminal voltage of the board is VBAT1 and the real cell terminal voltage is VBAT2, the internal resistance of the charging current I is formula (5):
R_charge=(VBAT2-VBAT1)/I (5)
assuming that the BAT terminal voltage VBAT1 and the real cell terminal voltage VBAT2 are present, the internal resistance of the discharge current I is formula (6):
R_boost=(VBAT1-VBAT2)/I (6)
according to the formulas (5) and (6), the internal resistance of the battery under different battery currents during charging and discharging can be calculated, the calculated values are put into internal resistance tables R _ charge [ M ] and R _ boost [ M ], and a waiting program calls the two tables according to different battery currents.
In this embodiment, the system calculates the electric quantity and is divided into four models: the system comprises a charging calculation model, a charging-to-discharging calculation model, a discharging calculation model and a discharging-to-charging calculation model. The charge-to-discharge calculation model and the discharge-to-charge calculation model are used for realizing smooth switching of electric quantity during charge-discharge switching, so that sudden change of electric quantity due to sudden change of voltage during charge-discharge switching is avoided. The charging calculation model and the discharging calculation model are independent in the used electric quantity-voltage meter, namely, CHARGE _ CAP [ N ] [ M ] and BOOST _ CAP [ N ] [ M ], so that the calculation of the electric quantity can be more accurate.
During the first battery power-on, the system calculates the increase or decrease of the electric quantity according to the initial preset CHARGE _ CAP [ N ] [ M ] and BOOST _ CAP [ N ] [ M ] tables. The system collects the battery voltage VBAT and the battery current IBAT every other period T, and calculates VBAT _ OCV _ TMP during charging and discharging according to the following two formulas:
VBAT_OCV_TMP=VBAT- IBAT* R_charge[M] (1)
VBAT_OCV_TMP=VBAT+ IBAT* R_boost[M] (3)
as shown in fig. 3, when the CHARGE level is 0 and charging is performed, charging self-calibration is started, VBAT _ OCV _ TMP is stored in the set of CHARGE _ CAP _ TMP [ N ] every period T until a charging self-calibration process is completed if the CHARGE level is equal to 100, and the self-calibration fails if there is a transition to a discharging state. When the charging self-calibration is completed, the value of CHARGE _ CAP _ TMP [ N ] is updated into CHARGE _ CAP [ N ] [ M ]. In the CHARGE-voltage meter CHARGE _ CAP [ N ] [ M ] two-dimensional array, the M value represents self-learning information, corresponds to the M value in CHARGE _ CAP _ NUMBER [ M ], and the N value corresponds to the N value in CHARGE _ CAP _ TMP [ N ], that is, when updating the table, it can be known that the self-calibration is self-calibrated under the condition of average battery current, when the system operates, according to the battery average current when the CHARGE capacity is equal to 0, the system firstly checks the battery current which is closest to the CHARGE _ CAP _ NUMBER [ M ] at the moment, records the M value in CHARGE _ CAP _ NUMBER [ M ], and the M value is to determine which CHARGE-voltage meter to adopt.
As shown in fig. 4, when the charge is 100 and discharging is performed, discharging self-calibration is started, VBAT _ OCV _ TMP is stored in the plurality of sets of BOOST _ CAP _ TMP [ N ] every period T, until when the charge is equal to 0, a discharging self-calibration process is completed, and if there is a transition to a charging state, the self-calibration fails. When the discharge self-calibration is completed, the value of BOOST _ CAP _ TMP [ N ] is updated into BOOST _ CAP [ N ] [ M ]. Wherein. In the two-dimensional array of the discharge-charge-voltage meter BOOST _ CAP [ N ] [ M ], M represents self-learning information, corresponds to N in BOOST _ CAP _ NUMBER [ N ], and corresponds to N in BOOST _ CAP _ TMP [ N ], that is, the self-calibration can be known in the condition of average battery current when updating the table, the system can firstly check the average battery current closest to the time in the BOOST _ CAP _ NUMBER [ N ] according to the battery average current when the discharge charge is equal to 100, record the M in the BOOST _ CAP _ NUMBER [ M ] at the time, and the M is the discharge-charge-voltage meter which is used.
Of course, considering that the variation trend of the OCV will be different under different charging currents and discharging currents, this embodiment adds a self-learning process, after each calibration is completed, it learns that this is self-calibrated under that battery current charging and discharging, and when the calculation model calculates the electric quantity, according to the principle of the closest battery current, calls the table closest to the actual current in the self-calibrated and self-learned CHARGE _ CAP [ N ] [ M ] and BOOST _ CAP [ N ] [ M ] tables to calculate the electric quantity.
In the present embodiment, when the OCV voltage is calculated and specified, the battery voltage abruptly changes in several cases:
1. when the load is overloaded during discharging, the load is suddenly removed, and the voltage of the battery is raised;
2. when the load is suddenly increased under light load during discharging, the voltage of the battery is reduced;
3. during charging, the voltage of the battery is increased along with the increase of the charging current;
4. during charging, when the charging is suddenly removed, the battery voltage is pulled down.
If the VBAT voltage at the board terminal is directly used to calculate the power, it is obvious that under the above-mentioned several conditions, the power fluctuates back and forth, which is an unreasonable way to calculate the power.
Based on the above situation, it is reasonable to calculate the electric quantity by using the OCV, which is the compensated battery voltage, and a rule needs to be added:
during charging, the electric quantity is only increased, and VBAT _ OCV is also only increased;
during discharging, the electric quantity is only reduced, and VBAT _ OCV is also only reduced;
there are two basic formulas for OCV calculation:
during charging: VBAT _ OCV = VBAT-IBAT R _ charge
During discharging: VBAT _ OCV = VBAT + IBAT R _ boost
VBAT _ OCV is the compensated battery voltage, which is used to calculate the electric quantity by looking up a table, VBAT is the collected battery voltage, IBAT is the collected battery current, R _ charge is the internal resistance during charging, and R _ boost is the internal resistance during charging.
In this embodiment, when the charge and discharge internal resistance table is calculated, since the two internal resistance values of R _ charge and R _ boost change according to the change of the battery current, internal resistance compensation values under different currents need to be obtained according to actual measurement, and when the internal resistance compensation values need to be called, the internal resistance compensation values are called according to different battery currents.
Assuming that the panel BAT terminal voltage VBAT1 and the real cell terminal voltage VBAT2 are present, the internal resistance of the charging current I is formula (5):
R_charge=(VBAT2-VBAT1)/I (5)
similarly, assuming that the BAT terminal voltage VBAT1 and the real cell terminal voltage VBAT2 are present, the internal resistance of the discharge current I is formula (6):
R_boost=(VBAT1-VBAT2)/I (6)
according to the above two formulas, the internal resistances of the battery under different battery currents during charging and discharging can be calculated, the values are put into internal resistance tables R _ charge [ M ] and R _ boost [ M ], and a waiting program calls the two tables according to different battery currents.
Specifically, the charge-discharge self-calibration process provided by this embodiment includes:
step 1: the system is powered on for the first time, the increase or decrease of the electric quantity is calculated according to the initial electric quantity-voltmeter, and when the system is discharged for the first time until the electric quantity is 0 and the system is turned off, the charging self-calibration is started;
step 2: the CHARGE starts from 0, VBAT _ OCV _ TMP is recorded every period T, and VBAT _ OCV _ TMP is recorded as a value in the array CHARGE _ CAP _ TMP [ N ], and the battery current IBAT is recorded as a value in the array CHARGE _ IBAT _ TMP [ N ], expressed as formula (1):
VBAT_OCV_TMP=VBAT- IBAT* R_charge[M] (1)
and 3, step 3: starting charging until the CHARGE amount is added to 100, counting the accumulated CHARGE _ CAP _ TMP [ N ] value, and obtaining the total charging time T1 by the N value: t1= N × T;
then, the total charging time T is averaged to 100 electric quantities, and there is a charging time T2 for each electric quantity 1: t2= T1/100;
then the new OCV voltage relationship corresponding to 1% of electricity after mathematical averaging has: VBAT _ OCV = CHARGE _ CAP _ TMP [ T2];
then the new OCV voltage relationship corresponding to the 2% power after the mathematical average is: VBAT _ OCV = CHARGE _ CAP _ TMP [ T2 × 2];
then the new OCV voltage relationship corresponding to the mathematically averaged electrical quantity CAP has: VBAT _ OCV = CHARGE _ CAP _ TMP [ T2 × CAP ]
From the above formula, a new CHARGE-voltage table CHARGE _ CAP _ TMP [ N ] is obtained, and after the charging self-calibration is completed, the value of this table CHARGE _ CAP _ TMP [ N ] is updated into CHARGE _ CAP [ N ] [ M ], and this M looks at the M value in CHARGE _ CAP _ NUMBER [ M ].
And 4, step 4: the method comprises the steps that electric quantity is discharged from 100, discharging self-calibration is started, VBAT _ OCV _ TMP is recorded once every period T, VBAT _ OCV _ TMP is recorded in an array BOOST _ CAP _ TMP [ N ] as a numerical value, and battery current IBAT is recorded in an array BOOST _ IBAT _ TMP [ N ] as a numerical value;
and 5: starting discharging until the power is reduced to 0, counting the accumulated BOOST _ CAP _ TMP [ N ] value, and obtaining the total discharging time T3 by the N value: t3= N × T; then, for a total discharge time T3, averaged over 100 electrical quantities, there is a discharge time T4 for each electrical quantity 1: t4= T/100;
then the new OCV voltage relationship corresponding to 1% of electricity after mathematical averaging has: VBAT _ OCV = BOOST _ CAP _ TMP [ T4];
then the new OCV voltage relationship corresponding to the 2% power after the mathematical average is: VBAT _ OCV = BOOST _ CAP _ TMP [ T4 × 2];
then the new OCV voltage relationship corresponding to the mathematically averaged electrical quantity CAP has: VBAT _ OCV = BOOST _ CAP _ TMP [ T4 × CAP ];
from the above formula, a new discharge capacity-voltmeter BOOST _ CAP _ TMP [ N ] is obtained, and after the discharge self-calibration is completed, the value of the table BOOST _ CAP _ TMP [ N ] is updated into BOOST _ CAP [ N ] [ M ], and the M looks at the M value in the BOOST _ CAP _ NUMBER [ M ].
Step 6: the step 2-3 is completed by charging self-calibration, the step 4-5 is completed by discharging self-calibration, and the charging self-calibration and the discharging self-calibration are complete and integrated, the battery is worn after long-term use, but the capacity of the battery can be calibrated only after one charging and discharging self-calibration each time, so that the charging and discharging display is uniform.
The OCV may vary differently in consideration of the battery under different charging and discharging currents. When the space resource is enough, if the electric quantity calculation is more accurate, the embodiment adds a self-learning process.
For example, in the discharge of the output constant currents 3A and 5A, the variation tendency of the OCV is certainly different;
for another example, when different powers are input, the variation trend of the OCV is definitely different;
therefore, a self-learning process is added, and after charging self-calibration and discharging self-calibration are completed each time, the self-calibration is recorded under the condition of charging or discharging how much battery current is obtained.
In this embodiment, after the charging self-calibration is completed, the average battery current IBAT _ AVE of this charging self-calibration can be obtained through CHARGE _ IBAT _ TMP [ N ]:
IBAT_AVE=(CHARGE_IBAT_TMP[1]+...+CHARGE_IBAT_TMP[N])/N。
if the charging self-calibration is the first time, the value is stored to CHARGE _ CAP _ NUMBER [ M ], then: CHARGE _ CAP _ NUMBER [1] = IBAT _ AVE.
If the self-calibration is the second time of charging, and the difference between the IBAT _ AVE of the second time and the IBAT _ AVE of the first time is more than OFFSET (MA), the self-calibration data of the second time and the last self-calibration data are considered to be different, the second time data are recorded to be valid, and the following steps are carried out: CHARGE _ CAP _ NUMBER [2] = IBAT _ AVE.
Otherwise, the group of data closest to this IBAT _ AVE in CHARGE _ CAP _ NUMBER [ M ] is overwritten, in order to ensure that the self-calibrated data is up-to-date.
If the CHARGE _ CAP _ NUMBER [ M ] has more than two data, the CHARGE _ CAP _ NUMBER [ M ] needs to be sorted, and the values in the CHARGE _ CAP _ NUMBER [ M ] are sorted from small to large.
After the discharge self-calibration is completed, the average battery current IBAT _ AVE of the discharge self-calibration can be obtained through BOOST _ IBAT _ TMP [ N ]:
IBAT_AVE=(BOOST_IBAT_TMP[1]+...+BOOST_IBAT_TMP[N])/N。
if it is the first discharge self-calibration, starting to store the value into the BOOST _ CAP _ NUMBER [ M ], then there are: BOOST _ CAP _ NUMBER [1] = IBAT _ AVE.
If the self-calibration is the second discharge self-calibration, and the difference between the IBAT _ AVE of the second time and the IBAT _ AVE of the first time is more than OFFSET (MA), the self-calibration data of the second time is considered to be different from the data of the last self-calibration, the data of the second time is recorded to be valid, and BOOST _ CAP _ NUMBER [2] = IBAT _ AVE exists.
Otherwise, the set of data closest to this IBAT _ AVE in BOOST _ CAP _ NUMBER [ M ] is overwritten, in order to ensure that the self-calibrated data is up-to-date.
If the BOOST _ CAP _ NUMBER [ M ] has more than two data, then the BOOST _ CAP _ NUMBER [ M ] needs to be sorted from small to large.
Therefore, the invention discloses a method with the functions of self-learning and self-calibration, OCV double-check electric quantity-voltmeter and voltage abrupt change smooth change and the like, and the method is applied to a system with the functions of self-learning and self-calibration for calculating the electric quantity by the OCV. The system is divided into four models for calculating the electric quantity: the system comprises a charging calculation model, a charging-to-discharging calculation model, a discharging calculation model and a discharging-to-charging calculation model. The charging-discharging calculation model and the discharging-charging calculation model are used for realizing smooth switching of electric quantity during charging and discharging switching, and avoiding the situation that the electric quantity is suddenly changed due to sudden change of voltage during charging and discharging switching; the charging calculation model and the discharging calculation model are independent in the used electric quantity-voltage meter, namely CHARGE _ CAP [ N ] [ M ] and BOOST _ CAP [ N ] [ M ], so that the calculation of the electric quantity can be more accurate.
Therefore, the method is simple and feasible, has high speed and high OCV electric quantity calculation efficiency, and can effectively save time cost and equipment use cost; the method has high calculation accuracy, and the error between the OCV obtained by the method and the OCV obtained by the conventional method is smaller under the same charge amount.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above embodiments are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited thereby, and any insubstantial changes and substitutions made by those skilled in the art based on the present invention are within the protection scope of the present invention.

Claims (12)

1. The OCV electric quantity calculation method with the self-learning and self-calibration functions is characterized by being applied to an OCV electric quantity calculation system with the self-learning and self-calibration functions, the system comprises a charging calculation model, a charging-to-discharging calculation model, a discharging calculation model and a discharging-to-charging calculation model, and the method comprises the following steps:
the method comprises the following steps that a system starts to operate, when the system is charged, the system starts to enter a charging self-calibration mode, battery voltage and battery current during charging are collected every period T, the OCV voltage during charging is determined to be VBAT _ OCV _ TMP, data of the OCV voltage VBAT _ OCV _ TMP are stored into an array CHARGE _ CAP _ TMP [ N ] every period T, and data of the battery current are stored into an array CHARGE _ IBAT _ TMP [ N ];
judging whether the electric quantity is 100, if so, obtaining total charging time T1 and charging time T2 of each electric quantity by counting accumulated N values of CHARGE _ CAP _ TMP [ N ], obtaining an updated CHARGE-voltage meter CHARGE _ CAP _ TMP [ N ], and updating the value of the table to a preset CHARGE-voltage meter CHARGE _ CAP [ N ] [ M ];
when the system discharges, starting to enter a discharge self-calibration mode;
after charging self-calibration and discharging self-calibration are completed each time, the average battery current of each charging self-calibration and the average battery current of each discharging self-calibration are obtained, and a charging self-learning process and a discharging self-learning process are completed.
2. The method of claim 1, wherein:
when the charge is 0 and charging is performed, the charging self-calibration mode is started.
3. The method according to claim 1 or 2, characterized in that:
when the power is 100 and is discharged, the discharge self-calibration mode is started.
4. The method of claim 3, wherein:
after entering a discharge self-calibration mode, recording an OCV voltage VBAT _ OCV _ TMP during discharge once every period T, storing data of the OCV voltage VBAT _ OCV _ TMP into a plurality of groups of BOOST _ CAP _ TMP [ N ], and recording data of battery current into a plurality of groups of BOOST _ IBAT _ TMP [ N ];
and starting discharging until the electric quantity is reduced to 0, obtaining the total discharging time T3 and the discharging time T4 of each electric quantity by counting the N value of the accumulated BOOST _ CAP _ TMP [ N ], obtaining an updated electric quantity-voltmeter BOOST _ CAP _ TMP [ N ], and updating the value of the table into a preset discharging-electric quantity-voltmeter BOOST _ CAP [ N ] [ M ].
5. The method of claim 3, wherein:
after the charging self-calibration is completed, obtaining the average battery current IBAT _ AVE of the charging self-calibration through an array CHARGE _ IBAT _ TMP [ N ], and expressing the average battery current IBAT _ AVE as the formula (11):
IBAT_AVE=(CHARGE_IBAT_TMP[1]+...+CHARGE_IBAT_TMP[N])/N(11)
if this time is the first charging self-calibration, starting to store the value into the array CHARGE _ CAP _ NUMBER [ M ], then there is formula (12):
CHARGE_CAP_NUMBER[1]=IBAT_AVE (12)
if the charging self-calibration is performed for the second time, and the difference between the average battery current IBAT _ AVE of the second time and the average battery current IBAT _ AVE of the first time is out of the error range, the charging self-calibration is considered to be different from the previous self-calibration data, and the data of the charging self-calibration is recorded to be valid, so that the formula (13) is provided:
CHARGE_CAP_NUMBER[2]=IBAT_AVE (13)
if the difference between the second average battery current IBAT _ AVE and the first average battery current IBAT _ AVE is not outside the error range, the data in the array CHARGE _ CAP _ NUMBER [ M ] which is closest to the second average battery current IBAT _ AVE is covered.
6. The method of claim 5, wherein:
after the discharge self-calibration is completed, obtaining the average battery current IBAT _ AVE of the discharge self-calibration through an array BOOST _ IBAT _ TMP [ N ], which is expressed as a formula (21):
IBAT_AVE=(BOOST_IBAT_TMP[1]+...+BOOST_IBAT_TMP[N])/N (21)
if this time is the first discharge self-calibration, starting to store the value into the array BOOST _ CAP _ NUMBER [ M ], then there is formula (22):
BOOST_CAP_NUMBER[1]=IBAT_AVE (22)
if the discharging self-calibration is performed for the second time, and the difference between the average battery current IBAT _ AVE of the second time and the average battery current IBAT _ AVE of the first time is out of the error range, the discharging self-calibration is considered to be different from the previous self-calibration data, the discharging self-calibration data is recorded to be valid, and the formula (23) is provided
BOOST_CAP_NUMBER[2]=IBAT_AVE (23)
If the difference between the second average battery current IBAT _ AVE and the first average battery current IBAT _ AVE is not outside the error range, the data in the array BOOST _ CAP _ NUMBER [ M ] which is closest to the second average battery current IBAT _ AVE is covered.
7. The method of claim 6, wherein:
if the CHARGE _ CAP _ NUMBER [ M ] or the BOOST _ CAP _ NUMBER [ M ] has more than two data, the CHARGE _ CAP _ NUMBER [ M ] or the BOOST _ CAP _ NUMBER [ M ] needs to be sorted, that is, the values in the CHARGE _ CAP _ NUMBER [ M ] or the BOOST _ CAP _ NUMBER [ M ] are sorted from small to large.
8. The method of claim 3, wherein:
the charge calculation model is to:
the battery voltage VBAT and the battery current IBAT are sampled every period T, and assuming that the present charge amount is CAP, the OCV voltage VBAT _ OCV _ TMP at the time of charging is expressed as formula (1):
VBAT_OCV_TMP=VBAT-IBAT*R_charge[M] (1)
the comparison value VBAT _ OCV is set, expressed as equation (2):
VBAT_OCV=CHARGE_CAP[T2*(CAP+1)][M] (2)
wherein VBAT _ OCV is the compensated battery voltage, VBAT is the collected battery voltage, IBAT is the collected battery current, and R _ charge is the internal resistance during charging;
when charging continues until VBAT _ OCV _ TMP is greater than VBAT _ OCV, the charge is increased by 1 and the next comparison value is updated.
9. The method of claim 8, wherein:
the charge-to-discharge calculation model is used for:
when charging is converted into discharging, entering the processing of a charging-discharging calculation model, comprising the following steps:
if the discharging light load state is kept all the time, the system enters a standby state after a specified time, and the electric quantity is kept unchanged;
if the load is detected to be inserted for discharging at the moment, the decrement of the electric quantity is carried out according to the BOOST _ CAP [ N ] [ M ], and the method comprises the following steps:
assuming that the current capacity is CAP, the current OCV voltage is VBAT _ OCV _ TMP, expressed as formula (3):
VBAT_OCV_TMP=VBAT+IBAT*R_boost[M] (3)
wherein, R _ boost is the internal resistance during charging;
the comparison value VBAT _ OCV is set, expressed as equation (4):
VBAT_OCV=BOOST_CAP[T4*(CAP-1)][M] (4)
if VBAT _ OCV _ TMP is less than VBAT _ OCV, after every period T5, the power is reduced by 1, and whether VBAT _ OCV _ TMP is less than VBAT _ OCV is continuously judged: if the VBAT _ OCV _ TMP is larger than the VBAT _ OCV, entering a discharging calculation model;
if VBAT _ OCV _ TMP is greater than VBAT _ OCV, then the discharge calculation model is entered directly.
10. The method of claim 9, wherein:
the discharge calculation model is used for:
the battery voltage VBAT and the battery current IBAT are sampled every period T, and assuming that the present charge amount is CAP, the OCV voltage VBAT _ OCV _ TMP at the time of discharge is expressed as formula (3):
VBAT_OCV_TMP=VBAT+IBAT*R_boost[M] (3)
the comparison value VBAT _ OCV is set, expressed as equation (4):
VBAT_OCV=BOOST_CAP[T4*(CAP-1)][M] (4)
when discharging continues until VBAT _ OCV _ TMP is less than VBAT _ OCV, the charge is decremented by 1 and the next comparison value is updated.
11. The method of claim 10, wherein:
the discharge-to-charge calculation model is used for:
when the discharge is converted into the charge, the discharge-to-charge calculation model processing is carried out, and the processing comprises the following steps:
assuming that the current capacity is CAP, the current OCV voltage is VBAT _ OCV _ TMP, expressed as formula (1):
VBAT_OCV_TMP=VBAT-IBAT*R_charge[M] (1)
the comparison value VBAT _ OCV is set, expressed as equation (2):
VBAT_OCV=CHARGE_CAP[T2*(CAP+1)][M] (2)
if VBAT _ OCV _ TMP is greater than VBAT _ OCV, after every period T6, the power is increased by 1, and the power CAP is updated, and it is continuously determined whether VBAT _ OCV _ TMP is greater than VBAT _ OCV: if the VBAT _ OCV _ TMP is smaller than the VBAT _ OCV, entering a charging calculation model;
if VBAT _ OCV _ TMP is less than VBAT _ OCV, then the charging calculation model is entered directly.
12. The method of claim 8, further performing:
obtaining internal resistance compensation values under different currents according to actual measurement, and calling according to different battery currents when calling is needed, wherein the internal resistance compensation values comprise:
assuming that the BAT terminal voltage of the board is VBAT1 and the real cell terminal voltage is VBAT2, the internal resistance of the charging current I is formula (5):
R_charge=(VBAT2-VBAT1)/I (5)
assuming that the BAT terminal voltage VBAT1 and the real cell terminal voltage VBAT2 are present, the internal resistance of the discharge current I is formula (6):
R_boost=(VBAT1-VBAT2)/I (6)
according to the formulas (5) and (6), the internal resistance of the battery under different battery currents during charging and discharging can be calculated, the calculated values are put into internal resistance tables R _ charge [ M ] and R _ boost [ M ], and a waiting program calls the two tables according to different battery currents.
CN202211418491.2A 2022-11-14 2022-11-14 OCV electric quantity calculation method with self-learning and self-calibration functions Active CN115728641B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211418491.2A CN115728641B (en) 2022-11-14 2022-11-14 OCV electric quantity calculation method with self-learning and self-calibration functions

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211418491.2A CN115728641B (en) 2022-11-14 2022-11-14 OCV electric quantity calculation method with self-learning and self-calibration functions

Publications (2)

Publication Number Publication Date
CN115728641A true CN115728641A (en) 2023-03-03
CN115728641B CN115728641B (en) 2023-09-01

Family

ID=85295410

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211418491.2A Active CN115728641B (en) 2022-11-14 2022-11-14 OCV electric quantity calculation method with self-learning and self-calibration functions

Country Status (1)

Country Link
CN (1) CN115728641B (en)

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007282457A (en) * 2006-04-12 2007-10-25 Yamaha Motor Co Ltd Device for calculating battery residual capacity
JP2012058088A (en) * 2010-09-09 2012-03-22 Calsonic Kansei Corp Charge rate estimation apparatus for battery
CN103048629A (en) * 2013-01-24 2013-04-17 圣邦微电子(北京)股份有限公司 Method and device for metering lithium battery electric quantity
CN103792490A (en) * 2013-11-22 2014-05-14 广州视源电子科技股份有限公司 Method for measuring and calculating system battery electricity quantity
US20150032394A1 (en) * 2013-07-24 2015-01-29 Rohm Co., Ltd. Power management system
DE102014206112A1 (en) * 2014-04-01 2015-10-01 Robert Bosch Gmbh Method for monitoring a state of charge or a charging or discharging current of an accumulator
CN105589042A (en) * 2015-12-10 2016-05-18 希姆通信息技术(上海)有限公司 Calculation method for calculating residual electricity quantity of battery
EP3207388A1 (en) * 2014-10-17 2017-08-23 Jaguar Land Rover Limited Battery condition monitoring
CN109799461A (en) * 2019-01-29 2019-05-24 珠海迈科智能科技股份有限公司 A kind of measurement of battery dump energy and evaluation method
CN109884545A (en) * 2019-03-27 2019-06-14 奇瑞商用车(安徽)有限公司 A kind of SOC estimation method based on dynamic electric voltage calibration
CN111142028A (en) * 2020-02-20 2020-05-12 广东天波信息技术股份有限公司 Method and device for measuring electric quantity of lithium battery
CN111245241A (en) * 2020-03-26 2020-06-05 珠海英集芯半导体有限公司 Low-voltage high-noise-resistant BUCK-BOOST converter and conversion method thereof
CN111245242A (en) * 2020-03-26 2020-06-05 珠海英集芯半导体有限公司 Average current mode-based BUCK-BOOST converter and conversion method thereof
CN111426965A (en) * 2020-05-15 2020-07-17 深圳英集芯科技有限公司 Method for calculating electric quantity of battery
CN112782735A (en) * 2020-12-30 2021-05-11 大运汽车股份有限公司 Self-learning endurance mileage correction calculation method
WO2022183399A1 (en) * 2021-03-03 2022-09-09 深圳市大疆创新科技有限公司 Electric quantity display method, electronic device and storage medium
CN115248391A (en) * 2022-09-21 2022-10-28 深圳英集芯科技股份有限公司 Constant-voltage charging electric quantity calculation method and system and electronic equipment

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007282457A (en) * 2006-04-12 2007-10-25 Yamaha Motor Co Ltd Device for calculating battery residual capacity
JP2012058088A (en) * 2010-09-09 2012-03-22 Calsonic Kansei Corp Charge rate estimation apparatus for battery
CN103048629A (en) * 2013-01-24 2013-04-17 圣邦微电子(北京)股份有限公司 Method and device for metering lithium battery electric quantity
US20150032394A1 (en) * 2013-07-24 2015-01-29 Rohm Co., Ltd. Power management system
CN103792490A (en) * 2013-11-22 2014-05-14 广州视源电子科技股份有限公司 Method for measuring and calculating system battery electricity quantity
DE102014206112A1 (en) * 2014-04-01 2015-10-01 Robert Bosch Gmbh Method for monitoring a state of charge or a charging or discharging current of an accumulator
EP3207388A1 (en) * 2014-10-17 2017-08-23 Jaguar Land Rover Limited Battery condition monitoring
CN105589042A (en) * 2015-12-10 2016-05-18 希姆通信息技术(上海)有限公司 Calculation method for calculating residual electricity quantity of battery
CN109799461A (en) * 2019-01-29 2019-05-24 珠海迈科智能科技股份有限公司 A kind of measurement of battery dump energy and evaluation method
CN109884545A (en) * 2019-03-27 2019-06-14 奇瑞商用车(安徽)有限公司 A kind of SOC estimation method based on dynamic electric voltage calibration
CN111142028A (en) * 2020-02-20 2020-05-12 广东天波信息技术股份有限公司 Method and device for measuring electric quantity of lithium battery
CN111245241A (en) * 2020-03-26 2020-06-05 珠海英集芯半导体有限公司 Low-voltage high-noise-resistant BUCK-BOOST converter and conversion method thereof
CN111245242A (en) * 2020-03-26 2020-06-05 珠海英集芯半导体有限公司 Average current mode-based BUCK-BOOST converter and conversion method thereof
CN111426965A (en) * 2020-05-15 2020-07-17 深圳英集芯科技有限公司 Method for calculating electric quantity of battery
CN112782735A (en) * 2020-12-30 2021-05-11 大运汽车股份有限公司 Self-learning endurance mileage correction calculation method
WO2022183399A1 (en) * 2021-03-03 2022-09-09 深圳市大疆创新科技有限公司 Electric quantity display method, electronic device and storage medium
CN115248391A (en) * 2022-09-21 2022-10-28 深圳英集芯科技股份有限公司 Constant-voltage charging electric quantity calculation method and system and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李申飞: "电池电量精确测量方法的研究", 《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》, no. 05, pages 042 - 221 *

Also Published As

Publication number Publication date
CN115728641B (en) 2023-09-01

Similar Documents

Publication Publication Date Title
JP5605717B2 (en) Cell balance apparatus and method using voltage change behavior of battery cell
US6841972B2 (en) Method for resetting a state of charge of a battery of a hybrid electric vehicle
US7973534B2 (en) Protection device for assembled battery, and battery pack unit
JP5466564B2 (en) Battery degradation estimation method, battery capacity estimation method, battery capacity equalization method, and battery degradation estimation apparatus
KR101402802B1 (en) Apparatus and Method for cell balancing based on battery's voltage variation pattern
CN110061531B (en) Energy storage battery equalization method
KR101500547B1 (en) Apparatus and method for balancing of battery cell's charging capacity
CN103138026A (en) Battery pack control device
CN113311347B (en) Apparatus, method and system for estimating available state of charge of battery
CN111142032B (en) Method, device and equipment for determining battery electric quantity and storage medium
CN103217651A (en) Method and system for estimating charge state of storage battery
CN110729797A (en) Vehicle and battery pack balance control method, device and system thereof
CN116113837A (en) Method for estimating state of charge of battery
CN111537901B (en) Battery power state measuring and calculating method, battery pack and vehicle
CN116520162A (en) Correction method, system and storage medium for SOC of lithium iron phosphate battery
CN115754736A (en) SOC calibration method and device for charging and discharging tail ends of energy storage system
CN113075558B (en) Battery SOC estimation method, device and system
JP2003068369A (en) Detecting method of total capacity of secondary battery and detector of total capacity
CN112433156A (en) SOC estimation method
JP2001051030A (en) Charging battery or changing battery pack
CN115728641B (en) OCV electric quantity calculation method with self-learning and self-calibration functions
JPH1189104A (en) Charging method for lead battery
KR20150043265A (en) Apparatus and method for controlling charging of secondary battery
CN112698225B (en) Battery capacity tracking method and device and electronic equipment
JP2001008375A (en) Control method for state of secondary battery and battery pack using the same

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant