Battery SOC estimation method of thermal printer, thermal printer and readable storage medium
By obtaining the battery and printhead data in the thermal printer, estimating and updating the battery SOC in real time, and using the Kalman filter to correct the energy threshold, the problem of battery display error during printing is solved and the battery life is extended.
Patent Information
- Application Number
- CN202411087303.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-08-08
AI Technical Summary
The thermal printer cannot accurately update the battery SOC during the printing process and within a period of time after the printing is completed, resulting in the gradual increase in the error between the power display and the actual SOC, and missed the low-voltage alarm, causing the battery to be overdischarged and affecting the battery life.
By obtaining the battery start voltage data and printhead energy consumption data, the battery SOC is estimated using an algorithm, the display is updated in real time, and the energy threshold estimate is corrected by the Kalman filter after printing, improving the accuracy of SOC estimation.
Real-time display of the battery SOC during printing is achieved, reducing the error between the battery display and the actual SOC, extending the service life of the battery, and avoiding excessive battery discharge.
Smart Images

Figure CN118604638B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of printers, and in particular to a battery SOC estimation method during the printing process of a thermal printer, a thermal printer and a readable storage medium. Background Art
[0002] The current thermal printer does not update the battery SOC during the printing process and for a period of time after printing. The reason is that the current of the thermal printer during the printing process is relatively large. When the lithium battery is discharged at high power, the load current produces a voltage drop on the internal resistance of the battery, causing the battery voltage to decrease. When the discharge is completed, the battery polarization phenomenon causes the battery voltage to rise to a certain extent, resulting in a large error in the battery voltage measured during this period. Therefore, the power can only be updated in non-printing states such as not printing or waiting for overheating.
[0003] This battery SOC management method is prone to the problem of increasing discrepancy between the power displayed by the printer and the actual battery SOC during continuous printing. In addition, when printing continuously, the low power alarm will be missed, and when the number of print points is too large, the problem of printing even when the remaining power is 0% will occur, causing excessive discharge of the battery and affecting the battery life. Summary of the invention
[0004] A first object of the present invention is to provide a method for estimating the battery SOC of a thermal printer during printing.
[0005] A second object of the present invention is to provide a thermal printer capable of displaying a battery SOC estimation value in real time during printing.
[0006] A third object of the present invention is to provide a readable storage medium capable of implementing the battery SOC estimation method of the thermal printer.
[0007] The battery SOC estimation method of the thermal printer provided by the first purpose of the present invention includes obtaining the current starting voltage data of the battery and the energy consumption data of the print head; generating the battery voltage estimation data according to the starting voltage data, the energy consumption data and the energy threshold estimation data obtained corresponding to the current printing; and obtaining the battery SOC estimation value according to the voltage estimation data and a pre-stored data table.
[0008] It can be seen from the above scheme that the actual SOC value of the battery cannot be obtained by detecting the battery voltage during the printing process and for a period of time after the printing is completed. For this reason, the present invention uses the following algorithm to calculate the SOC estimation value: if the current is the first cycle step of this printing, the starting voltage value is the actual voltage value after the last printing, if the current is not the first cycle step of this printing, the starting voltage value is the voltage estimation value calculated in the last cycle; an energy threshold estimation value data is preset, when printing for the first time, the energy threshold estimation value is a pre-stored value, when printing for the non-first time, the energy threshold estimation value is a correction value of the last printing, and the energy consumption data of the print head can be calculated by the relevant data of the heating program on the print head during this printing process. Whenever the consumed energy reaches an energy threshold estimation value, the corresponding battery voltage will decrease by one unit, and a battery SOC estimation value can be obtained in real time by looking up the table and updated and displayed. Therefore, the battery SOC estimation method of the thermal printer can display the SOC estimation value in real time during the printing process, effectively solving the problem that the error between the displayed power of the printer and the actual battery SOC is getting larger and larger under continuous printing.
[0009] A further solution is that after the step of obtaining the battery SOC estimation value based on the voltage estimation value data and the pre-stored data table, it also includes when the current printing is completed: detecting and obtaining the battery's post-printing voltage data; correcting the energy threshold estimation value data based on the obtained pre-printing voltage data, post-printing voltage data and energy consumption data; the corrected energy threshold estimation value data is used for calculating the voltage estimation value data in the next printing.
[0010] As can be seen from the above, the battery voltage tends to be stable after a period of time after the printing is finished. At this time, the actual value of the battery voltage is obtained by measurement. At this time, the observed data of this printing (battery voltage data before printing, voltage data after printing after a period of time after the printing is finished, and energy consumption data of this printing) are used to correct the energy threshold estimation data. Through the prediction and correction of each printing, the energy threshold estimation value will tend to be stable and reach the optimal estimation value. This setting makes this method iterative and improves accuracy.
[0011] A further solution is to also obtain voltage gain measurement error data and energy threshold estimation error data when the current printing is completed; the step of correcting the energy threshold estimation data based on the obtained pre-printing voltage data, post-printing voltage data and energy consumption data includes correcting the energy threshold estimation data based on the obtained pre-printing voltage data, post-printing voltage data, energy consumption data, voltage gain measurement error data and energy threshold estimation error data.
[0012] A further solution is that the step of correcting the energy threshold estimation data based on the acquired pre-printing voltage data, post-printing voltage data, energy consumption data, voltage gain measurement error data and energy threshold estimation error data includes calculating and generating energy threshold measurement data based on the acquired pre-printing voltage data, post-printing voltage data and energy consumption data; calculating and generating Kalman gain data based on the voltage gain measurement error data and the energy threshold estimation error data; and correcting the energy threshold estimation data based on the energy threshold measurement data and the Kalman gain data.
[0013] It can be seen from the above that by establishing a Kalman filter mathematical model, based on the above-mentioned observation data, voltage gain measurement error data, energy threshold estimation error data and generated Kalman gain data, the energy threshold estimation data can be corrected more accurately, and a battery SOC estimation value that is closer to the actual value can be calculated under iterative optimization.
[0014] A further solution is that after the step of calculating and generating Kalman gain data based on the voltage gain measurement error data and the energy threshold estimation error data, it also includes correcting the energy threshold estimation error data based on the Kalman gain data; the corrected energy threshold estimation error data is used for calculating the Kalman gain data after the next printing is completed.
[0015] As can be seen from the above, the present invention also calculates the Kalman gain data at the end of each printing to correct the energy threshold estimation error data, so as to ensure that the energy threshold estimation value data can be corrected more accurately after the next printing is completed.
[0016] Another further solution is that after the step of obtaining the battery SOC estimation value according to the voltage estimation value data and the pre-stored data table, the battery SOC estimation value is displayed in real time after the current printing is completed and before the preset time period is reached.
[0017] A further solution is that after the step of obtaining the battery SOC estimation value based on the voltage estimation data and the pre-stored data table, it also includes when the preset time is reached after the current printing is completed: detecting and obtaining the battery's post-printing voltage data, generating the battery SOC actual value based on the post-printing voltage data and displaying the battery SOC actual value.
[0018] As can be seen from the above, under this setting, after printing and before the preset time when the influence of heat on the voltage has not been eliminated, the battery SOC estimated value is displayed to ensure that the user can obtain the current power status of the printer in real time and in time during the printing process, so as to make timely operations, charging preparations and relevant decisions for the next print; and after a period of time after the printing is completed, the battery voltage tends to stabilize. At this time, the actual battery SOC value is displayed to ensure that the displayed data has higher accuracy.
[0019] Another further solution is that the step of obtaining the battery's starting voltage data and the print head's energy consumption data includes obtaining the print head's heating point number data and the print head's heating time data; and calculating and generating the energy consumption data based on the heating point number data and the heating time data.
[0020] As can be seen from the above, the energy consumption data can be calculated based on the number of heating points and heating time during printing. The heating time is calculated based on factors such as the current print head temperature, voltage estimation data, and the number of heating points. The print head temperature and voltage estimation data will change in real time. Therefore, when the print head is heated in sections, the heating time of each section is different, so the heating time needs to be determined in real time; and the number of heating points is determined in advance based on the recognition of the printed content.
[0021] A further solution is that the step of obtaining the current starting voltage data of the battery and the energy consumption data of the print head also includes the step of using the pre-printing voltage data obtained by detection as the starting voltage data if the starting voltage data is obtained for the first time for this printing; if the starting voltage data is not obtained for the first time for this printing, the voltage estimation value data obtained by the most recent calculation is used as the starting voltage data.
[0022] It can be seen from the above scheme that the accuracy of the starting voltage data further guarantees the accuracy of the battery SOC estimation value of the final calculation result. For this reason, when the starting voltage data is obtained for the first time in a printing task, in fact, printing has not been started before, and the detected pre-printing voltage data is not affected by heating and is accurate; when the starting voltage data is not obtained for the first time, because printing has been done before, the accuracy of the voltage currently detected is affected, so it is better to use the voltage estimation value data obtained by the most recent calculation, that is, the last calculation, as the starting voltage data. In this way, the present invention takes into account the difference in the actual situation between the first printing step and the other printing steps in a printing task, and makes adaptive selections for the calculation parameters respectively, so as to further improve the accuracy of the calculation results.
[0023] The second object of the present invention is to provide a thermal printer, the thermal printer comprising a processor, the processor being used to implement the above-mentioned battery SOC estimation method of the thermal printer when executing a computer program stored in a memory.
[0024] The third object of the present invention provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the above-mentioned method for estimating the battery SOC of a thermal printer is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 The present invention is a flowchart of a method for estimating battery SOC of a thermal printer according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] Battery SOC estimation method embodiment of thermal printer
[0027] The battery SOC estimation method of the thermal printer of the present invention is applied to the thermal printer, and the present invention seeks to protect the thermal printer capable of implementing the battery SOC estimation method of the present invention.
[0028] A thermal printer includes a thermal print head, on which a heatable dot matrix is arranged. Depending on the printing content, each heating point in each row and column of the heating dot matrix can be heated at the same or different times. Generally, in order to avoid damage to the print head due to excessive current, a row of heating points will be evenly divided into multiple sections when heated, and heated multiple times using time differences.
[0029] Of course, the thermal printer also includes a processor, which is used to implement the above-mentioned battery SOC estimation method when executing the computer program stored in the memory. The processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0030] The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0031] The main purpose of the battery SOC estimation method of the thermal printer of the present invention is to be able to display a relatively accurate battery SOC estimation value to the user during the printing process of a printing task and within a certain period of time after the printing is completed (the period of time when the printer voltage is not eliminated by the temperature).
[0032] See also Figure 1 The battery SOC estimation method of the thermal printer of the present invention comprises:
[0033] First, step S1 is executed to start printing. When the system receives a printing instruction, the printing work of this printing task starts, and the heating head starts heating work.
[0034] When the printer starts printing for the first time in a non-charging state, it will read the factory-preset initial energy threshold estimation value data X0 and the factory-preset initial energy threshold estimation error data e from the FLASH. EST0 , the factory preset initial Kalman gain data k0 and the factory preset fixed voltage gain measurement error data e MEA In addition, the voltage data V0 before printing can also be obtained through detection.
[0035] In a complete printing task, the printing work of the print head will be carried out in multiple steps according to time, and each line of content will be printed in multiple steps.
[0036] Since it is desired to update the battery SOC information in real time during the printing process, the method of the present invention calculates the energy consumption after each printing operation of the print head. Whenever the energy consumption reaches a threshold, the battery SOC information is estimated and displayed accordingly.
[0037] See also Figure 1 , then execute step S2, obtain the starting voltage data of the battery and the energy consumption data of the print head; generate the voltage estimation data of the battery according to the starting voltage data, the energy consumption data and the preset energy threshold estimation data; obtain the battery SOC estimation value according to the voltage estimation data and the pre-stored data table, and then execute: until the preset time after the current printing is completed, the battery SOC estimation value is displayed in real time. Step S2 is the step executed after each printing step in a printing task.
[0038] In step S2, during this printing process, the heating point number data N obtained in this step can be used to calculate the heating point number. n With heating time data T n Data processing is performed to obtain the energy consumption data of this step, and then the real-time battery voltage estimation data V1 is calculated in combination with the energy threshold estimation data X0, and then the battery SOC estimation value is obtained by table lookup.
[0039] Specifically:
[0040] In step 1 of a print run:
[0041] The current is the initial voltage data of the battery obtained for the first time in this printing. The pre-printing voltage data V0 obtained by detection is used as the initial voltage data of this step. The energy consumption data E1 of the first step and the current total energy consumption data P1 of this printing are calculated according to the heating point number data N1 and the heating time data T1; the real-time battery voltage estimation data V1 is calculated according to the pre-printing voltage data V0, the energy consumption data E1 and the energy threshold estimation data X0. In addition, the remainder M1 obtained by dividing the energy consumption data E1 by the energy threshold estimation data X0 is also calculated. The calculation formula for step 1 is as follows:
[0042] E1= N1× T1——Calculate the energy consumption data E1 in step 1
[0043] P1= N1× T1——Calculate the current total energy consumption data P1 for this printing
[0044] V1= V0- ( E1 / X0) ——Calculate the real-time battery voltage estimation data V1
[0045] M1= E1% X0——Calculate the remainder M1 obtained by dividing the energy consumption data E1 by the energy threshold estimated value data X0
[0046] In step 2 of a print run:
[0047] The starting voltage data of the battery is not obtained for the first time in this printing. The real-time battery voltage estimation value data V1 calculated in step 1, that is, the battery voltage estimation value data V1 calculated most recently, is used to update the starting voltage data for use in the calculation in step 2.
[0048] The energy consumption data E2 of step 2 is calculated according to the remainder M1 obtained in the previous step (step 1), the heating point data N2 of this step, and the heating time data T2, and the total energy consumption data P1 calculated in the previous step and the heating point data N2 and the heating time data T2 of this step are used to update the current total energy consumption data P2 after this step; the real-time battery voltage estimation value data V2 after printing in step 2 is calculated according to the real-time battery voltage estimation value data V1 of step 1, the energy consumption data E2, and the energy threshold estimation value data X0; the remainder M2 obtained by dividing the energy consumption data E2 by the energy threshold estimation value data X0 is also calculated. In addition, the calculated real-time battery voltage estimation value data V2 is used to update the starting voltage data for use in the next step of calculation.
[0049] Step 2:
[0050] E2=M1+ (N2× T2) ;
[0051] P2= P1+ (N2× T2) ;
[0052] V2= V1- ( E2 / X0);
[0053] M2= E2% X0
[0054] Step n-1:
[0055] E n-1 = M n-2 + (N n-1 × T n-1 ) ;
[0056] P n-1 =P n-2 + (N n-1 × T n-1 ) ;
[0057] V n-1 = V n-2 - ( E1 / X0 );
[0058] M n-1 = E n-1 % X0
[0059] Step n:
[0060] E n = M n-1 + (N n × T n ) ;
[0061] P n =P n-1 + (N n × T n ) ;
[0062] V n = V n-1 - ( E1 / X0 );
[0063] M n = E n % X0
[0064] Taking the execution of step 1 printing as an example, when the energy consumption data E1 reaches an energy threshold estimate X0, the corresponding battery voltage will decrease by one unit. Therefore, according to the formula V1= V0- (E1 / X0), it can be calculated how many units the battery voltage has decreased and how many units are left. Then, the current battery SOC estimate can be updated in real time based on the table lookup.
[0065] Among them, since the starting voltage value data before printing in step 1 can obtain the actual value according to the detection, therefore, in the formula V1= V0- (E1 / X0) corresponding to step 1, V0 on the right side of the equal sign adopts the voltage data V0 before printing;
[0066] Among them, after printing in step 2, the voltage estimation value data V1 calculated in step 1 is used as V1 on the right side of the equal sign in the formula V2= V1- (E2 / X0), and is used as the starting voltage data in this calculation. That is, after generating the battery voltage estimation value data according to the starting voltage data, the energy consumption data and the preset energy threshold estimation value data in one step, the starting voltage data is updated with the voltage estimation value data, and when calculating the voltage estimation value data in the next step, the updated starting voltage data is used as the basis.
[0067] Then, since the multi-step printing calculation adopts accumulation, after calculating the number of battery voltage reduction units and the number of remaining units, M1= E1% X0 is used to calculate the remainder after printing in this step (step 1). Since the remainder part is actually consumed but not calculated, the remainder is added to the calculation of the energy consumption data printed in the next step (step 2) E2=M1+ (N2× T2), thereby ensuring the accuracy of the calculation of the number of voltage consumption units.
[0068] Among them, in step S2, after the battery SOC estimation value is obtained according to the voltage estimation value data and the pre-stored data table, the battery SOC estimation value is displayed in real time until a preset time after the current printing is completed.
[0069] After each execution of step S2, judgment step S3 is executed once to determine whether this printing is completed. If not, continue to loop step S2 to complete multi-step printing; if the judgment result is yes, this printing is completed. See the above formula group. In this embodiment, this printing is completed after printing n steps. The printing task may require continuous printing of multiple pages. Due to the situation of continuous printing, in fact, the printing interval between two sheets of paper will be shorter than the above preset time. In this interval, the influence of temperature on voltage has not been eliminated. At this time, the battery SOC is calculated and displayed by detecting the voltage value. There will also be errors. At this time, it will be necessary to continuously execute step S2 to estimate the battery SOC. Similarly, even if the printing task is a single-page print, it is necessary to continuously execute step S2 to estimate the battery SOC before completing the printing.
[0070] If the determination result of step S3 is yes, the current printing is finished.
[0071] Then, the system executes step S4, detects and obtains the post-printing voltage data V of the battery after a preset time period after the current printing is completed, generates the actual SOC value of the battery according to the post-printing voltage data, and displays the actual SOC value of the battery.
[0072] After executing step S4, step S5 is executed to correct the energy threshold estimation value data and the energy threshold estimation error data based on the Kalman filter mathematical model.
[0073] In step S5, the pre-printing voltage data V0 before the current printing task, the post-printing voltage data V obtained after the current printing is completed and after a preset time, and the total energy consumption data P accumulated after the current printing steps are obtained. n , and then calculate the energy threshold measurement value Z1:
[0074] Z1=P n / ( V - V0)
[0075] After calculating the energy threshold measurement value Z1, the system first determines whether correction is required.
[0076] Specifically, by judging whether the difference between the energy threshold measurement value Z1 and the energy threshold estimation value data X0 used in the current printing exceeds the preset value, that is, judging whether Z1-X0 is greater than or equal to the preset value;
[0077] If the judgment result is no, it means that the actual energy threshold measurement value Z1 in this printing is slightly different from the energy threshold estimation value data X0 calculated after the last printing, or even no difference. The current energy threshold estimation value data X0 is relatively accurate, so no correction is made first. According to the Kalman gain data k1 calculated this time, the energy threshold estimation value X0, and the energy threshold measurement value Z1 this time, the energy threshold estimation value data X1 is calculated: X1= X0+ k1× ( Z1- X0)
[0078] If the judgment result is yes, it means that the actual energy threshold measurement value Z1 in this printing is significantly different from the energy threshold estimation value data X0 calculated after the last printing. The energy threshold estimation value data X0 and the energy threshold estimation error data e related to the calculation of X0 are EST 0 And the Kalman gain data k1 need to be corrected. Therefore, the system continues to perform the following correction steps:
[0079] In this embodiment, in this correction, since it is the first printing task completed after the machine is turned on, the energy threshold estimation error data e EST 0 The factory preset energy threshold estimation error data e EST0 , the initial Kalman gain data k0 is the factory preset Kalman gain data k0. After the non-first printing task is completed, the energy threshold estimation error data e EST 0 The Kalman gain data k0 is the corrected value after the last printing task is completed.
[0080] Then, the fixed voltage gain measurement error data e that has been read is obtained. MEA and energy threshold estimation error data e EST 0 :
[0081] Calculate the Kalman gain data k1 printed this time:
[0082] k1= e EST 0 / ( e EST 0 + e MEA )
[0083] In this embodiment, in this correction, since it is the first printing task after power-on, the energy threshold estimation value X0 is the factory preset value. After the non-first printing task is completed, the energy threshold estimation value X0 is the value corrected after the last printing task.
[0084] Then, based on the Kalman gain data k1 obtained in this calculation, the energy threshold estimation value X0, and the energy threshold measurement value Z1 of this time, the energy threshold estimation value data X1 of this time is calculated:
[0085] X1= X0+ k1× ( Z1- X0)
[0086] At this point, the steps of calculating and generating energy threshold measurement value data based on the acquired pre-printing voltage data, post-printing voltage data and energy consumption data; calculating and generating Kalman gain data based on voltage gain measurement error data and energy threshold estimation error data; and correcting energy threshold estimation value data based on energy threshold measurement value data and Kalman gain data are completed.
[0087] Finally, the error data e is estimated by energy threshold EST 0 And the Kalman gain data k1 obtained in this calculation, calculate the energy threshold estimation error data e EST 1 .
[0088] e EST 1 = ( 1 – k1) × e EST 0
[0089] At this time, after completing the step of calculating and generating Kalman gain data based on the voltage gain measurement error data and the energy threshold estimation error data, it also includes the step of correcting the energy threshold estimation error data based on the Kalman gain data; the corrected energy threshold estimation error data is used for correcting the energy threshold estimation value data after the next printing is completed.
[0090] After each printing task is completed, k1= e EST 0 / ( e EST 0 + e MEA ) and e EST 1 = ( 1 – k1) × e EST 0Calculation can make the value of Kalman gain data k gradually decrease. Until the current Kalman gain data k satisfies the condition that Z1- X0 is greater than or equal to the preset value, the current energy threshold estimation value data X is relatively accurate, and the current Kalman gain data k reaches a better value, so there is no need to correct the energy threshold estimation value data X, and the Kalman gain data k is no longer required to be calculated and corrected. Of course, the system will continue to obtain the calculation results of Z1- X0, and judge whether it is necessary to restart the calculation and correction of Kalman gain data k based on this.
[0091] In this way, when estimating the battery SOC next time, the corrected energy threshold estimation value data X1 is used as the basis, and when making the next correction, the corrected energy threshold estimation error data e1 is used as the basis. EST 1 As a basis, after multiple printing iterations, the energy threshold estimation data will tend to the optimal estimation value, which also ensures the accuracy of the battery COS estimation data.
[0092] In the continuous printing process, as the number of historical printing times increases, the energy threshold estimation data tends to the optimal estimation value. Therefore, the estimation accuracy can still be guaranteed without correction in the continuous printing process.
[0093] In addition, if printing is performed during the charging process, the energy threshold estimation value data will be relatively reduced, so it is necessary to define the variables of the charging state and the non-charging state separately to distinguish them. Specifically, a judgment step can be performed before the step S1 of starting printing to judge whether it is in the charging state, and the initial energy threshold estimation value data is determined according to the judgment result.
[0094] Readable storage medium embodiment
[0095] The computer-readable storage medium of the present invention can be any form of storage medium that can be read by a processor of a computer device, including but not limited to non-volatile memory, volatile memory, ferroelectric memory, etc. A computer program is stored on the computer-readable storage medium. When the processor of the computer device reads and executes the computer program stored in the memory, the steps of the above-mentioned thermal printer battery SOC estimation method can be implemented.
[0096] The computer program includes computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer readable media do not include electric carrier signals and telecommunication signals.
[0097] Finally, it should be emphasized that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various changes and modifications. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for estimating battery SOC of a thermal printer, characterized in that: include: Obtain the current battery starting voltage data and print head energy consumption data; Generate battery voltage estimation data according to the starting voltage data, the energy consumption data and the acquired energy threshold estimation data corresponding to the current printing; The battery SOC estimation value is obtained according to the voltage estimation value data and a pre-stored data table.
2. The method for estimating battery SOC of a thermal printer according to claim 1, characterized in that: After the step of obtaining the battery SOC estimation value according to the voltage estimation value data and the pre-stored data table, the method further includes: When this printing is finished: Detect and obtain the printed voltage data of the battery; Correcting the energy threshold estimation value data according to the acquired pre-printing voltage data, the post-printing voltage data and the consumed energy data; The corrected energy threshold estimated value data is used for calculating the voltage estimated value data in the next printing.
3. The method for estimating battery SOC of a thermal printer according to claim 2, characterized in that: When this printing is finished: Also obtaining voltage gain measurement error data and energy threshold estimation error data; The step of correcting the energy threshold estimated value data according to the acquired pre-printing voltage data, the post-printing voltage data and the consumed energy data comprises: The energy threshold estimation value data is corrected according to the acquired pre-printing voltage data, the post-printing voltage data, the consumed energy data, the voltage gain measurement error data and the energy threshold estimation error data.
4. The method for estimating battery SOC of a thermal printer according to claim 3, characterized in that: The step of correcting the energy threshold estimation value data according to the acquired pre-printing voltage data, the post-printing voltage data, the energy consumption data, the voltage gain measurement error data and the energy threshold estimation error data comprises: Calculate and generate energy threshold measurement value data according to the acquired pre-printing voltage data, the post-printing voltage data and the consumed energy data; Calculate and generate Kalman gain data according to the voltage gain measurement error data and the energy threshold estimation error data; The energy threshold estimation data is corrected based on the energy threshold measurement data and the Kalman gain data.
5. The method for estimating battery SOC of a thermal printer according to claim 4, characterized in that: After the step of calculating and generating Kalman gain data according to the voltage gain measurement error data and the energy threshold estimation error data, the method further includes: Correcting the energy threshold estimation error data according to the Kalman gain data; The corrected energy threshold estimation error data is used for calculating the Kalman gain data after the next printing is completed.
6. The method for estimating battery SOC of a thermal printer according to any one of claims 1 to 5, characterized in that: After the step of obtaining the battery SOC estimation value according to the voltage estimation value data and the pre-stored data table, the step further includes: after the current printing is completed and before the preset time period is reached, the battery SOC estimation value is displayed in real time.
7. The method for estimating battery SOC of a thermal printer according to claim 6, characterized in that: After the step of obtaining the battery SOC estimation value according to the voltage estimation value data and the pre-stored data table, the method further includes: When the preset time period is reached after the current printing is completed: the post-printing voltage data of the battery is detected and acquired, and the actual SOC value of the battery is generated according to the post-printing voltage data and the actual SOC value of the battery is displayed.
8. The method for estimating battery SOC of a thermal printer according to claim 6, characterized in that: The step of obtaining the starting voltage data of the battery and the energy consumption data of the print head includes: Obtain the heating point number data and heating time data of the print head; The energy consumption data is calculated and generated according to the heating point number data and the heating time data.
9. The method for estimating battery SOC of a thermal printer according to any one of claims 1 to 5, characterized in that: The step of obtaining the current battery starting voltage data and the print head energy consumption data further includes: If the starting voltage data is obtained for the first time during this printing, the voltage data before printing obtained by detection is used as the starting voltage data; If the starting voltage data is not obtained for the first time during this printing, the voltage estimation value data obtained by the most recent calculation is used as the starting voltage data.
10. Thermal printer, characterized in that: The thermal printer comprises a processor, and the processor is used to implement the battery SOC estimation method of the thermal printer according to any one of claims 1 to 9 when executing a computer program stored in a memory.
11. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the battery SOC estimation method of the thermal printer according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Method and device for displaying electricity amount of battery and electronic device
CN104297689A
Method and device for estimating state of charge of battery
CN106716158A
