A method for realizing efficient printing using low-end processors
By using low-end processors to build a printing system in thermal printers, the problem of poor printing results in the existing technology is solved, efficient and clear printing results are achieved, and design costs are reduced.
Patent Information
- Application Number
- CN202211287552.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-20
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2042-10-20
AI Technical Summary
The processors used by existing thermal printers are expensive and have low cost performance, resulting in poor printing results, such as unclear printing, ghosting, dragging, or excessive printing.
A low-end processor is used to build a printing system, including a printing control chip and a printing module, and efficient printing is achieved through the coordinated work of printing data reception, grouping, heating timer and pulse width data timer.
It effectively avoids the problems of unclear printing, ghosting and distortion, optimizes the printing effect, improves the user experience, and reduces design costs.
Smart Images

Figure CN116039263B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of financial payment and receipt printing, and in particular to a method for realizing efficient printing by using a low-end processor. Background Art
[0002] In daily life, thermal printers are widely used in various fields as tools for daily information recording. However, with the wide application, some problems have also been brought. For example, the processor used in the printer is expensive and has a low cost performance. Although the processor with general performance can basically realize the printing function, the printing effect is not good, such as unclear printing, ghosting, smearing, or heavy printing. Summary of the invention
[0003] The object of the present invention is to provide a method for realizing efficient printing by using a low-end processor, thereby solving the above-mentioned problems existing in the prior art.
[0004] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0005] A method for realizing efficient printing by using a low-end processor, the method is realized by using a printing system, the printing system comprises a printing control chip and a printing module connected to the printing control chip; the printing control chip comprises a printing data receiving port, a pulse width data timer, and a heating timer; the printing module comprises a stepping motor and a heater;
[0006] The method comprises the following steps,
[0007] S1, the print data receiving port waits to receive the print data and stores it in the cache, and records the number of lines of the current data to be printed;
[0008] S2, determine whether the number of lines of the current data to be printed reaches the set start printing threshold, if so, enter S3; otherwise return to S1 to wait for receiving print data;
[0009] S3, print the current data to be printed, and determine whether the current data to be printed has been printed. If so, return to S1 to wait for the next data to be printed, otherwise continue to print the current data to be printed until printing is completed; the specific process of printing the current data to be printed in S3 is as follows:
[0010] S31, read a bit of row data from the cache, that is, M binary numbers;
[0011] S32, grouping the read point row data;
[0012] S33, calculating the total number of groups, the pulse width time of the stepping motor, the pulse phase sequence and the heating time according to the grouping situation;
[0013] S34, the printing control chip sends the first set of data to the printing module and latches it;
[0014] S35, turn on the heater to start heating, and at the same time turn on the heating timer to start timing; turn on the stepper motor to start printing, and at the same time the printing control chip sends the pulse phase of this time to the stepper motor through the stepper motor pulse phase line, and at the same time turn on the pulse width data timer to start timing;
[0015] S36, determine whether the current timing of the heating timer is greater than or equal to the heating time, and determine whether the current timing of the pulse width data timer is greater than or equal to the pulse width time; if the current timing of the heating timer is greater than or equal to the heating time and the current timing of the pulse width data timer is greater than or equal to the pulse width time, enter S37; if the current timing of the heating timer is less than the heating time and / or the current timing of the pulse width data timer is less than the pulse width time, return to S35 to continue heating or continue sending the pulse phase;
[0016] S37, determine whether the group number currently being printed is less than the total number of groups of the dot row data, if so, return to S34 and enter the printing of the next group of group data of the dot row; otherwise, return to S1 and wait for receiving the next print data.
[0017] Preferably, when the point line data are grouped, if one point line data includes M binary data, the grouping is performed with a maximum of N binary data in each group, and the amount of data in each group after grouping is still M binary data, but only N or less than N binary data are 1, and the rest are 0; the calculation formula of the total number of groups Group_Max is,
[0018]
[0019] Preferably, the calculation formula of the heating time t is,
[0020]
[0021] E=E 25 -T C ×(T x -25)
[0022]
[0023] Where E is the real-time printing energy; R is the correction resistance value; C is the correction pulse width time; V is the correction voltage, V = 1.124 × V P -1.182; V P is the thermal print head driving voltage; E 25 is the standard printing energy; T C is the temperature coefficient; T x is the real-time temperature value; RH is the thermal element resistance of the thermal print head; R i is the wiring resistance of the thermal print head; R C is the common thermal wiring resistance in thermal print heads; r C V P and GND.
[0024] The beneficial effects of the present invention are: effectively avoiding the disadvantages of unclear printing, ghosting and smearing, optimizing the printing effect, improving the user experience and reducing the design cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 is a schematic diagram of the structure of a printing system in an embodiment of the present invention;
[0026] Figure 2 is a schematic flow chart of a method in an embodiment of the present invention;
[0027] Figure 3 It is a schematic diagram of a specific process of printing in an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation methods described herein are only used to explain the present invention and are not used to limit the present invention.
[0029] In this embodiment, a method for realizing efficient printing by using a low-end processor is provided. The method is realized by using a printing system, such as Figure 1 As shown, the printing system includes a printing control chip and a printing module connected to the printing control chip; the printing control chip is used to receive and process the data to be printed, and control the printing module to print according to the processing results.
[0030] The printing module includes a stepper motor for printing and a heater for heating; the printing control chip includes a printing data receiving port for receiving data to be printed, a pulse width data timer for timing the pulse width data of the stepper motor, and a heating timer for timely heating the heater;
[0031] The printing module is provided with a data receiving port, and the printing control chip is provided with a data sending port, and the data receiving port is connected to the data sending port to realize data interaction between the two. The printing control chip includes 4 GPIOs (connected to the pulse width data timer) for sending stepper motor signals to the printing module, one GPIO (connected to the heating timer) for sending heating signals to the printing module, and one GPIO for sending latch signals to the printing module, a total of 6 GPIOs, which can generally be met by low-end processors. The 4 GPIOs for sending stepper motor signals to the printing module are connected to the printing module via four stepper motor pulse phase lines.
[0032] like Figure 2 As shown, the method comprises the following steps:
[0033] S1. The print data receiving port waits to receive the print data and stores it in the cache, and records the number of lines of the current data to be printed L_Now; at this time, the data to be printed is dot matrix data, which can be understood as binary dot matrix data of a Chinese painting, and a line of binary dot matrix data is a dot line.
[0034] S2, determine whether the number of lines of the current data to be printed reaches the set start printing threshold L_Max, if so, enter S3; otherwise return to S1 to wait for receiving the next print data;
[0035] S3, printing the current data to be printed, and determining whether the current data to be printed has been printed, if so, returning to S1 to wait for the next data to be printed, otherwise continuing to print the current data to be printed until printing is completed.
[0036] In this embodiment, Figure 3 As shown, the specific process of printing the current data to be printed in S3 is as follows:
[0037] S31, read one dot line of data from the cache, that is, M binary numbers; for example, in a commonly used printing receipt, one dot line of printing data is 48 bytes, M = 48*8 bits, that is, 384;
[0038] S32, grouping the read point row data;
[0039] S33, calculate the total number of groups, the pulse width time of the stepper motor, the pulse phase sequence and the heating time according to the grouping situation; (the pulse width time is based on the heating time, and the corresponding value is obtained by looking up the table; the phase is an independent table, which is increased by 1 each time. When this table is walked once, the motor rotates one circle)
[0040] S34, the printing control chip sends the first set of data to the printing module and latches it;
[0041] S35, turn on the heater to start heating, and at the same time turn on the heating timer Timer1 to start timing; turn on the stepper motor to start printing, and at the same time the printing control chip sends the pulse phase of this time to the stepper motor through the stepper motor pulse phase line, and at the same time turn on the pulse width data timer Timer2 to start timing;
[0042] S36, determine whether the current timing of the heating timer is greater than or equal to the heating time, and determine whether the current timing of the pulse width data timer is greater than or equal to the pulse width time; if the current timing of the heating timer is greater than or equal to the heating time and the current timing of the pulse width data timer of the stepping motor is greater than or equal to the pulse width time, enter S37; if the current timing of the heating timer is less than the heating time and / or the current timing of the pulse width data timer is less than the pulse width time, return to S35 to continue heating or continue sending the pulse phase;
[0043] S37, determine whether the group number currently being printed is less than the total number of groups of the dot row data, if so, return to S34 and enter the printing of the next group of group data of the dot row; otherwise, return to S1 and wait for receiving the next print data.
[0044] In this embodiment, when the point line data is grouped, if a point line data includes M binary data, the grouping is performed with a maximum of N binary data in each group, and the amount of data in each group after grouping is still M binary data, but only N or less than N binary data are 1, and the rest are 0; the calculation formula of the total number of groups Group_Max is,
[0045]
[0046] For example, M=384, the data of this point row is 48 bytes of 0xFF, N=96, and the grouping is performed according to the formula Group_Max=M*8bit / N+(M*8bit%N?1:0), and the result is 4.
[0047] The specific grouping results are:
[0048] Group 1:
[0049] {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
[0050] Group 2:
[0051] {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
[0052] Group 3:
[0053] {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
[0054] Group 4:
[0055] {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,,0xFF,0xFF,0xFF,0xFF}
[0056] Depending on the value of N, the last group of binary data containing 1 may be less than N.
[0057] In this embodiment, the calculation formula of the heating time t is:
[0058]
[0059] E=E 25 -T C ×(T x -25)
[0060]
[0061] Where E is the real-time printing energy; R is the correction resistance value; C is the correction pulse width time; V is the correction voltage, V = 1.124 × V P -1.182; V P is the thermal print head driving voltage; E 25 is the standard printing energy; T C is the temperature coefficient; T x is the real-time temperature value; R H is the thermal element resistance of the thermal print head; R i is the wiring resistance of the thermal print head; R C is the common thermal wiring resistance in thermal print heads; r C V P The connection resistance between and GND (ground terminal).
[0062] In the formula, the standard printing energy E 25 And the corresponding temperature coefficient T C It can be obtained by looking up the table according to the type of printing paper. In the formula, N also refers to the number of points activated at the same time.
[0063] In this embodiment, in order to further reduce the requirements for low-end processors, a large amount of floating-point data can still be calculated and data printing can be realized when using a low-end processor. The commonly used calculations can be made into a table, and the table can be looked up and the values can be obtained by different temperatures and N values. This can further shorten the calculation time and reduce the pressure on the processor. As shown below, the calculation results related to the Tx temperature in Table VX_TBL
[256] and the calculation results related to N (the amount of binary data of 1) in Table CX1_TBL
[256] are:
[0064]
[0065]
[0066]
[0067]
[0068] By adopting the above technical solution disclosed in the present invention, the following beneficial effects are obtained:
[0069] The present invention provides a method for realizing efficient printing by using a low-end processor, which effectively avoids the drawbacks of unclear printing, ghosting and dragging, optimizes the printing effect, improves the user experience and reduces the design cost.
[0070] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be considered as the scope of protection of the present invention.
Claims
1. A method for achieving efficient printing using a low-end processor, Features: The method is implemented by a printing system, which includes a printing control chip and a printing module connected to the printing control chip; the printing control chip includes a printing data receiving port, a pulse width data timer, and a heating timer; the printing module includes a stepping motor and a heater; The method comprises the following steps, S1, the print data receiving port waits to receive the print data and stores it in the cache, and records the number of lines of the current data to be printed; S2, determine whether the number of lines of data to be printed currently reaches the set printing start threshold, if so, proceed to S3; Otherwise, return to S1 and wait for receiving print data; S3, print the current data to be printed, and determine whether the current data to be printed has been printed. If so, return to S1 to wait for the next data to be printed, otherwise continue to print the current data to be printed until printing is completed; the specific process of printing the current data to be printed in S3 is as follows: S31, read a bit of row data from the cache, that is, M binary numbers; S32, grouping the read point row data; S33, calculating the total number of groups, the pulse width time of the stepping motor, the pulse phase sequence and the heating time according to the grouping situation; S34, the printing control chip sends the first set of data to the printing module and latches it; S35, turn on the heater to start heating, and at the same time turn on the heating timer to start timing; turn on the stepper motor to start printing, and at the same time the printing control chip sends the pulse phase of this time to the stepper motor through the stepper motor pulse phase line, and at the same time turn on the pulse width data timer to start timing; S36, determine whether the current timing of the heating timer is greater than or equal to the heating time, and determine whether the current timing of the pulse width data timer is greater than or equal to the pulse width time; if the current timing of the heating timer is greater than or equal to the heating time and the current timing of the pulse width data timer is greater than or equal to the pulse width time, enter S37; if the current timing of the heating timer is less than the heating time and / or the current timing of the pulse width data timer is less than the pulse width time, return to S35 to continue heating or continue sending the pulse phase; S37, judging whether the group number currently being printed is less than the total number of groups of the data of the dot row, if so, returning to S34, and entering the printing of the next group of group data of the dot row; Otherwise, return to S1 and wait for receiving the next print data.
2. The method for realizing efficient printing using a low-end processor according to claim 1, Features: When point-line data is grouped, if a point-line data includes M binary data, then each group is grouped with a maximum of N binary data, and the amount of data in each group after grouping is still M binary data, but only N or less than N binary data are 1, and the rest are 0; the calculation formula of the total number of groups Group_Max is, 3. The method for realizing efficient printing by using a low-end processor according to claim 2, Features: The calculation formula of the heating time t is, E=E 25 -T C ×(T x -25) Where E is the real-time printing energy; R is the correction resistance value; C is the correction pulse width time; V is the correction voltage, V = 1.124 × V P -1.182; V P is the thermal print head driving voltage; E 25 is the standard printing energy; T C is the temperature coefficient; T x is the real-time temperature value; R H is the thermal element resistance of the thermal print head; R i is the wiring resistance of the thermal print head; R C is the common thermal wiring resistance in thermal print heads; r C V P and GND.
Citation Information
Patent Citations
Printer heating operation processing method based on inverted sequence logic control
CN114889347A
Interleave pulse modulation for thermal printers
US6375300B1