Thermo-sensitive label positioning method and system for printer and computer readable medium

By obtaining the first curve and determining the rising segment of the trough region corresponding to the gap, and using a photoelectric sensor to convert the photovoltage value, the problem of inaccurate thermal tag positioning was solved, and high-precision thermal tag positioning was achieved.

CN121290966APending Publication Date: 2026-01-09SHANGHAI SUMI TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511645632.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-11
Publication Date
2026-01-09

AI Technical Summary

Technical Problem

In existing technologies, the positioning of thermal labels is inaccurate, causing the printing heat to be spread into the gaps, resulting in the loss of the desired output content.

Method used

By obtaining the first curve, the rising segment of the trough region corresponding to the gap is determined. The light is output by the photoelectric sensor and converted into a voltage value. The gap position is determined based on the analog difference, eliminating interference in the printing process and adapting to thermal labels with different content.

Benefits of technology

It significantly improves the printing positioning accuracy of thermal labels, avoids positioning errors caused by interference, and is suitable for thermal labels of different materials and contents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121290966A_ABST
    Figure CN121290966A_ABST
Patent Text Reader

Abstract

The invention provides a thermosensitive label positioning method and system for a printer and a computer readable medium. The thermosensitive label positioning method for the printer comprises the steps that a first curve is obtained, the first curve is composed of a plurality of data points, the abscissa of each data point is the stepping number of a stepping motor, and the ordinate of each data point is the analog quantity; obtaining an ascending section of a trough area corresponding to the gap according to the first curve: determining the ascending section of the trough area on the first curve, and obtaining a first analog quantity and a second analog quantity, the first analog quantity being an analog quantity corresponding to an end point of the ascending section, and the second analog quantity being an analog quantity corresponding to a starting point of the ascending section; in response to the fact that a first difference value between the first analog quantity and the second analog quantity belongs to a first range, determining that the ascending section is the ascending section of the trough area corresponding to the gap; and taking the step number corresponding to the ascending section of the trough region corresponding to the gap as the starting position of the thermosensitive label.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates primarily to the field of printers, and more particularly to a method, system, and computer-readable medium for positioning thermal labels in a printer. Background Technology

[0002] Currently, the thermal paper used in the market includes thermal label paper, whose heat-developable area is discontinuous. Multiple thermal labels of the same size are placed at equal intervals on a non-developable backing paper using an adhesive substance. Between two adjacent heat-developable areas of the paper, there will be a section of backing paper that cannot be developed, which is usually called a gap.

[0003] When printing on thermal paper, the front end of the developable paper needs to be aligned with the printer's heating line before starting the print job. After printing, the gap area should be aligned with the paper exit for easy label removal by the user. However, existing technology still suffers from inaccurate positioning of thermal labels, causing the printing heat to be distributed into the gap, resulting in the loss of the desired output content. Summary of the Invention

[0004] This application addresses the technical problem of inaccurate thermal label positioning in existing technologies by providing a thermal label positioning method for printers, which improves the accuracy of thermal label positioning. The proposed thermal label positioning method for printers includes: obtaining a first curve, the first curve being composed of multiple data points, wherein the horizontal axis of each data point is the step number of a stepper motor, and the vertical axis of each data point is an analog quantity; wherein the stepper motor is used to feed paper into the printing area of ​​the printer; the paper includes multiple thermal labels disposed on a backing paper, with a predetermined gap between adjacent thermal labels; the printer is equipped with a photoelectric sensor, the photoelectric sensor being used to output light and receive reflected or transmitted light from the paper, converting the reflected or transmitted light into a voltage value; the analog quantity is... The voltage value is converted to an integer value according to a preset ratio; obtaining the rising segment of the trough region corresponding to the gap according to the first curve includes: determining the rising segment of the trough region on the first curve, obtaining a first analog quantity and a second analog quantity, wherein the first analog quantity is the analog quantity corresponding to the end point of the rising segment, and the second analog quantity is the analog quantity corresponding to the start point of the rising segment; and determining the rising segment as the rising segment of the trough region corresponding to the gap in response to a first difference between the first analog quantity and the second analog quantity belonging to a first range; and using the step number corresponding to the rising segment of the trough region corresponding to the gap as the starting position of the thermal tag.

[0005] In one embodiment of this application, obtaining the rising segment of the trough region corresponding to the gap based on the first curve further includes: obtaining a third analog quantity and a fourth analog quantity, wherein both the third analog quantity and the fourth analog quantity are less than the first analog quantity and greater than the second analog quantity, and the third analog quantity is greater than the fourth analog quantity; in response to a second difference between the third analog quantity and the fourth analog quantity of the trough region belonging to a second range, determining the rising segment of the trough region corresponding to the gap to be the position of the step number corresponding to when the analog quantity in the first curve belongs to a first range.

[0006] In one embodiment of this application, the third analog quantity is one-third of the first analog quantity minus the first difference, and the fourth analog quantity is one-third of the second analog quantity plus the first difference.

[0007] In one embodiment of this application, determining the rising segment of the trough region on the first curve includes: representing the analog quantity of the current data point of the first curve as... The analog quantity of the previous data point is represented as The threshold is denoted by x, where x is a positive number; if more than m consecutive data points satisfy: If x > 0, then the curve segment containing the m data points belongs to the rising segment.

[0008] In one embodiment of this application, the method further includes: obtaining the rising segment of the trough region corresponding to the gap based on the first curve further includes: obtaining a first new data point, the first new data point being the end point of the rising segment; generating a new data point of the first curve in response to the stepper motor step number update; taking the weighted average of the analog quantity corresponding to the first new data point and the current first analog quantity as the new current first analog quantity; and obtaining a second new data point, the second new data point being the start point of the rising segment; taking the weighted average of the analog quantity corresponding to the second new data point and the current second analog quantity as the new current second analog quantity.

[0009] In one embodiment of this application, the weighted average includes: performing a weighted average using the following formula, b=(m+a) / (n+1), where b is the new first analog quantity, n is the number of the first new data points that have been weighted and averaged, m is the sum of the analog quantities corresponding to the first new data points that have been weighted and averaged, and a is the current first analog quantity.

[0010] In one embodiment of this application, before obtaining the first curve, the method further includes: detecting the test environment to confirm that the printer is in a paperless state and the printer is in a closed state; adjusting the output intensity of the photoelectric sensor, wherein the output intensity is the intensity of the light output by the photoelectric sensor; obtaining a second curve, wherein the horizontal axis of the second curve is the output intensity and the vertical axis of the second curve is the analog quantity; and obtaining a target output intensity, wherein the target output intensity is the output intensity of the photoelectric sensor corresponding to the second curve reaching a preset slope; and using the target output intensity as the fixed output intensity of the light output by the photoelectric sensor.

[0011] In one embodiment of this application, adjusting the output intensity of the sensor includes: taking the maximum output intensity of the photoelectric sensor as a starting point and gradually reducing the output intensity.

[0012] This application also provides a thermal tag positioning system, comprising: a memory for storing instructions executable by a processor; and a processor for executing the instructions to implement the method described above.

[0013] This application also provides a computer-readable medium storing computer program code that, when executed by a processor, implements the method described above.

[0014] By obtaining the first curve and determining the rising segment of the first curve, obtaining the first difference between the first analog quantity and the second analog quantity, and determining whether the rising segment meets the preset conditions, that is, whether the first difference between the first analog quantity and the second analog quantity belongs to the first range, it is then determined whether the rising segment is the rising segment of the trough region corresponding to the gap position. This eliminates the interference of the rising segment caused by the jitter of the first curve due to interference during printing on the rising segment of the trough region corresponding to the gap position, and can adapt to thermal labels with different content, thereby significantly improving the printing positioning accuracy of thermal labels. Attached Figure Description

[0015] The accompanying drawings are included to provide a further understanding of this application; they are incorporated into and constitute a part of this application. The drawings illustrate embodiments of this application and, together with this specification, serve to explain the principles of this application. In the drawings:

[0016] Figure 1 This is a flowchart of a thermal tag positioning method according to an embodiment of this application;

[0017] Figure 2 This is a flowchart illustrating how a photoelectric sensor obtains the target output intensity according to an embodiment of this application;

[0018] Figure 3 This is a second schematic diagram of an embodiment of this application;

[0019] Figure 4 This is a waveform diagram of the first curve according to an embodiment of this application;

[0020] Figure 5 This is a waveform diagram of the first curve according to another embodiment of this application;

[0021] Figure 6 This is a schematic diagram of a first curve according to another embodiment of this application;

[0022] Figure 7 This is a block diagram of a positioning system according to an embodiment of this application. Detailed Implementation

[0023] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are merely some examples or embodiments of this application. For those skilled in the art, these drawings can be applied to other similar scenarios without creative effort. Unless obvious from the context or otherwise specified, the same reference numerals in the drawings represent the same structures or operations.

[0024] As indicated in this application, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" do not specifically refer to the singular and may also include the plural. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of explicitly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.

[0025] Unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps described in these embodiments do not limit the scope of this application. It should also be understood that, for ease of description, the dimensions of the various parts shown in the drawings are not drawn to actual scale. Techniques, methods, and devices known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and devices should be considered part of the specification. In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters in the following drawings denote similar items; therefore, once an item is defined in one drawing, it need not be further discussed in subsequent drawings.

[0026] Flowcharts are used in this application to illustrate the operations performed by the system according to embodiments of this application. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, various steps can be processed in reverse order or simultaneously. Furthermore, other operations may be added to these processes, or one or more steps may be removed from these processes.

[0027] Existing technologies use reflective or transmissive photoelectric sensors to identify gaps and determine the position of thermal labels. In reflective photoelectric sensors, the photoelectric output circuit and photoelectric receiving circuit are located on the same side of the paper, and the voltage change of the photoelectric receiving circuit determines whether the current passing through the sensor is the label area or the gap area. In transmissive photoelectric sensors, the photoelectric output circuit and photoelectric receiving circuit are located on opposite sides of the paper.

[0028] However, existing thermal label positioning technologies suffer from the following technical problems: The label positioning process relies solely on simple analog threshold judgments to distinguish between paper and gaps. This threshold is ill-suited to thermal labels of different colors, materials, and pre-printed content, and cannot eliminate interference from the printing process. Sources of interference include: equipment aging, changes in the printer's hardware structure, the gradual reduction in paper weight during printing, and inconsistent light intensity output from different photoelectric output circuits (i.e., poor raw material consistency). Furthermore, the printer requires a specialized learning process during label printing, leading to wasted label paper in the early stages. This learning process is necessary because the printer's hardware design uses a fixed-intensity photoelectric output circuit. To avoid excessively strong light output due to manufacturing errors, the light intensity output by the photoelectric output circuit is intentionally reduced during printing. This results in low light intensity received by the photoelectric receiving circuit for both gaps and different label content, leading to insignificant differences in the analog signal received by the photoelectric receiving circuit for gaps and different label content, making accurate gap identification impossible. Therefore, to adapt to thermal labels with different content and accurately identify gaps, a learning process is often required for more accurate gap identification.

[0029] To address the aforementioned issues, this application proposes a thermal label positioning method for printers, applicable to printers with reflective photoelectric sensors and transmissive photoelectric sensors.

[0030] Figure 1 This is a flowchart of a thermal tag positioning method according to an embodiment of this application. Figure 1 As shown, the present application proposes a method 10 for positioning thermal labels in a printer, comprising:

[0031] Step S11: Obtain the first curve, which is composed of multiple data points. The horizontal axis of the first curve is the step number of the stepper motor, and the vertical axis of each first curve is an analog quantity. The stepper motor is used to feed the paper into the printing area of ​​the printer. The paper includes multiple thermal labels set on the backing paper. A predetermined gap is set between adjacent thermal labels. The printer is equipped with a photoelectric sensor for outputting light and for receiving the reflected or transmitted light after the light passes through the paper and converting the reflected or transmitted light into a voltage value. The analog quantity is an integer value converted from the voltage value according to a preset ratio.

[0032] Step S12: Obtain the rising segment of the trough region corresponding to the gap based on the first curve, including: determining the rising segment of the trough region on the first curve, obtaining a first analog quantity and a second analog quantity, wherein the first analog quantity is the analog quantity corresponding to the end point of the rising segment, and the second analog quantity is the analog quantity corresponding to the start point of the rising segment; and determining the rising segment as the rising segment of the trough region corresponding to the gap in response to a first difference between the first analog quantity and the second analog quantity belonging to a first range.

[0033] And, step S13: take the step number corresponding to the rising segment of the trough region corresponding to the gap as the starting position of the thermal label.

[0034] By obtaining the first curve and determining the rising segment of the first curve, obtaining the first difference between the first analog quantity and the second analog quantity, and determining whether the rising segment meets the preset conditions, that is, whether the first difference between the first analog quantity and the second analog quantity belongs to the first range, it is then determined whether the rising segment is the rising segment of the trough region corresponding to the gap position. This eliminates the interference of the rising segment caused by the jitter of the first curve due to interference during printing on the rising segment of the trough region corresponding to the gap position, and can adapt to thermal labels with different content, thereby significantly improving the printing positioning accuracy of thermal labels.

[0035] The printer described in this application is a printer equipped with a reflective photoelectric sensor or a transmissive photoelectric sensor. This application does not impose specific limitations on the circuitry of the photoelectric sensor or the structure of the printer. In some embodiments, the printer may be a thermal printer as described in patent CN117549680A, and the photoelectric sensor may be an adjustable sensitivity photoelectric sensor circuit as described in patent CN114285397A.

[0036] In some embodiments, the intensity of the light output by the photoelectric sensor in step S11 is fixed. Before obtaining the first curve in step S11, the target output intensity of the photoelectric sensor can also be set.

[0037] Figure 2 A flowchart illustrating how a photoelectric sensor of one embodiment of this application obtains the target output intensity is shown. For example... Figure 2As shown, in some embodiments, step S11, before obtaining the first curve, further includes:

[0038] Step S21: Check the test environment to confirm that the printer is in a paperless state and the printer lid is closed;

[0039] Step S22: Adjust the output intensity of the photoelectric sensor, where the output intensity is the intensity of the light output by the photoelectric sensor, to obtain a second curve. The horizontal axis of the second curve represents the output intensity, and the vertical axis represents the analog quantity.

[0040] Step S23: Obtain the target output intensity, which is the output intensity of the photoelectric sensor when the second curve reaches the preset slope;

[0041] Step S24: Use the target output intensity as the fixed output intensity of the light output by the photoelectric sensor.

[0042] In the above embodiments, the photoelectric sensor includes a photoelectric output circuit and a photoelectric receiving circuit. The photoelectric output circuit outputs light, and the photoelectric receiving circuit receives reflected or transmitted light from the paper and converts it into a voltage value. The analog quantity is an integer value converted from the voltage value according to a preset ratio. The output intensity of the photoelectric sensor is the output intensity of the photoelectric output circuit. By setting the output intensity of the photoelectric output circuit corresponding to a preset slope as the target output intensity, and setting the target output intensity as a fixed output intensity of the light output by the photoelectric output circuit, it is possible to avoid excessively strong light output by the photoelectric output circuit and ensure that the light source intensity received by the photoelectric receiving circuit is appropriate. Even with gaps and different label content, the difference in the magnitude of the analog quantity obtained by the photoelectric receiving circuit remains appropriate, ensuring that different photoelectric receiving circuits obtain consistent analog quantities under the same conditions. This solves the problem of poor raw material consistency and avoids the learning process of the printer and the waste of paper in the early stages. In the above embodiments, the process of the photoelectric output circuit obtaining the target output intensity is a photoelectric consistency check and verification process. By setting the printer to a paperless state during the check and verification, deviations in the check and verification results due to differences in the content or material of the test paper and the actual printed paper are avoided.

[0043] In some embodiments, photoelectric consistency checks and verifications can be performed during production testing at the factory (the equipment function verification stage after the hardware and structure of the printing module are assembled).

[0044] In some embodiments, in step S21, it can be confirmed whether the printer is in a closed or paperless state using methods commonly used in the art. In some embodiments, it is confirmed whether the printer is in a closed state by checking a microswitch inside the printer's tray cover. When the tray cover is closed, the microswitch circuit closes, thereby confirming the current closed state. In some embodiments, the detection test environment also includes confirming whether the printing device's connection signal is normal and whether the printing device is overheating.

[0045] In some embodiments, adjusting the output intensity of the photoelectric sensor in step S22 includes: taking the maximum output intensity of the photoelectric sensor as a starting point and gradually reducing the output intensity to improve the efficiency of obtaining the second curve.

[0046] In some embodiments, the photoelectric sensor used in the above-described photoelectric consistency check and verification process can be either reflective or transmissive. Figure 3 A second schematic diagram of an embodiment of this application is shown. For example... Figure 3 As shown, the horizontal axis of the second curve has the unit of duty cycle (photoelectric output ratio) in 100%, and the vertical axis has the unit of analog quantity (ADC value).

[0047] like Figure 3 As shown, the ADC value gradually increases with the increase of photoelectric output intensity. Figure 3 In the embodiment shown, the ADC value at point 31 begins to rise significantly. This point is the point where the preset slope is reached. Therefore, the output intensity corresponding to point 31 can be used as the target output intensity for label positioning during the printing process.

[0048] In some embodiments, the preset slope can be set according to the specific hardware environment or structural design.

[0049] In some embodiments, step S24 refers to the output intensity of the light output circuit when the target output intensity is used as the subsequent label printing intensity, and the magnitude of this output intensity is not adjusted during label printing. In some embodiments, an adjustable photoelectric output circuit continuously adjusts the photoelectric output intensity, and the main control chip reads the ADC value received by the photoelectric receiving circuit to obtain the target photoelectric output intensity. The duty cycle value output by the PWM circuit corresponding to the target photoelectric output intensity is written into the power-off non-loss storage medium of the photoelectric sensor. In subsequent printing, once the printing device triggers the thermal label positioning task, the target photoelectric output intensity is obtained from the medium for label positioning during printing. In some embodiments, in step S11, each step of the stepper motor updates the step number, generating a new data point for the first curve. Therefore, the first curve is updated in real time to determine whether the current paper position is a gap position or a label position, thereby achieving real-time label positioning.

[0050] In some embodiments, the step number is the number obtained by accumulating the printer's steps, that is, the printer's step number is incremented by one for each step the printer takes.

[0051] In some embodiments, the analog quantity (ADC value) in step S11 is the light received by the photoelectric receiving circuit and converted into a voltage value of 0-3.3V, which is converted into 4096 integer values ​​from 0 to 4095 according to a preset ratio.

[0052] Figure 4 A waveform diagram of a first curve according to an embodiment of this application is shown. Figure 5 This is a waveform diagram of the first curve according to another embodiment of this application. Figure 4 This is a schematic diagram of the first curve obtained without interference. Figure 5 This is a schematic diagram of the first curve indicating that the printing process is being disrupted.

[0053] like Figure 4 and Figure 5 As shown, the horizontal axis of the first curve represents the stepper motor's step number, and the vertical axis represents the ADC value. The stable curve points 41 and 51, where the ADC value is relatively high, represent the positions of the thermal tag. The first trough region 42 and the second trough region 52, where the ADC value is relatively low, represent the gap positions.

[0054] like Figure 4 As shown, ideally, the ADC value corresponding to each trough in the first trough region 42 is the same, and there is only one trough at each gap location. Figure 5As shown, under interference, a third trough region 53 appears in the area where the thermal label is located. This third trough region 53 consists of multiple troughs with larger ADC values. Meanwhile, there are multiple troughs 521 at the second trough region 52, each corresponding to a narrower trough region. The presence of multiple troughs 521 at the third trough region 53 and the second trough region 52 is due to interference (sources of which include label style content, equipment aging, or hardware structural environment) or the vibration of the paper itself, causing fluctuations in the first curve.

[0055] Therefore, in order to solve the above-mentioned interference problem, it is necessary to find the trough region in the first curve that actually corresponds to the gap location.

[0056] In some embodiments, the positioning method of this application first determines the rising segment on the first curve, then determines whether the rising segment meets the above-mentioned judgment conditions, and further determines whether the rising segment is the rising segment of the trough region corresponding to the gap. Figure 5 For example, in some embodiments, the difference between the ADC value (first analog quantity) corresponding to the end point 5221 of the rising segment 522 and the starting point 5222 (second analog quantity) of the rising segment is D1. When D1 belongs to the first range, the trough region 52 where the rising segment 522 is located corresponds to the position of the gap, and the rising segment 522 is the rising segment of the trough region corresponding to the gap. The difference between the ADC value corresponding to the end point 5311 of the rising segment 531 and the ADC value corresponding to the starting point 5312 of the rising segment is D2. D2 is less than D1, and D2 does not belong to the first range. Therefore, the trough region 53 where the rising segment 531 is located does not correspond to the position of the gap, and the rising segment 531 is not the rising segment of the trough region corresponding to the gap. Therefore, by limiting the range of the first difference between the first analog quantity and the second analog quantity, it is possible to avoid the possibility that the rising segment of the trough region corresponding to a non-gap location is identified as the position corresponding to the gap, thereby eliminating interference caused by external conditions (label style content or hardware structure environment) and interference caused by slight paper shaking.

[0057] In some embodiments, it can be determined whether the trough region corresponds to the gap location by judging whether both the rising and falling segments of the same trough region meet the above judgment conditions.

[0058] In some embodiments, the first range is set according to the actual testing equipment, testing environment, and test object (e.g., the thickness of the backing paper and thermal label). In some embodiments, the first range is [800, 4095].

[0059] In some embodiments, when printing the first label paper, the judgment on whether the first difference belongs to the first range is not performed, or the first range is set to be very wide to avoid affecting the printing of the first label paper. For example, when printing the first label paper, the first analog quantity is set to 4095 and the second analog quantity is set to 200, and the difference in the first range is a very large range.

[0060] In some embodiments, determining the rising segment of the trough region on the first curve in step S12 includes: representing the analog quantity of the current data point on the first curve as , representing the analog quantity of the previous data point as , representing the threshold as x, where x is a positive number; if more than m consecutive data points all satisfy: >x, then the curve segment where the m data points are located belongs to the rising segment.

[0061] By setting the threshold x, it is possible to accurately judge whether the current curve segment of the first curve is a rising segment, and further help to determine the starting point and the ending point of the rising segment, and judge whether the first difference belongs to the first range.

[0062] In some embodiments, when judging the section of the first curve, the stepping motor samples at least once each time it takes a step, obtaining a new data point, and samples at least eight times per millimeter of the paper, obtaining eight new data points.

[0063] In some embodiments, the specific value of x is set according to the characteristics of the printer device. In some embodiments, x is 25.

[0064] In some embodiments, m is set according to the number of samples per millimeter of the paper. For example, m can be set to: half of the number of samples per millimeter of the paper. In some embodiments, m is 3 or 4.

[0065] In some embodiments, if more than m consecutive data points all satisfy: <-x, then the curve segment where the m data points are located belongs to the falling segment. If more than m consecutive data points all satisfy: -x < <x, then the waveform where the m data points are located belongs to the steady period.

[0066] In some embodiments, obtaining the rising segment of the trough region corresponding to the gap according to the first curve further includes: obtaining a third analog quantity and a fourth analog quantity, where both the third analog quantity and the fourth analog quantity are less than the first analog quantity and greater than the second analog quantity, and the third analog quantity is greater than the fourth analog quantity; in response to the second difference between the third analog quantity and the fourth analog quantity in the trough region belonging to the second range, determining that the rising segment of the trough region corresponding to the gap is at the position of the stepping number corresponding to the trough region.

[0067] When a user uses a thermal label multiple times, the paper becomes lighter, causing the paper to vibrate during printing. This changes the ADC value of both the trough region corresponding to the gap and the ADC value corresponding to the thermal label, resulting in more pronounced vibrations in the first curve. In the above embodiment, the criteria for determining the gap are further narrowed down to: when the second difference between the third analog quantity corresponding to the midpoint of the rising segment and the fourth analog quantity corresponding to the midpoint of the rising segment falls within a second range, the trough region where the rising segment is located corresponds to the gap location. The third and fourth analog quantities are obtained based on the first and second analog quantities from the earlier period when the paper roll was heavier and the vibration was less. This eliminates the possibility of severe vibrations in the first curve caused by the paper becoming lighter later, thus avoiding the impact of lighter paper on label recognition.

[0068] In some embodiments, the third analog quantity is one-third of the first analog quantity minus the first difference, and the fourth analog quantity is one-third of the second analog quantity plus the first difference.

[0069] Figure 6 A first curve diagram of another embodiment of this application is shown. (See diagram below.) Figure 6 As shown, the horizontal axis of the first curve is still the stepper motor's step number, and the vertical axis is still the ADC value. The first analog quantity of the first curve is the ADC value corresponding to line 61, where the end of the rise phase is located. The second analog quantity is the ADC value corresponding to line 62, where the start of the rise phase is located. Lines 61 and 62 are divided into three equal parts. The third analog quantity is the ADC value corresponding to position 63, which is the upper third of the distance between lines 61 and 62. The fourth analog quantity is the ADC value corresponding to position 64, which is the lower third of the distance between lines 61 and 62.

[0070] In some embodiments, the second range may be the same as the first range. In some embodiments, the second range may be set according to the actual printing environment.

[0071] In some embodiments, a third analog quantity and a fourth analog quantity are set according to the severity of the paper roll shaking. For example, if the paper roll shaking is relatively mild, the third analog quantity can be set to one-quarter of the first analog quantity minus the first difference, and the fourth analog quantity can be set to the second analog quantity plus one-quarter of the first difference.

[0072] In some embodiments, obtaining the rising segment of the trough region corresponding to the gap according to the first curve further includes: obtaining a first new data point, the first new data point being the end point of the rising segment; generating a new data point of the first curve in response to the stepper motor step number update; taking the weighted average of the analog quantity corresponding to the first new data point and the current first analog quantity as the new current first analog quantity; and obtaining a second new data point, the second new data point being the start point of the rising segment; taking the weighted average of the analog quantity corresponding to the second new data point and the current second analog quantity as the new current second analog quantity.

[0073] By updating the first and second analog values ​​based on the latest data points, the problem of the first curve jittering due to the subsequent lightening of the paper can be further avoided, thus improving the accuracy of label positioning.

[0074] In some embodiments, the weighted average includes: performing a weighted average using the following formula (1),

[0075] b=(m+a) / (n+1) (1)

[0076] Where b is the new first analog quantity, n is the number of the first new data points that have been weighted and averaged, m is the sum of the analog quantities corresponding to the first new data points that have been weighted and averaged, and a is the current first analog quantity.

[0077] In some embodiments, step S13 includes setting the step number corresponding to the end point of the rising segment of the trough region corresponding to the gap position as the starting position point of the thermal tag. In some embodiments, the step number corresponding to the starting point of the falling segment of the trough region corresponding to the gap position may also be set as the ending position point of the thermal tag.

[0078] In some embodiments, in step S13, the thermal label is positioned based on the location of the gap. That is, by obtaining the rising segment of the trough region corresponding to the gap position, the corresponding point for entering the thermal label through the gap is considered to have been found. Then, the thermal label is advanced the corresponding distance to align the gap of the thermal label with the paper tearing nozzle of the printing device.

[0079] In some embodiments, after obtaining the current position of the thermal label, the current thermal label is printed, and new first analog quantity, second analog quantity, third analog quantity, and fourth analog quantity are obtained for subsequent label positioning.

[0080] The positioning method of this application is applicable to both transmissive and reflective sensors. By obtaining a first curve and determining its rising segment, a first difference between a first analog quantity and a second analog quantity is obtained. It then determines whether the rising segment meets a preset condition: the first difference between the first analog quantity and the second analog quantity falls within a first range. This determines whether the rising segment corresponds to the rising segment of the trough region at the gap location. This eliminates interference from printing-related trough regions in the first curve that could affect the identification of the rising segment of the trough region corresponding to the gap location. Furthermore, it can adapt to thermal labels with different content, significantly improving the printing positioning accuracy of thermal labels. By further narrowing the gap judgment condition to: when the second difference between the third and fourth analog quantities corresponding to the point in the middle of the rising segment falls within a second range, the rising segment is identified as the rising segment position of the trough region corresponding to the gap. This obtains the third and fourth analog quantities corresponding to the earlier period when the paper roll weight is high and the shaking is light. This eliminates the severe shaking of the first curve caused by the later paper becoming lighter, avoiding the impact of lighter paper on the identification of the rising segment of the trough region corresponding to the gap. By obtaining the target output intensity, we can avoid the waste of label learning caused by the reflective approach, and at the same time solve the problem of consistency of equipment raw materials.

[0081] This application also proposes a thermal tag positioning system, including a memory for storing instructions executable by a processor; and a processor for executing the instructions to implement the method described above.

[0082] Figure 7 This is a block diagram of a positioning system according to an embodiment of this application. (Reference) Figure 7 As shown, the positioning system 700 may include an internal communication bus 701, a processor 702, a read-only memory (ROM) 703, a random access memory (RAM) 704, and a communication port 705. When applied to a personal computer, the positioning system 700 may also include a hard disk 706. The internal communication bus 701 enables data communication between the components of the positioning system 700. The processor 702 can make judgments and issue prompts. In some embodiments, the processor 702 may consist of one or more processors. The communication port 705 enables data communication between the positioning system 700 and external devices. In some embodiments, the positioning system 700 can send and receive information and data from a network through the communication port 705. The positioning system 700 may also include different forms of program storage units and data storage units, such as the hard disk 706, the read-only memory (ROM) 703, and the random access memory (RAM) 704, capable of storing various data files used for computer processing and / or communication, as well as possible program instructions executed by the processor 702. The processor executes these instructions to implement the main part of the method. The results processed by the processor are transmitted to the user device through the communication port and displayed on the user interface.

[0083] The above-described positioning method can be implemented as a computer program, stored in the hard disk 706, and loaded into the processor 702 for execution to implement the positioning method of this application.

[0084] This application also includes a computer-readable medium storing computer program code that, when executed by a processor, implements the methods described above.

[0085] When the positioning method is implemented as a computer program, it can also be stored as an article of art in a computer-readable storage medium. For example, a computer-readable storage medium may include, but is not limited to, magnetic storage devices (e.g., hard disks, floppy disks, magnetic stripes), optical discs (e.g., compact discs (CDs), digital multifunction discs (DVDs)), smart cards, and flash memory devices (e.g., electrically erasable programmable read-only memory (EPROM), cards, sticks, key drives). Furthermore, the various storage media described herein can represent one or more devices and / or other machine-readable media for storing information. The term "machine-readable medium" may include, but is not limited to, wireless channels and various other media (and / or storage media) capable of storing, containing, and / or carrying code and / or instructions and / or data.

[0086] It should be understood that the embodiments described above are merely illustrative. The embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For hardware implementation, the processor may be implemented within one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, and / or other electronic units designed to perform the functions described herein, or combinations thereof.

[0087] Some aspects of this application can be executed entirely by hardware, entirely by software (including firmware, resident software, microcode, etc.), or by a combination of hardware and software. The aforementioned hardware or software may be referred to as a "data block," "module," "engine," "unit," "component," or "system." The processor may be one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DAPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, or combinations thereof. Furthermore, aspects of this application may manifest as computer products residing in one or more computer-readable media, including computer-readable program code. For example, computer-readable media may include, but are not limited to, magnetic storage devices (e.g., hard disks, floppy disks, magnetic tapes, etc.), optical discs (e.g., compressed CDs, digital multifunction DVDs, etc.), smart cards, and flash memory devices (e.g., cards, sticks, key drives, etc.).

[0088] A computer-readable medium may contain a propagated data signal containing computer program code, for example, on baseband or as part of a carrier wave. This propagated signal may take various forms, including electromagnetic, optical, and so on, or suitable combinations thereof. A computer-readable medium can be any computer-readable medium other than a computer-readable storage medium, which can be connected to an instruction execution system, apparatus, or device to enable communication, propagation, or transmission of a program for use. The program code located on the computer-readable medium can be propagated through any suitable medium, including radio, cable, fiber optic cable, radio frequency signals, or similar media, or any combination of the above media.

[0089] The basic concepts have been described above. Obviously, for those skilled in the art, the above disclosure is merely illustrative and does not constitute a limitation of this application. Although not explicitly stated herein, those skilled in the art may make various modifications, improvements, and corrections to this application. Such modifications, improvements, and corrections are suggested in this application, and therefore remain within the spirit and scope of the exemplary embodiments of this application.

[0090] Furthermore, this application uses specific terms to describe embodiments of the application. For example, "an embodiment," "one embodiment," and / or "some embodiments" refer to a particular feature, structure, or characteristic related to at least one embodiment of the application. Therefore, it should be emphasized and noted that "an embodiment," "one embodiment," or "an alternative embodiment" mentioned twice or more in different locations in this specification do not necessarily refer to the same embodiment. In addition, certain features, structures, or characteristics in one or more embodiments of the application can be appropriately combined.

[0091] In some embodiments, numbers describing the quantity of components and attributes are used. It should be understood that such numbers used in the description of embodiments are modified in some examples with the terms "approximately," "approximately," or "generally." Unless otherwise stated, "approximately," "approximately," or "generally" indicates that the numbers are allowed to vary by ±20%. Accordingly, in some embodiments, the numerical parameters used in the specification are approximate values, which may be changed according to the characteristics required by individual embodiments. In some embodiments, numerical parameters should take into account specified significant digits and employ a general method of digit reservation. Although the numerical ranges and parameters used to confirm their breadth of range in some embodiments of this application are approximate values, in specific embodiments, such values ​​are set as precisely as feasible.

Claims

1. A method for positioning thermal labels in a printer, characterized in that, include: A first curve is obtained, which is composed of multiple data points. The horizontal axis of each data point is the step number of the stepper motor, and the vertical axis of each data point is an analog quantity. The stepper motor is used to feed paper into the printing area of ​​the printer. The paper includes multiple thermal labels disposed on the backing paper. A predetermined gap is provided between adjacent thermal labels. The printer is equipped with a photoelectric sensor, which is used to output light and receive the reflected light or transmitted light of the light passing through the paper and convert the reflected light or transmitted light into a voltage value. The analog quantity is an integer value converted from the voltage value according to a preset ratio. Obtaining the rising segment of the trough region corresponding to the gap based on the first curve includes: determining the rising segment of the trough region on the first curve; obtaining a first analog quantity and a second analog quantity, wherein the first analog quantity is the analog quantity corresponding to the end point of the rising segment, and the second analog quantity is the analog quantity corresponding to the start point of the rising segment; and determining the rising segment as the rising segment of the trough region corresponding to the gap in response to a first difference between the first analog quantity and the second analog quantity belonging to a first range; and The step number corresponding to the rising segment of the trough region corresponding to the gap is used as the starting position of the thermal tag.

2. The positioning method as described in claim 1, characterized in that, The process of obtaining the rising segment of the trough region corresponding to the gap based on the first curve further includes: obtaining a third analog quantity and a fourth analog quantity, wherein both the third analog quantity and the fourth analog quantity are less than the first analog quantity and greater than the second analog quantity, and the third analog quantity is greater than the fourth analog quantity; in response to a second difference between the third analog quantity and the fourth analog quantity of the trough region belonging to a second range, determining the position of the rising segment of the trough region corresponding to the gap as the position of the step number corresponding to when the analog quantity in the first curve belongs to a first range.

3. The positioning method as described in claim 2, characterized in that, The third analog quantity is one-third of the first analog quantity minus the first difference, and the fourth analog quantity is one-third of the second analog quantity plus the first difference.

4. The positioning method as described in claim 1, characterized in that, The rising segment of the trough region on the first curve includes: The analog quantity of the current data point of the first curve is represented as: The analog quantity of the previous data point is represented as The threshold is denoted by x, where x is a positive number; If more than m consecutive data points all satisfy: If x > 0, then the curve segment containing the m data points belongs to the rising segment.

5. The positioning method as described in claim 1, characterized in that, Also includes: The step of obtaining the rising segment of the trough region corresponding to the gap based on the first curve further includes: obtaining a first new data point, the first new data point being the end point of the rising segment; generating a new data point of the first curve in response to the stepper motor's step number update; and taking the weighted average of the analog quantity corresponding to the first new data point and the current first analog quantity as the new current first analog quantity; and Obtain a second new data point, which is the starting point of the rising segment; take the weighted average of the analog quantity corresponding to the second new data point and the current second analog quantity as the new current second analog quantity.

6. The positioning method as described in claim 5, characterized in that, The weighted average includes: performing a weighted average using the following formula. b = (m + a) / (n + 1), Where b is the new first analog quantity, n is the number of the first new data points that have been weighted and averaged, m is the sum of the analog quantities corresponding to the first new data points that have been weighted and averaged, and a is the current first analog quantity.

7. The positioning method as described in claim 1, characterized in that, The process of obtaining the first curve includes: The test environment was checked to confirm that the printer was in a paperless state and that the printer lid was closed. Adjusting the output intensity of the photoelectric sensor, wherein the output intensity is the intensity of the light output by the photoelectric sensor, yields a second curve, where the horizontal axis of the second curve represents the output intensity, and the vertical axis of the second curve represents the analog quantity; and Obtain the target output intensity, which is the output intensity of the photoelectric sensor corresponding to when the second curve reaches a preset slope; The target output intensity is used as the fixed output intensity of the light output by the photoelectric sensor.

8. The positioning method as described in claim 7, characterized in that, Adjusting the output intensity of the sensor includes: taking the maximum output intensity of the photoelectric sensor as a starting point and gradually reducing the output intensity.

9. A thermal tag positioning system, comprising: Memory is used to store instructions that can be executed by the processor; and a processor for executing the instructions to implement the method as described in any one of claims 1-8.

10. A computer-readable medium storing computer program code that, when executed by a processor, implements the method as claimed in any one of claims 1-8.