Printer motor variable speed control method, printing device, medium and program product

Through the smooth processing and continuous update of the speed adjustment parameters of thermal printing motor motor, the problem of the difficulty of changing the transmission of heat -sensitive printing motor motor motor engine, the stability of the smooth control and heating time of the motor, improved the quality of printing and improving Effect.

CN119329200AActive Publication Date: 2025-01-21ZHUHAI QUIN TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411237377.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2025-01-21
Estimated Expiration
2044-09-04

AI Technical Summary

Technical Problem

It is difficult for thermal printers to achieve good motor speed control during printing, resulting in high motor noise and horizontal lines in the development position.

Method used

Through the forward -looking parameters of the motor speed adjustment of the motor speed in advance, the smooth control of the motor speed is achieved. Specific methods include the motor speed adjustment parameter array that obtains the data to be printed. After smooth processing, the cache area is stored, and the cache area is continuously updated during the printing process to ensure the smooth transmission of the motor speed.

Benefits of technology

The smooth control of the motor to decelerate, take into account the problem of heating duration, reduce the demand for hardware resources, simplify the implementation method, and improve the quality and effect of printing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119329200A_ABST
    Figure CN119329200A_ABST
Patent Text Reader

Abstract

The invention provides a printer motor variable speed control method, a printing device, a medium and a program product, and the method comprises the steps: obtaining a first motor speed adjustment parameter group of to-be-printed data of a preset line number; smoothing the first motor speed adjustment parameter group to obtain a second motor speed adjustment parameter group, and storing the second motor speed adjustment parameter group in a cache region; printing is carried out based on the cache region, and in the printing process, the steps that third motor speed adjusting parameters of a new printing line are obtained, and the new printing line and the current printing line are separated by a preset line number; and comparing the third motor speed adjusting parameter of the new printing line with a fourth motor speed adjusting parameter of the previous printing line of the new printing line to determine an adjusting area starting from the previous printing line of the new printing line in the cache area, smoothing the adjusting area, and updating the cache area according to the updated third motor speed adjusting parameter. Good motor variable speed control is achieved, and the implementation mode is simple.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of thermal printers, and in particular to a printer motor speed control method, a printing device, a medium and a program product. Background Art

[0002] A thermal printer is a device that uses thermal technology to achieve printing functions. It applies heat to thermal printing paper to make the content to be printed appear on the thermal printing paper.

[0003] In portable thermal printer products, the thermal film needs to dynamically adjust the heating time according to the number of heating points corresponding to the specific printing content of each line. When the number of heating points is small, the motor can run quickly to increase the printing speed; when the number of heating points is large, the motor needs to run at a lower speed to ensure the accurate correspondence of the heating position. It can be seen that during the printing process, the variable speed control effect of the motor is an important indicator for evaluating the performance of the printer.

[0004] However, due to the variability and unpredictability of the printed content, thermal printers often have difficulty in achieving good motor speed control. The printing speed of the motor is limited by the number of heating points corresponding to different print lines, the heating performance of the thermal sheet, and the heating control method, and it is necessary to take into account the sudden change in heating time, which brings difficulties to the motor speed control. The existing motor speed control method has the phenomenon of sudden speed changes, which causes problems such as loud motor noise and horizontal lines at the developing position during printing.

[0005] At present, there is a solution for smoothing the speed change process of the motor. It calculates the motor heating time required for each line, thereby obtaining the peak value, average value and change rate of the heating time and judging the change trend. Then, different algorithms are used to calculate the motor heating time for each line according to different change trends, and then the corresponding motor running speed is determined according to the motor heating time. The noise generated by the stepper motor during speed change is reduced by smoothing the motor heating time. However, this method needs to obtain N lines of data each time, and then perform the least squares fitting on the obtained N lines of data to judge the change trend. The implementation method is relatively complicated and does not take into account the problem of speed mutation between two adjacent N lines obtained. Speed ​​mutation will also cause horizontal stripes to appear at the developing position, affecting the printing quality and effect. Summary of the invention

[0006] The first object of the present invention is to provide a method for controlling the speed change of a printer motor with smooth motor speed change and simple implementation.

[0007] The second object of the present invention is to provide a computer device for implementing the above-mentioned printer motor speed control method.

[0008] A third object of the present invention is to provide a computer-readable storage medium for implementing the above-mentioned printer motor speed control method.

[0009] A fourth object of the present invention is to provide a computer program product for implementing the above-mentioned printer motor speed control method.

[0010] In order to achieve the above-mentioned first purpose, the present invention provides a printer motor speed control method, which includes the following steps: obtaining a first motor speed adjustment parameter group of a preset number of lines of data to be printed; the first motor speed adjustment parameter group includes the same number of first motor speed adjustment parameters as the preset number of lines, and each first motor speed adjustment parameter corresponds to a line of data to be printed; smoothing the first motor speed adjustment parameter group to obtain a second motor speed adjustment parameter group, and storing the second motor speed adjustment parameter group in a cache area; the second motor speed adjustment parameter group includes the same number of second motor speed adjustment parameters as the preset number of lines, and each second motor speed adjustment parameter corresponds to a line of data to be printed; printing is performed based on the cache area, and during the printing process, the following steps are continuously performed: obtaining a third motor speed adjustment parameter of a new print line, the new print line is separated from the current print line by a preset number of lines; comparing the third motor speed adjustment parameter of the new print line with the fourth motor speed adjustment parameter of the previous print line of the new print line to determine an adjustment area in the cache area starting from the previous print line of the new print line, smoothing the adjustment area, and updating the third speed adjustment parameter, and updating the cache area with the updated third motor speed adjustment parameter.

[0011] It can be seen from the above scheme that the present invention obtains the first motor speed adjustment parameter group of the data to be printed by pre-processing before printing, and after smoothing it, controls the motor to start printing based on the obtained second motor speed adjustment parameter group. During the printing process, the cache area is continuously updated according to the newly obtained third motor speed adjustment parameter of the new print line, so as to achieve smooth control of the motor speed and solve the problems of high noise and horizontal lines in the development caused by motor speed change. The present invention can achieve good motor speed control under the premise that the motor strictly corresponds to the heating parameters, and can well take into account the problem of sudden changes in heating time. Secondly, the present invention performs forward planning based on the third motor speed adjustment parameter of the new print line. Compared with the method of obtaining the motor speed adjustment parameters of multiple lines at one time and only adjusting the motor speed of the multiple lines, it requires less computing resources and is simple and reliable to implement. Thirdly, the present invention realizes receiving and processing part of the information to be printed before printing, preprocessing and then starting printing, and continuously receiving other parts of the information to be printed after printing starts, and simultaneously performing preprocessing and updating the cache area, thereby solving the problem of limited storage space for printing operations inside the thermal printing device, and having a good speed control effect for the entire printing process, and no sudden speed change occurs when printing adjacent lines between two preset lines in sequence, and has better universal applicability. In addition, the present invention can trigger a motor speed change once a line of printing is completed by setting a timer, thereby facilitating adjusting the motor speed by adjusting the motor speed adjustment parameters during the actual printing of different lines.

[0012] A further solution is to smooth the first motor speed adjustment parameter group to obtain the second motor speed adjustment parameter group, including: determining the largest first motor speed adjustment parameter in the first motor speed parameter group, setting each first motor speed adjustment parameter in the first motor speed parameter group to the largest first motor speed adjustment parameter, and obtaining the second motor speed adjustment parameter group.

[0013] It can be seen that the present invention can ensure that no missing printing occurs by using the first motor speed adjustment parameter corresponding to the slowest motor speed as the printing of the preset number of lines to start execution.

[0014] A further solution is that when smoothing the adjustment area, it includes: starting from the previous print line of the new print line, adjusting the fifth motor speed adjustment parameters of each print line in the adjustment area from back to front in sequence until the difference between two adjacent fifth motor speed adjustment parameters in the execution order in the cache area does not exceed a preset difference.

[0015] It can be seen that the present invention determines the area that needs to change speed in advance by comparing the motor speed adjustment parameters of the new print line and the corresponding previous print line, and performs smooth transition processing on the motor speed adjustment parameters in the area, thereby allowing the motor speed to change smoothly.

[0016] A further solution is that when determining the adjustment area, it includes: determining the number of rows to be changed according to the quotient of the difference between the third motor speed adjustment parameter and the fourth motor speed adjustment parameter and a preset difference, and determining the adjustment area according to the number of rows to be changed.

[0017] It can be seen that the present invention ensures smooth processing of the change in the motor speed adjustment parameter of a new row relative to the previous row by adjusting a certain number of consecutive rows.

[0018] A further solution is to update the third motor speed adjustment parameter, and when updating the cache area according to the updated third motor speed adjustment parameter, it includes: when comparing the third motor speed adjustment parameter of the new print line with the fourth motor speed adjustment parameter of the previous print line of the new print line, if the difference between the fourth motor speed adjustment parameter and the third motor speed adjustment parameter is greater than or equal to a preset difference, then updating the third motor speed adjustment parameter to the difference between the fourth motor speed adjustment parameter and the preset difference, and updating the cache area according to the updated third motor speed adjustment parameter.

[0019] A further solution is to update the third motor speed adjustment parameter, and when updating the cache area according to the updated third motor speed adjustment parameter, it includes: when comparing the third motor speed adjustment parameter of the new print line with the fourth motor speed adjustment parameter of the previous print line of the new print line, if the difference between the fourth motor speed adjustment parameter and the third motor speed adjustment parameter is greater than or equal to 0 and less than a preset difference, then the third motor speed adjustment parameter is kept unchanged and updated to the cache area as the updated third motor speed adjustment parameter.

[0020] It can be seen that the present invention can ensure the smooth acceleration of the motor operation and prevent the occurrence of violent acceleration.

[0021] A further solution is to update the third motor speed adjustment parameter, and when updating the cache area according to the updated third motor speed adjustment parameter, it includes: when comparing the third motor speed adjustment parameter of the new print line with the fourth motor speed adjustment parameter of the previous print line of the new print line, if the difference between the third motor speed adjustment parameter and the fourth motor speed adjustment parameter is greater than or equal to 0 and less than a preset difference, then the third motor speed adjustment parameter is kept unchanged and updated to the cache area as the updated third motor speed adjustment parameter.

[0022] It can be seen that, when the motor needs to decelerate, the present invention determines whether it is a sharp deceleration through a corresponding threshold, and then makes adjustments by determining the adjustment area only when a sharp deceleration is determined.

[0023] In order to achieve the above second objective, the present invention provides a thermal printing device, comprising a processor and a memory, wherein: the memory stores a computer program, and when the computer program is executed by the processor, the above printer motor speed control method is implemented.

[0024] In order to achieve the third objective mentioned above, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, the above-mentioned printer motor speed control method is implemented.

[0025] In order to achieve the fourth objective mentioned above, the present invention provides a computer program product, including computer instructions, wherein: when the computer instructions are executed by a processor, the above-mentioned printer motor speed control method is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a system block diagram of a printing system in an embodiment of a printer motor speed control method of the present invention.

[0027] Figure 2 It is a flow chart of the execution of the thermal printing device in the embodiment of the printer motor speed control method of the present invention.

[0028] Figure 3 It is a schematic diagram of the change of motor speed adjustment parameters in the embodiment of the printer motor speed control method of the present invention.

[0029] The present invention is further described below in conjunction with the accompanying drawings and embodiments. DETAILED DESCRIPTION

[0030] The printer motor speed control method of the present invention realizes good motor speed control by forward planning of motor speed adjustment parameters of a certain number of lines in advance. The present invention also provides a printing device, a computer readable storage medium and a computer program product for realizing the above printer speed control method.

[0031] Printer motor speed control method embodiment:

[0032] See also Figure 1 The printing system implementing this embodiment includes a terminal device 1 and a thermal printing device 2, and the terminal device 1 is connected to the thermal printing device 2.

[0033] The terminal device 1 may be a device such as a personal computer, a smart phone, or a tablet computer that provides data to be printed.

[0034] The thermal printing device 2 is provided with a motor, a rubber roller and a thermal sheet, the motor is connected to the rubber roller, and the rubber roller and the thermal sheet are arranged opposite to each other. During use, the thermal paper is tightly clamped between the thermal sheet and the rubber roller, the motor drives the rubber roller to rotate, and the rotation of the rubber roller drives the thermal paper to move along the paper output direction to realize paper feeding, and the heating point of the thermal sheet heats up so that the thermal paper passing by shows the printed content.

[0035] The terminal device 1 and the thermal printing device 2 can communicate via a wired network or a wireless network, so that the thermal printing device 2 can separate and parse the information to be printed obtained from the terminal device 1 based on the set communication protocol, thereby realizing the printing operation.

[0036] After the thermal printing device 2 obtains the information to be printed from the terminal device 1, the printer speed control method of this embodiment controls the motor to feed the paper for printing. Figure 2 The thermal printing device 2 specifically performs the following steps:

[0037] First, execute step S1: obtain information to be printed.

[0038] In this embodiment, a part of the information to be printed is first obtained for processing, and while printing begins, other information to be printed is continuously obtained to synchronously update the storage space of the thermal printing device. This cycle is repeated to implement the printing operation of all the information to be printed corresponding to the current printing content, thereby realizing the reuse of storage space.

[0039] Continue to execute step S2: pre-process part of the data to be printed to obtain a first motor speed adjustment parameter group.

[0040] The information to be printed is separated and analyzed according to the set communication protocol, that is, the information to be printed is divided into a preset number of rows of data to be printed, and the number of heating points on the thermal sheet corresponding to each row of data to be printed is obtained by analysis.

[0041] According to the number information of the heating points of each line of data to be printed, combined with the heating speed calculation of the thermal film, the heating time information corresponding to each line of data to be printed can be obtained, and then the paper feeding time of the motor in each line is determined. The paper feeding time of the motor in each line is not less than the heating time information, and the paper feeding time of each line is used as a motor speed adjustment parameter to adjust the speed of the motor in the line. Thus, a first motor speed adjustment parameter group is obtained, and the first motor speed adjustment parameter group includes a plurality of first motor speed adjustment parameters that are the same as the number of preset lines, and each first motor speed adjustment parameter corresponds to a line of data to be printed. For example, the acquired partial printing information includes N lines of data to be printed, and then includes N first motor speed adjustment parameters, the first line of data to be printed corresponds to the first first motor speed adjustment parameter, and the second line of data to be printed corresponds to the second first motor speed adjustment parameter. By analogy, when printing, the motor speed can be controlled according to the first first motor speed adjustment parameter to print the first line of data to be printed, and the motor speed can be controlled according to the second first motor speed adjustment parameter to print the second line of data to be printed.

[0042] See also Figure 3 In this embodiment, N is 16, and part of the data to be printed is 16 lines. After preprocessing the part of the data to be printed, the first motor speed adjustment parameter group obtained is {3, 12, 16, 5, 7, 14, 3, 7, 3, 2, 16, 5, 7, 14, 3, 7}. The first motor speed adjustment parameter corresponding to the first line of data to be printed is 3, and the first motor speed adjustment parameter corresponding to the second line of data to be printed is 12.

[0043] Without considering the smooth transition of the motor speed, the motor running speed and the corresponding heating time information corresponding to each line of data to be printed are one-to-one corresponding. However, since the number of heating points between different lines is not exactly the same, the motor operates according to the above calculated paper feeding time alone, or according to the first motor speed adjustment parameter corresponding to each line, and the motor speed will inevitably change suddenly. Therefore, it is necessary to smooth the paper feeding time, that is, to smooth the first motor speed adjustment parameter group.

[0044] In different embodiments, the above process of preprocessing part of the data to be printed may also be performed by the terminal device, so that the thermal printing apparatus directly obtains the first motor speed adjustment parameter group from the terminal device.

[0045] Then, step S3 is executed: smoothing the first motor speed adjustment parameter group to obtain a second motor speed adjustment parameter group.

[0046] Among them, the largest first motor speed adjustment parameter in the first motor speed adjustment parameter group is first determined, and then each first motor speed adjustment parameter in the first motor speed parameter group is set to the largest first motor speed adjustment parameter, so as to obtain the second motor speed adjustment parameter group.

[0047] See also Figure 3 In this embodiment, the largest first motor speed adjustment parameter in the first motor speed adjustment parameter group is 16, then the second motor speed adjustment parameter group obtained after smoothing the first motor speed adjustment parameter group is {16,16,16,16,16,16,16,16,16,16,16,16,16,16,16}.

[0048] Then, step S4 is executed: storing the second motor speed adjustment parameter group into the cache area.

[0049] Then, step S5 is executed: performing a printing operation based on the buffer area.

[0050] When step S5 is executed for the first time, since the cache area now stores the second motor speed adjustment parameter group corresponding to N lines of data to be printed, the thermal printing device sequentially reads the cache area (the cache area includes N addresses, which are read in address order, and the second motor speed adjustment parameters are stored in address order at this time), and starts printing line by line by controlling the motor speed through the second motor speed adjustment parameters stored therein.

[0051] See also Figure 3 In this embodiment, the motor speed adjustment parameter corresponding to each print line in lines 1 to 16, that is, the actual value, has been determined when printing begins. At this time, each print line sequentially read by the thermal printing device is the second motor speed adjustment parameter.

[0052] S6: Determine whether the third motor speed adjustment parameter of the new print line is obtained.

[0053] The third motor speed adjustment parameter is the motor speed adjustment parameter of the newly printed line. During the printing process, data preprocessing and the updating of the motor speed adjustment parameter are performed synchronously, and the new print line is separated from the actual print line by a preset number of lines. For example, N lines of data to be printed are processed first, and the preset number of lines is N. When the current actual line is line 1, the new print line is line N+1; when the current actual line is line 2, the new print line is line N+2. The third motor speed adjustment parameter is derived from the analysis of the newly received other parts of the information to be printed.

[0054] See also Figure 3In this embodiment, the preset number of lines is 16. When the current actual behavior is line 1, the newly printed behavior is line 17. At this time, another part of the information to be printed will be received. After separating, parsing and preprocessing the part of the information to be printed, the third motor adjustment parameter corresponding to the 17th line is obtained. At this time, the third motor adjustment parameter of the 17th line obtained is 28. Similarly, when the current actual behavior is line 2, the newly obtained third motor adjustment parameter of the 18th line is 12.

[0055] Thus, by judging whether the third motor speed adjustment parameter is obtained, it can be determined that the current printing has been completed. If the third speed adjustment parameter is not obtained, step S9 is executed to judge whether the printing of the print content corresponding to the information to be printed is completed. If so, the current printing is terminated. If not, return to step S5 and continue to print according to the actual value corresponding to each print line stored in the cache area. If the third speed adjustment parameter is obtained, step S7 is continued.

[0056] Then, step S7 is performed: comparing the third motor speed adjustment parameter with the fourth motor speed adjustment parameter to determine an adjustment region, smoothing the adjustment region, and updating the third motor speed adjustment parameter.

[0057] The fourth motor speed adjustment parameter is the motor speed adjustment parameter corresponding to the previous print line of the new print line. The number of lines to be changed from the new print line to the previous print line is determined by the quotient of the difference between the third motor speed adjustment parameter and the fourth motor speed adjustment parameter and the preset difference, and then the adjustment area is determined according to the number of lines to be changed.

[0058] Thus, the fifth motor speed adjustment parameter of each print line is adjusted in sequence from the back to the front in the adjustment area until the difference between two fifth motor speed adjustment parameters executed in adjacent order in the buffer area does not exceed the preset difference. The fifth motor speed adjustment parameter represents the motor speed adjustment parameter in the buffer area during the smoothing process of the adjustment area. The selection of the preset difference affects the speed of the motor speed change, and is adjusted and determined according to the characteristics of the specific motor used.

[0059] For example, when entering step S7 for the first time, the new print line is line N+1, and the previous print line of the new print line is line N. Suppose the third motor speed adjustment parameter of line N+1 is T n+1 , let the speed adjustment parameter of the fourth motor in row N be T n , the default difference is a, a>0, then through (T n+1 -T n ) / a can determine the number of rows to be changed, and the adjustment area is a set of motor speed adjustment parameters of a certain number of motor speed adjustment parameters before the Nth motor speed adjustment parameter in the cache area, and the certain number is the same as the value of the number of rows to be changed, specifically including:

[0060] First, compare the third motor speed adjustment parameter of the new printed line with the fourth motor speed adjustment parameter of the previous printed line of the new printed line. The following situations exist: (1) When the difference between the fourth motor speed adjustment parameter and the third motor speed adjustment parameter is greater than or equal to the preset difference, that is, T n -T n+1 ≥a, it is necessary to update the third motor speed adjustment parameter to the difference between the fourth motor speed adjustment parameter and the preset difference, that is, T n -a. The meaning at this time is that the increase in the motor speed of the (N + 1)-th line relative to the motor speed of the N-th line is large, and slow acceleration needs to be carried out according to the value of a; (2) When the difference between the fourth motor speed adjustment parameter and the third motor speed adjustment parameter is greater than or equal to 0 and less than the preset difference, that is, 0 ≤ T n -T n+1 <a, it is necessary to keep the third motor speed adjustment parameter as the actual T n+1 . The meaning at this time is that the increase in the motor speed of the (N + 1)-th line relative to the motor speed of the N-th line is small, and slow acceleration can be achieved by directly controlling the motor speed according to T n+1 ; (3) When the difference between the third motor speed adjustment parameter and the fourth motor speed adjustment parameter is greater than or equal to 0 and less than the preset difference, that is, 0 ≤ T n+1 -T n <a, it is necessary to keep the third motor speed adjustment parameter as the actual T n+1 . The meaning at this time is that the decrease in the motor speed of the (N + 1)-th line relative to the motor speed of the N-th line is small, and slow deceleration can be achieved by directly controlling the motor speed according to T n+1 ; (4) When the difference between the third motor speed adjustment parameter and the fourth motor speed adjustment parameter is greater than the preset difference, that is, T n+1 -T n ≥a, it is necessary to keep the third motor speed adjustment parameter as T n+1 . At this time, since the decrease in the motor speed of the (N + 1)-th line relative to the motor speed of the N-th line is large, it is necessary to determine the adjustment area, and perform look-ahead control on the fifth motor speed adjustment parameter in the adjustment area starting from the N-th line forward, and decelerate in advance to prevent the motor from decelerating violently at the (N + 1)-th line. Therefore, there is an actual adjustment area only when the third motor speed adjustment parameter of the new printed line is greater than the fourth motor speed adjustment parameter of the previous printed line to a certain extent. At this time, the motor speed of the new printed line is a violent deceleration relative to the motor speed of the previous printed line.

[0061] Then, for the situations in (1), (2), and (3) above, when calculating the quotient of (T n+1 -T n ) / a, a number greater than or equal to 1 cannot be obtained, and the number of lines to be changed is 0 for all. For the situation in (4) above, (T n+1-T n ) / a is a number greater than or equal to 1, calculate (T n+1 -T n ) / a can determine the number of rows to be changed, (T n+1 -T n ) / a is a non-integer. The number of rows to be changed is determined based on the integer part. n+1 -T n ) / a is 3, then the 3 rows before the Nth row are the adjustment area, namely the Nth row, the N-1th row, and the N-2th row, and the adjustment starts from the Nth row in sequence. For example, the speed adjustment parameter of the fifth motor corresponding to the Nth row is determined to be T n+1 -a, determine that the fifth motor speed adjustment parameter corresponding to row N-1 is T n+1 -2a, determine that the fifth motor speed adjustment parameter corresponding to row N-2 is T n+1 -3a.

[0062] It should be noted that when the difference between two fifth motor speed adjustment parameters adjacent to each other in the printing order in the cache area does not exceed the value a, the calculation of the fifth motor speed adjustment parameter to be changed is stopped. For example, during the adjustment process, the fifth motor speed adjustment parameter corresponding to the N-2th row in the cache area is T n+1 -2a, the fifth motor speed adjustment parameter corresponding to row N-1 is T n+1 -2a, the fifth motor speed adjustment parameter corresponding to row N is T n+1 -3a, the speed adjustment parameter of the third motor corresponding to the newly printed line N+1 is T n+1 , when adjusting from the Nth row to the front, the Nth row is T n+1 -3a The fifth motor speed adjustment parameter is adjusted to T n+1 -a, the difference between the two fifth motor speed adjustment parameters in the cache area in the printing order is no more than a, and there is no need to continue adjusting the N-2th row and the N-1th row.

[0063] See also Figure 3In this embodiment, the preset difference a=3 corresponds to the situation in (4) above: when step S7 is executed for the first time, the new print line is the 17th line, and the third motor speed adjustment parameter corresponding to the 17th line is 28. The previous print line of the new print line is the 16th line, and the fourth motor speed adjustment parameter corresponding to the 16th line is 16. Since the difference of 28-16 is greater than or equal to 3, the quotient of (28-16) / 3 is 4, and it is determined that the number of lines to be changed is 4. Then, the 4 lines starting from the 16th line are the adjustment area, namely the 16th line, the 15th line, the 14th line and the 13th line. Then, the adjustment area is smoothed. In this process, the fifth motor speed adjustment parameters arranged in the printing order in the cache area are {16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16}, the fifth motor adjustment parameter in the 16th row is adjusted to 25 (obtained by 28-3), the fifth motor adjustment parameter in the 15th row is adjusted to 22 (obtained by 28-3*2), and the fifth motor adjustment parameter in the 14th row is adjusted to 19 (obtained by 28-3*3). At this time, the fifth motor speed adjustment parameters arranged in the printing order in the cache area are {16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 22, 25}. The interval between two adjacent fifth motor speed adjustment parameters in the printing order in the cache area is no more than 3, and the smoothing of the adjustment area is completed. At this time, the updated third motor speed adjustment is 28. The corresponding situation in (2) above is: when step S7 is executed for the fourth time, the new print line is the 20th line, and the third motor speed adjustment parameter corresponding to the 20th line is 36. The previous print line of the new print line is the 19th line, and the fourth motor speed adjustment parameter corresponding to the 19th line is 38. Since the difference of 38-36 is greater than or equal to 0 and less than 3, the third motor speed adjustment parameter of the 20th line is kept at 36. In addition, the number of lines to be changed determined by the quotient of (36-38) / 3 is 0. At this time, the updated third motor speed adjustment parameter is 36. The corresponding situation in (1) is as follows: when step S7 is executed for the fifth time, the new print line is the 21st line, the third motor speed adjustment parameter corresponding to the 21st line is 25, the previous print line of the new print line is the 20th line, the fourth motor speed adjustment parameter corresponding to the 20th line is 36, and since the difference of 36-25 is greater than 3, the third motor speed adjustment parameter of the 21st line is set to 33 (obtained by 36-3), and the number of lines to be changed determined by the quotient of (25-36) / 3 is 0. At this time, the updated third motor speed adjustment parameter is 33.The situation corresponding to the above (3) is: when step S7 is executed for the 7th time, the new print line is the 23rd line, the third motor speed adjustment parameter corresponding to the 23rd line is 32, the previous print line of the new print line is the 22nd line, and the fourth motor speed adjustment parameter corresponding to the 22nd line is 30. Since the difference of 32-30 satisfies greater than or equal to 0 and less than 3, the third motor speed adjustment parameter of the 23rd line is kept at 32, and the number of lines to be changed determined by the quotient of (32-30) / 3 is 0. At this time, the updated third motor speed adjustment parameter is 32.

[0064] S8: updating the updated third motor speed adjustment parameter to the cache area.

[0065] After the smoothing process of the adjustment area is completed, the updated third motor speed adjustment parameter determined in step S7 is updated to the cache area, and then the process returns to step S5 to continue printing. For example, when the thermal printing device controls the motor to print the second line of data to be printed according to the second address of the cache area, the third motor speed adjustment parameter corresponding to the N+1th line has been updated to the first address of the cache area.

[0066] See also Figure 3 In this embodiment, the first adjustment is completed after the first execution of step S8. At this time, the motor speed adjustment parameters stored in the cache area can be arranged in the order of printing as {16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 22, 25, 28}. Similarly, the second adjustment is completed after the second execution of step S8. At this time, the motor speed adjustment parameters stored in the cache area can be arranged in the order of printing as {16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 22, 25, 28}. It can be arranged as {16,16,16,16,16,16,16,16,16,16,16,19,22,25,28,25}. After the seventh execution of step S8, the seventh adjustment is completed. At this time, the motor speed adjustment parameters stored in the cache area can be arranged in the order of printing as {16,16,16,17,20,23,26,29,32,35,38,36,33,33,30,32}

[0067] In summary, the present invention can realize smooth control of motor acceleration and deceleration, and can well take into account the problem of sudden change in heating time. In addition, the present invention has less hardware resource requirements, is simple and reliable in implementation, has good speed control effect, and has better universal applicability.

[0068] Thermal printing device embodiment:

[0069] The thermal printing device of this embodiment includes a processor and a memory. The memory stores a computer program. When the processor executes the computer program, the above-mentioned printer motor speed control method embodiment is implemented.

[0070] The thermal printing device may include but is not limited to a processor and a memory. Those skilled in the art will appreciate that the thermal printing device may include more or fewer components, or a combination of certain components, or different components, for example, the thermal printing device may also include input and output devices, network access devices, buses, etc.

[0071] For example, the processor may 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 gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microcontroller or any conventional processor, etc. The processor is the control center of the thermal printing device, and uses various interfaces and lines to connect various parts of the entire thermal printing device.

[0072] The memory can be used to store computer programs and / or modules. The controller realizes various functions of the thermal printing device by running or executing the computer programs and / or modules stored in the memory, and calling the data stored in the memory. For example, the memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the thermal printing device, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Med ia 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.

[0073] Computer readable storage medium embodiment:

[0074] If the module integrated in the thermal printing device of the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the implementation of all or part of the process of the embodiment of the printer motor speed control method can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the controller, the steps of the above printer motor speed control method embodiment can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The storage medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can 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, the computer-readable medium does not include electric carrier signal and telecommunication signal.

[0075] Computer program product embodiment:

[0076] The computer program product of this embodiment includes computer instructions, which are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes each step of the above-mentioned printer motor speed control method embodiment.

Claims

1. A printer motor speed control method, characterized in that: The following steps are involved: Acquire a first motor speed adjustment parameter group of a preset number of lines of data to be printed; the first motor speed adjustment parameter group includes the same number of first motor speed adjustment parameters as the preset number of lines, and each of the first motor speed adjustment parameters corresponds one-to-one to a line of data to be printed; Smoothing the first motor speed adjustment parameter group to obtain a second motor speed adjustment parameter group, and storing the second motor speed adjustment parameter group in a cache area; The second motor speed adjustment parameter group includes the same number of second motor speed adjustment parameters as the preset number of lines, and each second motor speed adjustment parameter corresponds one-to-one to a line of data to be printed; Printing is performed based on the cache area, and during the printing process, the following steps are continuously performed: Obtaining a third motor speed adjustment parameter for a new print line, wherein the new print line is separated from the current print line by the preset number of lines; Compare the third motor speed adjustment parameter of the new print line with the fourth motor speed adjustment parameter of the previous print line of the new print line to determine the adjustment area in the cache area starting from the previous print line of the new print line, smooth the adjustment area, update the third speed adjustment parameter, and update the updated third motor speed adjustment parameter to the cache area.

2. The printer motor speed control method according to claim 1, characterized in that: The following steps are involved: The first motor speed adjustment parameter group is smoothed to obtain the second motor speed adjustment parameter group, including: The maximum first motor speed adjustment parameter in the first motor speed parameter group is determined, and each of the first motor speed adjustment parameters in the first motor speed parameter group is set as the maximum first motor speed adjustment parameter to obtain the second motor speed adjustment parameter group.

3. The printer motor speed control method according to claim 2, characterized in that: The smoothing process for the adjustment area includes: Starting from the previous print line of the new print line, the fifth motor speed adjustment parameter of each print line is adjusted in sequence from back to front in the adjustment area until the difference between two adjacent fifth motor speed adjustment parameters in the execution order in the cache area does not exceed a preset difference.

4. The printer motor speed control method according to claim 3, characterized in that: Determining the adjustment area includes: The number of rows to be changed is determined according to the quotient of the difference between the third motor speed adjustment parameter and the fourth motor speed adjustment parameter and the preset difference, and the adjustment area is determined according to the number of rows to be changed.

5. The printer motor speed control method according to claim 4, characterized in that: Updating the third motor speed adjustment parameter, and updating the cache area according to the updated third motor speed adjustment parameter, including: when comparing the third motor speed adjustment parameter of the new print line with the fourth motor speed adjustment parameter of the previous print line of the new print line, if the difference between the fourth motor speed adjustment parameter and the third motor speed adjustment parameter is greater than or equal to the preset difference, then updating the third motor speed adjustment parameter to the difference between the fourth motor speed adjustment parameter and the preset difference, and updating to the cache area according to the updated third motor speed adjustment parameter.

6. The printer motor speed control method according to claim 4, characterized in that: Updating the third motor speed adjustment parameter, and updating the cache area according to the updated third motor speed adjustment parameter, including: when comparing the third motor speed adjustment parameter of the new print line with the fourth motor speed adjustment parameter of the previous print line of the new print line, if the difference between the fourth motor speed adjustment parameter and the third motor speed adjustment parameter is greater than or equal to 0 and less than the preset difference, keeping the third motor speed adjustment parameter unchanged and updating it to the cache area as the updated third motor speed adjustment parameter.

7. The printer motor speed control method according to claim 4, characterized in that: Updating the third motor speed adjustment parameter, and updating the cache area according to the updated third motor speed adjustment parameter, including: when comparing the third motor speed adjustment parameter of the new print line with the fourth motor speed adjustment parameter of the previous print line of the new print line, if the difference between the third motor speed adjustment parameter and the fourth motor speed adjustment parameter is greater than or equal to 0 and less than the preset difference, keeping the third motor speed adjustment parameter unchanged and updating it to the cache area as the updated third motor speed adjustment parameter.

8. A thermal printing device, comprising a processor and a memory, characterized in that: The memory stores a computer program, and when the computer program is executed by the processor, the printer motor speed control method according to any one of claims 1 to 7 is implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the printer motor speed control method according to any one of claims 1 to 7 is implemented.

10. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by the processor, the printer motor speed control method described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method for reducing operation noise of stepping motor of thermal printer

    CN112937134A

  • Printing data processing method and electronic equipment

    CN113805808A

  • Thermal printer and control program for the same

    JP2011251472A

  • Method and apparatus for printhead control

    US20140009768A1