PRINTING SYSTEM, DETECTION METHOD, AND COMPUTER PROGRAM
The printing system addresses the challenge of accurately detecting gap portions between label parts by using a moving average calculation and judgment unit to differentiate between actual gaps and paper flutters, thereby reducing false detection and improving system accuracy.
Patent Information
- Application Number
- JP2021003590
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-01-13
- Publication Date
- 2025-05-12
- Estimated Expiration
- 2041-01-13
AI Technical Summary
Existing printing systems face challenges in accurately detecting the gap portions between label parts on label paper, due to the small difference in reflectance between label and gap portions, which can lead to false detection of paper flutters as gaps.
A printing system that includes a conveyance control unit, a sensor for detecting reflected light, a detection unit for processing sensor output, a moving average calculation unit to calculate the moving average of voltage values, and a judgment unit that determines the presence of gap portions based on the moving average and threshold values calculated.
The proposed solution effectively reduces false detection of gap portions between label parts, enhancing the accuracy of printing systems by differentiating between actual gaps and paper flutters.
Smart Images

Figure 0007674840000001 
Figure 0007674840000002 
Figure 0007674840000003
Abstract
Description
[Technical field]
[0001] The present invention relates to a printing system, a detection method, and a computer program. [Background technology]
[0002] A technology for detecting a detection area provided on a paper surface is known for printing systems such as thermal printers (see, for example, Patent Document 1). In this technology, a conveying unit conveys paper on which a mark for determining a printing position is provided on at least a part of the paper surface, an acquiring unit acquires a detection signal from a sensor that optically detects the mark on the paper surface conveyed by the conveying unit at a predetermined interval as the paper is conveyed, and a detecting unit detects the mark based on an integrated value of the amount of change in the detection signal acquired at the predetermined interval. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2017-132087 A Summary of the Invention [Problem to be solved by the invention]
[0004] In the above-mentioned technology, marks are detected by utilizing the difference in reflectance between the portion of the paper surface where the mark is provided and the portion where the mark is not provided. Therefore, if label paper with label portions without marks is used, the portions between the label portions are detected from the difference in reflectance between the label portions and the portion between the labels. Hereinafter, the portions between the labels may be referred to as "gaps." The difference in reflectance between the label and gap areas is very small. In some cases, the change in reflectance caused by flapping label paper is greater than the difference in reflectance. This can lead to the flapping label paper being mistakenly detected as a gap.
[0005] The present invention has been made in consideration of the above circumstances, and its purpose is to provide a printing system, a detection method, and a computer program that can reduce erroneous detection of the areas between label portions of paper on which labels are formed. [Means for solving the problem]
[0006] (1) In view of the above-mentioned problems, a printing system according to one aspect of the present invention includes a transport control unit that controls a transport unit that transports paper on which label parts are formed at predetermined intervals on a printing surface, a sensor that irradiates light onto the paper transported by the transport unit and detects reflected light of the irradiated light, a detection unit that detects an output of the sensor, a moving average calculation unit that calculates a moving average of voltage values based on the output of the sensor detected by the detection unit, and a determination unit that determines whether a portion between adjacent label parts has been detected based on the moving average of the voltage values calculated by the moving average calculation unit and the output of the sensor, wherein the moving average calculation unit calculates a threshold value for determining that a portion between the label parts is a portion between the adjacent label parts based on an average of a maximum value of the moving average corresponding to the portion between the adjacent label parts calculated based on the moving average and a current moving average, and the determination unit detects the threshold value calculated by the moving average calculation unit. is equal to or greater than the output of the sensor. It is determined that adjacent label portions have been detected.
[0007] (2) In a printing system according to an aspect of the present invention, the moving average calculation unit may calculate a moving average for a dot line that is set based on the length of the portion between adjacent label units.
[0009] ( 3 ) In a printing system according to one aspect of the present invention, the determination unit may determine that fluttering of the label portion has been detected when the threshold value calculated by the moving average calculation unit is less than the output of the sensor, the difference between the output of the sensor and the threshold value is less than a voltage threshold value for determining that a gap portion is present, or the number of dot lines at which the output of the sensor exceeds the threshold value is less than a dot line number threshold value for determining that a gap portion is present.
[0010] ( 4 )In a printing system according to one aspect of the present invention, the determination unit may determine that a portion between adjacent label portions has been detected when the threshold value calculated by the moving average calculation unit is less than the output of the sensor, when the output of the sensor is higher than the threshold value by at least a voltage threshold value for determining that a portion is a gap, and when the number of dot lines at which the output of the sensor exceeds the threshold value is equal to or greater than a dot line number ... out of paper, when paper is fed, and when the output of the sensor is equal to or less than the maximum value of the moving average of the previous gap portion.
[0011] ( 5 )In a printing system according to one aspect of the present invention, the determination unit may determine that no paper has been detected when the threshold calculated by the moving average calculation unit is less than the output of the sensor, when the output of the sensor is higher than the threshold by at least a voltage threshold for determining that a gap portion is present, and when the number of dot lines at which the output of the sensor exceeds the threshold is equal to or greater than a dot line number ... the determination unit may determine that no paper has been detected when the output of the sensor is higher than the maximum value of the moving average of the previous gap portion when paper is fed.
[0012] ( 6 ) In a printing system according to one aspect of the present invention, the determination unit may be configured to update the moving average corresponding to the portion between the label portions based on the output of the sensor when the output of the sensor is higher than the threshold value calculated by the moving average calculation unit, or when the output of the sensor is higher than the moving average corresponding to the portion between the label portions.
[0013] ( 7) A detection method according to one aspect of the present invention is a detection method executed by a printing system, the detection method comprising the steps of: controlling a transport unit that transports paper on which label parts are formed at predetermined intervals on a printing surface; a step of a sensor irradiating light onto the paper transported by the transport unit and detecting reflected light of the irradiated light; a step of detecting an output of the sensor; a step of calculating a moving average of voltage values based on the output of the sensor detected in the detecting step; and a step of determining that a portion between adjacent label parts has been detected based on the moving average of voltage values calculated in the calculating a moving average of voltage values, wherein in the calculating step, a threshold value for determining that a portion between adjacent label parts has been detected is calculated based on an average of a maximum value of the moving average corresponding to the portion between adjacent label parts calculated based on the moving average and a current moving average, and in the determining step, is equal to or greater than the output of the sensor. It is determined that adjacent label portions have been detected.
[0014] ( 8 ) A computer program according to one aspect of the present invention causes a computer of a printing system to execute the following steps: controlling a transport unit that transports paper on which label parts are formed at predetermined intervals on a printing surface; a step of a sensor irradiating light onto the paper transported by the transport unit and detecting reflected light of the irradiated light; a step of detecting an output of the sensor; a step of calculating a moving average of voltage values based on the output of the sensor detected in the detecting step; and a step of determining that a portion between adjacent label parts has been detected based on the moving average of voltage values calculated in the calculating a moving average of voltage values, wherein in the calculating step, a threshold value for determining that a portion between adjacent label parts has been detected is calculated based on the average of a maximum value of the moving average corresponding to the portion between adjacent label parts calculated based on the moving average and a current moving average, and in the determining step, is equal to or greater than the output of the sensor. It is determined that adjacent portions of the label part have been detected. Effect of the Invention
[0015] According to the present invention, it is possible to reduce erroneous detection of the portion between labels of a sheet of paper on which labels have been formed. [Brief description of the drawings]
[0016] [Figure 1] 1 is a block diagram showing an example of a configuration of a printing system according to an embodiment of the present invention. [Diagram 2] FIG. 4 is a diagram showing Example 1 of a voltage waveform detected by the printing system of the present embodiment. [Diagram 3] FIG. 11 is a diagram showing Example 2 of a voltage waveform detected by the printing system of the present embodiment. [Figure 4] FIG. 11 is a diagram showing Example 3 of a voltage waveform detected by the printing system of the present embodiment. [Diagram 5] FIG. 11 is a diagram showing Example 4 of a voltage waveform detected by the printing system of the present embodiment. [Figure 6] FIG. 5 is a diagram showing Example 5 of a voltage waveform detected by the printing system of the present embodiment. [Figure 7] FIG. 6 is a diagram showing Example 6 of a voltage waveform detected by the printing system of the present embodiment. [Figure 8] FIG. 7 is a diagram showing Example 7 of a voltage waveform detected by the printing system of the present embodiment. [Figure 9] 1 is a perspective view of a printer apparatus according to an embodiment; [Figure 10] FIG. 2 is a plan view of recording paper P according to an embodiment. [Figure 11] FIG. 1 is a diagram illustrating a first example of the operation of the printing system according to the present embodiment. [Figure 12] FIG. 11 is a diagram illustrating a second example of the operation of the printing system according to the present embodiment. [Figure 13] FIG. 2 is a front perspective view of a printing unit according to an embodiment. [Figure 14] FIG. 2 is an exploded front perspective view of the printing unit according to the embodiment; [Figure 15] FIG. 2 is a rear perspective view of the printing unit according to the embodiment; [Figure 16]FIG. 2 is a front view of a printing unit according to an embodiment. [Figure 17] 17 is a cross-sectional view taken along line VII-VII of FIG. 16. [Figure 18] FIG. 2 is an exploded front perspective view of the electrical equipment of the printing unit according to the embodiment; [Figure 19] FIG. 2 is a diagram illustrating an example of a sensor of the printing system of the present embodiment. [Figure 20] FIG. 4 is a flow diagram showing an example of the operation of the printing system of the present embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0017] Next, a printing system, a detection method, and a computer program according to the present embodiment will be described with reference to the drawings. The embodiment described below is merely an example, and the embodiment to which the present invention is applied is not limited to the following embodiment. In addition, in this application, "based on XX" means "based on at least XX" and includes cases where it is based on other elements in addition to XX. Furthermore, "based on XX" is not limited to cases where XX is directly used, but also includes cases where it is based on XX that has been calculated or processed. "XX" is any element (for example, any information).
[0018] (Embodiment) (Printing System) FIG. 1 is a block diagram showing an example of the configuration of a printing system according to the present embodiment. As shown in the figure, the printing system 1 includes a host terminal 2 that transmits commands to a printer device 8, and a printer device 8 that receives the commands and print data transmitted by the host terminal 2 and performs processing based on the received commands and print data. The printing system 1 transports recording paper. The recording paper has peelable labels formed on the printing surface at predetermined intervals. The printing system 1 includes a sensor that irradiates light onto the transported recording paper, detects the reflected light of the irradiated light, and outputs the detection result of the reflected light of the light. The printing system 1 detects the output of the sensor, and calculates a moving average of the voltage value based on the detected output of the sensor. The printing system 1 determines that the portion between adjacent label parts has been detected based on the calculation result of the moving average of the voltage value and the output of the sensor. The host terminal 2 and the printer device 8 that constitute the printing system 1 will be described in order below.
[0019] (Host terminal) The host terminal 2 includes a communication unit 2-1, a storage unit 2-2, an operation unit 2-3, an information processing unit 2-4, and a display unit 2-5. The communication unit 2-1 is realized by a communication module. Specifically, the communication unit 2-1 is configured by a wireless device that performs wireless communication using a wireless communication technology such as wireless LAN (registered trademark). The communication unit 2-1 may also be configured by a device that performs wired communication. Here, the explanation will continue on the case where the communication unit 2-1 is configured by a wireless device that performs wireless communication using a wireless communication technology. The communication unit 2-1 communicates with external devices such as the printer device 8 via the network. Specifically, the communication unit 2-1 receives status information transmitted by the printer device 8 and outputs the received status information to the information processing unit 2-4. Here, the status information is information for notifying the state of the printer device 8. The communication unit 2-1 also acquires print data output by the information processing unit 2-4 and transmits the acquired print data to the printer device 8. The communication unit 2-1 also acquires commands output by the information processing unit 2-4 and transmits the acquired commands to the printer device 8.
[0020] The storage unit 2-2 is realized by, for example, a RAM (Random Access Memory), a ROM (Read Only Memory), a HDD (Hard Disk Drive), a flash memory, or a hybrid storage device that combines a plurality of these. The storage unit 2-2 stores a program executed by the information processing unit 2-4. The operation unit 2-3 is a user interface and includes an input unit and an output unit. The input unit is, for example, a key button or a touch panel. The key buttons are a start key, a stop key, a numeric keypad, a clear key, a reset key, etc. The start key is a key button for starting a printing operation. The stop key is a key button for interrupting a printing operation. The numeric keypad is a key button for setting numerical values, etc. In this embodiment, the output unit is the display unit 2-5. The display unit 2-5 functions as a touch panel in addition to displaying images. The display unit 2-5 displays a setting screen for printing processing. From this setting screen, the user can change the size, set the density, etc. by operating the touch panel function or key buttons of the display unit 2-5.
[0021] The information processing unit 2-4 acquires the status information output by the communication unit 2-1, and acquires information indicating the state of the printer device 8 contained in the acquired status information. The information processing unit 2-4 monitors the state of the printer device 8 based on the acquired information indicating the state of the printer device 8. Specifically, the information processing unit 2-4 monitors whether the printer device 8 is printing or not. The information processing unit 2-4 also generates print data and outputs the generated print data to the communication unit 2-1. The information processing unit 2-4 also generates commands and outputs the generated commands to the communication unit 2-1. All or a part of the information processing unit 2-4 is a functional unit (hereinafter referred to as a software functional unit) realized by a processor such as a CPU (Central Processing Unit) executing a program stored in the storage unit 2-2. All or a part of the information processing unit 2-4 may be realized by hardware such as an LSI (Large Scale Integration), an ASIC (Application Specific Integrated Circuit), or an FPGA (Field-Programmable Gate Array), or may be realized by a combination of a software functional unit and hardware.
[0022] (Printer device) The printer device 8 includes a processing unit 5 and a mechanism unit 9. The processing unit 5 includes a communication unit 5-1, a memory unit 5-2, a command analysis unit 5-3, a print data creation unit 5-4, a print unit control unit 5-5, a transport control unit 5-6, a detection unit 5-7, a moving average calculation unit 5-8, and a determination unit 5-9. The mechanism unit 9 includes a printing unit 10 and a sensor 81. The communication unit 5-1 is realized by a communication module. Specifically, the communication unit 5-1 is configured by a wireless device that performs wireless communication using a wireless communication technology such as wireless LAN (registered trademark). The communication unit 5-1 may also be configured by a device that performs wired communication. Here, the explanation will continue on the case where the communication unit 5-1 is configured by a wireless device that performs wireless communication using a wireless communication technology. The communication unit 5-1 communicates with external devices such as the host terminal 2 via a network. Specifically, the communication unit 5-1 receives commands and print data sent by the host terminal 2. The communication unit 5-1 also acquires status information output by the printing unit control unit 5-5 and transmits the acquired status information to the host terminal 2.
[0023] The storage unit 5-2 is realized by, for example, a RAM, a ROM, a HDD, a flash memory, or a hybrid storage device that combines a plurality of these. The storage unit 5-2 stores a control program for causing the printer device 8 to execute printing. The command analysis unit 5-3 acquires the command received by the communication unit 5-1 and analyzes the acquired command. The print data creation unit 5-4 acquires the print data received by the communication unit 5-1, and creates print image data based on the acquired print data. The printing section control section 5-5 acquires the image data created by the print data creation section 5-4, and creates a control signal for causing the thermal head to print based on the acquired image data. The printing section control section 5-5 outputs the created control signal to the print unit 10. The printing section control section 5-5 also acquires the command analysis result from the command analysis section 5-3, and performs processing based on the acquired command analysis result. Specifically, if the command analysis result is reset, the printing section control section 5-5 resets (restarts) the printer device 8. The printing section control section 5-5 also creates status information, and outputs the created status information to the communication section 5-1.
[0024] The transport control unit 5-6 acquires the image data created by the print data creation unit 5-4, creates a control signal for driving a stepping motor based on the acquired image data, and outputs the created control signal to the printing unit 10. The detection unit 5-7 detects a voltage value output by the sensor 81 based on the detection result of reflected light of the light. One example of the detection unit 5-7 detects a voltage value output by the sensor 81 for each dot line. The detection unit 5-7 acquires a voltage waveform based on the detection result of the voltage value output by the sensor 81. One example of the sensor 81 may be a reflective photointerrupter or a transmissive photointerrupter. The moving average calculation unit 5-8 calculates a moving average of the voltage values based on the voltage waveform acquired by the detection unit 5-7. One example of the moving average calculation unit 5-8 calculates a moving average of the voltage values for N dot lines. Specifically, the moving average calculation unit 5-8 calculates the moving average of the voltage values based on the formula (1). MAve=(VSen(n)+VSen(n-1)+···+VSen(n-(N-1))) / N (1) In formula (1), MAve is the moving average [V] of the sensor output (voltage value) for N dot lines, VSen(n), VSen(n-1), ..., VSen(n-(N-1)) are the sensor outputs [V] from the current dot line to the N dot lines before, and N is the moving average calculation range [dot lines]. N can be any value.
[0025] The moving average calculation unit 5-8 acquires information specifying a predetermined value of the moving average of the previous gap portion. Examples of the predetermined value include a maximum value, a value of a portion that is lower than the maximum value by a predetermined percentage, and the like. In this embodiment, the description will continue with the case where the maximum value is applied as an example of the predetermined value. In this case, the moving average calculation unit 5-8 acquires information specifying the maximum value of the moving average of the previous gap portion. The moving average calculation unit 5-8 calculates a threshold value for determining the gap portion, which is a portion between adjacent label portions, based on the acquired information specifying the maximum value of the moving average of the previous gap portion and the calculation result of the moving average of the voltage value. Specifically, the moving average calculation unit 5-8 calculates a threshold value for determining the gap portion, which is a portion between adjacent label portions, based on Equation (2). Thr = (MAve + MAMax) / 2 (2) In formula (2), Thr is a threshold value [V] for determining a gap portion between adjacent label portions, and MAMax is the maximum value of the moving average of the previous gap portion [V]. The moving average calculation unit 5-8 sets the calculation result of the average of the current moving average and the maximum value of the moving average of the previous gap portion as the threshold value. The determination unit 5-9 acquires information for identifying the threshold calculated by the moving average calculation unit 5-8, information for identifying the voltage waveform, information for identifying the maximum value of the moving average of the previous gap portion, and the calculation result of the moving average. The determination unit 5-9 determines whether noise (paper fluttering), a gap portion, or no paper has been detected based on the acquired information for identifying the threshold, information for identifying the voltage waveform, information for identifying the maximum value of the moving average of the previous gap portion, and the calculation result of the moving average.
[0026] The process of determining whether noise (paper flutter), a gap, or no paper has been detected will be described with reference to FIGS. 2 to 8. FIG. Fig. 2 is a diagram showing Example 1 of a voltage waveform detected by the printing system of this embodiment. In Fig. 2, the horizontal axis is distance [mm] and the vertical axis is voltage [V]. Fig. 2 shows the relationship between the distance from a predetermined position on the paper and the voltage value output by sensor 81. The solid line shows the voltage obtained when sensor 81 irradiates light onto the label portion, and the dashed line shows the voltage obtained when sensor 81 irradiates light onto the gap portion. 2, it can be seen that the voltage in the gap is higher than the voltage in the label. Also, as the distance from the designated position increases, the voltage obtained when the sensor 81 shines light on the label and the voltage obtained when the sensor 81 shines light on the gap increase. This is presumably because the flapping of the paper increases as the distance from the designated position increases. The moving average calculation unit 5-8 obtains a voltage waveform as shown by the dashed line when the sensor 81 irradiates light onto the gap portion and the detection unit 5-7 detects the gap portion, and obtains a voltage waveform as shown by the solid line when the sensor 81 irradiates light onto the label portion and the detection unit 5-7 detects the label portion.
[0027] Fig. 3 is a diagram showing Example 2 of a voltage waveform detected by the printing system of this embodiment. In Fig. 3, the horizontal axis is the number of dot lines of paper feed [dot lines], and the vertical axis is voltage [V]. Fig. 3 shows the output waveform of the voltage value output by sensor 81 relative to the number of paper feed dot lines when paper feed is being performed. When paper is being fed by the conveying control unit 5-6, the moving average calculation unit 5-8 acquires a voltage waveform that rises when the area onto which the sensor 81 irradiates light changes from the label section to the gap section, and falls when the area onto which the sensor 81 irradiates light changes from the gap section to the label section.
[0028] Fig. 4 is a diagram showing Example 3 of a voltage waveform detected by the printing system of this embodiment. In Fig. 4, the horizontal axis is the number of paper feed dot lines [dot lines], and the vertical axis is voltage [V]. In Fig. 4, the dashed line shows the output waveform of the voltage value output by sensor 81 relative to the number of paper feed dot lines, and the solid line shows the waveform of the moving average of N dot lines of the voltage value output by sensor 81 relative to the number of paper feed dot lines. The moving average calculation unit 5-8 calculates the moving average of the voltage value based on the voltage waveform acquired from the detection unit 5-7. FIG. 5 is a diagram showing Example 4 of a voltage waveform detected by the printing system of this embodiment. In FIG. 5, the horizontal axis is the number of dot lines [dot lines] of paper feed, and the vertical axis is voltage [V]. In FIG. 5, the output waveform of the voltage value output by the sensor 81 for the number of paper feed dot lines shown in FIG. 4 and the waveform of the moving average of N dot lines of the voltage value output by the sensor 81 for the number of dot lines are shown by dashed lines, and further the maximum value of the moving average of the previous gap part is shown by a solid line. When the determination part 5-9 detects a cap part, the moving average calculation part 5-8 acquires the maximum value of the moving average obtained when determining that it is a gap part based on the calculated moving average as information for specifying the maximum value of the moving average of the previous gap part. Based on the information for specifying the maximum value of the moving average of the previous gap part, a process is performed to determine that the next noise (paper flutter), the gap part, or no paper has been detected.
[0029] Fig. 6 is a diagram showing Example 5 of a voltage waveform detected by the printing system of this embodiment. In Fig. 6, the horizontal axis is the number of paper feed dot lines [dot lines], and the vertical axis is voltage [V]. Fig. 6 shows, with a dashed line, the output waveform of the voltage value output by the sensor 81 for the number of paper feed dot lines shown in Fig. 5, the waveform of the moving average of N dot lines of the voltage value output by the sensor 81 for the number of paper feed dot lines, and the maximum value of the moving average of the previous gap portion for the number of paper feed dot lines, and shows a threshold value with a solid line. The moving average calculation unit 5-8 calculates the average of the maximum value of the moving average of the previous gap portion and the current moving average, and sets the result as a threshold value for determining the gap portion, which is the portion between adjacent label portions.
[0030] Fig. 7 is a diagram showing Example 6 of a voltage waveform detected by the printing system of this embodiment. In Fig. 7, the horizontal axis is the number of paper feed dot lines [dot lines], and the vertical axis is voltage [V]. In Fig. 7, (A) shows a threshold value for the number of paper feed dot lines and an output waveform of the voltage value output by sensor 81, and (B) shows the difference between the output waveform of the voltage value output by sensor 81 for the number of paper feed dot lines and the threshold value. However, in (B), when the voltage output by sensor 81 is less than the threshold value, it is set to zero. In the label portion, the output waveform of the voltage output by the sensor 81 becomes lower than the threshold value, and the difference obtained by subtracting the threshold value from the voltage output by the sensor 81 becomes negative. The determination unit 5-9 acquires information specifying the voltage waveform, information specifying the threshold value, information specifying the maximum value of the moving average of the previous gap portion, and the calculation result of the moving average from the moving average calculation unit 5-8. The determination unit 5-9 calculates the difference between the voltage value output by the sensor 81 and the threshold value for each dot line based on the acquired information specifying the voltage waveform and information specifying the threshold value. The determination unit 5-9 judges whether the voltage value output by the sensor 81 is lower than the threshold value. When the determination unit 5-9 determines that the voltage value output by the sensor 81 is lower than the threshold, it determines whether the voltage value output by the sensor 81 exceeds the maximum value of the moving average of the previous gap portion. When the voltage value output by the sensor 81 does not exceed the maximum value of the moving average of the previous gap portion, the determination unit 5-9 updates the threshold based on information specifying the maximum value of the moving average of the previous gap portion and the acquired calculation result of the moving average. When the output waveform of the voltage output by the sensor 81 is lower than the updated threshold value, the determination unit 5-9 determines that a label portion has been detected.
[0031] In the gap portion, the output waveform of the voltage output by the sensor 81 becomes higher than the threshold value, and the difference obtained by subtracting the threshold value from the voltage output by the sensor 81 becomes positive. The determination unit 5-9 acquires information specifying the voltage waveform, information specifying the threshold value, information specifying the maximum value of the moving average of the previous gap portion, and the calculation result of the moving average from the moving average calculation unit 5-8. The determination unit 5-9 calculates the difference between the voltage value output by the sensor 81 and the threshold value for each dot line based on the acquired information specifying the voltage waveform and information specifying the threshold value. The determination unit 5-9 judges whether the voltage value output by the sensor 81 is lower than the threshold value. When the determination unit 5-9 determines that the voltage value output by the sensor 81 is higher than the threshold value, it starts counting the number of paper feed dots and updates the maximum value of the moving average of the previous gap portion with the voltage value output by the sensor 81. The determination unit 5-9 updates the threshold value based on information specifying the updated value of the maximum value of the moving average of the previous gap portion and the acquired calculation result of the moving average. The determination unit 5-9 determines whether the output waveform of the voltage output by the sensor 81 is higher than the updated threshold value. When the determination unit 5-9 determines that the output waveform of the voltage output by the sensor 81 is higher than the updated threshold value, it determines whether the voltage value output by the sensor 81 is higher than the updated threshold value by at least a gap voltage threshold value VGapThr and whether the number of dot lines in which the voltage value output by the sensor 81 exceeds the updated threshold value is at least a gap dot line number threshold value NGapLng. Here, the gap voltage threshold value VGapThr is a voltage threshold value for determining that a portion is a gap, and the gap dot line number threshold value NGapLng is a threshold value for the number of dot lines for determining that a portion is a gap.
[0032] A small peak may appear in the label portion. It is assumed that this small peak is due to flapping of the label paper. The determination unit 5-9 determines that flapping of the label portion has been detected if it determines that the voltage value output by the sensor 81 is higher than the updated threshold value but the difference is less than the gap portion voltage threshold value VGapThr, or if it determines that the number of dot lines where the voltage value output by the sensor 81 exceeds the updated threshold value is less than the gap portion dot line number threshold value NGapLng. When the determination unit 5-9 determines that the voltage value output by the sensor 81 is higher than the updated threshold value by at least the gap voltage threshold VGapThr and that the voltage value output by the sensor 81 has exceeded the updated threshold value by at least the gap dot line number threshold NGapLng, the determination unit 5-9 determines whether the voltage value output by the sensor 81 will be equal to or lower than the updated maximum value of the moving average of the previous gap portion when the paper is fed by the paper-out dot line number threshold NNoPap. Here, the paper-out dot line number threshold NNoPap is a threshold for the number of dot lines for determining that there is no paper. The determination unit 5-9 determines that a gap portion is detected when the voltage value output by the sensor 81 is equal to or lower than the updated maximum value of the moving average of the previous gap portion when the paper is fed by the paper-out dot line number threshold NNoPap.
[0033] Fig. 8 is a diagram showing Example 7 of a voltage waveform detected by the printing system of this embodiment. In Fig. 8, the horizontal axis is the number of dot lines of paper feed [dot lines], and the vertical axis is voltage [V]. With reference to Fig. 8, a case will be described in which the determination unit 5-9 detects a paper-out portion based on information specifying the voltage waveform and information specifying a threshold value. When the determination unit 5-9 determines that the voltage value output by the sensor 81 is higher than the updated threshold value by at least the gap voltage threshold VGapThr and that the voltage value output by the sensor 81 has exceeded the updated threshold value for at least the gap dot line number threshold NGapLng, the determination unit 5-9 determines whether the voltage value output by the sensor 81 will be equal to or lower than the updated maximum value of the moving average of the previous gap portion when the paper is fed by the paper-out dot line number threshold NNoPap. When the determination unit 5-9 determines that the paper is out, if the voltage value output by the sensor 81 is not equal to or lower than the updated maximum value of the moving average of the previous gap portion when the paper is fed by the paper-out dot line number threshold NNoPap.
[0034] All or part of the command analysis unit 5-3, print data creation unit 5-4, print unit control unit 5-5, transport control unit 5-6, detection unit 5-7, moving average calculation unit 5-8, and judgment unit 5-9 are software function units realized by, for example, a processor such as a CPU executing a control program stored in the storage unit 5-2. Note that all or part of the command analysis unit 5-3, print data creation unit 5-4, print unit control unit 5-5, transport control unit 5-6, detection unit 5-7, moving average calculation unit 5-8, and judgment unit 5-9 may be realized by hardware such as an LSI, ASIC, or FPGA, or may be realized by a combination of software function units and hardware.
[0035] The mechanism section 9 includes a printing unit 10 and a sensor 81. The printing unit 10 and the sensor 81 will be described. Fig. 9 is a perspective view of a printer according to one embodiment. As shown in Fig. 9, the printer 8 is configured to be capable of printing on recording paper P. The recording paper P is thermal paper that changes color when heat is applied, and is suitable for printing various labels, receipts, tickets, and the like. The recording paper P is set in the printer 8 in the form of roll paper R that is wound so as to have a hollow hole, and printing is performed on the portion of the roll paper R that is pulled out.
[0036] The printer device 8 has a casing 3, a display unit 4, a processing unit 5, and a printing unit 10. The casing 3 is formed in a hollow box shape from plastic or metal materials such as ABS (Acrylonitrile butadiene styrene) or a composite material of ABS and polycarbonate. The casing 3 has a rectangular parallelepiped main body 6 and a roll paper storage section 7 that protrudes from one end of the main body 6 in the longitudinal direction to one side of the main body 6 in the thickness direction.
[0037] A printing unit 10 is housed in one longitudinal end of the main body 6. An outlet 3a is formed in the end face of one longitudinal end of the main body 6. The recording paper P printed through the printing unit 10 is discharged from the outlet 3a. A display unit 4 is disposed on the main surface of the main body 6 opposite the roll paper storage unit 7 in the thickness direction. The display unit 4 is, for example, a liquid crystal panel, and is connected to the processing unit 5 to display various information. Roll paper R is housed in the roll paper storage unit 7.
[0038] (Recording paper) FIG. 10 is a plan view of the recording paper P according to an embodiment. As shown in FIG. 10, the recording paper P has a plurality of peelable labels P1 formed at a predetermined interval on the printing surface of the paper. The label P1 is a rectangular die-cut thermosensitive layer adhered to the release paper P3 (base paper) on the opposite side of the printing surface of the recording paper P, and a plurality of labels are formed at intervals in the longitudinal direction of the recording paper P. A frame-shaped liner P2 is formed around the periphery of the label P1. The label P1 is peelable from the release paper P3 leaving the liner P2. Thus, the recording paper P of this embodiment is a label release paper with a liner P2. The recording paper P is transported in the direction of the arrow. The portion of the release paper P3 between adjacent labels P1 is called a gap portion G. In FIG. 6, (1) indicates the position of the head end face, (2) indicates the position of the heating element, and (3) indicates the position of the sensor 81 when it is determined that there is no paper.
[0039] Fig. 11 is a diagram showing Example 1 of the operation of the printing system of this embodiment. Fig. 11 shows an example of an area on the recording paper P where the moving average calculation unit 5-8 measures the voltage value of the voltage waveform used to calculate the moving average in the printing system 1. The sensor 81 sequentially irradiates light onto the detection areas DA-A, DA-B, ... of the conveyed recording paper P, sequentially detects the reflected light of the irradiated light, and sequentially outputs voltage values based on the detection results of the reflected light. The detection unit 5-7 detects the voltage values sequentially output by the sensor 81. The detection unit 5-7 acquires the voltage waveform based on the detection results of the voltage values sequentially output by the sensor 81. The moving average calculation unit 5-8 calculates a moving average of the voltage values based on the voltage waveform acquired by the detection unit 5-7.
[0040] Fig. 12 is a diagram showing a second example of the operation of the printing system of this embodiment. Fig. 12 shows a voltage value outputted based on the detection result of the reflected light when the sensor 81 sequentially irradiates light to the detection areas DA-1 to DA-9 of the conveyed recording paper P in the printing system 1. When sensor 81 shines light on detection area DA-1 of recording paper P, detection area DA-1 corresponds to the label portion, so the voltage value detected by detection unit 5-7 is a low value. When sensor 81 shines light on detection area DA-2 of recording paper P, detection area DA-2 includes a gap portion in part compared to detection area DA-1, so the voltage value detected by detection unit 5-7 is a high value compared to detection area DA-1. When sensor 81 shines light on detection area DA-3 of recording paper P, detection area DA-3 includes an even wider gap portion in part compared to detection area DA-2, so the voltage value detected by detection unit 5-7 is a high value compared to detection area DA-2. When sensor 81 shines light on detection area DA-4 of recording paper P, the gap portion included in detection area DA-4 is wider than in detection area DA-3, so the voltage value detected by detection unit 5-7 is higher than in detection area DA-3. When sensor 81 shines light on detection area DA-5 of recording paper P, detection area DA-5 corresponds to the gap portion, so the voltage value detected by detection unit 5-7 is the highest. When sensor 81 shines light on detection area DA-6 of recording paper P, detection area DA-6 includes a label portion in part compared to detection area DA-5, so the voltage value detected by detection unit 5-7 is lower than in detection area DA-5.
[0041] When sensor 81 shines light on detection area DA-7 of recording paper P, the label portion included in detection area DA-7 is wider than that included in detection area DA-6, so the voltage value detected by detection unit 5-7 is lower than that included in detection area DA-6. When sensor 81 shines light on detection area DA-8 of recording paper P, the label portion included in detection area DA-8 is wider than that included in detection area DA-7, so the voltage value detected by detection unit 5-7 is lower than that included in detection area DA-7. When sensor 81 shines light on detection area DA-9 of recording paper P, detection area DA-9 corresponds to the label portion, so the voltage value detected by detection unit 5-7 is the lowest. In FIG. 12, detection areas DA-1 to DA-9 are the range in which the voltage value output by sensor 81 changes. The range in which the voltage value output by sensor 81 changes is the range in which moving average calculation unit 5-8 calculates the moving average of the voltage value. Detection areas DA-3 to DA-7 are the range of gap G. For example, moving average calculation unit 5-8 calculates the moving average for each range in which the voltage value output by sensor 81 changes. In this case, N dot lines of voltage values output by sensor 81 correspond to the range in which the voltage value output by sensor 81 changes. The range in which the voltage value output by sensor 81 changes changes depending on the range (length) of the gap, so N is set based on the range (length) of the gap.
[0042] (Printing unit) Fig. 13 is a front perspective view of the print unit according to the embodiment, Fig. 14 is an exploded front perspective view of the print unit according to the embodiment, and Fig. 15 is a rear perspective view of the print unit according to the embodiment. As shown in FIG. 13, the printing unit 10 includes a platen roller 51 having a driven gear 56, a motor 61 that rotates the platen roller 51, a main body frame 11 that rotatably supports the platen roller 51 and to which the motor 61 is attached, a first reduction gear 65 and a second reduction gear 66 that reduce the driving force of the motor 61 and transmit it to the driven gear 56, and a thermal head 41 that is pressed against the peripheral surface of the platen roller 51.
[0043] The printing unit 10 discharges the recording paper P that has passed between the platen roller 51 and the thermal head 41 in the direction indicated by the arrow A. In the following explanation of the printing unit 10, the direction along the arrow A is defined as the up-down direction L1. The axial direction in which the rotation shaft of the platen roller 51 extends and perpendicular to the up-down direction L1 is defined as the left-right direction L2. Furthermore, the direction perpendicular to the up-down direction L1 and the left-right direction L2 is defined as the front-rear direction L3.
[0044] In the up-down direction L1, the side where the recording paper P is discharged (the side indicated by the arrow A) is defined as the top, and the opposite side is defined as the bottom. In the left-right direction L2, the side where the motor 61 is located is defined as the right, and the opposite side is defined as the left. In the front-rear direction L3, the side where the platen roller 51 is located is defined as the front, and the opposite side where the thermal head 41 is located is defined as the rear.
[0045] The main body frame 11 is formed of a plate material such as polycarbonate resin containing glass fiber. The main body frame 11 is formed in a U-shape that opens toward the front when viewed from the up-down direction L1. Specifically, the main body frame 11 has a back plate portion 12 extending in the left-right direction L2, a first side wall portion 13 erected toward the front from an end portion on one side (left side) of the back plate portion 12 in the left-right direction L2, a second side wall portion 14 erected toward the front and downward from an end portion on the other side (right side) of the back plate portion 12 in the left-right direction L2, and a paper guide portion 20 provided between the first side wall portion 13 and the second side wall portion 14.
[0046] The back plate 12 is formed in a plate shape having a thickness in the front-rear direction L3. The first side wall 13 is formed in a plate shape having a thickness in the left-right direction L2. A first roller insertion groove 16A is formed in the upper edge of the first side wall 13 and cut downward. The second side wall 14 is formed in a plate shape having a thickness in the left-right direction L2. A second roller insertion groove 16B is formed in the upper edge of the second side wall 14 and cut downward.
[0047] The second roller insertion groove 16B is formed so that its shape and position when viewed from the left-right direction L2 match those of the first roller insertion groove 16A. The platen roller 51 is removably inserted into the first roller insertion groove 16A and the second roller insertion groove 16B. The second side wall portion 14 extends forward from the end portion on the other side (right side) in the left-right direction L2 of the back plate portion 12 and further extends downward.
[0048] A motor 61 is attached to the second side wall 14 below the connection between the second side wall 14 and the back plate 12. The motor 61 is attached to the second side wall 14 from the inside in the left-right direction L2, and an output shaft 61A of the motor 61 penetrates the second side wall 14 and protrudes outside the second side wall 14 in the left-right direction L2. The motor 61 is connected to the processing unit 5 via a flexible printed circuit board 71 on which a wiring pattern (not shown) is printed. The motor 61 is driven based on a signal from the processing unit 5.
[0049] A gear box portion 17 is formed on the outer side of the second side wall portion 14. The gear box portion 17 has a peripheral wall portion 18 that stands outward in the left-right direction L2 from the periphery of the second side wall portion 14. The peripheral wall portion 18 is formed in a U-shape that is open upward when viewed in the left-right direction L2. The gear box portion 17 opens outward in the left-right direction L2.
[0050] A recess 19 recessed downward is formed on each of the front and rear upper edges of the peripheral wall 18. The pair of recesses 19 are formed to match each other in shape and position when viewed from the front-rear direction L3. A hole 18a is formed in the lower part of the peripheral wall 18. A cover member (not shown) that covers the gear box 17 engages with the pair of recesses 19 and hole 18a.
[0051] A first reduction gear 65 and a second reduction gear 66 are assembled inside the gear box portion 17. As shown in Fig. 14, the first reduction gear 65 is rotatably supported by a first rotating shaft 67 erected from the second side wall portion 14. The first reduction gear 65 meshes with an output shaft 61A of the motor 61. The second reduction gear 66 is rotatably supported by a second rotating shaft 68 erected from the second side wall portion 14 above the first rotating shaft 67. The second reduction gear 66 meshes with the first reduction gear 65.
[0052] The paper guide part 20 is formed in a substantially right-angled triangular column shape extending along the left-right direction L2. One end of the paper guide part 20 on one side (left side) in the left-right direction L2 is connected to the inner surface of the first side wall part 13, and the other end of the paper guide part 20 on the other side (right side) in the left-right direction L2 is connected to the inner surface of the second side wall part 14. The paper guide part 20 is formed with a pair of mounting parts 20a that are recessed downward when viewed from the front-rear direction L3.
[0053] The pair of mounting parts 20a are formed with a gap therebetween in the left-right direction L2. A through hole 20b is provided at the bottom of the mounting part 20a, passing through the bottom of the mounting part 20a in the up-down direction. The main body frame 11 is attached to the casing 3 by inserting a fastening member such as a bolt through the through hole 20b of the paper guide part 20.
[0054] The thermal head 41 prints on the recording paper P. The thermal head 41 is formed in a rectangular shape with the longitudinal direction being the left-right direction L2 when viewed from the front-rear direction L3. The thermal head 41 is disposed with its longitudinal direction coinciding with the width direction of the recording paper P. A large number of heating elements 42 are arranged on the head surface 41a of the thermal head 41 in the left-right direction L2.
[0055] The head surface 41a faces the printing surface of the recording paper P, and is adapted to hold the recording paper P between itself and the outer peripheral surface of the platen roller 51. The thermal head 41 is connected to the processing unit 5 via a flexible printed circuit board 71, and a driver IC (not shown) mounted on the thermal head 41 controls the heat generation of the heating elements 42 based on signals from the processing unit 5. The thermal head 41 prints various characters, figures, and the like on the printing surface of the recording paper P by controlling the heat generation of the heating elements 42.
[0056] The thermal head 41 is affixed and fixed to a head support 45 supported by the main body frame 11. The head support 45 is a plate-shaped member whose longitudinal direction is the left-right direction L2, and the thermal head 41 is affixed and fixed to the front surface. The head support 45 is disposed between the first side wall portion 13 and the second side wall portion 14, and is also disposed between the back plate portion 12 and the paper guide portion 20.
[0057] 15, an elastic member 46 is interposed between the head support 45 and the back plate portion 12, and biases the head support 45 and the back plate portion 12 in a direction separating them from each other. That is, the elastic member 46 is configured to constantly press the head support 45 forward. A plurality of elastic members 46 (three in this embodiment) are arranged at intervals in the left-right direction L2.
[0058] As shown in FIG. 14, a pair of stoppers 45a for restricting the rotation range of the head support 45 is formed at the upper end of the head support 45. The pair of stoppers 45a is formed in a substantially rectangular prism shape and extends outward in the left-right direction L2 of the head support 45. The pair of stoppers 45a is inserted into a rectangular hole 13a formed in the upper part of the first side wall part 13 of the main body frame 11 and a rectangular hole 14a formed in the upper part of the second side wall part 14. The stoppers 45a are configured to move in the holes 13a and 14a as the head support 45 rotates and to be able to come into contact with the inner wall surfaces of the holes 13a and 14a. The stoppers 45a restrict the rotation amount of the head support 45 by coming into contact with the inner wall surfaces of the holes 13a and 14a.
[0059] 13, the platen roller 51 is disposed opposite the thermal head 41, and rotates with the recording paper P sandwiched between the platen roller 51 and the thermal head 41 to feed the recording paper P in the direction indicated by the arrow A. The platen roller 51 has a roller shaft 52, a roller body 53 fitted to the roller shaft 52, and a pair of bearings 54 attached to both ends of the roller shaft 52. The roller shaft 52 is formed to be slightly longer than the distance between the first side wall portion 13 and the second side wall portion 14 of the main body frame 11. The roller body 53 is formed of, for example, rubber, and is uniformly disposed over the entire roller shaft 52 except for both ends in the left-right direction L2.
[0060] The platen roller 51 has a pair of bearings 54 attached to both ends which are inserted into the first roller insertion groove 16A and the second roller insertion groove 16B of the main body frame 11. This allows the platen roller 51 to be rotatably and detachably held relative to the main body frame 11. When inserted into the first roller insertion groove 16A and the second roller insertion groove 16B, the platen roller 51 is arranged so that the roller body 53 comes into contact with the thermal head 41 with recording paper P pulled out from the roll paper R sandwiched therebetween.
[0061] As shown in FIG. 13, a driven gear 56 is fixed to the end of the platen roller 51 on the other side (right side) in the left-right direction L2. The driven gear 56 is assembled to the upper part of the gear box unit 17 when the platen roller 51 is held by the first side wall portion 13 and the second side wall portion 14. At this time, the driven gear 56 overlaps with the second reduction gear 66 when viewed from the left-right direction L2, and is disposed on the inner side of the second reduction gear 66, and meshes with the second reduction gear 66. As a result, the rotational driving force from the motor 61 is transmitted to the driven gear 56 via the first reduction gear 65 and the second reduction gear 66. The platen roller 51 rotates while being held by the first side wall portion 13 and the second side wall portion 14, and can feed out the recording paper P.
[0062] Fig. 16 is a front view of the print unit according to one embodiment, Fig. 17 is a cross-sectional view taken along line VII-VII of Fig. 16, Fig. 18 is an exploded front perspective view of the electrical components of the print unit according to one embodiment. As shown in FIG. 17, the paper guide section 20 has a guide slope 21 through which the recording paper P is inserted from an acute angle toward a print area 100 by the thermal head 41.
[0063] Here, the printing area 100 refers to the head surface 41a of the thermal head 41 on which the heating elements 42 are provided, which faces the platen roller 51. In a narrow sense, the printing area 100 refers to the area of the head surface 41a that is in pressure contact with the circumferential surface of the platen roller 51. The printing area 100 in this embodiment is a flat area that extends in the up-down direction L1 and the left-right direction L2.
[0064] The guide slope 21 is inclined at an angle θ1 with respect to the printing area 100. The angle θ1 is an acute angle less than 90° when the printing area 100 is set as a reference plane of 0°. The angle θ1 is preferably an acute angle of 57.5° or less. This makes it possible to insert the recording paper P into the printing area 100 without applying a strong bend to the recording paper P and preventing the label portion P1 from peeling off. In other words, the upper limit of the angle θ1 is preferably 57.5°.
[0065] On the other hand, the lower limit of angle θ1 is preferably angle θ2. Angle θ2 is the angle that a tangent 101 drawn from the printing area 100 to the peripheral surface 61a of the motor 61 forms with respect to the printing area 100. As shown in FIG. 13, peripheral surface 61a of motor 61 is disposed within the paper passage path of recording paper P and guides recording paper P. If angle θ1 is less than angle θ2, recording paper P will float with respect to inclined guide surface 21, which is not preferable. In other words, it is preferable that inclined guide surface 21 is inclined with respect to printing area 100 at an angle equal to or greater than angle θ2.
[0066] In this embodiment, the inclined guide surface 21 is inclined at an acute angle of 37.5° with respect to the printing area 100. By setting the inclined guide surface 21 at 37.5°, the minimum internal space required for laying out the sensor 81 on the inclined guide surface 21 can be secured in the paper guide unit 20. In this manner, the angle θ1 is preferably equal to or larger than the angle θ2 and equal to or smaller than 57.5°, and more preferably equal to or larger than 37.5° and equal to or smaller than 57.5°.
[0067] 16, an opening 22 in which a sensor 81 is disposed is formed in the guide slope 21. The opening 22 is formed in a T-shape when viewed from the front. The opening 22 is disposed between the pair of mounting parts 20a in the left-right direction of the guide slope 21. The opening 22 is disposed between the pair of mounting parts 20a, closer to the mounting part 20a on one side (the left side) in the left-right direction.
[0068] In the opening 22, a sensor 81 for detecting the recording paper P is disposed. Fig. 19 is a diagram showing an example of a sensor of the printing system of this embodiment. An example of the sensor 81 is a photoreflector. The photoreflector has a light-emitting element and a light-receiving element, and detects the presence (presence) and position of an object by the reflected light of the object. The sensor 81 may be a non-contact sensor other than a photoreflector. The sensor 81 may also be a contact sensor. The sensor 81 is provided on the flexible printed circuit board 71 as shown in Fig. 18.
[0069] The flexible printed circuit board 71 includes a head connection portion 72 connected to the heating element 42, a motor connection portion 73 connected to the motor 61, and a sensor connection portion 74 connected to a sensor 81. The sensor connection portion 74 and the sensor 81, together with a sensor holder 91, are inserted into the opening 22 of the paper guide portion 20 from the bottom side of the paper guide portion 20. The sensor holder 91 is a resin molded part, and is detachably engaged with the opening 22 of the paper guide portion 20.
[0070] (Printing system operation) 20 is a flow diagram showing an example of the operation of the printing system of this embodiment. FIG. 20 mainly shows the process performed by the printer device 8 of the printing system 1. (Step S1-1) In the printer device 8, the detection unit 5-7 detects a voltage value output by the sensor 81 based on the detection result of reflected light, and acquires a voltage waveform based on the detection result of the voltage value output by the sensor 81. The moving average calculation unit 5-8 calculates a moving average of the voltage value based on the voltage waveform acquired by the detection unit 5-7. (Step S2-1) In the printer device 8, the moving average calculation unit 5-8 acquires information for identifying the maximum value of the moving average of the previous gap portion. The moving average calculation unit 5-8 calculates a threshold value based on the acquired information for identifying the maximum value of the moving average of the previous gap portion and the calculation result of the moving average of the voltage value. The determination unit 5-9 acquires information specifying the voltage waveform, information specifying the threshold, information specifying the maximum value of the moving average of the previous gap portion, and the calculation result of the moving average from the moving average calculation unit 5-8. The determination unit 5-9 calculates the difference between the voltage value output by the sensor 81 and the threshold for each dot line based on the acquired information specifying the voltage waveform and information specifying the threshold. The determination unit 5-9 judges whether the voltage value output by the sensor 81 is lower than the threshold.
[0071] (Step S3-1) In the printer device 8, when the determination unit 5-9 determines that the voltage value output by the sensor 81 is lower than the threshold value, it determines whether or not the voltage value output by the sensor 81 exceeds the maximum value of the moving average of the previous gap portion. (Step S4-1) In the printer device 8, when the judgment unit 5-9 judges that the voltage value output by the sensor 81 is higher than the threshold value, or when the judgment unit 5-9 judges that the voltage value output by the sensor 81 exceeds the maximum value of the moving average of the previous gap portion, the judgment unit 5-9 starts counting the number of paper feed dots and updates the maximum value of the moving average of the previous gap portion with the voltage value output by the sensor 81. (Step S5-1) In the printer device 8, the judgment unit 5-9 updates the threshold value when the voltage value output by the sensor 81 does not exceed the maximum value of the moving average of the previous gap portion, or after updating the maximum value of the moving average of the previous gap portion with the voltage value output by the sensor 81.
[0072] (Step S6-1) In the printer device 8, the determination unit 5-9 determines whether or not the output waveform of the voltage output by the sensor 81 is higher than the updated threshold value. (Step S7-1) In the printer device 8, the determination unit 5-9 determines that a label portion has been detected when it determines that the output waveform of the voltage output by the sensor 81 is lower than the updated threshold value. (Step S8-1) In the printer device 8, when the judgment unit 5-9 judges that the output waveform of the voltage output by the sensor 81 is higher than the updated threshold value, it judges whether the voltage value output by the sensor 81 is higher than the updated threshold value by more than the gap voltage threshold value VGapThr, and whether the number of dot lines in which the voltage value output by the sensor 81 exceeds the updated threshold value is greater than or equal to the gap dot line number threshold value NGapLng. (Step S9-1) In the printer device 8, the judgment unit 5-9 judges that fluttering of the label portion has been detected if it determines that the voltage value output by the sensor 81 is higher than the updated threshold value but the difference is less than the gap voltage threshold value VGapThr, or if it determines that the number of dot lines in which the voltage value output by the sensor 81 exceeds the updated threshold value is less than the gap dot line number threshold value NGapLng.
[0073] (Step S10-1) In the printer device 8, when the judgment unit 5-9 judges that the voltage value output by the sensor 81 is higher than the updated threshold value by more than the gap voltage threshold VGapThr and that the voltage value output by the sensor 81 has exceeded the updated threshold value for more than the gap dot line count threshold NGapLng, it judges whether the voltage value output by the sensor 81 will be lower than the updated maximum value of the moving average of the gap portion last time when the paper is fed by the paper-out dot line count threshold NNoPap. (Step S11-1) In the printer device 8, the judgment unit 5-9 judges that a gap has been detected if the voltage value output by the sensor 81 is less than or equal to the updated maximum value of the moving average of the previous gap portion when the paper is fed by the paper-out dot line count threshold NNoPap. (Step S12-1) In the printer device 8, the judgment unit 5-9 judges that a paper out state has been detected if the voltage value output by the sensor 81 when the paper is fed by the paper out dot line count threshold NNoPap is not equal to or less than the value obtained by updating the maximum value of the moving average of the previous gap portion.
[0074] In the above embodiment, the maximum value of the moving average of the previous gap portion is used, but the present invention is not limited to this example. For example, if the circuit logic is configured in a reversed manner to that of the embodiment, the minimum value of the moving average of the previous gap portion may be used. In the above-described embodiment, the moving average calculation unit 5-8 may calculate a threshold value for determining a gap between adjacent label parts based on the maximum value of the moving average of the previous gap part when the circuit is configured with a pull-up resistor.The moving average calculation unit 5-8 may calculate a threshold value for determining a gap between adjacent label parts based on the minimum value of the moving average of the previous gap part when the circuit is configured with a pull-down resistor. In the above-described embodiment, the printing system 1 may be configured to perform gap detection for die-cut label paper, or to perform mark detection for marked paper.
[0075] The printing system 1 of this embodiment is equipped with a transport control unit 5-6 that controls the transport unit serving as a platen roller 51 that transports recording paper P (paper) having peelable label portions P1 formed at predetermined intervals on its printing surface, a sensor 81 that irradiates light onto the paper transported by the transport unit and detects the reflected light of the irradiated light, a detection unit 5-7 that detects the output of the sensor 81, a moving average calculation unit 5-8 that calculates a moving average of voltage values based on the output of the sensor 81 detected by the detection unit 5-7, and a judgment unit 5-9 that judges that a portion between adjacent label portions P1 (gap portion G) has been detected based on the moving average of the voltage values calculated by the moving average calculation unit 5-8 and the output of the sensor 81. By configuring in this manner, the printing system 1 calculates a moving average of the voltage values based on the reflected light of light irradiated onto the paper, and can detect the portion (gap portion G) between adjacent label portions P1 based on the calculated moving average of the voltage values and the output of the sensor 81, thereby reducing erroneous detection of the portion (gap portion G) between label portions P1 of the paper on which the label portion P1 is formed. One of the causes of erroneous detection of the portion (gap portion G) between the label portions P1 of the paper is erroneous detection by the sensor due to fluttering of the paper. In order to reduce erroneous detection by the sensor due to fluttering of the paper, the sensor can be enlarged. However, if the printing system 1 is applied to a small-sized printer, it is difficult to reduce the size of the sensor. In this embodiment, the portion (gap portion G) between adjacent label portions P1 can be detected based on the moving average of the voltage value and the output of the sensor 81, so that erroneous detection of the portion (gap portion G) between the label portions P1 of the paper can be reduced without enlarging the sensor.
[0076] Furthermore, the moving average calculation unit 5-8 calculates a moving average for a dot line that is set based on the length of the portion between the adjacent label portions. By configuring in this way, it is possible to calculate a moving average of the voltage value. Further, the moving average calculation unit 5-8 acquires a moving average corresponding to the portion between adjacent label parts P1 based on the moving average, and calculates a moving average corresponding to the portion between label parts P1 acquired and a threshold value for determining that the portion is between label parts P1 based on the moving average, and the determination unit 5-9 determines that the portion between adjacent label parts P1 has been detected if the threshold value calculated by the moving average calculation unit 5-8 is equal to or greater than the output of the sensor 81. With this configuration, it is possible to calculate the moving average corresponding to the portion between label parts P1 and a threshold value for determining that the portion is between label parts P1 based on the moving average, and therefore it is possible to determine that the portion between adjacent label parts P1 has been detected.
[0077] Furthermore, when the threshold calculated by the moving average calculation unit 5-8 is less than the output of the sensor 81, the determination unit 5-9 determines that fluttering of the label unit P1 has been detected when the difference between the output of the sensor 81 and the threshold is less than the voltage threshold for determining that a gap exists, or when the number of dot lines at which the output of the sensor 81 exceeds the threshold is less than the dot line number threshold for determining that a gap exists. By configuring in this way, it is possible to determine that fluttering of the label unit P1 has been detected based on the voltage threshold for determining that a gap exists and the dot line number threshold for determining that a gap exists. Furthermore, when the threshold calculated by the moving average calculation unit 5-8 is less than the output of the sensor 81, the determination unit 5-9 determines that a portion between adjacent label portions P1 has been detected if the output of the sensor 81 is higher than the threshold by at least a voltage threshold for determining that a gap portion P1 exists, and the number of dot lines where the output of the sensor 81 exceeds the threshold is equal to or greater than the dot line number threshold for determining that a gap portion P1 exists, and when the output of the sensor 81 is equal to or less than the maximum value of the moving average of the previous gap portion P1 when the paper is fed, By configuring in this manner, it is possible to determine that a portion between adjacent label portions P1 has been detected based on the dot line number threshold for determining that no paper exists when the output of the sensor 81 is higher than the threshold by at least a voltage threshold for determining that a gap portion P1 exists, and the number of dot lines where the output of the sensor 81 exceeds the threshold is equal to or greater than the dot line number threshold for determining that a gap portion P1 exists.
[0078] In addition, when the threshold calculated by the moving average calculation unit 5-8 is less than the output of sensor 81, the judgment unit 5-9 determines that no paper has been detected if the output of sensor 81 is higher than the threshold by more than the voltage threshold for determining that it is a gap portion P1, and the number of dot lines where the output of sensor 81 exceeds the threshold is equal to or greater than the dot line number threshold for determining that it is a gap portion P1.When paper is fed, the judgment unit 5-9 determines that no paper has been detected if the output of sensor 81 is higher than the maximum value of the moving average of the previous gap portion P1.By configuring in this way, it can be determined that no paper has been detected based on the dot line number threshold for determining that no paper has been detected when the output of sensor 81 is higher than the threshold by more than the voltage threshold for determining that it is a gap portion P1, and the number of dot lines where the output of sensor 81 exceeds the threshold is equal to or greater than the dot line number threshold for determining that it is a gap portion P1. Furthermore, when the output of sensor 81 is higher than the threshold value calculated by moving average calculation unit 5-8 or when the output of sensor 81 is higher than the moving average corresponding to the portion between label part P1, determination unit 5-9 updates the moving average corresponding to the portion between label part P1 based on the output of sensor 81. By configuring in this manner, it is possible to update the moving average corresponding to the portion between label part P1 based on the threshold value or the moving average corresponding to the portion between label part P1.
[0079] In addition, all or part of the functions of each unit of the host terminal 2 and the printer device 8 in the above-mentioned embodiment may be realized by recording a program for realizing these functions on a computer-readable recording medium, and reading and executing the program recorded on the recording medium into a computer system. Note that the "computer system" referred to here includes hardware such as the OS and peripheral devices.
[0080] In addition, the term "computer-readable recording medium" refers to portable media such as flexible disks, optical magnetic disks, ROMs, and CD-ROMs, and storage units such as hard disks built into computer systems. Furthermore, the term "computer-readable recording medium" may also include those that dynamically hold a program for a short period of time, such as a communication line when transmitting a program via a network such as the Internet or a communication line such as a telephone line, and those that hold a program for a certain period of time, such as a volatile memory inside a computer system that serves as a server or client in such cases. Furthermore, the above program may be one that realizes part of the above-mentioned functions, or may be one that can realize the above-mentioned functions in combination with a program already recorded in the computer system.
[0081] The above describes the form for carrying out the present invention using an embodiment, but the present invention is not limited to such an embodiment, and various modifications and substitutions can be made within the scope that does not deviate from the gist of the present invention. [Explanation of symbols]
[0082] 1...printing system, 2...host terminal, 2-1...communication unit, 2-2...storage unit, 2-3...operation unit, 2-4...information processing unit, 2-5...display unit, 3...casing, 3a...discharge port, 4...display unit, 5...processing unit, 5-1...communication unit, 5-2...storage unit, 5-3...command analysis unit, 5-4...print data creation unit, 5-5...printing unit control unit, 5-6...transport control unit, 5-7...detection unit, 5-8...moving average calculation unit, 5-9...determination unit, 6...main body unit, 7...roll paper storage unit, 8...printer printer device, 9...mechanism section, 10...printing unit, 11...main body frame, 12...back plate section, 13...first side wall section, 13a...hole section, 14...second side wall section, 14a...hole section, 16A...first roller insertion groove, 16B...second roller insertion groove, 17...gear box section, 18...peripheral wall section, 18a...hole section, 19...recess, 20...paper guide section, 20a...mounting section, 20b...through hole, 21...guide slope, 22...opening section, 22a...inner wall surface, 23...clamping section, 24...engaged section, 41...substrate Normal head, 41a...head surface, 42...heating element, 45...head support, 45a...stopper, 46...elastic member, 51...platen roller, 52...roller shaft, 53...roller body, 54...bearing, 56...driven gear, 61...motor, 61a...periphery, 61A...output shaft, 65...first reduction gear, 66...second reduction gear, 67...first rotating shaft, 68...second rotating shaft, 71...flexible printed circuit board, 72...head connection portion, 73...motor connection portion, 74...sensor connection portion, 74a...band portion, 74b...notch portion, 81...sensor, 91...sensor holder, 92...base portion, 92a...rib, 93A...first inclined portion, 93B...second inclined portion, 94...engagement portion, 95...shoulder portion, 96...recess, 100...printing area, 101...tangent line, A...arrow, IC...driver, L1...up-down direction, L2...left-right direction, L3...front-rear direction, P...recording paper, P1...label, P2...liner, P3...release paper, R...roll paper, S...space, θ1...angle, θ2...angle
Claims
1. a conveyance control unit that controls a conveyance unit that conveys paper on which labels are formed at predetermined intervals on a printing surface; a sensor that irradiates light onto the paper being transported by the transport unit and detects reflected light of the irradiated light; A detection unit that detects an output of the sensor; a moving average calculation unit that calculates a moving average of a voltage value based on the output of the sensor detected by the detection unit; a determination unit that determines that a portion between adjacent label portions has been detected based on the moving average of the voltage values calculated by the moving average calculation unit and the output of the sensor; Equipped with the moving average calculation unit calculates a threshold value for determining that the portion is between the adjacent label portions based on an average of a maximum value of the moving average corresponding to the portion between the adjacent label portions calculated based on the moving average and a current moving average; A printing system, wherein the determination unit determines that adjacent portions of the label have been detected when the threshold value calculated by the moving average calculation unit is equal to or greater than the output of the sensor.
2. The printing system according to claim 1 , wherein the moving average calculation unit calculates a moving average for a dot line that is set based on a length of the portion between adjacent label portions.
3. 2. The printing system according to claim 1, wherein the determination unit determines that fluttering of the label portion has been detected when the threshold value calculated by the moving average calculation unit is less than the output of the sensor, the difference between the output of the sensor and the threshold value is less than a voltage threshold value for determining that a gap portion is present, or when the number of dot lines in which the output of the sensor exceeds the threshold value is less than a dot line number threshold value for determining that a gap portion is present.
4. the determination unit determines that a portion between adjacent label portions has been detected when the threshold calculated by the moving average calculation unit is less than the output of the sensor, the output of the sensor is higher than the threshold by at least a voltage threshold for determining that a portion is a gap, and the number of dot lines where the output of the sensor exceeds the threshold is equal to or greater than a dot line number threshold for determining that a portion is a gap, and when the output of the sensor exceeds the threshold by at least a dot line number threshold for determining that a portion is out of paper, the determination unit determines that a portion between adjacent label portions has been detected when the output of the sensor is equal to or less than a maximum value of a moving average of a previous gap portion when paper is fed.
5. The printing system according to claim 4, wherein the determination unit determines that paper is out when the threshold calculated by the moving average calculation unit is less than the output of the sensor, the output of the sensor is higher than the threshold by at least a voltage threshold for determining that it is a gap portion, and the number of dot lines where the output of the sensor exceeds the threshold is equal to or greater than a dot line number threshold for determining that it is a gap portion, and when the output of the sensor exceeds the threshold by at least a dot line number threshold for determining that it is a gap portion, the determination unit determines that paper is out when the output of the sensor is higher than the maximum value of the moving average of the previous gap portion when paper is fed.
6. 6. The printing system according to claim 1 , wherein the determination unit updates the moving average that corresponds to the portion between the label units based on the output of the sensor when the output of the sensor is higher than the threshold value calculated by the moving average calculation unit or when the output of the sensor is higher than the moving average that corresponds to the portion between the label units.
7. A detection method implemented by a printing system, comprising: controlling a conveying unit that conveys paper on which labels are formed at predetermined intervals on a printing surface; a step in which a sensor irradiates light onto the paper being transported by the transport unit and detects reflected light of the irradiated light; detecting an output of the sensor; calculating a moving average of a voltage value based on the output of the sensor detected in the detecting step; determining that a portion between adjacent label portions has been detected based on the moving average of the voltage values calculated in the step of calculating the moving average of the voltage values; having In the calculating step, a threshold value for determining that the portion is between the adjacent label portions is calculated based on a moving average and an average of a maximum value of the moving average corresponding to the portion between the adjacent label portions, the moving average being calculated based on the moving average, and the current moving average is calculated; In the determining step, it is determined that adjacent label portions have been detected if the threshold value calculated in the calculating step is equal to or greater than the output of the sensor.
8. On the printing system computer, controlling a conveying unit that conveys paper on which labels are formed at predetermined intervals on a printing surface; a step in which a sensor irradiates light onto the paper being transported by the transport unit and detects reflected light of the irradiated light; detecting an output of the sensor; calculating a moving average of a voltage value based on the output of the sensor detected in the detecting step; determining that a portion between adjacent label portions has been detected based on the moving average of the voltage values calculated in the step of calculating the moving average of the voltage values; Run the command, In the calculating step, a threshold value for determining that the portion is between the adjacent label portions is calculated based on a moving average and an average of a maximum value of the moving average corresponding to the portion between the adjacent label portions, the moving average being calculated based on the moving average, and the current moving average is calculated; a computer program for causing the computer to determine, in the determining step, that adjacent portions of the label have been detected if the threshold value calculated in the calculating step is equal to or greater than the output of the sensor;
Citation Information
Patent Citations
Method and apparatus for detecting label
JP2002308242A
Printer, and its controlling method
JP2005041086A
Measuring method of label with release paper, measuring device thereof and label printer
JP2006030092A
Printer and sheet detection method
JP2017081673A
Detection device, printer, and detection method
JP2017132087A