Cigarette packet color film online detection method and system based on double-station edge intelligent vision

CN122517286APending Publication Date: 2026-08-07CHINA TOBACCO JIANGXI IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA TOBACCO JIANGXI IND CO LTD
Filing Date
2026-04-20
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0006]本发明的目的是为了解决现有技术中存在的烟包彩膜包装全过程缺乏及时且标准有效的质量监督以及问题,而提出的一种基于双工位边缘智能视觉的烟包彩膜在线检测方法,该方法能够实时监测彩膜在包装过程中的定位精度,实现对缺陷产品的自动识别与精准剔除

Benefits of technology

[0041] Compared with existing technologies, the beneficial effects of this invention are as follows: By deploying dual-station detection before and after heat sealing, and performing virtual displacement tracking on the cigarette pack, this invention achieves full-process quality monitoring of the cigarette pack. Combined with the real-time processing capabilities of edge computing, it enables full-process control and precise graded removal of defects in the cigarette pack's color film, improving detection quality and efficiency. It solves the problem that traditional open-loop compensation technology cannot monitor deformation during the heat sealing process, realizing full-process quality monitoring from packaging to heat sealing. Through a graded removal strategy of coarse at the beginning and fine at the end, serious defects are intercepted at an early stage. Compared with traditional solutions, it significantly reduces the waste of packaging materials (such as carton and inner lining paper), achieving significant economic benefits.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122517286A_ABST
    Figure CN122517286A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on double position edge intelligent vision's cigarette packet color film online detection method and system, belong to cigarette packet color film detection technical field;The method is realized real-time collection and defect determination of color film pattern by image sensor and image vision algorithm, completes the edge intelligent processing of collection, namely analysis, with PLC as core control, realizes precision phase synchronization by shaft encoder, and adopts virtual shift tracking algorithm to each cigarette packet for full-process identification and accurate tracking.Detection result is transmitted to PLC in real time by industrial network, and it is controlled according to quality mark to reject mechanism to carry out grading accurate rejection, and forms the closed-loop quality control system of front coarse and rear fine.The application effectively solves the technical problem that traditional open-loop compensation technology cannot monitor the deformation of wrapping and heat sealing process, realizes color film defect online real-time monitoring and automatic rejection, significantly improves the automation, intelligent control level of cigarette packaging quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cigarette pack color film detection technology, and in particular to an online detection method and system for cigarette pack color films based on dual-station edge intelligent vision. Background Technology

[0002] The cigarette pack color film positioning system is a core component of the tobacco industry to achieve intelligent manufacturing and precise quality control, and is crucial for ensuring product appearance consistency, anti-counterfeiting reliability, and a high-end brand image.

[0003] In actual production, the positioning accuracy of the colored film on cigarette packs is affected by multiple factors: slight errors exist in film cutting, the materials themselves have different thermal shrinkage characteristics, and vibrations and dynamic fluctuations during high-speed equipment operation make it common for the colored film pattern to deviate from the cigarette pack alignment. Although the servo compensation technology widely used in the industry can make open-loop adjustments to the initial position of the colored film during the feeding stage, it has significant limitations: it can only make one-time compensation at the starting point and cannot monitor and provide closed-loop feedback on dynamic changes such as material deformation and thermal shrinkage offset that occur in subsequent wrapping and heat sealing processes in real time.

[0004] The aforementioned technical deficiencies have led to four prominent problems: First, there is a lack of full-process quality monitoring, with defects remaining out of control at key process stages; second, there is a lack of final quality verification, and the open-loop control model makes it easy for defective products to flow into the next process or even the market; third, the detection methods are severely outdated, with the main reliance on manual sampling being inefficient, inconsistent in standards, and unable to match the high-speed production pace on site; and fourth, economic losses continue to occur, as defective cigarette packs are usually only manually detected after all packaging processes are completed, resulting in the complete scrapping of the entire set of packaging materials, including the color film, inner lining, and carton, and generating significant direct economic losses.

[0005] Therefore, there is an urgent need to develop a new detection system that can monitor the entire color film packaging process in real time online and has the ability to automatically identify and accurately reject defects, so as to break through the current technical bottleneck of quality control and achieve the comprehensive goal of intercepting defects at the source, significantly reducing costs, and improving quality stability. Summary of the Invention

[0006] The purpose of this invention is to address the lack of timely and standardized quality supervision throughout the entire process of cigarette packaging using colored film, as well as other existing technologies. The invention proposes an online inspection method for colored film on cigarette packaging based on dual-station edge intelligent vision. This method can monitor the positioning accuracy of the colored film during the packaging process in real time, enabling automatic identification and precise removal of defective products.

[0007] To achieve the above objectives, the present invention adopts the following technical solution:

[0008] This invention proposes an online detection method for cigarette pack color films based on dual-station edge intelligent vision, which includes the following steps:

[0009] The PLC reads the shaft encoder signal of the packaging machine spindle and establishes an internal clock reference that is synchronized with the mechanical movement of the packaging machine.

[0010] The PLC determines the spatiotemporal starting point of the cigarette pack entering the detection area based on the signals from the dual-pack detection sensor and the count value of the shaft encoder. It monitors the position of the cigarette pack based on the virtual shift tracking algorithm. When the cigarette pack reaches the photographing phase before heat sealing, the PLC triggers the first station image sensor to take a picture. It performs end-side analysis on the acquired image to determine whether there are defects in the color film wrapping, generates the first station detection result and feeds it back to the PLC, and performs the first-level rejection.

[0011] When the cigarette pack reaches the image phase after heat sealing, the PLC triggers the second station image sensor to take pictures of the two cigarette packs, detects defects after heat sealing, generates the second station detection results, and performs the second-level rejection.

[0012] The test results, rejection count, and monitoring status are displayed in real time on the HMI touchscreen.

[0013] More preferably, the virtual shift tracking algorithm is as follows:

[0014] A one-dimensional array of length N is used as a first-in-first-out queue. The elements in the array represent the state of the cigarette pack. The encoder angle changes periodically between 0° and 360°. Whenever the encoder angle reaches 0°, the PLC performs an array shift operation, moving all elements one position to the right and removing the last element.

[0015] The dual-packet detection sensor signal is considered valid when the encoder angle is within the range of 190°-220°. At this time, the PLC writes the newly detected cigarette pack information to the head of the array queue.

[0016] When a cigarette pack is present and reaches the image sensor's capture phase before heat sealing, the first-station image sensor is triggered to take a picture, perform image detection, and update the cigarette pack status of the array element with the detection result. If the array element is abnormal and contains a cigarette pack, the first-station CH rejection signal is output and marked as rejected. When a cigarette pack is present and heat sealing triggers the second-station image sensor to take a picture of the two cigarette packs, image detection is performed and the cigarette pack status of the array element is updated.

[0017] Monitor the state of the tail of the array. If the state of the cigarette pack in the array element is abnormal and there is a cigarette pack, output the second station CT rejection signal and mark it as rejected.

[0018] More preferably, the PLC triggers the image sensor at the first station to take a picture, and performs end-side analysis on the acquired image to determine whether there are defects in the color filter wrapping. The method is as follows:

[0019] The PLC determines the spatiotemporal starting point of the cigarette pack entering the detection zone based on the signals from the dual-pack detection sensor and the count value from the shaft encoder.

[0020] The PLC sends a hardware trigger signal to the first station image sensor based on the preset image phase of the first station image sensor.

[0021] After receiving the trigger signal, the image sensor at the first station acquires an image and uses the built-in algorithm to calculate the distance from the edge of the cigarette pack to the label and the drift of the color area inside the label to determine whether the color film has a defect.

[0022] If a defect is detected in the color filter, the image sensor at the first station will send the result back to the PLC in real time via the bus. The PLC will then mark the cigarette pack as unqualified at the first station.

[0023] More preferably, the calculation of the distance from the edge of the cigarette pack to the label and the drift of the color area inside the label to determine whether the color film has a defect uses the following two detection modes in a coordinated manner:

[0024] Edge distance detection is achieved by performing the Hough line search algorithm in the cigarette pack edge area and the label edge area respectively, locating the cigarette pack edge line and the label edge line, calculating the pixel distance between them, and comparing it with the upper and lower limit thresholds calibrated by the process. If it exceeds the range, it is judged as unqualified.

[0025] The drift detection of color areas within the label involves defining a detection box at the boundary between two different colors within the label, and calculating the mean and variance of the color pixels within the detection box as feature quantities. When a color area within the label drifts, the different color area will enter the detection box, causing the mean and variance to deviate from the range specified in the process calibration, which will then be judged as unqualified.

[0026] More preferably, the PLC triggers the second-station image sensor to take pictures of the double-packed cigarettes, detects defects after heat sealing, and generates the second-station detection result, as follows:

[0027] When the cigarette pack passes through the double pusher of the packaging machine, a position signal is generated. The position signal of the double pusher is combined with the signal of the shaft encoder to determine the position reference of the cigarette pack. The shaft encoder signal spans two cycles of 0°-720° to adapt to double pack detection.

[0028] When the second station's photo-taking phase arrives, the second station's image sensor is triggered to acquire the image after heat sealing. For the acquired image after heat sealing, the industrial intelligent machine of the second station's image sensor calls the image processing algorithm, segments the image grayscale threshold, counts the number of pixels within the image grayscale threshold range, and judges that those that are greater than or less than the normal color film cigarette pack pixel threshold range are unqualified, and outputs the second station's detection result.

[0029] The PLC updates the quality label in the cigarette pack tracking unit based on the inspection results of the second station, marking the cigarette pack as unqualified at the second station.

[0030] More preferably, in the first-level rejection, if the cigarette pack only has the first station's non-conforming mark, when it reaches the first station CH rejection point, the PLC controls the first station CH rejection machine to operate and perform single pack rejection;

[0031] In the second-level rejection, if the cigarette pack has a second-station defective mark, when the pack of cigarettes containing it reaches the second-station CT rejection point, the PLC controls the second-station CT rejection machine to operate and perform the rejection of the entire pack.

[0032] Another aspect of this invention proposes an online inspection system for cigarette pack color films based on dual-station edge intelligent vision, which executes an online inspection method for cigarette pack color films based on dual-station edge intelligent vision. The system includes:

[0033] The visual perception unit includes a first-station image sensor set before the color film is heat-sealed and a second-station image sensor set after heat-sealing.

[0034] The edge intelligent decision unit is an industrial intelligent machine with built-in machine vision detection algorithms and AI learning models. It is connected to both the first and second station image sensors for edge image processing.

[0035] The central control unit, including the PLC controller, establishes a communication connection with the vision sensing unit via a bus, reads the shaft encoder signal to establish an internal clock reference, and executes a virtual shift tracking algorithm.

[0036] The execution unit includes a first-station CH rejection machine and a second-station CT rejection mechanism, which receive instructions from the central control unit to execute defective cigarette pack rejection actions;

[0037] The human-machine interface unit, including an HMI touchscreen, is used for monitoring status display and parameter setting.

[0038] More preferably, the first station image sensor is located at the hexagonal forming wheel outlet of the packaging machine and is used to detect the packaging status of the colored film before heat sealing; the second station image sensor is located at the small package beauty container outlet and is used to detect the quality status of the colored film after heat sealing. Both the first station image sensor and the second station image sensor are equipped with an optical illumination system and a polarized light filter component.

[0039] More preferably, the PLC reads the shaft encoder signal of the packaging machine through the counting module, establishes a phase reference consistent with the first station image sensor and the second station image sensor, and triggers the shooting signals of the first station image sensor and the second station image sensor through the bus.

[0040] More preferably, it also includes a dynamic position tracking unit, which establishes an array in the PLC memory based on encoder pulse counts, executes a virtual shift tracking algorithm, and is used to establish an independent position identifier for each cigarette pack and monitor the trajectory in real time.

[0041] Compared with existing technologies, the beneficial effects of this invention are as follows: By deploying dual-station detection before and after heat sealing, and performing virtual displacement tracking on the cigarette pack, this invention achieves full-process quality monitoring of the cigarette pack. Combined with the real-time processing capabilities of edge computing, it enables full-process control and precise graded removal of defects in the cigarette pack's color film, improving detection quality and efficiency. It solves the problem that traditional open-loop compensation technology cannot monitor deformation during the heat sealing process, realizing full-process quality monitoring from packaging to heat sealing. Through a graded removal strategy of coarse at the beginning and fine at the end, serious defects are intercepted at an early stage. Compared with traditional solutions, it significantly reduces the waste of packaging materials (such as carton and inner lining paper), achieving significant economic benefits. Attached Figure Description

[0042] Figure 1 This is a flowchart of the online detection method for cigarette pack colored film based on dual-station edge intelligent vision proposed in this invention. Detailed Implementation

[0043] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0044] An online detection method for cigarette pack color films based on dual-station edge intelligent vision, such as... Figure 1 As shown, the online detection method includes the following steps:

[0045] Step S1: System power-on initialization. In this embodiment, the packaging machine model YB55 can be selected first. The PLC reads the shaft encoder signal of the packaging machine spindle, establishes an internal clock reference synchronized with the mechanical movement of the packaging machine, and initializes the detection parameters, including image processing parameters, detection sensitivity, rejection delay, and other parameters.

[0046] The PLC is set to synchronize with the packaging machine. The PLC reads the shaft encoder signal of the packaging machine spindle in real time, analyzes and establishes an internal clock reference that is completely synchronized with the mechanical movement of the packaging machine. This step is the basis for achieving the accuracy of all subsequent triggering and tracking actions.

[0047] Step S2, Color filter inspection before heat sealing: This step is for coarse inspection and early interception.

[0048] When a pack of cigarettes passes the double-pack detection sensor at the entrance of the packaging machine, the double-pack detection sensor signal and the current encoder count value are captured by the PLC as the spatiotemporal starting point for the cigarette pack to enter the detection area. The double-pack detection sensor is the original sensor on the packaging machine that detects the presence of double packs on the conveyor lug chain. Each lug on the packaging machine contains only one pack of cigarettes.

[0049] During the movement of cigarette packs on the production line, a virtual shift tracking algorithm based on encoder pulse counting and a virtual shift register is executed to track the position of the cigarette packs. The PLC initiates the virtual shift tracking algorithm, establishing an independent position marker for each cigarette pack entering the detection area and monitoring the cigarette pack's trajectory in real time. The virtual shift tracking algorithm is as follows:

[0050] A one-dimensional array of length N is used as the first-in-first-out queue. The elements in the array represent the status of the cigarette packs. The status of the cigarette packs includes the unique identifier ID of the cigarette pack, whether there are cigarette packs, whether the cigarette packs are normal, etc. N is the capacity of the cigarette packs from the detection point where the dual-pack detection sensor is located to the rejection point of the second station CT. The encoder angle changes periodically between 0° and 360°. Whenever the encoder angle reaches 0°, the PLC performs an array shift operation. The shift rule is: Array_new[1] is set to empty, Array_new[i] = Array_old[i-1] (i=2,3,…,N), that is, all elements are moved one position to the right, and the last element is removed.

[0051] The dual-packet detection sensor signal is only considered valid when the encoder angle is within the range of 190°-220°. At this time, the PLC writes the newly detected cigarette pack information into the array[1] (queue head). During the tracking process, the PLC performs detection and rejection in the detection area and rejection point, and monitors the status of array[5] in real time. When there is smoke and it reaches the photo-taking phase of the first station image sensor before heat sealing, the PLC sends a hardware trigger signal to the industrial intelligent machine connected to the first station image sensor through the PROFINET IO device according to the preset photo-taking phase of the first station image sensor, performs photo detection, and updates the detection result to the smoke pack status (Status) of the array element; monitors the status of array

[13] . If the smoke pack status is abnormal and there is smoke pack, the first station CH rejection signal is output and marked as rejected; monitors the status of array

[29] . When there is smoke pack and the second station image sensor is triggered to take a photo of the double smoke pack after heat sealing, the photo detection is performed and the smoke pack status (Status) of the array element is updated; finally, monitors the status of array[N] (tail). If its Status is abnormal and there is smoke pack, the second station CT rejection signal is output and marked as rejected. This virtual shift tracking algorithm uses the encoder angle as the synchronization reference and simulates the physical movement of cigarette packs on the conveyor chain through periodic array shifting, achieving precise tracking from the detection point to the rejection point.

[0052] The array is the specific data structure implementation of the virtual shift tracking algorithm. Each element in the array is the tracking unit corresponding to a single cigarette pack. When the encoder rotates to 0°, the PLC system performs an array shift operation once. The tracking units of all cigarette packs move one position backward as a whole. Newly entered cigarette packs are written into Array[1], and cigarette packs that reach the tail of the queue Array[N] leave the tracking area. The rejection is based on the rejection strategy rules of the virtual shift tracking algorithm. The execution conditions of this rule (whether the cigarette pack status is abnormal or whether it has reached the rejection position) are determined by reading the Status value of the corresponding index position in the array (such as Array

[13] corresponding to the first station CH rejection point). Therefore, the array is the implementation carrier of the algorithm, and the rejection strategy is the rule of the algorithm. The two are different levels of the same scheme.

[0053] Based on the virtual shift tracking algorithm, the PLC determines the spatiotemporal starting point of the cigarette pack entering the detection area according to the signals from the dual-pack detection sensor and the shaft encoder count value. When the cigarette pack reaches the image phase of the first station image sensor before heat sealing, the PLC, according to the preset image phase of the first station image sensor, sends a hardware trigger signal to the industrial intelligent machine connected to the first station image sensor via PROFINET IO communication. After receiving the trigger signal, the first station image sensor immediately acquires a high-definition image and transmits the acquired image to the corresponding industrial intelligent machine via cable. The acquired image is analyzed at the end to determine whether the color film wrapping is qualified. If the offset of the label exceeds the process requirements, it is determined whether there are defects such as positional offset, wrinkles, or missing parts in the color film wrapping. The processing method is to use the built-in algorithm of the industrial intelligent machine to calculate the straight-line distance from the edge of the cigarette pack to the edge of the label and the drift of the color area inside the label. The pattern on the cigarette pack is used as the positioning reference for the entire image. All detection frames are offset according to this reference.

[0054] Edge distance detection is achieved by performing the Hough line search algorithm in the cigarette pack edge area and the label edge area respectively, locating the cigarette pack edge line and the label edge line, calculating the pixel distance between them, and comparing it with the upper and lower limit thresholds specified by the process. If the distance exceeds the range, it is judged as unqualified.

[0055] The specific operation is as follows: First, high-definition images are acquired based on the image sensor at the first workstation, and preprocessed by grayscale conversion, Gaussian filtering, and edge enhancement. Then, two regions of interest (ROIs) 1 and 2 are defined in the image, where ROI1 covers the edge area of ​​the cigarette pack body and ROI2 covers the edge area of ​​the label. Next, Hough line detection is performed in the two ROIs 1 and ROI2 respectively, and the most significant cigarette pack edge line and label edge line are selected from the detected lines. The pixel distance D between these two lines is calculated. Finally, the pixel distance D is compared with the upper and lower limit thresholds determined by the process calibration. and Compare them.

[0056] The first straight line (the straight line of the cigarette pack edge) Choose any two points. and Use these two points to determine the general form of the equation of the line: ,in , , ;

[0057] Take the second straight line (the line along the edge of the label). any point on ) The formula for the pixel distance D between these two lines is as follows:

[0058]

[0059] The specific operation for calibrating the upper and lower limit thresholds of the process is as follows: select 30 to 50 standard cigarette packs that have been manually confirmed as qualified as samples, measure the pixel distance of each sample, and calculate the average pixel distance. and standard deviation The upper and lower thresholds of the process calibration are determined according to the following formula:

[0060]

[0061]

[0062] In the formula The correction factor is typically between 3 and 6; the upper and lower limit thresholds calibrated by the process are written into the PLC as the judgment criterion. During online detection, if the pixel distance D of the current cigarette pack is less than... or greater than If the label offset is found to be non-compliant, the cigarette pack status will be marked as abnormal; otherwise, it will be considered compliant.

[0063] Drift detection of color regions within the label involves defining a detection box at the boundary between two different colors within the label and calculating the average value of the color pixels within the detection box. and variance As a characteristic quantity:

[0064]

[0065]

[0066] in, Indicates the total number of pixels. Indicates the first Each pixel value;

[0067] When the color area inside the label drifts, the discolored area will enter the detection frame, causing the mean and variance to deviate from the normal range specified in the process calibration, and thus it is judged as unqualified.

[0068] By working together, the two detection modes described above can be used to achieve comprehensive detection of label position deviation and color printing deviation in cigarette packs.

[0069] The detection results from the first station are fed back to the PLC in real time via the bus (PROFINET bus communication protocol). Based on the detection results from the first station, the PLC marks the cigarette pack as qualified or unqualified and includes it in the virtual shift register for tracking.

[0070] If a defect is detected in the color film of the cigarette pack, the industrial intelligent machine connected to the image sensor at the first station will send the determination result back to the PLC in real time via the bus. The PLC will then mark the cigarette pack as unqualified at the first station in the cigarette pack tracking unit.

[0071] Intelligent Decision-Making and Precise Rejection: The PLC uses a virtual shift tracking algorithm based on encoder pulse counting to track the position of the cigarette packs in real time. According to the quality label of the cigarette pack, the PLC controls the actuator at the corresponding rejection station to perform graded rejection. The rejection strategy is based on the following rules:

[0072] Rule A: If a cigarette pack only has a defect mark at the first station, then when it reaches the CH rejection point at the first station, it will be rejected as a single pack (only one color film will be wasted).

[0073] Rule B: If a cigarette pack passes through the first station but fails to pass through the second station, it shall be rejected when it reaches the CT rejection point of the second station (to avoid waste of subsequent packaging materials).

[0074] Rule C, in addition to the two rules mentioned above, allows setting continuous defect alarm thresholds and shutdown thresholds. For example, five consecutive defects can trigger an audible and visual alarm, and 30 consecutive defects can trigger an automatic shutdown. Continuous defect alarms may indicate mechanical failure. Rule C enables proactive quality intervention to prevent a large number of defective products.

[0075] Based on the above rejection strategy rules and virtual shift tracking algorithm, the trajectory of the cigarette pack marked as unqualified at the first station is predicted in real time. The PLC sends a rejection control signal to the rejection mechanism at the first station CH, driving the rejection mechanism at the first station CH to complete the action, ensuring that the defective cigarette pack is accurately ejected during high-speed operation.

[0076] This step performs the first-level elimination decision:

[0077] If a cigarette pack carries a defective label from the first station, when it reaches the CH rejection point at the first station, the PLC controls the CH rejection mechanism at the first station to activate and reject the entire pack. Specifically:

[0078] Shift tracking: The PLC's virtual shift tracking algorithm runs continuously. When a cigarette pack marked as unqualified at the first station is about to reach the first station CH rejection station of the packaging machine, the first-level rejection decision logic is activated.

[0079] At the first station (CH rejection), the PLC outputs a control pulse to the first station CH rejection valve (such as a high-speed solenoid valve) at a precisely calculated moment, driving the first station rejection actuator to eject the defective cigarette pack from the production line. This action only results in the loss of the colored film on the cigarette pack, achieving early interception and economical rejection. Cigarette packs that pass inspection are not rejected at the first station (CH rejection) and continue to the next stage to complete the heat-sealing process.

[0080] The key to achieving accurate timing calculation at the first station CH rejection point lies in hard synchronizing the rejection action with the phase angle of the shaft encoder.

[0081] Specifically, the PLC does not rely on time-based delays or speed estimations, but directly reads the real-time phase signal from the shaft encoder of the packaging machine's main shaft. The PLC system, pre-calibrated on-site, determines the optimal operating phase window for the first station CH rejection actuator valve to be 90° to 220°. This angle range corresponds to the mechanical position where the rejection actuator valve is precisely aligned with the defective cigarette pack, and the ejection action effectively hits the target. During cigarette pack tracking, the status of each cigarette pack in the virtual displacement array is monitored in real time. When a cigarette pack's status is marked as abnormal and its position reaches the first station CH rejection point (i.e., the index position corresponding to the first station CH rejection point in the array), the PLC does not immediately output an output, but continuously waits for the shaft encoder phase to fall within the 90°-220° range. Once the phase condition is met, the PLC immediately outputs a precisely wide control pulse to the first station CH rejection actuator, driving the actuator to eject the defective cigarette pack. This method uses the encoder phase as the time reference for the action, eliminating the uncertainty caused by transmission speed fluctuations and PLC scanning cycle jitter, ensuring that the rejection action is strictly synchronized with the mechanical position of the packaging machine spindle, thereby achieving early and accurate interception and economical rejection.

[0082] Step S3, Color Film Inspection After Heat Sealing: When the cigarette pack reaches the image capture phase after heat sealing, the PLC triggers the image sensor at the second station to take a picture. The acquired image is analyzed at the end to detect defects after heat sealing. Defects after heat sealing include the integrity of the heat seal and whether there are defects such as color film burns or bubbles. The second station inspection result is generated. This step pays special attention to defects that may be missed by the first station and introduced by the thermal process. Finally, the second station inspection result is updated to the quality label of the cigarette pack to form a complete quality file.

[0083] The specific method for color filter testing after heat sealing is as follows:

[0084] When the cigarette packs enter the heat sealing process, two packs of cigarettes are stacked together. There are two packs of cigarettes at one station, so the shaft encoder needs to make two revolutions to move one station. Before heat sealing, there is a single pack, and the shaft encoder moves one station with one revolution.

[0085] When the cigarette pack passes through the double pusher of the packaging machine, a position signal is generated. The position signal of the double pusher is combined with the signal of the shaft encoder to determine the position reference of the cigarette pack. The shaft encoder signal spans two cycles from 0° to 720° to adapt to the double pack detection.

[0086] The dual-push signal, combined with encoder positioning, generates a position signal when a cigarette pack passes the dual-push mechanism of the packaging machine. A dual-pack sensor is installed at the forefront of the push mechanism's movement. When the push mechanism reaches its frontmost position, the sensor detects the push mechanism and sends a set signal to the PLC. The PLC combines this set signal with the current encoder value. Based on the phase of the encoder (0°-360°), meaning the phase of one pack of cigarettes travels within this range, and considering that the second-station image sensor captures images of two packs, requiring the encoder to complete two cycles (0°-360° to equalize 0°-720°), the dual-push signal informs the PLC that the second cycle has arrived and the encoder signal needs to be increased by 360°. When the second-station image sensor captures the image (between 360° and 720°), it triggers the second-station image sensor to capture an image, accurately confirming that the cigarette pack has entered the second-station detection area and updating its tracking baseline.

[0087] Continue shift tracking: The PLC continues to use the same virtual shift tracking algorithm as in step S2 to maintain accurate prediction of the position of the cigarette pack.

[0088] Determining the arrival of the image capture phase: Similar to the detection and judgment at the first station, the PLC determines whether the cigarette pack has reached the preset image capture phase of the second station image sensor. When the second station image capture phase is reached, the PLC triggers the industrial intelligent machine connected to the second station image sensor, and the PLC triggers the second station image sensor to collect the image after heat sealing.

[0089] This inspection focuses on defects caused by the heat-sealing process, such as incomplete heat-sealed edges, burns, bubbles, and secondary misalignment of patterns due to heat shrinkage. The industrial intelligent machine corresponding to the image sensor at the second station calls the image processing algorithm, segments the image by grayscale threshold, counts the number of pixels within the grayscale threshold range, and determines that the number of pixels is unqualified if it is greater than or less than the normal color film cigarette pack pixel threshold range, and outputs the inspection results of the second station.

[0090] For images acquired after heat sealing, a threshold segmentation process is first performed, setting a lower grayscale limit T_low and an upper grayscale limit T_high. Pixels falling within this range are marked as valid pixels, and their total count P_count is calculated. Then, the count is compared with the normal range P_min to P_max defined by the process: when P_count is less than P_min, it indicates defects such as burns, bubbles, or incomplete heat-sealing edges causing abnormal grayscale; when P_count is greater than P_max, it indicates defects such as secondary pattern misalignment caused by heat shrinkage, causing abnormal grayscale areas to enter the detection range. Both cases are deemed unqualified, and the corresponding cigarette pack is marked as abnormal in the tracking array, awaiting processing at a subsequent rejection station. This algorithm is simple to calculate, highly real-time, and can effectively detect various color filter defects caused by the heat sealing process.

[0091] It can also utilize the AI ​​algorithms built into the industrial smart machine to learn about defects such as incomplete heat sealing, burns, and bubbles.

[0092] The PLC updates the quality label in the cigarette pack tracking unit based on the inspection results of the second station. If the inspection results of the second station are determined to be unqualified, the cigarette pack will be marked as unqualified by the second station.

[0093] This step executes the second-level elimination strategy rules:

[0094] For a carton of cigarettes (usually composed of several packs) about to reach the second CT rejection point downstream of the production line, based on the quality markings of all packs within that carton as described above, if any pack carries a second-station non-conforming mark, the PLC controls the second-station CT rejection mechanism to execute the entire carton rejection when it reaches the CT rejection point. This removes all products containing defective packs, ensuring that non-conforming products do not enter the market. This step is the final quality control step.

[0095] In step S4, for cigarette packs that successfully pass the dual-station inspection at the first and second workstations and are not removed by any rejection point, the PLC determines them to be qualified products and continues to track them until they leave the inspection control area. Subsequently, these cigarette packs will enter the subsequent processes normally.

[0096] Finally, the test results, rejection quantity, and monitoring status are displayed in real time on the HMI touch screen. The HMI touch screen supports functions such as test parameter adjustment, data recording, alarm query, and production statistics.

[0097] The online detection method for cigarette pack color films based on dual-station edge intelligent vision proposed in this embodiment can perform seamless tracking throughout the entire process. Each cigarette pack is continuously tracked, achieving a one-to-one correspondence between detection and execution, avoiding false rejection or missed rejection. An array (stack) is established for cigarette packs entering the detection area. The array length is the number of cigarette packs between the detection area where the dual-pack detection sensor is located and the CT rejection point of the second station. The array content includes information such as the unique identifier ID of the cigarette pack, the presence / absence status, and the normal / abnormal / rejected status. The array is shifted once every time a cigarette pack moves to a station on the production line, following a first-in, first-out strategy. When a defective cigarette pack is detected at the first station and the second station, the array changes the cigarette pack status. If the defective cigarette pack at the first station is rejected at the CH rejection point of the first station, the cigarette pack status in the array will change from defective to qualified. If the CH rejection point of the first station is not rejected, the cigarette pack status will not be changed. Through the detection at the first and second workstations, a grading strategy is completed, in which single packages are rejected at the CH rejection point at the first workstation and the entire pack is rejected at the CT rejection point at the second workstation. This maximizes the saving of packaging materials while ensuring quality, demonstrating the economical design of this invention.

[0098] In terms of overall quality control strategy, a complete production closed loop from inspection to identification, tracking, rejection and verification has been completed, which has completely changed the passive situation of the traditional open-loop compensation model.

[0099] This embodiment also proposes an online inspection system for cigarette pack color films based on dual-station edge intelligent vision, which performs the steps of the above-described online inspection method for cigarette pack color films based on dual-station edge intelligent vision. The online inspection system includes:

[0100] The visual perception unit includes a first-station image sensor set before the color film is heat-sealed and a second-station image sensor set after heat-sealing.

[0101] The edge intelligent decision unit is an industrial intelligent machine with built-in machine vision detection algorithms and AI learning models. It is connected one-to-one with the first and second station image sensors and is used for edge image processing to perform image processing and judgment.

[0102] The central control unit, including the PLC, establishes a communication connection with the vision sensing unit via a bus (PROFINET industrial network bus), reads the shaft encoder signal to establish an internal clock reference, and executes a virtual shift tracking algorithm;

[0103] The execution unit, including the first station CH rejection mechanism and the second station CT rejection mechanism, executes the rejection action of defective cigarette packs after receiving instructions from the central control unit (PLC).

[0104] The human-machine interface unit, including an HMI touchscreen, is used for monitoring status display and parameter setting.

[0105] Specifically, the first station image sensor is set at the hexagonal forming wheel outlet of the packaging machine to detect the packaging status of the colored film before heat sealing; the second station image sensor is set at the small package beauty container outlet to detect the quality status of the colored film after heat sealing. Both the first station image sensor and the second station image sensor are equipped with an optical illumination system and a polarized light filter component.

[0106] The industrial intelligent machine has a built-in AI learning model that uses an incremental learning algorithm combined with a sliding window mechanism to dynamically update the model weight parameters based on newly collected production samples, and has the ability to identify label offset patterns.

[0107] The PLC controller can preferably be a Siemens S7-1200 series. It reads the shaft encoder signal through the counting module, establishes a phase reference consistent with the first and second station image sensors, and triggers the first and second station image sensors to capture images via the bus.

[0108] In addition to the aforementioned unit modules, the online detection system also includes a dynamic position tracking unit. The dynamic position tracking unit establishes an array in the PLC memory based on encoder pulse counts and executes a virtual shift tracking algorithm to establish an independent position marker for each cigarette pack and monitor its trajectory in real time.

[0109] It should be noted that any parts not covered in this invention are the same as or can be implemented using existing technology. The above description is merely a preferred embodiment of this invention, but the scope of protection of this invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in this invention, based on the technical solution and inventive concept of this invention, should be covered within the scope of protection of this invention.

Claims

1. An online detection method for colored films on cigarette packs based on dual-station edge intelligent vision, characterized in that, Includes the following steps: The PLC reads the shaft encoder signal of the packaging machine spindle and establishes an internal clock reference that is synchronized with the mechanical movement of the packaging machine. The PLC determines the spatiotemporal starting point of the cigarette pack entering the detection area based on the signals from the dual-pack detection sensor and the count value of the shaft encoder. It monitors the position of the cigarette pack based on the virtual shift tracking algorithm. When the cigarette pack reaches the photographing phase before heat sealing, the PLC triggers the first station image sensor to take a picture. It performs end-side analysis on the acquired image to determine whether there are defects in the color film wrapping, generates the first station detection result and feeds it back to the PLC, and performs the first-level rejection. When the cigarette pack reaches the image phase after heat sealing, the PLC triggers the second station image sensor to take pictures of the two cigarette packs, detects defects after heat sealing, generates the second station detection results, and performs the second-level rejection. The test results, rejection count, and monitoring status are displayed in real time on the HMI touchscreen.

2. The online detection method for cigarette pack colored films based on dual-station edge intelligent vision according to claim 1, characterized in that, The virtual shift tracking algorithm is as follows: A one-dimensional array of length N is used as a first-in-first-out queue. The elements in the array represent the state of the cigarette pack. The encoder angle changes periodically between 0° and 360°. Whenever the encoder angle reaches 0°, the PLC performs an array shift operation, moving all elements one position to the right and removing the last element. The dual-packet detection sensor signal is considered valid when the encoder angle is within the range of 190°-220°. At this time, the PLC writes the newly detected cigarette pack information to the head of the array queue. When there is a cigarette pack and it reaches the image sensor phase of the first station before heat sealing, the first station image sensor is triggered to take a picture, perform picture detection, and update the cigarette pack status of the array element with the detection result. If the array element is abnormal and there is a cigarette pack, the first station CH rejection signal is output and marked as rejected. When the second station image sensor is triggered to take a picture of the two packs of cigarettes after the cigarette packs are heat-sealed, the picture detection is performed and the cigarette pack status of the array elements is updated. Monitor the state of the tail of the array. If the state of the cigarette pack in the array element is abnormal and there is a cigarette pack, output the second station CT rejection signal and mark it as rejected.

3. The online detection method for cigarette pack colored films based on dual-station edge intelligent vision according to claim 1, characterized in that, The PLC triggers the image sensor at the first station to take a picture, and performs end-side analysis on the acquired image to determine whether there are defects in the color filter wrapping. The method is as follows: The PLC determines the spatiotemporal starting point of the cigarette pack entering the detection zone based on the signals from the dual-pack detection sensor and the count value from the shaft encoder. The PLC sends a hardware trigger signal to the first station image sensor based on the preset image phase of the first station image sensor. After receiving the trigger signal, the image sensor at the first station acquires an image and uses the built-in algorithm to calculate the distance from the edge of the cigarette pack to the label and the drift of the color area inside the label to determine whether the color film has a defect. If a defect is detected in the color filter, the image sensor at the first station will send the result back to the PLC in real time via the bus. The PLC will then mark the cigarette pack as unqualified at the first station.

4. The online detection method for cigarette pack colored film based on dual-station edge intelligent vision according to claim 3, characterized in that, The distance from the edge of the cigarette pack to the label and the drift of the color area inside the label are calculated to determine whether the color film has a defect. The following two detection modes are used in conjunction for judgment: Edge distance detection is achieved by performing the Hough line search algorithm in the cigarette pack edge area and the label edge area respectively, locating the cigarette pack edge line and the label edge line, calculating the pixel distance between them, and comparing it with the upper and lower limit thresholds calibrated by the process. If it exceeds the range, it is judged as unqualified. The drift detection of the color region within the label involves defining a detection box at the boundary between two different colors within the label and calculating the mean and variance of the color pixels within the detection box as feature quantities. When the color area inside the label drifts, the discolored area will enter the detection frame, causing the mean and variance to deviate from the range specified in the process calibration, and thus it is judged as unqualified.

5. The online detection method for cigarette pack colored films based on dual-station edge intelligent vision according to claim 1, characterized in that, The PLC triggers the second-station image sensor to take pictures of the double-packed cigarettes, detects defects after heat sealing, and generates the second-station detection results. The process is as follows: When the cigarette pack passes through the double pusher of the packaging machine, a position signal is generated. The position signal of the double pusher is combined with the signal of the shaft encoder to determine the position reference of the cigarette pack. The shaft encoder signal spans two cycles of 0°-720° to adapt to double pack detection. When the second station's photo-taking phase arrives, the second station's image sensor is triggered to acquire the image after heat sealing. For the acquired image after heat sealing, the industrial intelligent machine of the second station's image sensor calls the image processing algorithm, segments the image grayscale threshold, counts the number of pixels within the image grayscale threshold range, and judges that those that are greater than or less than the normal color film cigarette pack pixel threshold range are unqualified, and outputs the second station's detection result. The PLC updates the quality label in the cigarette pack tracking unit based on the inspection results of the second station, marking the cigarette pack as unqualified at the second station.

6. The online detection method for cigarette pack colored films based on dual-station edge intelligent vision according to claim 1, characterized in that, In the first-level rejection, if the cigarette pack only has the first station's non-conforming mark, when it reaches the first station CH rejection point, the PLC controls the first station CH rejection machine to operate and perform single pack rejection. In the second-level rejection, if the cigarette pack has a second-station defective mark, when the pack of cigarettes containing it reaches the second-station CT rejection point, the PLC controls the second-station CT rejection machine to operate and perform the rejection of the entire pack.

7. An online inspection system for cigarette pack color films based on dual-station edge intelligent vision, comprising performing the online inspection method for cigarette pack color films based on dual-station edge intelligent vision as described in any one of claims 1-6, characterized in that, include: The visual perception unit includes a first-station image sensor set before the color film is heat-sealed and a second-station image sensor set after heat-sealing. The edge intelligent decision unit is an industrial intelligent machine with built-in machine vision detection algorithms and AI learning models. It is connected to both the first and second station image sensors for edge image processing. The central control unit, including the PLC controller, establishes a communication connection with the vision sensing unit via a bus, reads the shaft encoder signal to establish an internal clock reference, and executes a virtual shift tracking algorithm. The execution unit includes a first-station CH rejection machine and a second-station CT rejection mechanism, which receive instructions from the central control unit to execute defective cigarette pack rejection actions; The human-machine interface unit, including an HMI touchscreen, is used for monitoring status display and parameter setting.

8. The online inspection system for cigarette pack color film based on dual-station edge intelligent vision according to claim 7, characterized in that, The first station image sensor is installed at the hexagonal forming wheel outlet of the packaging machine to detect the packaging status of the colored film before heat sealing; the second station image sensor is installed at the small package beauty container outlet to detect the quality status of the colored film after heat sealing. Both the first station image sensor and the second station image sensor are equipped with an optical illumination system and a polarized light filter component.

9. The online inspection system for cigarette pack color film based on dual-station edge intelligent vision according to claim 7, characterized in that, The PLC reads the shaft encoder signal of the packaging machine through the counting module, establishes a phase reference consistent with the first and second station image sensors, and triggers the first and second station image sensors to take pictures via the bus.

10. The online inspection system for cigarette pack color film based on dual-station edge intelligent vision according to claim 7, characterized in that, It also includes a dynamic position tracking unit, which establishes an array in the PLC memory based on encoder pulse counts and executes a virtual shift tracking algorithm to establish an independent position identifier for each cigarette pack and monitor the trajectory in real time.