Labeling control method, system, medium and program product

By combining hardware interrupts and high-speed counters, the position error problem caused by the long response time of existing labeling machine controllers is solved, achieving high-precision labeling and efficient production.

CN122166420APending Publication Date: 2026-06-09SIEMENS (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SIEMENS (CHINA) CO LTD
Filing Date
2026-04-21
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

The controller response time of existing labeling machines is relatively long, resulting in large positional errors and making it difficult to meet the requirements of high-precision labeling.

Method used

A control method combining hardware interrupts and high-speed counters is adopted. The first interrupt program starts the label feeding, the second interrupt program calculates the deceleration strategy, and the third interrupt program realizes controlled deceleration. Combined with a multi-level constant speed segmented deceleration strategy, the displacement of the label feeding mechanism is precisely controlled.

Benefits of technology

Significantly improves labeling accuracy to ±0.5mm, increases production efficiency, reduces mechanical impact, and extends equipment life.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122166420A_ABST
    Figure CN122166420A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a labeling control method, system, medium and program product for a labeling machine. The method comprises: when detecting that a product to be labeled on a product conveying belt reaches a first position, executing a first interrupt program to control a label feeding mechanism to start and begin feeding labels; when detecting that a label driven by the label feeding mechanism reaches a second position, executing a second interrupt program to calculate N deceleration trigger count values corresponding to a deceleration strategy; and when the current count value of a high-speed counter reaches one of the N deceleration trigger count values each time, executing a third interrupt program to adjust the speed of the label feeding mechanism to a set speed corresponding to the deceleration trigger count value according to the deceleration strategy. Embodiments of the present application can greatly improve labeling accuracy and production efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of labeling technology, and in particular to a labeling control method, system, medium, and program product for a labeling machine. Background Technology

[0002] Labeling machines are widely used in industries such as pharmaceuticals, food and beverages, and daily chemicals to affix self-adhesive labels to products. With increasing demands for production efficiency and product quality, higher requirements are being placed on the labeling accuracy and speed of labeling machines.

[0003] Existing labeling machines typically use a controller (such as a PLC) to drive a servo motor by controlling the output pulse train through a cyclic scanning cycle, thereby controlling the positioning and label feeding speed of the label feeding mechanism. Taking a PLC as an example, there is a maximum response time (TL) from the input of the detection signal to the output of the control signal, which is typically about two scanning cycles. Taking a label feeding speed of 60 meters / minute (i.e., 1 millimeter / millisecond) as an example, if the PLC scanning cycle is 1-3 milliseconds, the maximum response time TL is approximately 2-6 milliseconds. This results in a positional error of several millimeters. This is far greater than the typically required labeling accuracy of ±0.5 millimeters. Therefore, existing technology is insufficient to meet the requirements of high-precision labeling. Summary of the Invention

[0004] In view of this, the present disclosure provides a labeling control method, system, medium, and program product for a labeling machine, which at least partially solves the above-mentioned technical problems.

[0005] In a first aspect, this disclosure provides a labeling control method for a labeling machine, comprising: when a product to be labeled on a product conveyor belt is detected to have reached a first position, executing a first interrupt program, the first interrupt program being used to control a label feeding mechanism to start and begin label feeding; when a label driven by the label feeding mechanism is detected to have reached a second position, executing a second interrupt program, the second interrupt program being used to obtain the current count value of a high-speed counter, and based on the current count value and a preset deceleration strategy, calculating N deceleration trigger count values ​​corresponding to the deceleration strategy, where N is an integer not less than 1; when the current count value of the high-speed counter reaches one of the N deceleration trigger count values ​​each time, executing a third interrupt program, the third interrupt program being used to adjust the speed of the label feeding mechanism to a set speed corresponding to the deceleration trigger count value, so as to achieve controlled deceleration and stop label feeding, and the set speed corresponding to the last reached deceleration trigger count value is 0.

[0006] In one possible implementation, the deceleration strategy employs a step-by-step constant-speed segmented deceleration strategy, comprising N uniform speed stages.

[0007] In one possible implementation, the second interrupt routine is further configured to obtain the total positioning distance L of the deceleration process in the deceleration strategy; calculate the total number of target pulses corresponding to the total positioning distance L based on the total positioning distance L and the pulse equivalent of the system; divide the total number of target pulses into the N uniform speed stages, and determine the N deceleration trigger count values ​​corresponding to the N uniform speed stages and the N set speeds corresponding to the N deceleration trigger count values, wherein the N set speeds decrease progressively and are all less than the initial speed of the deceleration process.

[0008] In one possible implementation, the duration of each of the N constant speed stages is equal; the second interrupt routine is further configured to calculate N set speeds corresponding to the N deceleration trigger counts based on the total positioning distance L of the deceleration process in the deceleration strategy, the number of constant speed stages N, and the initial speed of the deceleration process; and to calculate the N deceleration trigger counts based on the current count value obtained from the high-speed counter, the total positioning distance L of the deceleration process, the number of constant speed stages N, the initial speed of the deceleration process, and the pulse equivalent of the system.

[0009] In one possible implementation, the high-speed counter is used to count the number of pulses of the pulse signal output by the controller to the driver of the label feeding mechanism.

[0010] In one possible implementation, the first interrupt routine is further used to call a pulse train output instruction to start the label feeding mechanism to feed the label.

[0011] In one possible implementation, the first position is the front end of the product to be labeled, located upstream of the label outlet of the label feeding mechanism in the conveying direction of the product conveyor belt, and at a distance of a first preset value from the label outlet; the second position refers to the front end of the label to be labeled, located downstream of the label outlet in the label feeding direction of the label feeding mechanism.

[0012] In one possible implementation, the first interrupt procedure is used to control the label feeding mechanism to start and begin label feeding at a specified speed; the method further includes: controlling the product conveyor belt to drive the products to be labeled on the conveyor to run at the specified speed at a constant speed.

[0013] Secondly, this disclosure provides a controller, comprising: a detection module for detecting whether a product to be labeled on a product conveyor belt has reached a first position, and whether a label driven by a label feeding mechanism has reached a second position; an interrupt trigger module for calling a first interrupt program module when the product to be labeled on the product conveyor belt is detected to have reached the first position, calling a second interrupt program module when the label driven by the label feeding mechanism is detected to have reached the second position, and calling a third interrupt program module when the current count value of a high-speed counter reaches one of N deceleration trigger count values ​​each time; a first interrupt program module for controlling the label feeding mechanism to start and begin label feeding; a second interrupt program module for obtaining the current count value of the high-speed counter, and calculating N deceleration trigger count values ​​corresponding to the deceleration strategy based on the current count value and a preset deceleration strategy, where N is an integer not less than 1; and a third interrupt program module for adjusting the speed of the label feeding mechanism to a set speed corresponding to the deceleration trigger count value, so as to achieve controlled deceleration and stop label feeding, wherein the set speed corresponding to the last reached deceleration trigger count value is 0.

[0014] In one possible implementation, the deceleration strategy employs a step-by-step constant-speed segmented deceleration strategy, including the N constant-speed stages.

[0015] In one possible implementation, the second interrupt module is further configured to: obtain the total positioning distance L of the deceleration process in the deceleration strategy; calculate the total number of target pulses corresponding to the total positioning distance L based on the total positioning distance L and the pulse equivalent of the system; divide the total number of target pulses into the N uniform speed stages, and determine the N deceleration trigger count values ​​corresponding to the N uniform speed stages and the N set speeds corresponding to the N deceleration trigger count values, wherein the N set speeds decrease progressively and are all less than the initial speed of the deceleration process.

[0016] In one possible implementation, the duration of each of the N constant speed stages is equal; the second interrupt module further calculates the set speed for each stage based on the total positioning distance of the deceleration process in the deceleration strategy, the number of constant speed stages N, and the initial speed of the deceleration process; the second interrupt module is also used to calculate the N deceleration trigger count values ​​based on the current count value obtained from the high-speed counter, the total positioning distance L of the deceleration process, the number of constant speed stages N, the initial speed of the deceleration process, and the pulse equivalent of the system.

[0017] In one possible implementation, the controller includes the high-speed counter, which is used to count the number of pulses of the pulse signal output by the controller to the driver of the label feeding mechanism.

[0018] Thirdly, this disclosure provides a labeling control system for a labeling machine, comprising: a controller as described in any one of the first aspects above; a product detection sensor disposed at the first position; a label detection sensor disposed at the second position; a first drive device for controlling the operation of the product conveyor belt; and a second drive device for controlling the label feeding mechanism for feeding labels.

[0019] Fourthly, this disclosure provides a computer-readable storage medium storing computer instructions; the computer instructions are executable by at least one processor to implement the labeling control method for a labeling machine as described in any of the first aspects above.

[0020] Fifthly, this disclosure provides a computer program product, including a computer program; said computer program can be executed by at least one processor to implement the labeling control method for a labeling machine as described in any of the first aspects above.

[0021] In the embodiments of this application, real-time, high-precision monitoring of the label feeding mechanism's displacement is achieved through hardware interrupts and high-speed counters. Combined with a deceleration strategy with a compensation mechanism, labeling accuracy is greatly improved. This significantly increases the operating line speed of the labeling machine, thereby substantially increasing production efficiency. Associating key control timing points with hardware interrupt programs enables operation response times to reach the microsecond level, avoiding the error accumulation caused by traditional PLC scanning cycles. Multi-level deceleration strategies (e.g., N=10) achieve smoother, more precise stopping, reducing mechanical impact and extending equipment lifespan. Attached Figure Description

[0022] Figure 1 This is a flowchart of a labeling control method for a labeling machine according to an embodiment of the present disclosure.

[0023] Figure 2 This is a labeling state diagram of a product to be labeled reaching a first position according to an embodiment of the present disclosure.

[0024] Figure 3 This is a labeling state diagram showing the label reaching the second position according to an embodiment of the present disclosure.

[0025] Figure 4 This is a labeling state diagram when the label feeding mechanism drives the label to stop according to an embodiment of the present disclosure.

[0026] Figure 5 This is a controller structure diagram according to an embodiment of the present disclosure.

[0027] Figure 6 This is a structural diagram of a labeling control system for a labeling machine according to an embodiment of the present disclosure.

[0028] Figure 7This is a structural diagram of an electronic device according to an embodiment of the present disclosure.

[0029] List of reference numerals in the attached diagram:

[0030] 201. Product conveyor belt; 202. Label feeding mechanism; 203. Product; 204. Label; V1. Conveying direction; V2. Label feeding direction; A. First position; B. Second position; 400. Controller; 402. Detection module; 404. Interrupt trigger module; 406. First interrupt program module; 408. Second interrupt program module; 410. High-speed counter; 412. Third interrupt program module; 500. Labeling control system; 502. Product detection sensor; 504. Label detection sensor; 506. First drive device; 508. Second drive device; 600. Electronic equipment; 602. Processor; 604. Communication interface; 606. Memory; 608. Bus; 610. Program. Detailed Implementation

[0031] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided with reference to the accompanying drawings and embodiments. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments. All other technical solutions obtained by those skilled in the art based on the embodiments of this application fall within the scope of protection of this application.

[0032] Example 1: Labeling control method for labeling machines

[0033] This embodiment provides a labeling control method, the specific process of which is as follows: Figure 1 As shown, combined with Figure 2 , Figure 3 Please provide an explanation.

[0034] Step S102: When the product to be labeled 203 on the product conveyor belt 201 is detected to have reached the first position A, the first interrupt program is executed. The first interrupt program is configured to control the label feeding mechanism 202 to start and begin label feeding.

[0035] The product to be labeled 203 is driven by the product conveyor belt 201 to move at a constant speed. When the product detection sensor (e.g., photoelectric sensor) detects that the product to be labeled 203 on the conveyor belt has reached the first position A (e.g., ... Figure 2 When the product 203 is 5mm away from the label outlet of the label feeding mechanism 202 (as shown), the first interrupt procedure is executed. The first position A is the front end of the product 203 to be labeled, located upstream of the label outlet of the label feeding mechanism 202 in the conveying direction V1 of the conveyor belt, and at a distance of a first preset value from the label outlet. For example, when the front end of the product 203 is 5mm away from the label outlet of the label feeding mechanism 202, the product detection sensor sends a signal.

[0036] The first interrupt routine is configured to start the label feeding mechanism 202 and begin feeding labels at a specified speed. Specifically, the first interrupt routine can call the Pulse Train Output instruction (PTO instruction in the PLC) to start the label feeding mechanism 202. By calling the "CTRL_PTO_DB" instruction and configuring parameters such as the frequency of the pulse output (corresponding to the label feeding speed), the servo motor of the label feeding mechanism 202 can be driven to start feeding labels. At the same time, the conveyor belt drives the product 203 to be labeled on the conveyor belt to run at the specified speed at a uniform speed to ensure that the label 204 is synchronized with the product 203. It should be noted that, in addition to calling the PTO instruction, the first interrupt routine can also start the label feeding mechanism 202 in other ways (such as directly controlling the servo driver enable and speed).

[0037] In this embodiment, a high-speed counter 410 is used to count the number of pulses in the pulse signal output by the system to the driver of the label feeding mechanism. In some examples, the pulse signal output by the PLC itself (e.g., Q0.0) is fed back to the input terminal, and the high-speed counter 410 counts these pulses to accurately measure the displacement of the label feeding mechanism 202. This disclosure is not limited thereto; in other embodiments, the high-speed counter 410 can also be used to count the encoder pulse signal fed back by the servo driver.

[0038] Step S104: When the tag 204 driven by the tag feeding mechanism 202 is detected to reach the second position B, the second interrupt program is executed. The second interrupt program is configured to obtain the current count value of the high-speed counter 410, and calculate the N deceleration trigger count values ​​corresponding to the deceleration strategy based on the current count value and the preset deceleration strategy.

[0039] During the process of the label feeding mechanism 202 feeding out the label 204, when the label detection sensor (e.g., a photoelectric sensor) detects that the label 204 driven by the label feeding mechanism 202 has reached the second position B (e.g., ... Figure 3When (as shown), the second interrupt procedure is executed. The second position B refers to the front end of the label 204 to be labeled, located downstream of the label outlet in the label feeding direction V2 of the label feeding mechanism 202. For example, when the front end of the label 204 just leaves the peeling plate or leaves the peeling plate by 2mm, the label detection sensor sends a signal. The product detection sensor and the label detection sensor are not limited to photoelectric sensors, but can be any sensor that can accurately detect the position of the product 203 or the label 204, such as a proximity sensor, an ultrasonic sensor, a vision sensor, etc. It should be understood that although specific definitions are given in the claims, the first preset value and the second preset value can be flexibly adjusted according to factors such as the length of the label 204, the size of the product 203, and the labeling position in different application scenarios. For example, the first position A can also be defined as the position where the front end of the product 203 just reaches the label outlet, or at a position downstream of the label outlet, as long as the labeling sequence is met. The second position B can also be defined as the position where the tail of the label 204 reaches the label outlet.

[0040] This deceleration strategy, for example, employs a step-by-step constant-speed segmented deceleration strategy, decomposing the entire deceleration process into N discrete uniform-speed stages. Within each stage, the system operates at a constant set speed, and at the end of that stage, the speed is adjusted to the set speed corresponding to that stage. The next stage operates at the same set speed, and so on, until finally stopping. For example, the second interrupt procedure is also used to: obtain the total positioning distance L of the deceleration process; calculate the total number of target pulses corresponding to the total positioning distance L based on the total positioning distance L and the system's pulse equivalent; divide the total number of target pulses into the N uniform-speed stages, and determine the N deceleration trigger count values ​​corresponding to the N uniform-speed stages and the N set speeds corresponding to the N deceleration trigger count values, wherein the N set speeds decrease progressively and are all less than the initial speed of the deceleration strategy. Furthermore, assuming each uniform speed phase has an equal duration, the second interrupt procedure is also used to: calculate the set speed for each phase based on the total positioning distance L of the deceleration process, the number of uniform speed phases N, and the initial speed of the deceleration strategy; and calculate N deceleration trigger count values ​​based on the current count value obtained from the high-speed counter 410, the total positioning distance L of the deceleration process, the number of uniform speed phases N, the initial speed of the deceleration strategy, and the system's pulse equivalent. In practical applications, the set speed for each uniform speed phase can be taken as the instantaneous speed at the start of that phase in the equivalent uniform deceleration trajectory. The total positioning distance of the deceleration process is from... Figure 3 The label delivery mechanism 202 drives the label 204 to the second position B to begin. Figure 4 The distance L from which the label 204 driven by the label feeding mechanism 202 stops, the number of uniform speed stages N, and the initial speed V0 of the deceleration strategy can be set through the human-machine interface, and the user can adjust them as needed.

[0041] Step S106: When the current count value of the high-speed counter 410 reaches one of the N deceleration trigger count values, a third interrupt program is executed. This third interrupt program is configured to set the speed of the tag feeding mechanism 202 to a set speed corresponding to the deceleration trigger count value, according to the deceleration strategy, to achieve controlled deceleration and stop tag feeding. The set speed corresponding to the last reached deceleration trigger count value is 0. For example, by adjusting the frequency output of the PTO command, the servo motor can be gradually decelerated and eventually stopped.

[0042] In this embodiment, N is an integer not less than 1.

[0043] For example, when N=1, the second interrupt routine is configured to acquire the current count value of the high-speed counter 410, and based on the current count value and the preset first-level deceleration strategy, calculate one deceleration trigger count value corresponding to the first-level deceleration strategy. Furthermore, when the current count value of the high-speed counter 410 reaches the deceleration trigger count value, a third interrupt routine is executed. This third interrupt routine is configured to set the speed of the tag feeding mechanism 202 to 0 according to the first-level deceleration strategy, thereby immediately decelerating to 0 and stopping tag feeding.

[0044] For example, when N=10, the second interrupt program is configured to obtain the current count value of the high-speed counter 410, and calculate the 10 deceleration trigger count values ​​corresponding to the ten-level deceleration strategy based on the current count value and the preset ten-level deceleration strategy. When the current count value of the high-speed counter 410 reaches one of the 10 deceleration trigger count values ​​each time, the third interrupt program is executed. The third interrupt program is configured to set the speed of the label feeding mechanism 202 to a set speed corresponding to the deceleration trigger count value according to the ten-level deceleration strategy, so as to achieve controlled deceleration and stop label feeding. Specifically, for the scenario of N=10, the deceleration process will be more refined and gradual: (1) The second interrupt program will calculate 10 precise count trigger values ​​according to the preset ten-level deceleration strategy. These values ​​represent the 10 deceleration points that the label feeding mechanism 202 needs to pass through during the deceleration process. (2) When the current count value of the high-speed counter 410 reaches these 10 trigger values ​​in sequence, the third interrupt program will be triggered 10 times. (3) Each time it is triggered, the third interrupt program will adjust the speed of the label feeding mechanism 202 to the set speed corresponding to the current deceleration trigger count value. This means that the speed will gradually decrease from the initial specified speed through 9 steps, and finally adjust the speed to 0 when the 10th deceleration trigger count value is reached, thus smoothly stopping the label feeding. Compared with single-stage (N=1) deceleration, this multi-stage (e.g., N=10) deceleration can achieve a smoother and more precise stop, reduce mechanical impact, improve labeling accuracy and equipment life, and is especially suitable for application scenarios with high requirements for stopping accuracy.

[0045] This disclosure associates key control timing points with hardware interrupt routines, so that the response time of these operations is no longer limited by the PLC scan cycle, but is determined by the response speed of the hardware interrupt, typically reaching the microsecond level. Combined with the precise counting of servo motor pulses by the high-speed counter 410, real-time, high-precision monitoring of the displacement of the label feeding mechanism 202 is achieved. Furthermore, through a preset deceleration strategy and dynamic adjustment of the reference value of the high-speed counter 410, it is ensured that the label 204 can smoothly stop at the target position with the expected deceleration curve. This control method fundamentally solves the error accumulation problem caused by the controller (e.g., PLC) scan cycle in existing technologies, enabling labeling accuracy to stably reach ±0.5mm, or even higher. Simultaneously, due to the significant improvement in control accuracy, the labeling machine can operate at a higher linear speed (e.g., 60 m / min), thereby significantly improving production efficiency. For example, in traditional labeling control, if the controller scan cycle is 3ms and the label feeding speed is 1mm / ms, an error of 3-6mm may occur between each detection and control. In this disclosure, the interrupt response time is typically less than 0.1ms, and the high-speed counter 410 can count in real time, keeping the position error within 0.1mm. Combined with the optimization of the deceleration strategy, a labeling accuracy of ±0.5mm is finally achieved.

[0046] Example 2: Labeling Control System

[0047] This embodiment provides a labeling control system 500 for a labeling machine. System 500 aims to achieve high-precision and high-efficiency label 204 application, and is particularly suitable for high-speed labeling scenarios. This system optimizes the error accumulation problem caused by the scanning cycle in traditional PLC control by combining hardware interrupts with a high-speed counter 410.

[0048] The labeling control system 500 includes a PLC, which mainly comprises a detection module 402, an interrupt trigger module 404, a first interrupt program module 406, a second interrupt program module 408, a high-speed counter 410, and a third interrupt program module 412. These modules work together to achieve precise control of the label feeding mechanism 202.

[0049] In this embodiment, the detection module 402 is configured to detect whether the product 203 to be labeled on the product conveyor belt 201 has reached the first position A, and whether the label 204 driven by the label feeding mechanism 202 has reached the second position B. For example, a product detection sensor can be used to detect whether the product 203 to be labeled on the conveyor belt has reached the first position A. For example, a photoelectric sensor can be used, which sends a signal when the front end of the product 203 reaches a specific distance (e.g., 5mm) upstream of the label outlet of the label feeding mechanism 202. For example, a label detection sensor can be used to detect whether the label 204 driven by the label feeding mechanism 202 has reached the second position B. For example, a photoelectric sensor can be used, which sends a signal when the front end of the label 204 has just left the label peeling plate or left the label peeling plate by a specific distance (e.g., 2mm).

[0050] The interrupt trigger module 404 is configured to trigger the execution of a first interrupt program when the product 203 to be labeled on the conveyor belt reaches the first position A; to trigger the execution of a second interrupt program when the label 204 driven by the label feeding mechanism 202 reaches the second position B; and to trigger the execution of a third interrupt program when the current count value of the high-speed counter 410 reaches one of the N deceleration trigger count values. This is typically implemented by a hardware interrupt mechanism in a PLC or dedicated controller, ensuring real-time response with a response time down to the microsecond level.

[0051] The first interrupt program module 406 is configured to immediately control the label feeding mechanism 202 to start and begin label feeding upon receiving an instruction from the interrupt trigger module 404. This module is configured to call a Pulse Train Output (PTO) instruction (such as the CTRL_PTO_DB instruction in a PLC) to drive the servo motor of the label feeding mechanism 202. The label feeding speed can be controlled by configuring the pulse output frequency. Simultaneously, the system also controls the conveyor belt to run at a specified constant speed to ensure that the label 204 is synchronized with the product 203.

[0052] This system uses a high-speed counter 410 to count the pulse signals output by the PLC 400 itself, thereby accurately measuring the displacement of the label feeding mechanism 202.

[0053] The second interrupt program module 408 is configured to be triggered when the tag 204 reaches the second position B. Its core task is to obtain the current count value of the high-speed counter 410 and calculate N deceleration trigger count values ​​based on the preset deceleration strategy.

[0054] The deceleration strategy employs a step-by-step constant-speed segmented deceleration strategy, including the N discrete uniform speed stages, each of which may have an equal or unequal duration. The second interrupt procedure module 408 is further configured to: obtain the total positioning distance L of the deceleration strategy; calculate the total number of target pulses corresponding to the total positioning distance L based on the total positioning distance L and the system's pulse equivalent; divide the total number of target pulses into the N uniform speed stages, and determine the N deceleration trigger count values ​​corresponding to the N uniform speed stages and the N set speeds corresponding to the N deceleration trigger count values, wherein the N set speeds decrease progressively and are all less than the initial speed of the deceleration strategy. In addition, in the implementation where the duration of each constant speed phase is equal, the second interrupt program module 408 is also used to calculate the set speed of each phase based on the total positioning distance of the deceleration process, the number of constant speed phases N, and the initial speed of the deceleration strategy; and to calculate the N deceleration trigger count values ​​based on the current count value obtained from the high-speed counter, the total positioning distance L of the deceleration process, the number of constant speed phases N, the initial speed of the deceleration strategy, and the pulse equivalent of the system.

[0055] The third interrupt module 412 is configured to be triggered each time the current count value of the high-speed counter 410 reaches a deceleration trigger count value. Based on the deceleration strategy, it sets the speed of the label-feeding mechanism 202 to a set speed corresponding to the current deceleration trigger count value to achieve controlled deceleration. A constant speed is maintained during each uniform speed phase, and the speed is immediately adjusted when entering the next uniform speed phase (i.e., when the corresponding deceleration trigger count value is reached). The set speed corresponding to the last reached deceleration trigger count value is 0, ensuring a smooth stop for the label-feeding mechanism 202. For example, by adjusting the frequency output of the PTO command, the servo motor can be gradually decelerated and eventually stopped.

[0056] In some implementations, the labeling control system 500 includes a PLC 400, a product detection sensor 502, a label detection sensor 504, a first drive device 506 for controlling the operation of the product conveyor belt 201, and a second drive device 508 for controlling the label feeding mechanism 202.

[0057] This system 500 significantly improves response speed and control accuracy by associating key control points with hardware interrupts. Combined with real-time, high-precision displacement monitoring by a high-speed counter 410 and a deceleration strategy with compensation mechanisms, this system can stably control labeling accuracy to ±0.5mm or even higher, while supporting higher production line speeds (e.g., 60 meters / minute), thereby greatly improving production efficiency. This design fundamentally solves the error accumulation problem caused by the scanning cycle in traditional control methods.

[0058] It should be noted that the method of Embodiment 1 corresponds to the system of Embodiment 2, and the system of Embodiment 2 can be implemented in conjunction with the method of Embodiment 1. The relevant technical details mentioned in the method of Embodiment 1 are still valid in the system of Embodiment 2, and will not be repeated here to avoid repetition.

[0059] It should be understood that although this disclosure uses a PLC as an example in the embodiments, this disclosure is not limited to the use of a PLC. Any controller with a high-speed counter 410 and interrupt handling capabilities, such as a system based on a microcontroller (MCU), industrial PC (IPC), or dedicated motion controller, can implement the control method described in this disclosure. In addition, in the various embodiments of this disclosure, the deceleration strategy can be adjusted according to actual needs. In addition to multi-stage segmented deceleration, it can also be continuous curve deceleration, as long as precise stopping can be ensured.

[0060] Figure 6 This is a schematic diagram of an electronic device according to an embodiment of this application. The specific embodiments of this application do not limit the specific implementation of the electronic device. See also... Figure 6 The electronic device 600 provided in this application embodiment includes: a processor 602, a communications interface 604, a memory 606, and a bus 608. Wherein:

[0061] The processor 602, communication interface 604, and memory 606 communicate with each other via bus 608.

[0062] Communication interface 604 is used for communication with other electronic devices or servers.

[0063] The processor 602 is used to execute program 610, specifically to perform the relevant steps in the above method embodiments.

[0064] Specifically, program 610 may include program code that includes computer operation instructions.

[0065] Processor 602 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application. The smart device includes one or more processors, which may be processors of the same type, such as one or more CPUs; or they may be processors of different types, such as one or more CPUs and one or more ASICs.

[0066] Memory 606 is used to store program 610. Memory 606 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0067] Specifically, program 610 can be used to cause processor 602 to execute the methods in any of the foregoing embodiments.

[0068] The specific implementation of each step in program 610 can be found in the corresponding steps and units described in the above method embodiments, and will not be repeated here. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the devices and modules described above can be referred to the corresponding process descriptions in the foregoing method embodiments, and will not be repeated here.

[0069] This application also provides a computer-readable storage medium storing instructions for causing a machine to perform the methods described herein. Specifically, a system or apparatus equipped with a storage medium storing software program code that implements the functions of any of the embodiments described above, and enabling the computer (or CPU or MPU) of the system or apparatus to read and execute the program code stored in the storage medium.

[0070] In this case, the program code read from the storage medium can itself implement the function of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute part of this application.

[0071] Storage media embodiments for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer via a communication network.

[0072] This application also provides a computer program product, including computer instructions that instruct a computing device to perform any corresponding operation in the above-described plurality of method embodiments.

[0073] It should be noted that, depending on the implementation needs, the various components / steps described in the embodiments of this application can be broken down into more components / steps, or two or more components / steps or parts of the operation of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of this application.

[0074] The methods described in the embodiments of this application can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code downloaded over a network that is originally stored in a remote recording medium or a non-transitory machine-readable medium and will be stored in a local recording medium. Thus, the methods described herein can be processed by software stored on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an ASIC or FPGA). It is understood that the computer, processor, microprocessor controller, or programmable hardware includes storage components (e.g., RAM, ROM, flash memory, etc.) capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods described herein. Furthermore, when a general-purpose computer accesses code used to implement the methods shown herein, the execution of the code transforms the general-purpose computer into a dedicated computer for executing the methods shown herein.

[0075] It should be noted that not all steps and modules in the above processes and system structure diagrams are mandatory; some steps or modules can be omitted as needed. The execution order of each step is not fixed and can be adjusted as required. The system structure described in the above embodiments can be a physical structure or a logical structure. That is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or they may be jointly implemented by certain components in multiple independent devices.

[0076] In this patent application, nouns and pronouns relating to persons are not limited to specific genders. The terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0077] In the above embodiments, the hardware modules can be implemented mechanically or electrically. For example, a hardware module may include permanent, dedicated circuitry or logic (such as a dedicated processor, FPGA, or ASIC) to perform the corresponding operations. The hardware module may also include programmable logic or circuitry (such as a general-purpose processor or other programmable processor), which can be temporarily configured by software to perform the corresponding operations. The specific implementation method (mechanical, dedicated, permanent circuitry, or temporarily configured circuitry) can be determined based on cost and time considerations.

[0078] The present application has been shown and described in detail above with reference to the accompanying drawings and preferred embodiments. However, the present application is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art will know that more embodiments of the present application can be obtained by combining the code review methods in the different embodiments above. These embodiments are also within the protection scope of the present application.

Claims

1. A labeling control method for a labeling machine, comprising: When the product to be labeled on the product conveyor belt is detected to have reached the first position, the first interrupt program is executed. The first interrupt program is used to control the label feeding mechanism to start and begin label feeding. When the label driven by the label feeding mechanism is detected to have reached the second position, the second interrupt program is executed. The second interrupt program is used to obtain the current count value of the high-speed counter, and based on the current count value and the preset deceleration strategy, calculate the N deceleration trigger count values ​​corresponding to the deceleration strategy, where N is an integer not less than 1. When the current count value of the high-speed counter reaches one of the N deceleration trigger count values, the third interrupt program is executed. The third interrupt program is used to adjust the speed of the label feeding mechanism to a set speed corresponding to the deceleration trigger count value, so as to achieve controlled deceleration and stop label feeding. The set speed corresponding to the last deceleration trigger count value reached is 0.

2. The method according to claim 1, characterized in that, The deceleration strategy adopts a step-by-step constant speed segmented deceleration strategy, which includes N constant speed stages.

3. The method according to claim 2, characterized in that, The second interrupt routine is also used to obtain the total positioning distance L during the deceleration process in the deceleration strategy; and to calculate the total number of target pulses corresponding to the total positioning distance L based on the total positioning distance L and the pulse equivalent of the system. The total number of target pulses is divided into N uniform speed stages, and N deceleration trigger count values ​​corresponding to the N uniform speed stages and N set speeds corresponding to the N deceleration trigger count values ​​are determined. The N set speeds decrease step by step and are all less than the initial speed of the deceleration process.

4. The method according to claim 2, characterized in that, The duration of each of the N uniform velocity phases is equal. The second interrupt program is also used to calculate N set speeds corresponding to the N deceleration trigger count values ​​based on the total positioning distance L of the deceleration process in the deceleration strategy, the number N of the constant speed stages, and the initial speed of the deceleration process; and to calculate the N deceleration trigger count values ​​based on the current count value obtained from the high-speed counter, the total positioning distance L of the deceleration process, the number N of the constant speed stages, the initial speed of the deceleration process, and the pulse equivalent of the system.

5. The method according to claim 1, characterized in that, The high-speed counter is used to count the number of pulses in the pulse signal output by the controller to the driver of the label feeding mechanism.

6. The method according to claim 1, characterized in that, The first interrupt routine is further used to call the pulse train output instruction to start the label feeding mechanism to feed the label.

7. The method according to claim 1, characterized in that, The first position is the front end of the product to be labeled, located upstream of the label outlet of the label feeding mechanism in the conveying direction of the product conveyor belt, and at a distance of a first preset value from the label outlet. The second position refers to the front end of the label to be labeled, which is located downstream of the label outlet in the label feeding direction of the label feeding mechanism.

8. The method according to any one of claims 1-7, characterized in that, The first interrupt procedure is used to control the start of the bid feeding mechanism and to begin feeding bids at a specified speed; The method further includes: The product conveyor belt is controlled to drive the products to be labeled on the conveyor to run at a constant speed at the specified speed.

9. A controller (400), comprising: The detection module (402) is used to detect whether the product to be labeled on the product conveyor belt has reached the first position, and to detect whether the label driven by the label feeding mechanism has reached the second position; The interrupt trigger module (404) is used to call the first interrupt program module (406) when the product to be labeled on the product conveyor belt is detected to reach the first position, to call the second interrupt program module (408) when the label driven by the label feeding mechanism is detected to reach the second position, and to call the third interrupt program module (412) when the current count value of the high speed counter (410) reaches one of the deceleration trigger count values ​​of N deceleration trigger count values ​​each time. The first interrupt program module (406) is used to control the start of the bid delivery mechanism and begin bid delivery; The second interrupt program module (408) is used to obtain the current count value of the high-speed counter (410), and calculate N deceleration trigger count values ​​corresponding to the deceleration strategy based on the current count value and the preset deceleration strategy, where N is an integer not less than 1; The third interrupt program module (412) is used to adjust the speed of the label feeding mechanism to a set speed corresponding to the deceleration trigger count value, so as to achieve controlled deceleration and stop label feeding. The set speed corresponding to the last reached deceleration trigger count value is 0.

10. The system according to claim 9, characterized in that, The deceleration strategy adopts a step-by-step constant speed segmented deceleration strategy, including the N constant speed stages.

11. The system according to claim 10, characterized in that, The second interrupt module (408) is further configured to: obtain the total positioning distance L during the deceleration process in the deceleration strategy; and calculate the total number of target pulses corresponding to the total positioning distance L based on the total positioning distance L and the pulse equivalent of the system. The total number of target pulses is divided into N uniform speed stages, and N deceleration trigger count values ​​corresponding to the N uniform speed stages and N set speeds corresponding to the N deceleration trigger count values ​​are determined. The N set speeds decrease step by step and are all less than the initial speed of the deceleration process.

12. The system according to claim 10, characterized in that, The duration of each of the N uniform velocity phases is equal. The second interrupt module (408) also calculates the set speed for each stage based on the total positioning distance of the deceleration process in the deceleration strategy, the number N of the constant speed stages, and the initial speed of the deceleration process. The second interrupt module (408) is also used to calculate the N deceleration trigger count values ​​based on the current count value obtained from the high-speed counter, the total positioning distance L of the deceleration process, the number N of the constant speed stage, the initial speed of the deceleration process and the pulse equivalent of the system.

13. The system according to claim 9, characterized in that, The controller (400) includes the high-speed counter (410), which is used to count the number of pulses of the pulse signal output by the controller to the driver of the label feeding mechanism.

14. A labeling control system (500) for a labeling machine, wherein, include: The controller (400) as described in any one of claims 9-13; A product detection sensor (502) is installed at the first position (A); A label detection sensor (504) is disposed at the second position (B); A first drive unit (506) for controlling the operation of the product conveyor belt (201); A second drive device (508) for controlling the delivery of the bid by the bid delivery mechanism (202).

15. A computer-readable storage medium storing computer instructions; characterized in that, The computer instructions can be executed by at least one processor to implement the labeling control method for a labeling machine as described in any one of claims 1-8.

16. A computer program product, comprising a computer program; characterized in that, The computer program can be executed by at least one processor to implement the labeling control method for a labeling machine as described in any one of claims 1-8.