Learning-based method for positioning printing paper, printing method for printing paper, and printer

The learning-based printing paper positioning method addresses the challenge of limited compatibility and RAM usage by using a peak-trough algorithm to enhance printer versatility and accuracy while optimizing memory, supporting various paper types efficiently.

JP2025521940APending Publication Date: 2025-07-10SHANGHAI SUMI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2025500345
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2022-07-06
Filing Date
2023-04-28
Publication Date
2025-07-10

AI Technical Summary

Technical Problem

Existing printing methods struggle with versatility in supporting various types of printing paper due to limited compatibility and high RAM usage for storing ADC values, leading to inefficiencies in positioning accuracy and memory optimization.

Method used

A learning-based printing paper positioning method that utilizes a peak-trough positioning algorithm to analyze ADC value changes during printing, allowing for precise positioning of printing areas and connection areas, reducing the need for extensive RAM storage by focusing on key characteristic points.

Benefits of technology

The method enhances printer compatibility with diverse printing papers, improves positioning accuracy, and optimizes memory usage by storing only essential ADC value reference points, minimizing paper waste and storage requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025521940000001_ABST
    Figure 2025521940000001_ABST
Patent Text Reader

Abstract

The positioning method according to the present application includes the steps of: using a learning command as a trigger to search for a plurality of ADC (Analog-to-Digital Converter) value peaks and a plurality of ADC value troughs during the printing process of the printing paper; calculating the peak-trough difference values of the plurality of left edges of the plurality of measured printing points corresponding to the plurality of ADC value peaks; determining the measured positioning points corresponding to the ADC value peaks based on the peak-trough difference values of the plurality of left edges; determining an ADC value reference value based on the ADC value corresponding to the measured positioning point, and then completing the learning, thereby positioning the connection area between the printing means of the printing paper and the printing means during the printing process based on the ADC value reference value. According to the present application, comprehensive learning can be performed, the printer can support more types of paper, improve the accuracy of printing positioning, and optimize the internal storage space of the printer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application mainly relates to the field of printing positioning, and particularly relates to a method for positioning printing paper based on learning, a method for printing printing paper, and a printer.

Background Art

[0002] There are a very large number of types of printing paper with label functions on the market, and different types of printing paper have different characteristics in the ADC (Analog-to-Digital Converter) values fed back by sensors. In order to perform label printing on different types of printing paper, it is necessary to perform label learning before printing. The paper positioning component in currently commonly used printers usually has only one reflective sensor. In the prior art, there are also those that propose to adopt a learning method for the inclination of a single label, but there are significant limitations in the breadth of compatibility with printing paper. Also, since label positioning requires storing and making judgments on a large amount of data regarding the adc values of the scanned printing paper, the conventional method of determining the printing position of printing paper based on the adc value occupies a large amount of RAM space, causing problems in the configuration of the printer. Therefore, how to provide a printing method for printing paper with higher versatility and less RAM occupied space is an urgent problem to be solved in this field.

Summary of the Invention

Problems to be Solved by the Invention

[0003] The features and performance of this application will be further described by the following embodiments and their drawings.

[0004] The technical problem to be solved by the present application is to be able to comprehensively learn the positioning of printing paper, thereby enabling a printer to support more types of printing paper, improving the accuracy of printing positioning, and optimizing the memory space inside the printer, and to provide a learning-based printing paper positioning method, a printing method for printing paper, and a printer.

Means for Solving the Problem

[0005] To solve the above technical problem, the present application provides a learning-based printing paper positioning method that has continuously arranged printing areas and connection areas, includes a plurality of printing means, and is adapted to position the printing areas and the connection areas during the printing process of the printing paper. A learning command serves as a trigger, and steps of searching for a plurality of adc value peaks and a plurality of adc value troughs during the printing process of the printing paper, calculating peak-trough difference values of a plurality of left edges of a plurality of measured printing points corresponding to the plurality of adc value peaks based on the plurality of adc value peaks and the plurality of adc value troughs, where the peak-trough difference values of the plurality of left edges are difference values between an arbitrary adc value peak and an adc value trough adjacent to the arbitrary adc value peak before it, determining a measured positioning point corresponding to the adc value peak based on the peak-trough difference values of the plurality of left edges, determining an adc value reference value based on the adc value corresponding to the measured positioning point, and then completing the learning, and positioning the printing means and the connection area on the printing paper during the process in which the printing paper is printed based on the adc value reference value.

[0006] In one embodiment of the present application, the step of searching for a plurality of ADC value peaks specifically includes continuously reading the ADC values in the printing direction of the printing paper. When the ADC values continue to increase, it is determined that the printing paper is in the rising process of the ADC value. When the ADC value begins to decrease after any measurement printing point, it is determined that an ADC value peak has been found, and searching for the ADC value peak for each of the plurality of printing means. Also, the step of searching for a plurality of ADC value troughs specifically includes continuously reading the ADC values in the printing direction of the printing paper. When the ADC values continue to decrease, it is determined that the printing paper is in the falling process of the ADC value. When the ADC value begins to increase after any measurement printing point, it is determined that the ADC value trough has been found, and searching for the ADC value trough for each of the plurality of printing means may be included.

[0007] In one embodiment of the present application, it may further include the step of determining that the measurement printing point is a measurement positioning point when the peak-peak trough difference value of the left edge corresponding to any measurement printing point meets the positioning condition.

[0008] In one embodiment of the present application, N consecutive ones are extracted from the peak trough difference values of the plurality of left edges, the average value of the N consecutive peak trough difference values of the left edges is calculated as the difference value average value, and the positioning condition further includes that the proportional value between the peak trough difference value of the left edge corresponding to any measurement printing point and the difference value average value does not exceed the difference value threshold, and the range of the difference value threshold is 15 to 25.

[0009] In one embodiment of the present application, in the process of continuously printing the printing paper, at least three measurement positioning points corresponding to at least three adjacent printing means in the printing direction are obtained, and the three measurement positioning points are a first measurement positioning point, a second measurement positioning point, and a third measurement positioning point; recording the distance between the measurement printing points corresponding to the first measurement positioning point and the second measurement positioning point as a first distance, and recording the distance between the measurement printing points corresponding to the second measurement positioning point and the third measurement positioning point as a second distance, and when the difference value between the first distance and the second distance does not exceed the distance threshold, it is determined that the positioning is successful, and at the same time, recording the average value of the adc values corresponding to the first measurement positioning point, the second measurement positioning point, and the third measurement positioning point as the adc value reference value.

[0010] In one embodiment of the present application, at least three adc values corresponding to the at least three measurement positioning points are compared, and when the difference value between the adc value corresponding to any measurement positioning point x and the adc value corresponding to any other measurement positioning point y exceeds the adc value difference threshold, the measurement positioning point x is discarded and another measurement positioning point is searched for again, where the adc value difference threshold is the proportional value of the difference value and the adc value corresponding to the measurement positioning point y, and the range of the adc value difference threshold is 30% to 50%.

[0011] In one embodiment of the present application, the distance threshold includes the proportional value of the difference value between the second distance and the first distance occupying the first distance, and the range of the distance threshold may be 5% to 15%.

[0012] In one embodiment of the present application, after it is determined that the measurement printing point is the measurement positioning point, the correction distance to the correction printing point is continuously printed on the printing paper. In the process of continuously printing, based on the plurality of adc value peaks and the plurality of adc value troughs, the peak-trough difference values of a plurality of left edges are continuously calculated. If the peak-trough difference value of the left edge corresponding to an arbitrary replacement printing point between the measurement printing point and the correction printing point is greater than the peak-trough difference value of the left edge corresponding to the measurement printing point, the measurement positioning point corresponding to the measurement printing point is updated to the replacement positioning point corresponding to the replacement printing point. This may further be included.

[0013] In one embodiment of the present application, the correction distance may be 5 mm to 7.5 mm.

[0014] In one embodiment of the present application, when the length of the connection area on the printing paper exceeds the length threshold, the adc value is continuously read in the printing direction of the printing paper, and the slopes from measurement printing point n to measurement printing point n - 1 and from measurement printing point n - 1 to measurement printing point n - 2 are calculated in real time. By analogy in this way, until a plurality of sets of slope start points and slope end points are found, M slopes are calculated as the slope of the measurement printing point n. It may also include determining whether any of the measurement positioning points is within a slope interval composed of an arbitrary set of slope start points and slope end points, and if the determination result is YES, retaining the slope interval of that set.

[0015] In one embodiment of the present application, by calculating the length of the connection area on the printing paper based on at least two sets of slope start points and slope end points, the printing paper may be positioned together based on the adc value reference value and the length of the connection area during the printing process.

[0016] In one embodiment of the present application, the printing paper is printed by a printer during the printing process. The printer has a print head, a sensor, a stepping motor, a processor, and a storage means. The stepping motor advances the printing paper to perform printing. The method for positioning the printing paper based on the learning is as follows: in an initial state before a learning command is triggered, when it is detected by the sensor that the connection area is located in front of the print head and above or behind the sensor, printing is started; otherwise, after re-determining the position of the printing paper corresponding to the print head, printing is further performed until returning to the initial state again.

[0017] In one embodiment of the present application, in the initial state, when the connection area is located in front of the print head and above or behind the sensor, before starting the printing, the following steps are performed. When the connection area is located in front of the print head and behind the sensor, the stepping motor advances a first remaining stepping distance obtained by subtracting the distance between the edge of the connection area and the sensor from the distance from the print head to the sensor, and then starts printing; when the connection area is located in front of the print head and above the sensor, the stepping motor advances a second remaining stepping distance obtained by adding the length of the connection area to the distance from the print head to the sensor and further subtracting the distance that the sensor has advanced within the connection area, and then starts printing.

[0018] To solve the above technical problems, the present application provides a printing method for printing paper printed by a printer having a printing head, a sensor, a stepping motor, a processor, and a storage means, which is obtained by continuously stitching a plurality of printing areas and a plurality of connection areas at intervals. The stepping motor advances the printing paper for printing. The printing method includes starting printing when, in the initial state of printing, it is detected by the sensor that the connection area is located in front of the printing head and above or behind the sensor, and if not, after re-determining the position of the printing paper corresponding to the printing head, printing is performed until returning to the initial state of printing again. The step of re-determining the position of the printing paper corresponding to the printing head includes simultaneously executing a tilt positioning algorithm and a peak-trough positioning algorithm to determine an ADC value reference value, and the processor instructing the stepping motor to print the printing paper based on the ADC value reference value.

[0019] In one embodiment of the present application, in the initial state of printing, when the connection area is located in front of the printing head and above or behind the sensor, the following steps are performed before starting the printing. When the connection area is located in front of the printing head and behind the sensor, the stepping motor advances a first remaining stepping distance obtained by subtracting the distance between the edge of the connection area and the sensor from the distance from the printing head to the sensor, and then starts printing. And when the connection area is located in front of the printing head and above the sensor, the stepping motor may advance a second remaining stepping distance obtained by adding the length of the connection area to the distance from the printing head to the sensor and further subtracting the distance that the sensor has advanced within the connection area, and then starts printing.

[0020] In one embodiment of the present application, the tilt positioning algorithm continuously reads and records the adc values corresponding to a plurality of printing positions with a preset quantity, and continuously checks a plurality of tilt intervals consisting of a tilt start point and a tilt end point over a plurality of cycle periods during which the adc values continue to increase or decrease. The peak trough positioning algorithm continuously reads the adc values corresponding to a plurality of printing positions, determines a plurality of adc value peaks over a plurality of cycle periods during which the adc values continue to increase or decrease, and calculates the adc value reference value based on the final positioning point by determining the final positioning point based on the adc value peaks or by jointly determining the final positioning point based on the adc value peaks and the plurality of tilt intervals.

[0021] In one embodiment of the present application, before the initial state of the printing, the length of the connection area of the printing paper is obtained. When the length of the connection area is greater than a length threshold value that is a constant between 3 mm and 8 mm, it may further include determining the final positioning point based on the adc value peaks and the plurality of tilt intervals.

[0022] In one embodiment of the present application, the tilt positioning algorithm continuously reads the adc values corresponding to a plurality of printing positions during the printing process of the printing paper, determines the adc value tilt values corresponding to any two adjacent printing positions, determines N sets of tilt start points and tilt end points based on the plurality of adc value tilt values, and stores the N sets of tilt start points and tilt end points in the storage means by the processor, where N is an integer greater than 0 and less than or equal to 10.

[0023] In one embodiment of the present application, the peak trough positioning algorithm continuously reads the adc values corresponding to a plurality of printing positions during the printing process of the printing paper, determines a plurality of adc value peaks and a plurality of adc value troughs over a plurality of cycle periods in which the plurality of adc values continue to increase and decrease, determines candidate positioning points corresponding to any adc value peak based on the plurality of adc value peaks and the plurality of adc value troughs, determines whether the candidate positioning point falls within an inclination section composed of any set of the inclination start point and the inclination end point, and if the determination result is NO, directly determines the candidate positioning point as the final positioning point; otherwise, determines the final positioning point based on the inclination start point and the inclination end point into which the candidate positioning point falls, and calculates the adc value reference value based on the adc value corresponding to the final positioning point and stores it in the storage means, so that the processor instructs the stepping motor to advance and print the printing paper based on the adc value reference value. This may further be included.

[0024] In one embodiment of the present application, the step of determining the candidate positioning point based on the plurality of adc value peaks and the plurality of adc value troughs may further include calculating the difference values between a plurality of adjacent sets of adc value peaks and adc value troughs, and when the difference value x between the adc value peak and the adc value trough in any set n1 exceeds the difference value threshold z, determining that the printing position corresponding to the adc value peak in the set n1 is the candidate positioning point.

[0025] In one embodiment of the present application, after determining the candidate positioning point, the stepping motor is further advanced 80 to 120 steps from the printing position to the correction printing point, and a plurality of adc values are continuously read. If the difference value y between the adc value peak and the adc value trough in any set n2 obtained between the printing position and the correction printing point exceeds the difference value x, this may further include updating the candidate positioning point to the printing position corresponding to the adc value peak in the set n2.

[0026] In one embodiment of the present application, the steps of the peak-trough positioning algorithm include determining the numerical sizes of the adc value peak A1 corresponding to the candidate positioning point and the adc value reference A0 stored in the storage means, and when the difference value between A1 and A0 exceeds 20% to 60% of A0 and A1 is less than A0, discarding the candidate positioning point corresponding to A1 and searching for a new candidate positioning point again. This may further be included.

[0027] In one embodiment of the present application, the peak-trough positioning algorithm determines a plurality of candidate positioning points, calculates the average value d of the distances between the printing positions corresponding to the plurality of candidate positioning points, and when the difference value between A1 and A0 exceeds 20% to 60% of A0 and A1 is greater than A0, determines the distance dx between the printing position corresponding to the candidate positioning point corresponding to A1 and the printing position corresponding to the candidate positioning point corresponding to A0. If the difference between the distance dx and the average value d is greater than 10% of the average value d, discard the candidate positioning point corresponding to A1 and search for a new candidate positioning point again. This may further be included.

[0028] In one embodiment of the present application, the step of calculating the adc value reference based on the adc value corresponding to the final positioning point may further include taking the average value of the adc value peak A1 corresponding to the final positioning point and the adc value reference A0 stored in the storage means, using the new adc value reference, and storing it in the storage means.

[0029] In one embodiment of the present application, a printer having a print head, a sensor, a stepping motor, a processor, and a storage means may be provided, and the processor executes instructions to implement the above method.

[0030] In another aspect of the present application, a computer-readable medium storing computer program code for implementing the above-described printing method when executed by a processor may be provided.

[0031] Compared with the prior art, the present application has the following advantages. The learning-based printing paper positioning method and system of the present application utilize the change in the adc value of the printing paper during the printing process, and use the peak-trough positioning analysis algorithm to accurately learn the positioning mode for the printing paper having a connection area with the printing means, thereby adapting to various types of printing papers. On the premise of not changing the number and characteristics of the sensors, the characteristics of the waveform are fully utilized to improve the breadth of the machine's responsiveness to the printing paper.

[0032] During the positioning process of the printing paper in the present application, when there is a large amount of printing content, the position of the print head with respect to the paper can be recorded in real time so that a calculation positioning or repositioning determination can be made before starting each printing. The printed content after positioning can cover all the printing papers, and a large amount of paper feed waste phenomenon can be avoided.

[0033] In the present application, during the learning process of each repositioning, the characteristic parameters for the printing paper during the printing process can be obtained, and the distance and adc value can be inspected for the printing position corresponding to the adc value peak in real time during positioning, eliminating the influence of the previously printed content on the positioning result.

[0034] The present application does not need to store a large number of adc values, but only stores the characteristic points required for calculation, greatly optimizing the storage space and saving costs on the premise of optimizing the positioning function of the printer.

Brief Description of the Drawings

[0035] Including the drawings is for providing a further understanding of the present application, and they are incorporated to form a part of the present application. The drawings show embodiments of the present application and serve to explain the principles of the present application together with the specification of the present application. In the drawings

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Figure 8

Embodiments for Carrying Out the Invention

[0036] To more clearly explain the technical solution means of the embodiments of the present application, the drawings necessary for use in the description of the embodiments will be briefly described. Obviously, the drawings in the following description are only some examples or embodiments of the present application, and for those skilled in the art, the present application can also be applied to other similar scenarios based on these drawings without creative labor. Unless clearly stated or otherwise explained in the language environment, the same reference numerals in the drawings represent the same structure or operation.

[0037] As indicated in the present application and the claims, unless the context explicitly provides an exception, terms such as "a", "one", "a kind", and / or "said" can include not only the singular but also the plural. Generally, the terms "comprise" and "include" only present that they include the explicitly identified steps and elements, and these steps and elements do not constitute an exclusive listing, and the method or device may also include other steps or elements.

[0038] Unless otherwise specifically illustrated, the relative arrangements of the components and steps described in these embodiments, mathematical formulas, and numerical values do not limit the scope of the present application. Also, for the sake of facilitating the description, it should be understood that the dimensions of each part shown in the drawings are not drawn based on the actual proportional relationship. Technologies, methods, and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, the above-mentioned technologies, methods, and devices should be regarded as part of the specification. In all the examples shown and discussed herein, any specific value should be construed as an illustration rather than a limitation. Therefore, other examples of the exemplary embodiments can have different values. Note that since similar reference signs and alphabets represent similar items in the following figures, once an item is defined in one figure, there is no need to discuss it further in the following figures.

[0039] In the description of the present application, the orientation or positional relationship indicated by the orientation terms (such as "front, rear, upper, lower, left, right", "horizontal, vertical, perpendicular, horizontal", "ceiling, bottom", etc.) is generally the orientation or positional relationship based on the drawings, solely for the purpose of facilitating the description of the present application and simplifying the description. Unless otherwise stated, these orientation terms do not indicate or imply that the specified device or element must have a specific orientation or be configured and operate in a specific orientation, so it cannot be understood as a limitation on the protection scope of the present application. The orientation terms "inside, outside" refer to the inside and outside with respect to the contour of each component itself.

[0040] For ease of explanation, here, spatial relative terms such as "above", "over", "on the upper surface of", "of the upper surface" can be used to describe the spatial positional relationship between one device or feature and another device or feature as shown in the figures. It should be understood that spatial relative terms are intended to include use in orientations other than those in which the device is described in the figures, or different orientations during operation. For example, if the device in the drawing is upside down, after being described as a device "above another device or structure" or "on another device or structure", it is positioned "below another device or structure" or "under another device or structure". Thus, the exemplary term "above" can include both the orientation "above" and the orientation "below". This device may be positioned in other different ways (rotated 90 degrees or in other orientations), and the spatial relative descriptions used here can be appropriately interpreted.

[0041] Also, the use of terms such as "first", "second" to limit components is merely for the purpose of easily distinguishing the corresponding components. Without a particular declaration, these terms have no special meaning, and thus cannot be understood as a limitation of the protection scope of this application. Furthermore, the terms used in this application are selected from well-known common terms, but some of the terms mentioned in the specification of this application can be selected by the applicant according to his or her judgment, and the detailed meaning thereof will be explained in the relevant parts described in this specification. Moreover, it is required to understand this application not only through the actual terms used, but also through the meaning contained in each term.

[0042] When a part is said to be "on another part", "connected to another part", "coupled to another part", or "in contact with another part", it should be understood that it can be directly on the other part, connected or coupled or in contact with the other part, or an intervening part can be present. In contrast, when a part is said to be "directly on another part", "directly connected to", "directly coupled to", or "directly in contact with" another part, no intervening part is present. Similarly, when a first part is said to be "in electrical contact with" or "electrically coupled to" a second part, there is an electrical path that enables current flow between the first part and the second part. The electrical path can include a capacitor, coupled inductors, and / or other parts that enable current flow, and further does not have direct contact between the conductive parts.

[0043] One embodiment of the present application presents a learning-based printing paper positioning method 10 (hereinafter abbreviated as "positioning method 10") with reference to FIG. 1. The positioning method 10 can comprehensively learn the positioning of printing paper so as to make a printer compatible with many types of paper and improve the accuracy of printing positioning. The printing paper to which the positioning method 10 is applied includes a plurality of printing means having continuously arranged printing areas and connection areas. Exemplarily, the printing paper presented in the present application may be understood to be paper having a regular arrangement order such as lottery tickets, or printing paper having an adhesive function and including product information. The positioning method 10 is suitable for positioning the printing area and the connection area during the printing process of the printing paper so that the printer can accurately print in the printing area.

[0044] FIG. 1 in this application uses a flowchart to illustrate the operations performed by the system according to the embodiments of this application. It should be understood that the previous or following operations are not necessarily executed exactly in sequence. Conversely, various steps can be processed in reverse order or simultaneously. Also, other operations can be added to these processes, or certain steps or a number of steps of operations can be removed from these processes.

[0045] According to FIG. 1, the positioning method 10 includes the following steps.

[0046] In step 11, the learning command is triggered to search for a plurality of ADC (Analog-to-Digital Converter) value peaks and a plurality of ADC value troughs during the printing process of the printing paper. First, in actual applications, the learning command can be derived from the adjustment process of the printing equipment or the formal printing process. Specifically, during the formal printing process, whether in the initial state of the printing paper loading machine or at the point of intermittently stopping printing each time a printing operation is performed, a learning command can be generated to position the printing paper to be executed.

[0047] On the other hand, at the intersection of the printing means and the connection area, parameters such as the material and thickness of the paper change. By utilizing this physical property, when the paper is irradiated by a reflection-type sensor, a gently rising or falling change curve can be obtained at the intersection. As shown in FIG. 2, by acquiring the adc values at different printing positions, the rising and falling laws of the adc values can be discovered. This rising and falling curve reflects that the reflection-type sensor is passing through a rapid change from the printing means to the connection area or a rapid change from the connection area to the printing means. Generally, when the characteristic parameters of the printed paper are stable, stable waveform changes can also be observed at each printing position during the printing process. At each period, points A corresponding to the adc value peak value, points B corresponding to the adc value trough value, slope start point C where the slope of the adc value begins to change, and slope end point D where the slope of the adc value ends changing can be determined. In the following, these characteristic points will be described in more detail.

[0048] Exemplarily, in a plurality of embodiments including FIG. 1 of the present application, the step of searching for a plurality of adc value peaks specifically includes continuously reading the adc values in the printing direction of the printed paper. When the adc value continues to increase, it is determined that the printed paper is in the rising process of the adc value. When the adc value begins to decrease after an arbitrary measurement printing point, it is determined that an adc value peak has been searched for, and includes searching for adc value peaks for each of the plurality of printing means. Similarly, the step of searching for a plurality of adc value troughs specifically includes continuously reading the adc values in the printing direction of the printed paper. When the adc value continues to decrease, it is determined that the printed paper is in the falling process of the adc value. When the adc value begins to increase after an arbitrary measurement printing point, it is determined that an adc value trough has been searched for, and includes searching for adc value troughs for each of the plurality of printing means.

[0049] Furthermore, step 12 calculates the difference values of the peak-trough of the plurality of left edges of the plurality of measurement print points corresponding to the plurality of adc value peaks based on the plurality of adc value peaks and the plurality of adc value troughs found in step 11. Here, the difference value of the peak-trough of the left edge is the difference value between any adc value peak and the adc value trough adjacent to the front of any adc value peak. Exemplarily, for point A at the peak, the difference value of the peak-trough of its left edge is the difference value between the adc value corresponding to point A and the adc value corresponding to point B. By analogy, the same operation is performed for point E at the peak. Therefore, for any peak, the difference value of the peak-trough of the left edge can be obtained.

[0050] Step 13 determines the measurement positioning points based on the difference values of the peak troughs of the plurality of left edges. Here, each measurement positioning point corresponds to the adc value peak, which means that among the waveforms shown in FIG. 2, points A and E may be the measurement positioning points. Preferably, in some embodiments of the present application, when the difference value of the peak trough of the left edge corresponding to any measurement printing point (i.e., the characteristic point in the waveform diagram) meets the positioning condition, it further includes that the measurement printing point is determined to be the measurement positioning point. In this way, different selection conditions can be set according to the needs of the actual application scenario. Exemplarily, in some embodiments, the selection conditions are set as follows. Extract N consecutive ones from the difference values of the peak troughs of the plurality of left edges, calculate the average value of the difference values of the N consecutive peak troughs of the left edges as the average difference value, and the above positioning condition is that the ratio of the difference value of the peak trough of the left edge corresponding to any measurement printing point to the average difference value does not exceed the difference value threshold, and the range of the difference value threshold is 15 to 25. For example, when the difference value threshold is 20, it means that the difference value of the peak trough of the left edge corresponding to the current measurement positioning point is greater than 20 times the average difference value, and the current measurement positioning point is determined to be the peak of the maximum edge, and can be used as the candidate positioning point for calculating the adc value reference value. In this way, the minute jitter of the adc value due to the paper's characteristic parameters and the like can be eliminated.

[0051] More preferably, in some embodiments of the present application, after it is determined that the measurement printing point is the measurement positioning point, the printing paper is continuously made to print the correction distance to the correction printing point. During the process of continuous printing, the difference value of the peak trough of the plurality of left edges is continuously calculated based on the plurality of adc value peaks and the plurality of adc value troughs. If the difference value of the peak trough of the left edge corresponding to any replacement printing point between the measurement printing point and the correction printing point is greater than the difference value of the peak trough of the left edge corresponding to the measurement printing point, it includes updating the measurement positioning point corresponding to the measurement printing point to the replacement positioning point corresponding to the replacement printing point. Exemplarily, the correction distance is 5 mm to 7.5 mm.

[0052] In addition, the present application does not limit the number of measurement positioning points, and the number of measurement positioning points may be one or more. Exemplarily, in one embodiment of the present application, the number of measurement positioning points is three. In such an embodiment, in the process of continuing to print on the printing paper, at least three measurement positioning points corresponding to at least three adjacent printing means in the printing direction are obtained. The three measurement positioning points are the first measurement positioning point, the second measurement positioning point, and the third measurement positioning point, respectively. After the three measurement positioning points are obtained, the distance between the measurement printing points corresponding to the first measurement positioning point and the second measurement positioning point is recorded as the first distance, and the distance between the measurement printing points corresponding to the second measurement positioning point and the third measurement positioning point is recorded as the second distance. If the difference value between the first distance and the second distance does not exceed the distance threshold, it is determined that the positioning is successful. At the same time, the average value of the adc values corresponding to the first measurement positioning point, the second measurement positioning point, and the third measurement positioning point is recorded as the adc value reference value. Exemplarily, in some embodiments of the present application, the distance threshold includes the proportional value of the difference value between the second distance and the first distance occupying the first distance, and the range of the distance threshold is 5% to 15%. Exemplarily, when the distance of 10% is selected, if the deviation of the second distance from the first distance does not exceed 10%, the positioning requirements cannot be met. The above conditions of the distance threshold are based on the characteristic that the connection areas of the printing means on the printing paper are arranged in a certain regular order. If there are large fluctuations or deviations in the interval from the previous measurement positioning point after the measurement positioning point is determined, it is considered that the selection of the measurement positioning point has failed. After discarding the measurement positioning point to exclude the variation of the adc value caused by other factors on the printing paper, it is reselected.

[0053] More preferably, in some embodiments of the present application, in addition to comparing distances, at least three adc values corresponding to at least three measurement positioning points are compared. When the difference value between the adc value corresponding to any measurement positioning point x and the adc value corresponding to any other measurement positioning point y exceeds the adc value difference threshold, the measurement positioning point x is discarded and another measurement positioning point is searched for again. Here, the adc value difference threshold is a proportional value between the difference value and the adc value corresponding to the measurement positioning point y, and further includes that the range of the adc value difference threshold is 30% - 50%. This means that it is necessary to pay attention to the difference in adc values corresponding to three adjacent measurement positioning points. If the deviation is not large, for example, if the deviation does not exceed 40%, it is considered that the change in the adc value is acceptable, and step 14 is continued to be executed, and further learning is completed.

[0054] Finally, step 14 determines an adc value reference based on the adc value corresponding to the measurement positioning point. Exemplarily, in an embodiment where a measurement positioning point is selected, the adc value reference corresponds to the adc value reference corresponding to the measurement positioning point. On the other hand, in an embodiment where multiple measurement positioning points such as three are selected, the adc value reference is the average value of the adc values corresponding to the multiple measurement positioning points. After learning is completed after step 14, the adc values obtained during the above learning can be used to position the connection area between the printing means and the printing paper during the printing process based on the adc value reference until the next learning command is received.

[0055] In different embodiments of the present application, based on the positioning method 10 shown in FIG. 1, there are further deformations. Some implementations of the present application also include paying attention to the slope intervals in the adc value change curve. In some embodiments, when the length of the connection area on the printing paper exceeds a length threshold, for example, 5 mm, in such embodiments, it is preferable to further improve the learning accuracy by the slope parameter in the adc value change curve. In such embodiments, the printing paper positioning method based on the learning of the present application continuously reads the adc value in the printing direction of the printing paper, calculates in real time the slopes from the measurement printing point n to the measurement printing point n - 1 and from the measurement printing point n - 1 to the measurement printing point n - 2, and by analogy in this way, until finding multiple sets of slope start points and slope end points, for example, points C and D shown in FIG. 2, it further includes calculating M slopes as the slope of the measurement printing point n. Exemplarily, M may be an integer between 10 and 20. Then, based on this, it is determined whether any measurement positioning point is in the slope interval composed of any set of slope start points and slope end points. If the determination result is YES, the slope interval of the set is reserved, and a positioning point for calculating the adc value reference value can be determined by taking the average value from the printing position corresponding to the slope start point of the slope interval of the set and the printing position corresponding to the slope end point. Conversely, when the length of the connection area on the printing paper is always small, the measurement positioning points obtained by the above-mentioned peak trough positioning algorithm are usually accurate, and it is considered that a more appropriate algorithm can be adopted for different paper types. Furthermore, by calculating the length of the connection area on the printing paper based on at least two sets of slope start points and slope intervals composed of slope technical points, the printing paper can also be positioned together based on the adc value reference value and the length of the connection area during the printing process.

[0056] Even in the basic embodiment or the preferred embodiment, the printer paper positioning system based on the learning submitted in this application performs a precise analysis on the ADC value change curve, learns the parameters related to the printing positioning by finding the measurement positioning points, enables the printer to be more adaptable to many types of papers, and improves the accuracy of the printing positioning.

[0057] Furthermore, in some preferred embodiments of the present application, the printer paper is printed by the printer during the printing process. The printer has a print head, a sensor, a stepping motor, a processor, and a storage means. The stepping motor advances the printer paper for printing. The printer paper positioning method based on the above learning is detected by the sensor in the initial state before the learning command is triggered. When it is detected that the connection area is located in front of the print head and above or behind the sensor, printing is started; otherwise, after re-determining the position of the printer paper corresponding to the print head, printing is further performed until it returns to the initial state again.

[0058] Furthermore, some printing methods perform the following steps before starting printing when, in the initial state, the connection area is located in front of the print head and above or behind the sensor. When the connection area is located in front of the print head and behind the sensor, the stepping motor advances the first remaining stepping distance obtained by subtracting the distance between the edge of the connection area and the sensor from the distance from the print head to the sensor, and then starts printing. When the connection area is located in front of the print head and above the sensor, the stepping motor advances the second remaining stepping distance obtained by adding the length of the connection area to the distance from the print head to the sensor and then subtracting the distance that the sensor advances within the connection area, and then starts printing. Examples applying the above printer paper positioning method based on learning will be further described in detail below.

[0059] One embodiment of the present application also presents a learning-based printing paper positioning system 30 as shown in FIG. 3. According to FIG. 3, the learning-based printing paper positioning system 30 can include an internal communication bus 31, a processor 32, a read-only memory (ROM) 33, a random access memory (RAM) 34, and a communication port 35. When applied to a personal computer, the learning-based printing paper positioning system 30 can also further include a hard disk 36.

[0060] The internal communication bus 31 can realize data communication between components of the learning-based printing paper positioning system 30. The processor 32 can make judgments and presentations. In some embodiments, the processor 32 may be composed of one or more processors. The communication port 35 can realize external data communication with the learning-based printing paper positioning system 30. In some embodiments, the learning-based printing paper positioning system 30 can send and receive information and data from a network via the communication port 35.

[0061] The learning-based printing paper positioning system 30 can include different forms of program storage means and data storage means such as a hard disk 36, a read-only memory (ROM) 33, and a random access memory (RAM) 34, which can store various data files used in computer processing and / or communication and possible program commands executed by the processor 32. The processor executes these commands to realize the main part of the method. The results processed by the processor are transmitted to user equipment via the communication port and displayed on the user interface.

[0062] In addition to this, in another aspect of the present application, a computer-readable medium storing computer program code for realizing the above-described learning-based printing paper positioning method when executed by a processor is presented.

[0063] Based on the above-described learning-based printing paper positioning method, the present application proposes a preferred printing method for printing paper that combines a peak trough positioning algorithm for calculating an ADC value reference value from the above-described ADC value peak trough and an inclination positioning algorithm for positioning both inclination intervals, thereby further expanding the theoretically optimal printing paper positioning method to the optimization process of printer printing in actual printing. This part will be introduced below.

[0064] In the prior art, for positioning when printing on label printing paper, the most frequent value label positioning method can be adopted, and an exemplary positioning process is as follows.

[0065] 1. The stepping motor collects the ADC value for each step, and 2. Within the range of 0 to 4095, record the number of times each ADC value appears. After advancing 10 cm, record the ADC value with the most occurrences as a reference value for the next positioning, and 3. Since the length of the printing area is much longer than the length of the slit, the ADC with the most occurrences is inevitably the printing area. Add a gain to this reference value to obtain an ADC boundary value, and 4. During the positioning process, if the collected ADC value is greater than this ADC boundary value, it is regarded as a slit, and if the ADC value is less than the ADC boundary value, it is regarded as printing paper.

[0066] Such a method can often achieve the positioning effect of the printing paper. However, the mode value positioning method needs to record the number of occurrences for each ADC. For example, in the range of 0 to 4095, at least 8192 Bytes need to be consumed, which is a large overhead for an MCU with insufficient RAM resources. Since the estimated ADC boundary value is very close to the ADC value of the printing area, it is necessary to ensure that the jitter of the printing area during the printing process does not exceed the boundary ADC value. This cannot guarantee that most printing papers have such a smooth ADC curve, so there may be many misjudgments for printing papers with strong jitter. Also, for pre-printed papers, the pre-printed content will cause a sudden change in the ADC value and be positioned on the pre-printed content beyond the boundary ADC, resulting in the invalidation of the positioning. Finally, since the print head and the sensor are not on the same horizontal line, after the positioning is completed, the print head will not be at the positioning position, and there will be an area on the printing paper that cannot be covered by the print, resulting in a low actual printing utilization rate for the entire roll of printing paper.

[0067] Based on these deficiencies, one embodiment of the present application proposes a printing method 100 for printing paper (hereinafter abbreviated as "printing method 100") with reference to FIG. 4, which can achieve accurate positioning of the printed paper, is suitable for more types of printing paper, and can optimize the storage space inside the printer.

[0068] To more clearly explain the printing method 40, based on FIG. 5, the printer 20 submitted according to an embodiment of the present application will be introduced first. In a plurality of embodiments including FIG. 1 of the present application, the printing paper suitable for printing in the printing method is obtained by continuously stitching together a plurality of printing areas and a plurality of connection areas at intervals. The printing paper mentioned in some embodiments of the present application is, for example, a printing paper that can print information such as the entry and weight of products on the weighing platform in a supermarket. The printing paper can be composed of a printing area and a bottom plate in terms of its outer shape, and the printed area portion of the printed paper after printing can be removed and pasted on the product. Also, there is a connection area between the printing areas, and it is easy to intermittently remove the printing areas. Such printing paper is printed by a label printer 20 as shown in FIG. 5, and the printer 20 has a print head 21, a sensor 22, a stepping motor 23, a processor 24, and a storage means 25. Here, the stepping motor 23 advances the printing paper, and is printed by the print head 21. The sensor 22 exemplarily acquires information of the printing paper during the printing process by reflection. The printer 20 shown in FIG. 5 can be applied to the printing method of the printing paper in any embodiment submitted in the present application. Next, the printing method of the printing paper submitted in the present application will be described below.

[0069] First, referring to FIG. 4, the printing method 100 includes the following steps. Step 101 is detected by a sensor at the initial state of printing. When executing the determination of step 110, if it is detected that the connection area is in front of the print head and above or behind the sensor, step 102 is executed to start printing; otherwise, step 103 is executed to re-determine the position of the printing paper corresponding to the print head and then perform printing. According to FIG. 4, whether step 102 or step 103 is executed, the flow finally points to step 101. That is, whether directly starting printing or re-determining the position of the printing paper corresponding to the print head and then re-printing, it continues to wait for the initial state of the next printing, and again executes the determination step of step 110 to continuously correct the printing position throughout the printing process. It should be noted that the initial state of printing described in this application can specifically be understood as the point in time when attempting to start printing after each interruption of printing. Exemplarily, the state immediately after the entire roll of printing paper is loaded into the device is the initial state of printing. On the other hand, during the printing process, it may be necessary to continuously print a plurality of printing areas or intermittently print sheet by sheet, and each point in time when attempting to print the next printing area can be understood as the initial state of printing described in this application.

[0070] Specifically, in the above-described embodiment, the step of re-determining the position of the printing paper corresponding to the print head includes the processor simultaneously executing the tilt positioning algorithm and the peak trough positioning algorithm to determine the adc value reference value so as to instruct the stepping motor to print the printing paper based on the adc value reference value.

[0071] Preferably, some embodiments of the present application are further optimized and improved based on the printing method 100 shown in FIG. 4. Hereinafter, these modifications and preferred embodiments will be further described. First, in some embodiments of the present application, according to the determination step 110 in FIG. 1, when it is determined that the connection area is located in front of the print head and above or behind the sensor at the initial state of printing, step 102 is executed, and a step of calculating the print positioning is also executed before formally starting the printing. To more clearly explain how to calculate the print positioning, FIG. 6 shows an example of the printing paper 60. According to FIG. 6, the printing paper 60 consists of an intermittent printing area 61 and a bottom plate 600, and there is a connection area 62 between adjacent printing areas 61. The paper feeding direction during the process of the printing paper 60 is the X direction shown in FIG. 6. Also, the sensor 22 and the print head 21 in the printer 20 shown in FIG. 5 are also schematically shown in FIG. 6, and there is a fixed interval D0 between the sensor 22 and the print head 21.

[0072] To more clearly explain the positional relationship of the component structures in different cases, FIG. 6 schematically shows two different positional relationships on one printing paper 60. The part below the dashed line is the case where it is necessary to calculate the first stepping distance, and the part above the dashed line is the case where it is necessary to calculate the second stepping distance. Specifically, first, focusing on the part below the dashed line, when the connection area 62 is located in front of the print head 21 and behind the sensor 22, the stepping motor 23 advances the first remaining stepping distance and then starts printing. The calculation method of the first remaining stepping distance is to subtract the distance D1 between the edge of the connection area 62 and the sensor 22 from the distance D0 between the print head 21 and the sensor 22. On the other hand, referring to the part above the dashed line, when the connection area 62 is located in front of the print head 21 and above the sensor 22 (that is, the sensor 22 is at the slit position between adjacent printing areas 61), the stepping motor 23 advances the second remaining stepping distance and then starts printing. The calculation method of the second remaining stepping distance is to add the length D2 of the connection area to D0 and subtract the distance D3 that the sensor advances in the connection area.

[0073] As can be seen from FIG. 6, regardless of whether calculating the first remaining stepping distance or the second remaining stepping distance, when the printer 20 is about to perform printing as described above, by finely adjusting the position of the print head 21, continuous printing can be achieved in the next adjacent printing area 61. Thereby, the position of the print head 21 can be continuously corrected throughout the entire process of printing the entire roll of printing paper, improving the stability during the printing process and saving paper.

[0074] Although the case where printing can be directly started has been described, the case where repositioning is required again will be described below. In step 103 shown in FIG. 4, for the step of re-determining the position of the printing paper corresponding to the print head, there are specific embodiments in different embodiments of the present application. Exemplarily, in a plurality of embodiments including FIG. 4 of the present application, step 103 can determine the adc value reference value by simultaneously executing the inclination positioning algorithm and the peak-trough positioning algorithm so that the processor 24 shown in FIG. 5 instructs the stepping motor 23 to advance and print the printing paper according to the adc value reference value. Specifically, the inclination positioning algorithm includes continuously reading and recording the adc values corresponding to a plurality of preset printing positions, and continuously checking a plurality of inclination intervals composed of an inclination start point and an inclination end point over a plurality of cycle periods during which the adc value continues to increase and decrease. On the other hand, the peak-trough positioning algorithm continuously reads the adc values corresponding to a plurality of printing positions, determines a plurality of adc value peaks over a plurality of cycle periods during which the adc value continues to increase and decrease, and calculates the adc value reference value based on the final positioning point by determining the final positioning point based on the adc value peak or jointly determining the final positioning point based on the adc value peak and a plurality of inclination intervals. Such a method will be described in more detail.

[0075] First, referring to FIG. 7, during the printing process of the printing paper, as the printing position moves forward, the adc values corresponding to different printing positions continue to increase and decrease. For example, referring to FIG. 6, since the printing area 61 and the connection area 600 on the printing paper 60 have different parameter characteristics, if the material, thickness, etc. are different, when the sensor 22 passes through the printing area 61 and the connection area 600, different adc values may be fed back by the sensor 22. Since the printing area 61 and the connection area 600 are continuously arranged, from the feedback result of the adc value, a periodic rising, falling, and gently changing curve as shown in FIG. 7 can be expressed. Generally, the connection area 300 is at the position where the adc value is high, while the printing area 61 is generally at the position where the adc value is low and gentle. In each process of rising and then falling, it can be located at the C' point corresponding to the adc value peak, the D' point corresponding to the adc value trough, the A' point where the rise of the adc value starts, and the B point where the fall of the adc value ends. In the embodiments described later, the A' point and the B' point respectively correspond to the slope start point and the slope end point, and the C' point is the candidate positioning point corresponding to the adc value peak (i.e., the measurement positioning point described with reference to FIGS. 1 to 3).

[0076] The flowchart of FIG. 8 shows a more specific and preferred embodiment of calculating the adc value reference value using the above method in an embodiment of the present application. In the embodiment shown in FIG. 8, the slope positioning algorithm (specifically including steps 511 to 513) and the peak trough positioning algorithm (specifically including steps 521 to 526) are executed simultaneously during the printing process, and interact and cooperate in a timely manner, which will be described in detail below.

[0077] First, the slope positioning algorithm further includes the following steps 511 to 513.

[0078] Step 511 continuously reads the adc values corresponding to multiple printing positions during the printing process of the printing paper, and determines the slope value of the adc values corresponding to any two adjacent printing positions. As shown in FIG. 7, for two printing positions with adjacent front and rear orders, the adc value slope value can be obtained by comparing the adc value of the latter with the adc value of the former. When the adc value continues to increase, the value is positive. When the adc value continues to decrease, this value is negative. On the other hand, when the adc value region is gentle, this value becomes 0. The change trend of the adc value during the printing process can be obtained from the slope value of the adc value.

[0079] Step 512 determines N sets of slope start points and slope end points from the multiple adc value slope values. For example, according to FIG. 4, within each period, the slope start point A' and the slope technical point B' can be positioned. This step 512 implements determining a certain number of slope start points A' and slope technical points B' during the printing process to determine a slope interval, for example, the interval [A', B'].

[0080] Finally, in step 513, the N sets of slope start points and slope end points are stored in the storage means by the processor.

[0081] In the slope positioning algorithm, N is an integer greater than 0 and less than or equal to 10. However, the present application is not limited thereto. In some other embodiments of the present application, depending on the difference in the arrangement of the processing means 25 and the difference in actual needs, N can also take an integer in a range greater than 10. In a commercially available printer, by positioning N to about 10, it is not necessary to consume a large amount of the space of the storage means 25 while satisfying the slope positioning algorithm. Different from the conventional method that requires storing a large number of adc values, in the present application, it is not necessary to position the connection area by only calculating the change trend of the adc values corresponding to adjacent printing positions, so it is not necessary to store all the adc value data in the storage means 25 of the printer 20.

[0082] On the one hand, in the embodiment shown in FIG. 8, the peak-trough positioning algorithm further includes the following steps 521 to 526.

[0083] In step 521, during the printing process of the printing paper, adc values corresponding to a plurality of printing positions are continuously read, and a plurality of adc value peaks and a plurality of adc value troughs are determined over a plurality of cycle periods during which the plurality of adc values continue to increase and decrease. As shown in FIG. 7, the maximum point of the adc value is C', and the adc value trough is point D'.

[0084] In step 522, based on the plurality of adc value peaks and the plurality of adc value troughs, a candidate positioning point (for example, point C' shown in FIG. 7) corresponding to any adc value peak is determined.

[0085] In step 523, it is determined whether the candidate positioning point falls within a slope interval composed of any pair of slope start points and slope end points, for example, interval [A', B']. If the determination result is NO, step 524 of directly determining the candidate positioning point as the final positioning point is executed, and if not, step 525 of determining the final positioning point based on the slope start point and slope end point into which the candidate positioning point falls is executed. Exemplarily, the final positioning point can be determined by taking the average value for the printing positions corresponding to the slope start point and the slope end point respectively.

[0086] Finally, based on the adc value corresponding to the final positioning point, an adc value reference is calculated and stored in the storage means, whereby the processor instructs the stepping motor to print the printing paper from the adc value reference.

[0087] Based on the embodiment shown in FIG. 5, in some embodiments of the present application, the peak-trough positioning algorithm is further optimized. First, for step 522 of determining a candidate positioning point based on a plurality of adc value peaks and a plurality of adc value troughs, in some preferred embodiments of the present application, the following steps are further included.

[0088] Calculate the difference values between the adjacent multiple sets of adc value peaks and adc value troughs.

[0089] When the difference value x between the adc value peak and the adc value trough in any set n1 exceeds the difference value threshold z, it is determined that the printing position corresponding to the adc value peak in set n1 is the candidate positioning point. Exemplarily, in some embodiments of the present application, the difference value threshold can be determined by the average value of the differences of multiple sets, such as selecting 18 to 25 times the average value of the difference values of multiple sets as the difference value threshold. By doing so, the adc value variation jitter caused by paper or the like can be filtered out, and the position of the connection area can be accurately searched.

[0090] Furthermore, in such an embodiment, after determining the candidate positioning point, the stepping motor is further advanced 80 to 120 steps from the printing position to the correction printing point, and a plurality of adc values are continuously read. When the difference value y between the adc value peak and the adc value trough in any set n2 obtained between the printing position and the correction printing point exceeds the difference value x, it also includes updating the candidate positioning point to the printing position corresponding to the adc value peak in set n2. By doing so, the adc value peaks can be further screened to improve the accuracy of positioning the printing position.

[0091] On the other hand, in some embodiments of the present application, the steps of the peak-trough positioning algorithm further include a step of determining the numerical sizes of the adc value peak A1 corresponding to the candidate positioning point and the adc value reference A0 stored in the storage means. If the difference value between A1 and A0 exceeds 20% to 60% (for example, 40%) of A0 and A1 is less than A0, the candidate positioning point corresponding to A1 is discarded, and a new candidate positioning point is searched again. In such an embodiment, the flow of one repositioning is not limited to the conclusion of the candidate positioning point found by the flow, but by comparing more comprehensively with the adc value reference already stored in the storage means, the accuracy of the printing position in the entire printing process can be improved.

[0092] In such an embodiment, the peak trough positioning algorithm determines a plurality of candidate positioning points, calculates the average value d of the distances between the printing positions corresponding to the plurality of candidate positioning points, and when the difference value between A1 and A0 exceeds 20% to 60% (for example, 40%) of A0 and A1 is greater than A0, it determines the distance dx between the printing position corresponding to the candidate positioning point corresponding to A1 and the printing position corresponding to the candidate positioning point corresponding to A0. When the difference value between the distance dx and the average value d is greater than 10% of the average value d, it further includes discarding the candidate positioning point corresponding to A1 and searching for a new candidate positioning point again. This means that only the candidate positioning points that satisfy both the adc value condition and the printing position distance condition are accepted as reliable positioning points. By doing so, it is possible to further eliminate the influence of jitter during the printing process of the paper and the pre-printed content on the printing positioning.

[0093] Furthermore, the calculation of the adc value reference value will be described. In some embodiments, the adc value corresponding to the selected candidate positioning point (or the optimized final positioning point) can be directly used as the adc value reference value. However, in some preferred embodiments of the present application, step 526 shown in FIG. 8 further includes taking the average value of the adc value peak A1 corresponding to the final positioning point and the adc value reference value A0 stored in the storage means, then using it as the new adc value reference value and storing it in the storage means. By doing so, it is possible to more effectively remove the influence of the gradually decreasing radial thickness during the printing process of the entire volume of paper on the printing position, and improve the printing accuracy throughout the entire printing process.

[0094] In the above-described embodiments of the present application, by combining the peak-trough positioning algorithm and the tilt positioning algorithm, it is possible to realize the selection of candidate positioning points based only on the tilt intervals planned by the tilt start points and tilt end points of a small number of feature points. However, in some special embodiments of the present application, the length of the connection area of the printing paper is obtained before the initial state of printing, and when the length of the connection area is greater than the length threshold, which is a constant between 3 mm and 8 mm, determining the final positioning point based on the adc value peak and a plurality of tilt intervals is also included. Usually, if the length of the slit is within 5 mm, since the slit is short, through a lot of experimental verification, a relatively reasonable and accurate adc value reference value can also be obtained by the peak-trough positioning algorithm, and there is no deviation that is too large. On the other hand, when the length of the slit is large, auxiliary by the tilt positioning algorithm is often required to make the selection of candidate positioning points more accurate and improve the positioning accuracy.

[0095] The basis for the judgment of existing algorithms (such as the most frequent value label positioning method, etc.) is single, and it is impossible to increase the breadth of support for the printing paper, and the positioning accuracy may decrease due to changes in the paper. This method is used to realize the accurate positioning of the printing paper, can be applied to various types of printing papers, and also includes pre-printed papers. At the same time, the effect of optimizing the memory space by the present application is remarkable. For example, in some implementations of the present application, compared with the approximately 8192 Bytes of space required in the prior art, the technical solution of the present application only needs to occupy 239 Bytes of space by storing only the feature points. Therefore, regardless of the effect of accurate printing positioning, the types of printing papers used, and the memory space, both the printing method of the printing paper of the present application and the printer to which it is applied have very remarkable advantages.

[0096] In addition, in another aspect of the present application, there is provided a computer-readable medium storing computer program code for realizing the above-described printing method of the printing paper when executed by a processor.

[0097] Although the above basic concepts have been described, it is clear to those skilled in the art that the disclosure of the above invention is merely an example and does not constitute a limitation to this application. Although not explicitly described here, those skilled in the art may make various adjustments, improvements, and modifications to this application. Such adjustments, improvements, and modifications are proposed in this application and thus still fall within the spirit and scope of the embodiments of this application.

[0098] At the same time, specific terms are used to describe the embodiments of this application. For example, "one embodiment", "an embodiment", and / or "some embodiments" mean features, structures, or characteristics related to at least one embodiment of this application. Therefore, it should be emphasized and noted that "one embodiment" or "an embodiment" or "one alternative embodiment" mentioned more than once at different positions in this specification does not necessarily refer to the same embodiment. Furthermore, the features and structures of one or more embodiments of this application may be appropriately combined.

[0099] Some aspects of the present application may be fully implemented by hardware, may be fully implemented by software including firmware, resident software, microcode, etc., or may be implemented by a combination of hardware and software. These hardware or software may be referred to as "data blocks", "modules", "engines", "units", "components", or "systems". 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. Further, each aspect of the present application may be represented as a computer product residing on one or more computer-readable media including computer-readable program code. For example, the computer-readable media may include, but is not limited to, magnetic storage devices (e.g., hard disks, floppy disks, magnetic tapes...), optical disks (e.g., compact disks CD, digital versatile disks DVD...), smart cards, and flash memory devices (e.g., cards, sticks, key drives...).

[0100] The computer-readable media may include propagated data signals encoded with a computer program, either on a baseband or as part of a carrier. The propagated signal may have various representations, including electromagnetic forms, optical forms, etc., or a suitable combination thereof. The computer-readable media may be any computer-readable media other than a computer-readable storage media, which can execute a system, device, or equipment by being connected to commands so as to communicate, propagate, or transmit a program for use. The program code located on the computer-readable media may be propagated via any appropriate media including wireless, cable, optical fiber cable, radio frequency signal, or similar media, or a combination of any of the above media.

[0101] Similarly, to simplify the expressions disclosed in this application and facilitate the understanding of one or more embodiments of the invention, in the foregoing description of the embodiments of this application, a plurality of features may be integrated into one embodiment, drawing, or its description. However, this method of disclosure does not mean that the features necessary for the subject matter of this application are more than those recited in the claims. In fact, the features of the embodiments are fewer than all the features of the single embodiment described above.

[0102] In some embodiments, numbers are used to describe the number of components and attributes. However, it should be understood that the numbers used in the description of such embodiments are modified by the modifier "about", "approximate", or "substantially" in some examples. Unless otherwise specifically illustrated, "about", "approximate", or "substantially" means that the number allows a 20% change. Therefore, in some embodiments, all numerical parameters used in the specification and claims are approximate values, and these approximate values can vary according to the desired features of individual embodiments. In some embodiments, numerical parameters should consider the specified number of significant digits and adopt a general method of retaining digits. In some embodiments of this application, the numerical ranges and parameters for confirming the scope are approximate values. However, in specific embodiments, such numerical settings should be as accurate as possible within the possible range.

[0103] This application is described with reference to the current specific embodiments. However, it should be recognized by those skilled in the art that the above embodiments are only for explaining this application, and various equivalent changes or substitutions can be made without departing from the spirit of this application. Therefore, within the substantial spirit scope of this application, the changes and modifications of the above embodiments both fall within the scope of the claims of this application.

Claims

1. A learning-based method for positioning a printing paper, which has continuously arranged printing areas and connection areas, includes a plurality of printing means, and is adapted to position the printing area and the connection area during the printing process of the printing paper, wherein a learning command is triggered, and steps are taken to search for a plurality of ADC (Analog-to-Digital Converter, ADC) value peaks and a plurality of ADC value troughs during the printing process of the printing paper; Based on the plurality of ADC value peaks and the plurality of troughs, a step of calculating peak-trough difference values of a plurality of left edges of a plurality of measured printing points corresponding to the plurality of ADC value peaks, wherein the peak-trough difference values of the plurality of left edges are difference values between any ADC value peak and an ADC value trough adjacent to the any ADC value peak before it; Based on the peak-trough difference values of the plurality of left edges, a step of determining a measured positioning point corresponding to the ADC value peak; After determining an ADC value reference value based on the ADC value corresponding to the measured positioning point and completing the learning, steps are included to position the printing means and the connection area on the printing paper during the process in which the printing paper is printed based on the ADC value reference value. A learning-based method for positioning a printing paper, characterized by the above.

2. The step of searching for a plurality of ADC value peaks specifically includes continuously reading the ADC values in the printing direction of the printing paper. When the ADC value continues to increase, it is determined that the printing paper is in the rising process of the ADC value. When the ADC value begins to decrease after any measured printing point, it is determined that the ADC value peak has been found, and includes searching for the ADC value peaks of each of the plurality of printing means; The step of searching for a plurality of ADC value troughs specifically includes continuously reading the ADC values in the printing direction of the printing paper. When the ADC value continues to decrease, it is determined that the printing paper is in the falling process of the ADC value. Until the ADC value begins to increase after any measured printing point, it is determined that the ADC value trough has been found, and includes searching for the ADC value troughs of each of the plurality of printing means. A learning-based method for positioning a printing paper according to Claim 1, characterized by the above.

3. The method for positioning printing paper based on learning according to claim 1 or 2, further comprising a step of determining that the measurement printing point is a measurement positioning point when the peak trough difference value of the left edge corresponding to any measurement printing point satisfies the positioning condition.

4. The method further includes extracting N consecutive peak trough difference values from among the peak trough difference values of the plurality of left edges, and calculating an average value of the N consecutive peak trough difference values of the left edges as a difference value average value, wherein the positioning condition is that a proportional value between the peak trough difference value of the left edge corresponding to any measurement printing point and the difference value average value does not exceed a difference value threshold, and a range of the difference value threshold is 15 to 25. The method for positioning printing paper based on learning according to claim 3, characterized in that.

5. In the process of continuing to print the printing paper, at least three measurement positioning points corresponding to at least three adjacent printing means in the printing direction are obtained, and the three measurement positioning points include a first measurement positioning point, a second measurement positioning point, and a third measurement positioning point. Recording a distance between measurement printing points corresponding to the first measurement positioning point and the second measurement positioning point as a first distance, recording a distance between measurement printing points corresponding to the second measurement positioning point and the third measurement positioning point as a second distance, and determining that positioning is successful when a difference value between the first distance and the second distance does not exceed a distance threshold, and simultaneously recording an average value of adc values corresponding to the first measurement positioning point, the second measurement positioning point, and the third measurement positioning point as the adc value reference value. The method for positioning printing paper based on learning according to claim 1, characterized in that.

6. Compare at least three adc values corresponding to the at least three measurement positioning points. When the difference value between the adc value corresponding to any measurement positioning point x and the adc value corresponding to any other measurement positioning point y exceeds the adc value difference threshold, discard the measurement positioning point x and further include searching for another measurement positioning point again. The adc value difference threshold is a proportional value between the difference value and the adc value corresponding to the measurement positioning point y, and the range of the adc value difference threshold is 30% to 50%. The method for positioning printing paper based on learning according to claim 5, characterized in that.

7. The distance threshold includes a proportional value of the difference value between the second distance and the first distance occupying the first distance, and the range of the distance threshold is 5% to 15%. The method for positioning printing paper based on learning according to claim 5, characterized in that.

8. After it is determined that the measurement printing point is a measurement positioning point, continue to print the correction distance to the correction printing point on the printing paper. In the process of continuing to print, continuously calculate the difference value of the peak trough of the plurality of left edges based on the plurality of adc value peaks and the plurality of adc value troughs. When the difference value of the peak trough of the left edge corresponding to any replacement printing point between the measurement printing point and the correction printing point is greater than the difference value of the peak trough of the left edge corresponding to the measurement printing point, further include updating the measurement positioning point corresponding to the measurement printing point to the replacement positioning point corresponding to the replacement printing point. The method for positioning printing paper based on learning according to claim 1, characterized in that.

9. When the length of the connection area on the printing paper exceeds the length threshold, Continuously read the adc value in the printing direction of the printing paper, calculate in real time the slope from the measurement printing point n to the measurement printing point n - 1 and the slope from the measurement printing point n - 1 to the measurement printing point n - 2, and by analogy in this way, calculate M slopes as the slope of the measurement printing point n until multiple sets of slope start points and slope end points are found. Determine whether any of the said measurement positioning points is within a slope interval consisting of an arbitrary pair of slope start points and slope end points. If the determination result is YES, retain the slope interval of this pair. The method for positioning printing paper based on learning according to claim 1 further includes this, and is characterized by this.

10. The said printing paper is printed by a printer during the printing process. The printer has a print head, a sensor, a stepping motor, a processor, and a storage means. The method for positioning printing paper based on learning, in which the stepping motor advances the printing paper to perform printing, In the initial state before the learning command is triggered, when it is detected by the sensor that the connection area is located in front of the print head and above or behind the sensor, start printing. Otherwise, after re-determining the position of the printing paper corresponding to the print head, perform printing until returning to the said initial state again. The method for positioning printing paper based on learning according to claim 1 further includes this, and is characterized by this.

11. In the said initial state, when the connection area is located in front of the print head and above or behind the sensor, before starting the said printing, When the connection area is located in front of the print head and behind the sensor, the stepping motor advances a first remaining stepping distance obtained by subtracting the distance between the edge of the connection area and the sensor from the distance from the print head to the sensor, and then starts printing; When the connection area is located in front of the print head and above the sensor, the stepping motor advances a second remaining stepping distance obtained by adding the length of the connection area to the distance from the print head to the sensor and then subtracting the distance the sensor has advanced within the connection area, and then starts printing. The method for positioning printing paper based on learning according to claim 10 includes performing this, and is characterized by this.

12. A printing method for the said printing paper obtained by continuously stitching together a plurality of printing areas and a plurality of connection areas with intervals therebetween, and printed by a printer having a print head, a sensor, a stepping motor for advancing the printing paper to perform printing, a processor, and a storage means. In the initial state of printing, when it is detected by the sensor that the connection area is located in front of the print head and above or behind the sensor, printing is started; otherwise, after re-determining the position of the printing paper corresponding to the print head, printing is performed until it returns to the initial state of printing again, including Also, the step of re-determining the position of the printing paper corresponding to the print head includes the processor simultaneously executing a tilt positioning algorithm and a peak-trough positioning algorithm to determine an ADC value reference so as to instruct the stepping motor to print the printing paper from the ADC value reference. A printing method for printing paper, characterized by this.

13. In the initial state of printing, when the connection area is located in front of the print head and above or behind the sensor, before starting the printing, When the connection area is located in front of the print head and behind the sensor, the stepping motor advances a first remaining stepping distance obtained by subtracting the distance between the edge of the connection area and the sensor from the distance from the print head to the sensor, and then starts printing. When the connection area is located in front of the print head and above the sensor, the stepping motor advances a second remaining stepping distance obtained by adding the length of the connection area to the distance from the print head to the sensor and further subtracting the distance by which the sensor has advanced within the connection area, and then starts printing. The printing method for printing paper according to claim 12, characterized by performing this.

14. The tilt positioning algorithm continuously reads and records ADC values corresponding to a plurality of printing positions with preset quantities, and continuously checks a plurality of tilt intervals consisting of a tilt start point and a tilt end point over a plurality of cycle periods during which the ADC values are continuously increasing and decreasing. The peak trough positioning algorithm continuously reads adc values corresponding to a plurality of printing positions, determines a plurality of adc value peaks over a plurality of cycle periods during which the adc values are continuously increasing and decreasing, determines a final positioning point based on the adc value peaks, or jointly determines a final positioning point based on the adc value peaks and the plurality of slope intervals, and calculates the adc value reference value based on the final positioning point. The printing method of the printing paper according to claim 12 or 13, characterized in that.

15. Before the initial state of the printing, the length of the connection area of the printing paper is obtained. When the length of the connection area is greater than a length threshold value which is a constant between 3 mm and 8 mm, further including determining a final positioning point based on the adc value peak and the plurality of slope intervals. The printing method of the printing paper according to claim 14, characterized in that.

16. The slope positioning algorithm is During the printing process of the printing paper, continuously read adc values corresponding to a plurality of printing positions, and judge the adc value slope value corresponding to any two adjacent printing positions. Determine N sets of slope start points and slope end points based on the plurality of adc value slope values. The N sets of slope start points and slope end points are stored in the storage means by the processor, and N is an integer greater than 0 and less than or equal to 10. The printing method of the printing paper according to claim 14, further comprising the above.

17. The peak trough positioning algorithm is During the printing process of the printing paper, continuously read adc values corresponding to a plurality of printing positions, and determine a plurality of adc value peaks and a plurality of adc value troughs over a plurality of cycle periods during which the plurality of adc values are continuously increasing and decreasing. Determine candidate positioning points corresponding to any adc value peaks based on the plurality of adc value peaks and the plurality of adc value troughs. Judge whether the candidate positioning point falls within a slope interval composed of any set of the slope start point and the slope end point. If the judgment result is NO, directly determine the candidate positioning point as the final positioning point. Otherwise, determine the final positioning point based on the slope start point and the slope end point into which the candidate positioning point falls. By calculating the ADC value reference based on the ADC value corresponding to the final positioning point and storing it in the storage means, the processor instructs the stepping motor to print the printing paper based on the ADC value reference. The printing method of the printing paper according to claim 14, further comprising this.

18. The step of determining the candidate positioning point based on the plurality of ADC value peaks and the plurality of ADC value troughs includes: Calculating the difference values between a plurality of adjacent sets of ADC value peaks and ADC value troughs; When the difference value x between the ADC value peak and the ADC value trough in an arbitrary set n1 exceeds the difference value threshold z, it is determined that the printing position corresponding to the ADC value peak in the set n1 is the candidate positioning point. The printing method of the printing paper according to claim 17, further comprising this.

19. After determining the candidate positioning point, the stepping motor is further advanced 80 to 120 steps from the printing position to the correction printing point, and a plurality of ADC values are continuously read. When the difference value y between the ADC value peak and the ADC value trough in an arbitrary set n2 obtained between the printing position and the correction printing point exceeds the difference value x, the candidate positioning point is updated to the printing position corresponding to the ADC value peak in the set n2. The printing method of the printing paper according to claim 18, further comprising this.

20. The steps of the peak-trough positioning algorithm include determining the numerical sizes of the ADC value peak A1 corresponding to the candidate positioning point and the ADC value reference A0 stored in the storage means. When the difference value between A1 and A0 exceeds 20% to 60% of A0 and A1 is less than A0, the candidate positioning point corresponding to A1 is discarded, and a new candidate positioning point is searched again. The printing method of the printing paper according to claim 18, further comprising this.

21. The peak trough positioning algorithm determines a plurality of candidate positioning points, calculates an average value d of distances between printing positions corresponding to the plurality of candidate positioning points, and when the difference value between A1 and A0 exceeds 20% to 60% of A0 and A1 is greater than A0, determines a distance dx between a printing position corresponding to a candidate positioning point corresponding to A1 and a printing position corresponding to a candidate positioning point corresponding to A0, and when the difference between the distance dx and the average value d is greater than 10% of the average value d, further includes discarding the candidate positioning point corresponding to A1 and searching for a new candidate positioning point again. The printing method of the printing paper according to claim 20, characterized in that.

22. The step of calculating the adc value reference value based on the adc value corresponding to the final positioning point further includes taking an average value of the adc value peak A1 corresponding to the final positioning point and the adc value reference value A0 stored in the storage means, and then using it as a new adc value reference value and storing it in the storage means. The printing method of the printing paper according to claim 20, characterized in that.

23. A printer having a print head, a sensor, a stepping motor, a processor, and a storage means, wherein the processor executes instructions so as to implement the method according to any one of claims 1 to 22.

Citation Information

Patent Citations

  • Label printer and operation method thereof

    CN113580784A