Thermal printer abnormal state detection method, device, printer and storage medium
By using a photoelectric sensor in a thermal printer to detect the signal received after each paper feed, determine the abnormal status and output prompt information, it solves the complex design and high cost problems caused by multiple sensors, and achieves accurate detection and simplification of abnormal status. design.
Patent Information
- Application Number
- CN202311612418.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-28
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2043-11-28
AI Technical Summary
Existing thermal printers require multiple sensors to detect abnormal conditions, resulting in complex hardware module design, low data processing efficiency, and high equipment costs.
By setting up a photoelectric sensor in the printer and using the photoelectric signal received after each paper feeding a preset distance, the printer's abnormal status type is determined and corresponding prompt information is output, including lack of ribbon, ribbon breakage and tape abnormality.
It achieves accurate detection of printer abnormality through a single photoelectric sensor, simplifies the hardware structure design, and reduces hardware costs.
Smart Images

Figure CN117507645B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of printers, and in particular to a method and device for detecting an abnormal state of a thermal printer, a printer and a storage medium. Background Art
[0002] Thermal printing technology refers to a printing technology that heats the toner coating on the carbon ribbon and melts it and transfers it to the printing paper by heating the print head. The carbon ribbon is a polyester film coated with wax, resin or mixed ink on the surface. The coating material on the carbon ribbon has strong adhesion. The printed text or pattern is not affected by external factors and can be stored for a long time without fading. It will not change color due to changes in ambient temperature or contact with solvents. Based on the advantages of thermal printing technology, thermal printers have been widely used in electronic payment, transportation, logistics and other fields.
[0003] Since the carbon ribbon is made of polyester film material with low strength, it is easy to have abnormalities during the printing process, causing the printer to work abnormally. Usually, multiple sensors are required to detect the abnormal state of printers with carbon ribbon consumables. For example, when the printer is in an abnormal state, at least one independent sensor or even multiple sensors are required to assist in detecting the abnormal state. As a result, the printer needs to be configured with a large number of sensors, which brings about the problem of difficulty in the hardware module and structural design of the printer. After installing multiple sensors, the amount of data collected by the printer from multiple sensors is large, the data processing efficiency is low, the logic of the printer's abnormal state judgment is complex, and the equipment cost is high. Summary of the invention
[0004] In view of the above, it is necessary to provide a method and device for detecting abnormal state of a printer, a printer and a storage medium, which can accurately solve the problems existing in the abnormal state detection of the above-mentioned printer.
[0005] In a first aspect, the present application provides a method for detecting an abnormal state of a printer, wherein the printer includes a photoelectric sensor, and the printer is configured to receive a photoelectric signal sent by the photoelectric sensor during normal use. The abnormal state detection method includes: detecting and determining the type of abnormal state of the printer through the photoelectric signal received by the printer after each paper travels a preset distance; and outputting corresponding prompt information according to the type of abnormal state.
[0006] In a possible implementation, determining the abnormal state type of the printer based on the photoelectric signal received by the printer after each paper travels a preset distance includes: when the printer does not receive a preset number of photoelectric signals after the printer travels a preset distance for the first time, determining that the abnormal state type of the printer is a lack of carbon ribbon.
[0007] In a possible implementation, determining the abnormal state type of the printer through the photoelectric signal received by the printer after each paper feed of a preset distance also includes: receiving a preset number of photoelectric signals after the printer feeds the paper a preset distance for the first time, and continuing to determine whether printing content is detected when the printer does not receive the preset number of photoelectric signals after any paper feed of the preset distance after the first paper feed of the preset distance; if it is determined that printing content is detected, determining that the abnormal state type of the printer is a broken carbon ribbon; if it is determined that no printing content is detected, determining that the abnormal state type of the printer is a stuck tape abnormality.
[0008] In a possible implementation, the abnormal state detection method further includes: if the printer receives a preset number of photoelectric signals after each paper travels a preset distance, determining whether the printing task is completed; when it is determined that the printing task is completed, outputting a printing task completion prompt message.
[0009] In a possible implementation, the preset distance is greater than or equal to 10 mm and less than or equal to 30 mm. Preferably, the preset distance is 20 mm.
[0010] In a second aspect, an embodiment of the present application provides an abnormal state detection device for a printer, the abnormal state detection device comprising: a determination module for determining the abnormal state type of the printer through the photoelectric signal received by the printer after each paper travels a preset distance; and an output module for outputting corresponding prompt information according to the abnormal state type.
[0011] In a third aspect, an embodiment of the present application provides a printer, comprising: a memory and a processor; the memory stores computer-readable instructions; and the processor is used to execute the computer-readable instructions stored in the memory to implement the abnormal state detection method of the printer as described above.
[0012] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-readable instructions are stored. The computer-readable instructions are executed by a processor in a printer to implement a method for detecting an abnormal state of the printer.
[0013] In a fifth aspect, an embodiment of the present application further provides a printer, the printer comprising a photoelectric sensor, a grating disk and a carbon ribbon structure, the carbon ribbon structure comprising a carbon ribbon, a recovery wheel, a tensioning wheel, a first transmission shaft and a second transmission shaft, the recovery wheel being arranged on the first transmission shaft, the tensioning wheel being arranged on the second transmission shaft, one end of the carbon ribbon being connected to the recovery wheel, and the other end being connected to the tensioning wheel, the grating disk being arranged on the second transmission shaft, and being located below the tensioning wheel, the photoelectric sensor being arranged inside the housing of the carbon ribbon structure, close to the grating disk, the photoelectric sensor being configured as follows: when the printer performs a printing task and causes the recovery wheel to rotate, so as to drive the tensioning wheel and the grating disk to rotate through the carbon ribbon, the grating disk periodically blocks the infrared light emitted by the photoelectric sensor to output a photoelectric signal; the printer being configured as follows: determining the type of abnormal state of the printer according to the photoelectric signal received after each paper travels a preset distance; and outputting corresponding prompt information according to the type of abnormal state.
[0014] In a possible implementation, the printer is further configured to: output prompt information that the abnormal state type of the printer is a lack of carbon ribbon when the printer does not receive a preset number of photoelectric signals after the first paper feeds a preset distance; output prompt information that the abnormal state type of the printer is a broken carbon ribbon when the printer receives a preset number of photoelectric signals after the first paper feeds a preset distance, and does not receive the preset number of photoelectric signals after any paper feeds a preset distance after the first paper feeds a preset distance, and when printing content is detected; and
[0015] When the printer receives a preset number of photoelectric signals after the first paper feeds a preset distance, and when the printer does not receive the preset number of photoelectric signals after any paper feeds a preset distance after the first paper feeds the preset distance, and no printing content is detected, a prompt message is output that the abnormal state type of the printer is a tape jam abnormality.
[0016] In a possible implementation manner, the preset number is obtained based on the preset distance, the diameter of the grating disk, the number of grids of the grating disk, and the length of a single grid of the grating disk.
[0017] The abnormal state detection method, device, printer and medium provided in the embodiments of the present application determine the abnormal state type of the printer by the photoelectric signal received by the printer after each paper travels a preset distance; and output corresponding prompt information according to the abnormal state type. Not only can the abnormal state of the printer be accurately detected by a single photoelectric sensor, but also the hardware structure design of the printer is simplified and the hardware cost is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a schematic diagram of the structure of a printer provided in one embodiment of the present application.
[0019] Figure 2 It is a schematic diagram of the carbon ribbon structure of a printer provided in one embodiment of the present application.
[0020] Figure 3 It is a schematic diagram of a carbon ribbon structure of a printer provided in another embodiment of the present application.
[0021] Figure 4 It is a schematic diagram of the relative positions of the grating disk and the photoelectric sensor in the carbon ribbon structure provided in one embodiment of the present application.
[0022] Figure 5 This is a flowchart of an abnormal state detection method provided by another embodiment of the present application.
[0023] Figure 6 This is a flowchart of an abnormal state detection method provided by another embodiment of the present application.
[0024] Figure 7 It is a structural schematic diagram of an abnormal state detection device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0025] The following will describe the implementation methods of the present invention in detail in conjunction with the accompanying drawings and embodiments, so that the implementers of the present invention can fully understand how the present invention applies technical means to solve technical problems and achieve the implementation process of technical effects and implement the present invention specifically according to the above implementation process. It should be noted that as long as there is no conflict, the various embodiments and various features of the embodiments in the present invention can be combined with each other, and the technical solutions formed are all within the protection scope of the present invention.
[0026] Although the flowcharts describe the operations as sequential processes, many of the operations may be performed in parallel, concurrently, or simultaneously. The order of the operations may be rearranged. A process may be terminated when its operations are completed, but may also have additional steps not included in the accompanying drawings. A process may correspond to a method, function, procedure, subroutine, subprogram, etc.
[0027] The terms "first", "second", etc. may be used herein to describe various units, but these units should not be limited by these terms, and these terms are used only to distinguish one unit from another unit. The term "and / or" used herein includes any and all combinations of one or more of the listed associated items. When a unit is referred to as being "connected" or "coupled" to another unit, it can be directly connected or coupled to the other unit, or there can be intermediate units.
[0028] Since the carbon ribbon in the thermal transfer printer is made of polyester film material with low strength, it is easy to have abnormalities during the printing process, causing the printer to work abnormally. Usually, multiple sensors are required to detect the abnormal state of thermal transfer printers with carbon ribbon consumables. For example, when an abnormal state occurs in the printer, at least one independent sensor or even multiple sensors are required to assist in detecting the abnormal state. As a result, the printer needs to be configured with a large number of sensors, which brings about the problem of difficulty in the hardware module and structural design of the printer. Moreover, after installing multiple sensors, the amount of data collected by the printer from multiple sensors is large, the data processing efficiency is low, the logic of the printer's abnormal state judgment is complex, and the equipment cost is high.
[0029] In order to solve the above problems, the embodiments of the present application provide a method for detecting an abnormal state of a printer, which can effectively detect the abnormal state of a printer through a photoelectric sensor. In order to better understand the method, device, printer and storage medium for detecting an abnormal state of a printer provided in the embodiments of the present application, the application scenario of the method for detecting an abnormal state of a printer of the present application is first described below.
[0030] Figure 1 The printer abnormal state detection method is applied in a printer 1, which includes but is not limited to: a memory 11 connected via a communication bus 10, at least one processor 12, a photoelectric sensor 13, a motor 14, and a paper output sensor 15.
[0031] The printer 1 may be a thermal printer. The printer 1 further includes a ribbon structure 100, such as Figure 2 and Figure 3 As shown, the carbon ribbon structure 100 is arranged inside the printer 1. The carbon ribbon structure 100 includes a carbon ribbon 101, a recovery wheel 102, a tension wheel 103, a first transmission shaft 104 and a second transmission shaft 105. The recovery wheel 102 is arranged on the first transmission shaft 104, and the tension wheel 103 is arranged on the second transmission shaft 105. One end of the carbon ribbon 101 is connected to the recovery wheel 102, and the other end is connected to the tension wheel 103. When the printer 1 is working, the recovery wheel 102 is controlled to rotate by the motor 14, so that the tension wheel 103 is driven to rotate through the carbon ribbon 101 to perform the printing task.
[0032] In the embodiment of the present application, the printer 1 further includes a grating disk 106, which is disposed inside the printer 1. Specifically, the grating disk 106 is disposed on the second transmission shaft 105, and is located below the tensioning wheel 103. When the user closes the housing of the ribbon structure 100 and controls the recovery wheel 102 to rotate through the motor 14 in the printer 1 to perform a tightening action, the tensioning wheel 103 is driven to rotate through the ribbon 101, and the grating disk 106 is driven to rotate at the same time.
[0033] The photoelectric sensor 13 is used to detect the grating signal and output a photoelectric signal according to the grating signal and send it to the printer 1. The printer 1 can receive the photoelectric signal sent by the photoelectric sensor 13 during normal use. The photoelectric sensor 13 is arranged inside the housing of the carbon ribbon structure 100, close to the grating disk 106. Specifically, Figure 4 As shown, the grating disk 106 can be arranged between the infrared emitting tube 130 and the infrared receiving tube 131 of the photoelectric sensor 13. When the photoelectric sensor 13 is working, the infrared emitting tube 130 emits infrared light, and the infrared receiving tube 131 receives the infrared light and generates a photoelectric signal. In the embodiment of the present application, when the printer 1 is working and drives the grating disk 106 to rotate, the grid of the grating disk 106 will periodically block the infrared light emitted by the infrared emitting tube 130, so that the infrared receiving tube 131 periodically receives the infrared light and periodically outputs a level signal. The level signal is similar to a square wave signal, wherein the high level of the square wave signal represents the number of grids of the grating disk 106 rotating.
[0034] The motor 14 is used to control the paper feeding operation of the printer 1. Specifically, the motor 14 can control the recovery wheel 102 to rotate, and drive the tension wheel 103 to rotate through the carbon ribbon 101 to perform the printing task.
[0035] The paper discharge sensor 15 is used to determine whether the printer 1 discharges paper when it is working.
[0036] Figure 1 This is only an example of the printer 1 and does not constitute a corresponding limitation. In other embodiments, the printer 1 may include more components than those shown in the figure. It should be noted that the carbon ribbon structure is a common carbon ribbon structure in the existing thermal printer field.
[0037] In the following embodiments, for ease of description, the processor 12 is described by taking a controller as an example.
[0038] Figure 5 is a flow chart of a method for detecting an abnormal state of a printer provided by an embodiment of the present application. Figure 5 As shown, the abnormal state detection method is applied in a printer. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted.
[0039] Step S21, controlling the printer to execute the printing task.
[0040] Step S22, determining the abnormal state type of the printer according to the photoelectric signal received by the printer after each paper travels a preset distance.
[0041] In the embodiment of the present application, the preset paper feeding distance of the printer can be determined by counting the number of pulses sent to the motor. Specifically, assuming that the motor outputs a control pulse signal, it can drive the carbon ribbon to rotate 0.021175mm. Therefore, when the preset paper feeding distance is 20mm, the motor controls the printer to feed 20mm of paper, which requires about 945 pulse signals.
[0042] In addition, if the diameter of the grating disk is d = 20.9mm, then the circumference of the grating disk is 65.626mm. If the number of grids on the grating disk is 10, then the length of a single grid is 6.5626mm. Therefore, when the preset paper feeding distance of the printer is 20mm, theoretically the photoelectric sensor can capture 6.5626 / 20≈3 pulse signals, and output 3 photoelectric signals to the printer after capturing 3 pulse signals.
[0043] In the embodiment of the present application, the preset distance is greater than or equal to 10 mm and less than or equal to 30 mm. Preferably, the preset distance is 20 mm.
[0044] In the embodiment of the present application, the preset paper feeding distance and the preset number can vary with the diameter or circumference of the grating disk. Specifically, the value of the preset number can be obtained based on the preset distance, the diameter of the grating disk, the number of grids of the grating disk, and the length of a single grid of the grating disk. Preferably, the preset number is 3.
[0045] In an embodiment of the present application, determining the abnormal state type of the printer by the photoelectric signal received by the printer after each paper travels a preset distance includes: determining the abnormal state type of the printer by determining whether a preset number of photoelectric signals are received after each paper travels a preset distance. If there is a situation where the printer does not receive a preset number of photoelectric signals after the paper travels a preset distance, it is determined that the printer is in an abnormal state, and it is necessary to determine the abnormal state type of the printer, so as to promptly remind the user to deal with the printer abnormality. Specifically, the abnormal state types of the printer include, but are not limited to, missing carbon ribbon, broken carbon ribbon, and stuck ribbon abnormality.
[0046] In some embodiments, when the user closes the cover of the ribbon structure, the printer will tighten the ribbon, that is, the recycling wheel of the ribbon rotates a preset distance. If there is a ribbon in this process, the rotation of the recycling wheel will drive the tension wheel to rotate through the pulling effect of the ribbon, so that the infrared receiving tube of the photoelectric sensor can periodically receive the blocked level signal during the process of the tension wheel driving the grating disk to rotate together. If the ribbon is not installed in the ribbon structure, the tension wheel will not rotate during the rotation of the recycling wheel, and the photoelectric sensor will not be able to receive the blocked level signal. At this time, it is determined that the printer is in an abnormal state of lack of ribbon, and it is necessary to report the abnormal state to remind the user to replenish the ribbon.
[0047] In some embodiments, when the printer enters the printing process, it first detects whether the carbon ribbon exists. After determining that the carbon ribbon exists, the printer starts to execute the printing task. During the printing process of the printer, after the recovery wheel rotates, the carbon ribbon drives the tension wheel to rotate, so that the infrared receiving tube of the photoelectric sensor can periodically receive the level signal after being blocked during the process of the tension wheel driving the grating disk to rotate together, and output the level signal to the processor of the printer. If the printer still cannot receive the level signal sent by the photoelectric sensor after the paper feeds a preset distance (for example, 20mm) during the printing process, it indicates that an abnormal state of carbon ribbon breakage occurs during the printing process. Due to the breakage of the carbon ribbon, the tension wheel loses the pulling effect of the carbon ribbon and cannot drive the grating disk to rotate, then it is necessary to suspend the printing operation and report the abnormal state of carbon ribbon breakage to remind the user to handle it.
[0048] In some embodiments, during the normal printing process of the printer, after the recycling wheel rotates, the tension wheel will be driven to rotate through the carbon ribbon, so that the infrared receiving tube of the photoelectric sensor can periodically receive the level signal after being blocked during the process of the tension wheel driving the grating disk to rotate together, and output the level signal to the processor of the printer. If the printer still cannot receive the preset number of level signals sent by the photoelectric sensor after the paper moves a preset distance (for example, 20mm) during the printing process, and at this time, it is determined in combination with the paper output sensor that no print content is detected, that is, the recycling wheel cannot rotate and the tension wheel cannot rotate, it means that the main structure transmission of the printer is stuck by foreign objects, and an abnormal state of tape jam occurs. Therefore, it is necessary to immediately suspend the printing operation and report the abnormal state of tape jam in the main structure of the printer to remind the user to handle it in time.
[0049] Step S23: output corresponding prompt information according to the abnormal state type.
[0050] In an embodiment of the present application, in order to promptly remind the user that the printer has an abnormal condition, after determining the abnormal state type of the printer, corresponding prompt information can be output according to the abnormal state type. Specifically, when the printer does not receive a preset number of photoelectric signals after the first paper feed preset distance, the abnormal state type of the printer is determined to be a lack of carbon ribbon, and a prompt information that the abnormal state of the printer is a lack of carbon ribbon is output; when the printer receives a preset number of photoelectric signals after the first paper feed preset distance, and the printer does not receive a preset number of photoelectric signals after any paper feed preset distance after the first paper feed preset distance, and when the printing content is detected, the abnormal state type of the printer is determined to be a carbon ribbon break, and a prompt information that the abnormal state of the printer is a carbon ribbon break is output; and when the printer receives a preset number of photoelectric signals after the first paper feed preset distance, and the printer does not receive a preset number of photoelectric signals after any paper feed preset distance after the first paper feed preset distance, and when the printing content is not detected, the abnormal state type of the printer is determined to be a tape jam, and a prompt information that the abnormal state of the printer is a tape jam is output.
[0051] Step S24, determining whether the printing task is completed. If it is determined that the printing task is completed, the process proceeds to step S25; if it is determined that the printing task is not completed, the process returns to step S21 and continues to control the printer to execute the printing task.
[0052] In the embodiment of the present application, when it is determined that a preset number of photoelectric signals are received after each paper travels a preset distance, it is determined that no abnormal state occurs during the printer's execution of the print task, and it is further determined whether the printer's print task is completed. When it is determined that the print task is completed, the process enters step S25; when it is determined that the print task is not completed, the process returns to step S21, and the printer continues to be controlled to execute the print task.
[0053] Step S25, outputting a prompt message indicating that the printing task is completed.
[0054] In an embodiment of the present application, when it is determined that a preset number of photoelectric signals are received after each paper travels a preset distance and the printing task is completed, a prompt message indicating that the printing task is completed can be output.
[0055] In the embodiment of the present application, the user can be reminded of the completion of the printing task by outputting a voice prompt message, or by outputting a beep to remind the user of the completion of the printing task. In other embodiments, the user can also be reminded of the completion of the printing task by outputting a text prompt message, which is not limited in the present application.
[0056] Figure 6 is a flow chart of an abnormal state detection method provided by another embodiment of the present application. Figure 6As shown, the abnormal state detection method is applied in a printer. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted.
[0057] Step S31, controlling the printer to execute the printing task.
[0058] Step S32, controlling the printer to feed paper a preset distance for the first time.
[0059] In the embodiment of the present application, it is first necessary to confirm whether there is a carbon ribbon in the printer. If there is no carbon ribbon, the printer cannot execute the printing task or the printing task executed by the printer is invalid.
[0060] In some embodiments, when the user closes the cover of the ribbon structure, the printer will tighten the ribbon, that is, the recycling wheel of the ribbon rotates a preset distance. If there is a ribbon in this process, the rotation of the recycling wheel will drive the tension wheel to rotate by the pulling effect of the ribbon, thereby controlling the first paper feeding distance of the printer. If it is determined that there is no ribbon in this process, the recycling wheel cannot drive the tension wheel to rotate by the pulling effect of the ribbon after rotating.
[0061] Step S33, determining whether a preset number of photoelectric signals are received. If it is determined that the preset number of photoelectric signals are not received, executing step S34; if it is determined that the preset number of photoelectric signals are received, executing step S35.
[0062] In the embodiment of the present application, in the process of controlling the printer to move the paper for the first time by a preset distance, it is necessary to determine whether there is a carbon ribbon according to whether a preset number of photoelectric signals are received. If it is determined that the preset number of photoelectric signals are not received, it is determined that the printer lacks a carbon ribbon, and the process executes step S34. If it is determined that the preset number of photoelectric signals are received, it is determined that the printer does not lack a carbon ribbon, and the process executes step S35.
[0063] In the embodiment of the present application, since there is no ribbon in the printer, during the first paper feeding of the printer for a preset distance, the recovery wheel cannot drive the tension wheel to rotate through the pulling effect of the ribbon, so that the infrared receiving tube of the photoelectric sensor cannot periodically receive the level signal after being blocked during the process of the tension wheel driving the grating disk to rotate together during the paper feeding of the printer for a preset distance. At this time, it can be determined that the printer is in an abnormal state of lacking ribbon, and the process executes step S34, and the abnormal state needs to be reported to remind the user that the ribbon is missing.
[0064] In the embodiment of the present application, the preset paper feeding distance of the printer can be determined by counting the number of pulses sent to the motor. Specifically, assuming that the motor outputs a control pulse signal, it can drive the carbon ribbon to rotate 0.021175mm. Therefore, when the preset paper feeding distance is 20mm, the motor controls the printer to feed 20mm of paper, which requires about 945 pulse signals.
[0065] In addition, if the diameter of the grating disk is d = 20.9mm, then the circumference of the grating disk is 65.626mm. If the number of grids on the grating disk is 10, then the length of a single grid is 6.5626mm. Therefore, when the preset paper feeding distance of the printer is 20mm, theoretically the photoelectric sensor can capture 6.5626 / 20≈3 pulse signals, and output 3 photoelectric signals to the printer after capturing 3 pulse signals.
[0066] In the embodiment of the present application, the preset number is 3. It should be noted that the preset paper feeding distance and the preset number may vary with the diameter or circumference of the grating disk.
[0067] Step S34, outputting a ribbon shortage prompt message.
[0068] In the embodiment of the present application, when it is determined that a preset number of photoelectric signals output by the photoelectric sensor are not received, it is determined that there is no carbon ribbon in the printer, and the user needs to be reminded to replenish the carbon ribbon.
[0069] Step S35, controlling the printer to continue feeding the paper a preset distance.
[0070] In the embodiment of the present application, after determining that the carbon ribbon exists, it is necessary to continue to detect whether other abnormalities occur during the execution of the printing task by the printer, and control the printer to continue to feed the paper by a preset distance during the execution of the printing task.
[0071] It should be noted that after determining that there is a carbon ribbon, in the subsequent printing process, it is necessary to detect the level signal received by the photoelectric sensor once each time the paper travels a preset distance.
[0072] Step S36, determining whether a preset number of photoelectric signals are received. If it is determined that the preset number of photoelectric signals are not received, executing step S37; if it is determined that the preset number of photoelectric signals are received, executing step S38.
[0073] In an embodiment of the present application, after the printer continues to feed the paper a preset distance during the execution of a printing task, it is determined again whether a preset number of photoelectric signals are received, so as to determine whether a preset number of photoelectric signals sent by the photoelectric sensor can be received after each paper feed of the preset distance, thereby confirming the abnormal state of the printer.
[0074] It should be noted that the specific implementation of step S36 can refer to the implementation of step S22, which will not be repeated here.
[0075] Step S37, determining whether printed content is detected. If it is determined that no printed content is detected, executing step S39; if it is determined that printed content is detected, executing step S40.
[0076] In an embodiment of the present application, if after the printer feeds the paper for the first time for a preset distance, a preset number of photoelectric signals are received, it is determined that there is a carbon ribbon in the printer, and the printer is controlled to continue feeding the paper for the preset distance. After that, it is determined that the preset number of photoelectric signals are not received, and it is determined that an abnormality has occurred in the printer. At this time, in order to determine what specific abnormality has occurred in the printer, it can be determined in combination with whether the printed content is detected. Specifically, when it is determined that no printed content is detected, it is determined that the printer has a tape jam abnormality, and the process executes step S39 to output a prompt message of the tape jam abnormality; when it is determined that the printed content is detected, it is determined that the abnormality of the printer is a broken carbon ribbon, and the process executes step S40 to output a prompt message of the broken carbon ribbon.
[0077] Step S38, controlling the printer to continue feeding the paper a preset distance.
[0078] In the embodiment of the present application, it is necessary to determine whether a preset number of photoelectric signals sent by the photoelectric sensor are received after each paper feed of the printer for a preset distance. Therefore, after the printer feeds the paper for the first time for a preset distance, a preset number of photoelectric signals are received, and then the printer can be controlled to continue feeding the paper for a preset distance, and step S41 is executed to determine whether the printing task is completed. If it is determined that the printing task is completed, step S42 is executed to output a prompt message indicating that the printing task is completed; if it is determined that the printing task is not completed, steps S35-S41 are repeated until it is determined that the printing task is completed. In this way, the abnormal state of the printer can be determined by determining whether a preset number of photoelectric signals are received after each paper feed of a preset distance.
[0079] Step S39, outputting a prompt message indicating that the tape is abnormal.
[0080] In an embodiment of the present application, after the printer feeds the paper for the first time for a preset distance, the recycling wheel rotates and drives the tension wheel to rotate through the carbon ribbon, so that the infrared receiving tube of the photoelectric sensor can periodically receive the level signal after being blocked during the process of the tension wheel driving the grating disk to rotate together, and output the level signal to the processor of the printer. If the printer still cannot receive the preset number of level signals sent by the photoelectric sensor after feeding the paper for a preset distance (for example, 20mm) during the printing process, and at this time, it is determined in combination with the paper output sensor that no print content is detected, that is, the recycling wheel cannot rotate and the tension wheel cannot rotate, it means that the main structure transmission of the printer is stuck by foreign objects, and an abnormal state of tape jam occurs. Therefore, it is necessary to immediately suspend the printing operation and report the abnormal state of the main structure of the printer with tape jam, reminding the user to deal with it in time.
[0081] Step S40, outputting a prompt message indicating that the carbon ribbon is broken.
[0082] In an embodiment of the present application, after the printer feeds the paper for the first time for a preset distance, the recovery wheel rotates and drives the tension wheel to rotate through the carbon ribbon, so that the infrared receiving tube of the photoelectric sensor can periodically receive the level signal that is blocked during the process of the tension wheel driving the grating disk to rotate together, and output the level signal to the processor of the printer. If the printer still cannot receive the preset number of level signals sent by the photoelectric sensor after feeding the paper for a preset distance (for example, 20mm) during the printing process, and at this time, it is determined that the printed content has been detected in combination with the paper output sensor, it indicates that an abnormal state of carbon ribbon breakage has occurred during the printing process. Due to the breakage of the carbon ribbon, the tension wheel loses the pulling effect of the carbon ribbon and cannot drive the grating disk to rotate, then it is necessary to suspend the printing operation and report the abnormal state of carbon ribbon breakage to remind the user to handle it.
[0083] Step S41, determining whether the printing task is completed. If it is determined that the printing task is completed, executing step S42; if it is determined that the printing task is not completed, returning to step S35, controlling the printer to continue feeding the paper for a preset distance.
[0084] Step S42, outputting a prompt message indicating that the printing task is completed.
[0085] The specific implementation of steps S41-S42 can refer to Figure 3 The implementation of steps S24-S25 in will not be repeated here.
[0086] pass Figures 2 to 3 In the embodiment shown, the above scheme controls the printer to execute the printing task; detects and determines the abnormal state type of the printer through the photoelectric signal received by the printer after each paper travels a preset distance; and outputs corresponding prompt information according to the abnormal state type. The above method can accurately detect various abnormal state types of the printer during the printing process through the photoelectric sensor, simplify the hardware structure design of the printer and reduce hardware costs.
[0087] Figure 7 FIG. 4 is a schematic diagram of the structure of an abnormal state detection device 4 of a printer provided in an embodiment of the present application. Figure 7 As shown, in the embodiment of the present application, the abnormal state detection device 4 of the printer can be divided into multiple functional modules according to the functions it performs. The functional modules can include: a determination module 401 and an output module 402.
[0088] The determination module 401 is used to determine the abnormal state type of the printer according to the photoelectric signal received by the printer after each paper travels a preset distance;
[0089] The output module 402 is used to output corresponding prompt information according to the abnormal state type.
[0090] In some embodiments, the determination module 401 is further used to: determine that the abnormal state type of the printer is the lack of carbon ribbon when the printer does not receive the preset number of photoelectric signals after the printer travels the preset distance for the first time.
[0091] In some embodiments, the determination module 401 is also used to continue to determine whether printing content is detected when the printer receives a preset number of photoelectric signals after the printer feeds paper a preset distance for the first time, and when the printer does not receive the preset number of photoelectric signals after any time the printer feeds paper a preset distance after the first time the preset distance; if it is determined that printing content is detected, determine that the abnormal state type of the printer is a broken carbon ribbon; if it is determined that no printing content is detected, determine that the abnormal state type of the printer is a stuck tape abnormality.
[0092] In some embodiments, the determination module 401 is also used to: determine whether the printing task is completed if the printer does not receive the preset number of photoelectric signals after the paper moves a preset distance each time; when it is determined that the printing task is completed, output a prompt message that the printing task is completed.
[0093] The abnormal state detection device 4 provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0094] Please continue reading Figure 1 In this embodiment, the memory 11 may be an internal memory of the printer 1, that is, a memory built into the printer 1. In other embodiments, the memory 11 may also be an external memory of the printer 1, that is, a memory externally connected to the printer 1.
[0095] In some embodiments, the memory 11 is used to store program codes and various data, and to achieve high-speed and automatic access to programs or data during the operation of the printer 1 .
[0096] The memory 11 may include a 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 media card (SMC), a 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.
[0097] In one embodiment, the processor 12 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. A general-purpose processor may be a microprocessor, or the processor may be any other conventional processor, etc.
[0098] If the program code and various data in the memory 11 are implemented in the form of a software functional unit and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, such as the abnormal state detection method, and 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, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. 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, etc. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), etc.
[0099] It is understandable that the module division described above is a logical function division, and there may be other division methods in actual implementation. In addition, the functional modules in each embodiment of the present application may be integrated in the same processing unit, or each module may exist physically separately, or two or more modules may be integrated in the same unit. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0100] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.
Claims
1. A method for detecting abnormal state of a thermal printer, characterized in that: The thermal printer comprises a photoelectric sensor and a grating disk, wherein the grating disk is arranged between an infrared transmitting tube and an infrared receiving tube of the photoelectric sensor, and the printer is arranged to receive a photoelectric signal sent by the photoelectric sensor during normal use, and the grid of the grating disk periodically blocks the infrared light emitted by the infrared transmitting tube, and the infrared receiving tube periodically receives the infrared light and periodically outputs a photoelectric signal, and the abnormal state detection method comprises: Determining the abnormal state type of the printer according to the photoelectric signal received by the printer after each paper travels a preset distance; When the printer does not receive a preset number of photoelectric signals after the paper travels a preset distance for the first time, determining that the abnormal state type of the printer is a lack of carbon ribbon; When the printer receives a preset number of photoelectric signals after the first paper feeds a preset distance, and when the printer does not receive the preset number of photoelectric signals after any paper feeds a preset distance after the first paper feeds a preset distance, continue to determine whether print content is detected; If it is determined that the printed content is detected, determining that the abnormal state type of the printer is a carbon ribbon break; if it is determined that the printed content is not detected, determining that the abnormal state type of the printer is a tape jam; and Output corresponding prompt information according to the abnormal state type.
2. The method for detecting abnormal state of a thermal printer according to claim 1, wherein: The abnormal state detection method further includes: If the printer receives a preset number of photoelectric signals after each paper travels a preset distance, it determines whether the printing task is completed; when it is determined that the printing task is completed, a prompt message of the completion of the printing task is output.
3. The method for detecting abnormal state of a thermal printer as claimed in claim 1, characterized in that: The preset distance is greater than or equal to 10 mm and less than or equal to 30 mm.
4. A thermal printer abnormal state detection device, characterized in that: The thermal printer comprises a photoelectric sensor and a grating disk, wherein the grating disk is arranged between an infrared transmitting tube and an infrared receiving tube of the photoelectric sensor, and the printer is arranged to receive a photoelectric signal sent by the photoelectric sensor during normal use, wherein the grid of the grating disk periodically blocks the infrared light emitted by the infrared transmitting tube, and the infrared receiving tube periodically receives the infrared light and periodically outputs a photoelectric signal, and the abnormal state detection device comprises: a determination module, which is used to determine the abnormal state type of the printer according to the photoelectric signal received by the printer after each paper travels a preset distance; When the printer does not receive a preset number of photoelectric signals after the paper travels a preset distance for the first time, determining that the abnormal state type of the printer is a lack of carbon ribbon; When the printer receives a preset number of photoelectric signals after the first paper feeds a preset distance, and when the printer does not receive the preset number of photoelectric signals after any paper feeds a preset distance after the first paper feeds a preset distance, the printer is used to continue to determine whether print content is detected; If it is determined that the printed content is detected, determining that the abnormal state type of the printer is a broken carbon ribbon; If it is determined that no print content is detected, determining that the abnormal state type of the printer is a tape jam; and The output module is used to output corresponding prompt information according to the abnormal state type.
5. A thermal printer, characterized in that: The printer comprises: a memory and a processor; The memory stores computer-readable instructions; and the processor is configured to execute the computer-readable instructions stored in the memory to implement the abnormal state detection method of a thermal printer as claimed in any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions are executed by a processor in the printer to implement the abnormal state detection method of the thermal printer as claimed in any one of claims 1 to 3.
7. A thermal printer, characterized in that: The thermal printer comprises a photoelectric sensor, a grating disk and a carbon ribbon structure, wherein the carbon ribbon structure comprises a carbon ribbon, a recovery wheel, a tension wheel, a first transmission shaft and a second transmission shaft, wherein the recovery wheel is arranged on the first transmission shaft, the tension wheel is arranged on the second transmission shaft, one end of the carbon ribbon is connected to the recovery wheel, and the other end is connected to the tension wheel, the grating disk is arranged on the second transmission shaft and is located below the tension wheel, and the photoelectric sensor is arranged inside the housing of the carbon ribbon structure and is close to the grating disk. The photoelectric sensor is configured as: When the printer performs a printing task and causes the recovery wheel to rotate, so as to drive the tension wheel and the grating disk to rotate through the carbon ribbon, the grating disk periodically blocks the infrared light emitted by the photoelectric sensor to output a photoelectric signal; The printer is configured as: Determining the abnormal state type of the printer according to the photoelectric signal received after each paper travels a preset distance; When the printer does not receive a preset number of photoelectric signals after the paper travels a preset distance for the first time, outputting a prompt message indicating that the abnormal state type of the printer is a lack of carbon ribbon; When the printer receives a preset number of photoelectric signals after the first paper feeds a preset distance, and does not receive the preset number of photoelectric signals after any paper feeds a preset distance after the first paper feeds a preset distance, and when printing content is detected, outputting prompt information that the abnormal state type of the printer is a carbon ribbon break; as well as When the printer receives a preset number of photoelectric signals after the first paper feeds a preset distance, and when the printer does not receive the preset number of photoelectric signals after any paper feeds a preset distance after the first paper feeds a preset distance, and does not detect printing content, outputting prompt information that the abnormal state type of the printer is a tape jam abnormality; And output corresponding prompt information according to the abnormal state type.
8. The thermal printer according to claim 7, wherein: The preset number is obtained based on the preset distance, the diameter of the grating disk, the number of grids of the grating disk, and the length of a single grid of the grating disk.
Citation Information
Patent Citations
Bar code printer
CN110949018A
Printing paper shortage detection method, device and equipment and storage medium
CN111813352A
Apparatus and method for controlling an RFID printer system
CN1801076A
