Production line laser marking cooperative control method, device and equipment and storage medium
By introducing synchronous pulse signals and dynamic path correction technology into the laser marking system, the problems of marking accuracy and stability caused by workpiece position fluctuations have been solved, achieving efficient laser marking control and ensuring continuous operation of the production line and product quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-04
- Publication Date
- 2026-03-27
AI Technical Summary
Existing laser marking control methods struggle to achieve precise workpiece positioning under high-speed continuous production conditions, resulting in insufficient marking accuracy and stability, which in turn affects production efficiency.
By establishing a collaborative mechanism between production line motion and marking control through synchronous pulse signals, the real-time position offset of the workpiece is obtained, the marking path is dynamically corrected, and the precise matching and synchronization of marking timing and workpiece position is achieved by using pulse counting and threshold comparison.
It significantly improves the accuracy and stability of the marking position under motion, ensures the consistency of marking quality, and enhances overall production efficiency and the continuous operation capability of the production line.
Smart Images

Figure CN121733019A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of laser marking, and in particular to a collaborative control method, device, equipment and storage medium for laser marking on a production line. Background Technology
[0002] Industrial laser marking technology, as a key component of modern intelligent manufacturing, plays a vital role in areas such as parts traceability and product identification. As industrial production continues to evolve towards higher precision and efficiency, achieving high-quality laser marking on workpieces in motion, while ensuring the accuracy and consistency of the marking position, has become a crucial issue for improving the automation level of production lines. Existing marking control methods typically employ independent trigger control strategies, lacking close coordination between the marking system and the production line movement, resulting in poor adaptability to workpiece position fluctuations. This relatively isolated control approach struggles to meet the requirements for marking accuracy and stability under high-speed continuous production conditions, impacting overall production efficiency. Summary of the Invention
[0003] The main objective of this invention is to provide a collaborative control method, device, equipment, and storage medium for laser marking on a production line. By establishing a collaborative mechanism between production line motion and marking control through synchronous pulse signals, the invention achieves precise matching between marking timing and workpiece position, thereby significantly improving the accuracy of marking position during motion.
[0004] To achieve the above objectives, the present invention provides a collaborative control method for laser marking on a production line, comprising: Acquire a synchronization pulse signal that is synchronized with the production line displacement, trigger an image device to acquire a motion image of the target workpiece through the synchronization pulse signal, and identify and calculate the position offset between the real-time position of the workpiece and the preset marking reference point in the motion image; Based on the position offset, all coordinate points in the pre-stored theoretical marking path are synchronously translated and transformed to generate a corrected marking path; Based on the synchronous pulse signal, pulse counting is performed, and the obtained real-time pulse count value is compared with the preset marking trigger threshold. When the real-time pulse count value reaches the marking trigger threshold, the laser marking device is driven to perform marking operation on the target workpiece according to the corrected marking path to obtain marking information. Based on the marking information, the quality of the marked target workpiece is judged. If it is judged to be an unqualified workpiece, the unqualified workpiece is removed.
[0005] Preferably, the step of acquiring a synchronization pulse signal synchronized with the production line displacement, controlling the imaging device to acquire motion images of the target workpiece through the synchronization pulse signal, and identifying and calculating the positional offset between the real-time position of the workpiece and the preset marking reference point in the motion image includes: The synchronous pulse signal output by the production line encoder deployed on the production line is image counted to obtain an image count value. When the image count value reaches a preset image acquisition trigger value, an acquisition command is sent to the image device to acquire the motion image. Extract the contour feature point set of the target workpiece from the motion image, and calculate the actual center coordinates of the contour feature point set in the preset image coordinate system; Calculate the pixel difference between the actual center coordinates and the marking reference point in the horizontal and vertical coordinate directions of the image; The pixel difference is converted into the position offset based on the calibration parameters of the image device.
[0006] Preferably, the step of synchronously translating all coordinate points in the pre-stored theoretical marking path according to the position offset to generate a corrected marking path includes: Extract the horizontal and vertical offset components from the position offset; Iterate through each coordinate point stored in the theoretical marking path and read the original x-coordinate value and original y-coordinate value of each coordinate point; Each of the original horizontal coordinate values is algebraically added to the horizontal offset component to obtain the corrected horizontal coordinate value; The original ordinate value is algebraically added to the vertical offset component to obtain the corrected ordinate value; The corrected abscissa and corrected ordinate values corresponding to each coordinate point are combined to form a new coordinate point, which is then sorted and stored according to the order of the coordinate points in the theoretical marking path to form the corrected marking path.
[0007] Preferably, the step of counting pulses based on the synchronous pulse signal and comparing the obtained real-time pulse count value with a preset marking trigger threshold, wherein when the real-time pulse count value reaches the marking trigger threshold, the laser marking device is driven to perform a marking operation on the target workpiece according to the corrected marking path to obtain marking information, including: The synchronization pulse signal is continuously monitored. When the rising edge of the synchronization pulse signal is detected, the pulse value of the synchronization pulse signal is accumulated to generate the real-time pulse count value. The real-time pulse count value is compared with the marking trigger threshold. When the real-time pulse count value is less than the marking trigger threshold, the next synchronization pulse signal is recalculated. When the real-time pulse count value is equal to the marking trigger threshold, the laser marking equipment is controlled to scan and mark the target workpiece according to the corrected marking path, and a marking completion signal is generated. Based on the marking completion signal, the trajectory coordinates, marking timestamps, and workpiece status parameters of the target workpiece during the marking process are recorded and integrated to obtain the marking information.
[0008] Preferably, the step of controlling the laser marking device to scan and mark the target workpiece according to the corrected marking path when the real-time pulse count value is equal to the marking trigger threshold, and generating a marking completion signal, includes: Extract the corrected coordinate point sequence and motion parameters from the corrected marking path; Traverse each of the corrected coordinate points in the sequence of corrected coordinate points and convert the current corrected coordinate point into a motion control command for the laser marking device; The laser emission time interval between adjacent corrected coordinate points is calculated based on the velocity parameter in the motion parameters. When controlling the laser marking equipment to scan and mark the target workpiece, the laser marking equipment is controlled to move to the target position of the corrected coordinate point according to the motion control command, and the laser emission time of the laser marking equipment on the target workpiece is controlled according to the laser emission time interval. After the marking operation of the last corrected coordinate point in the corrected coordinate point sequence is completed, a marking completion signal is generated and the real-time pulse count value is reset.
[0009] Preferably, the step of controlling the laser marking device to move to the target position of the corrected coordinate point according to the motion control command, and controlling the laser marking time of the laser marking device on the target workpiece according to the laser emission time interval, includes: The motion control command is parsed into vertical axis displacement components and horizontal axis displacement components; The longitudinal axis displacement component is input to the longitudinal axis driver of the laser marking equipment, and the transverse axis displacement component is input to the transverse axis driver. Read the position feedback signals of the vertical axis driver and the horizontal axis driver, calculate the difference between the position feedback signal and the correction coordinate point, and obtain the position deviation value. Determine whether the position deviation value is less than a preset position tolerance threshold. If it is less, send an output light signal to the laser controller of the laser marking equipment. During the valid period of the light emission signal, the laser marking equipment is controlled to perform laser marking and time interval timing on the target workpiece. When the time interval timing reaches the laser light emission time interval, a shutdown signal is sent to the laser controller to stop the laser marking.
[0010] Preferably, the step of judging the quality of the marked target workpiece based on the marking information, and removing the unqualified workpiece if it is judged to be a defective workpiece, includes: Extract the marking trajectory coordinate set from the marking information, and calculate the point-by-point coordinate deviation between the marking trajectory coordinate set and the pre-stored standard marking trajectory template to obtain the trajectory deviation of each point. Each trajectory deviation is compared with a preset allowable deviation threshold, and the number of out-of-limit coordinate points exceeding the allowable deviation threshold is counted. If the number of out-of-limit coordinate points exceeds a preset fault tolerance threshold, the target workpiece is marked as a defective workpiece, and a rejection instruction for the defective workpiece is generated based on the marking information and the synchronization pulse signal. The rejection instruction is sent to the corresponding rejection execution device, which then drives the rejection execution device to remove the defective workpiece from the production line.
[0011] The present invention also provides a production line laser marking collaborative control device, applied to any one of the above-described production line laser marking collaborative control methods, comprising: The acquisition module is used to acquire a synchronization pulse signal that is synchronized with the production line displacement, and to trigger an image device to acquire a motion image of the target workpiece through the synchronization pulse signal, and to identify and calculate the position offset between the real-time position of the workpiece and the preset marking reference point in the motion image. The analysis module is used to synchronously translate all coordinate points in the pre-stored theoretical marking path according to the position offset to generate a corrected marking path. The association module is used to count pulses based on the synchronization pulse signal and compare the obtained real-time pulse count value with a preset marking trigger threshold. When the real-time pulse count value reaches the marking trigger threshold, the laser marking device is driven to perform marking operation on the target workpiece according to the corrected marking path to obtain marking information. The processing module is used to perform quality judgment on the target workpiece after marking based on the marking information. If the workpiece is judged to be unqualified, the unqualified workpiece is removed.
[0012] This invention also provides a collaborative control device for laser marking on a production line, comprising: Memory, used to store programs; A processor is used to execute the program to implement each step of the collaborative control method for laser marking on a production line as described in any of the above-mentioned embodiments.
[0013] The present invention also provides a storage medium storing computer instructions for causing a computer to perform any of the methods described above.
[0014] The present invention provides a collaborative control method, device, equipment, and storage medium for laser marking on a production line, which has the following beneficial effects: By establishing a coordinated mechanism for production line motion and marking control through synchronous pulse signals, precise matching of marking timing and workpiece position is achieved, significantly improving the accuracy of marking position during movement. Based on real-time visual positioning and dynamic correction of the marking path, marking deviations caused by workpiece position fluctuations are effectively overcome, enhancing the stability of the marking process. Online judgment and closed-loop control of marking quality enable automatic identification and rejection of defective workpieces, ensuring the consistency of final product quality. The use of a coordinated timing method combining pulse counting and threshold comparison ensures the synchronization of actions of multiple execution units during continuous production line operation, improving overall production efficiency. Through the synergistic effect of these technologies, the continuous operation rhythm of the production line is maintained while ensuring marking accuracy, achieving a balance between precision and efficiency. Attached Figure Description
[0015] Figure 1 This is a flowchart of a collaborative control method for laser marking on a production line provided by the present invention; Figure 2 This is a structural diagram of a production line laser marking collaborative control device provided for the present invention; Figure 3 This is a structural diagram of a production line laser marking collaborative control device provided for this invention.
[0016] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0018] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments.
[0019] Reference Figure 1 As shown, the present invention also provides a collaborative control method for laser marking on a production line, comprising: Step S1: Obtain a synchronization pulse signal that is synchronized with the production line displacement. Trigger the image device to acquire the motion image of the target workpiece through the synchronization pulse signal, and identify and calculate the position offset between the real-time position of the workpiece and the preset marking reference point in the motion image. Step S2: Perform synchronous translation transformation on all coordinate points in the pre-stored theoretical marking path according to the position offset to generate the corrected marking path; Step S3: Count pulses based on the synchronous pulse signal and compare the obtained real-time pulse count value with the preset marking trigger threshold. When the real-time pulse count value reaches the marking trigger threshold, drive the laser marking equipment to perform marking operation on the target workpiece according to the corrected marking path to obtain marking information. Step S4: Based on the marking information, perform quality judgment on the target workpiece after marking. If the workpiece is judged to be unqualified, remove the unqualified workpiece.
[0020] Based on the steps described above, the detailed process is as follows: Step S1: Acquire a synchronization pulse signal synchronized with the production line displacement. This synchronization pulse signal triggers an imaging device to acquire a motion image of the target workpiece. The device then identifies and calculates the positional offset between the workpiece's real-time position and the preset marking reference point in the motion image. The production line motion is monitored in real-time by a production line encoder deployed on the production line drive shaft. The encoder generates a pulse signal that is strictly synchronized with the production line displacement as it rotates with the shaft. The image acquisition device is an industrial camera.
[0021] The pulse signal is transmitted to the programmable logic controller (PLC) via a high-speed digital input module. The PLC is internally configured with an image acquisition trigger threshold register. When the pulse count matches the preset trigger threshold in the register, the PLC sends a hardware trigger signal to the industrial camera. Upon receiving the trigger signal, the industrial camera acquires a digital image of the moving workpiece using preset exposure parameters. The image data is then transmitted to the image processing unit via a gigabit Ethernet interface.
[0022] The image processing unit preprocesses the acquired moving images, including color space conversion, Gaussian filtering for noise reduction, and contrast enhancement. An edge detection algorithm is used to extract workpiece contour features, and sub-pixel interpolation technology is employed to improve contour positioning accuracy. The two-dimensional coordinates of the contour centroid in the image pixel coordinate system are calculated, and these coordinates are differentially calculated with the coordinates of the pre-calibrated reference marking point to obtain pixel-level coordinate offsets. Using the transformation matrix between the pixel coordinate system established by the camera calibration parameters and the physical coordinate system of the marking head, the pixel offset is converted into a physical position offset in the marking head coordinate system. This position offset includes two translation components in the horizontal and vertical directions, providing accurate compensation data for subsequent marking path correction.
[0023] Step S2: Based on the position offset, all coordinate points in the pre-stored theoretical marking path are synchronously translated to generate a corrected marking path. Position offset data, including horizontal and vertical offset components, is received from the image processing unit. Pre-stored theoretical marking path data, stored as a sequence of coordinate points (each point containing horizontal and vertical coordinates and corresponding laser control parameters), is read from non-volatile memory.
[0024] The algorithm iterates through each coordinate point in the theoretical marking path, performing coordinate transformation operations on each point. The original x-coordinate value is algebraically added to the horizontal offset component to obtain the corrected x-coordinate value; the original y-coordinate value is algebraically added to the vertical offset component to obtain the corrected y-coordinate value. The coordinate transformation process employs a pipelined architecture; while the current coordinate point is being transformed, the data for the next coordinate point is simultaneously read, ensuring real-time path correction. The corrected coordinate points maintain their original sequence order, and the laser control parameters remain consistent with the original path. After completing the transformation operations for all coordinate points, a new coordinate point sequence is generated and stored in a high-speed buffer.
[0025] The newly generated corrected marking path, while maintaining the geometric characteristics of the original marking trajectory, achieves precise compensation for workpiece position deviations. The path correction process is synchronized with the production line movement, ensuring that all calculations are completed before the workpiece reaches the marking station. The corrected marking path data is transmitted to the laser marking machine controller via a real-time Ethernet bus, providing accurate trajectory data for subsequent marking operations.
[0026] Step S3: Pulse counting is performed based on the synchronous pulse signal, and the obtained real-time pulse count value is compared with a preset marking trigger threshold. When the real-time pulse count value reaches the marking trigger threshold, the laser marking equipment is driven to perform a marking operation on the target workpiece according to the corrected marking path to obtain marking information. The synchronous pulse signal is accumulated and counted by the high-speed counter module inside the programmable logic controller, and the counter uses a 32-bit register to store the real-time pulse count value.
[0027] A marking trigger threshold register is maintained; this threshold is preset via the human-machine interface and stored in non-volatile memory. A comparator unit compares the pulse count value with the marking trigger threshold in real time, generating a hardware interrupt signal when the count value equals the threshold. The interrupt service routine responds to the hardware interrupt signal, reading the corrected marking path data from the high-speed buffer. The marking path data is converted into a sequence of control instructions recognizable by the laser marking machine, including galvanometer positioning instructions and laser power control parameters.
[0028] Control commands are transmitted to the laser marking machine controller via real-time Ethernet. After parsing the commands, the controller drives the galvanometer motor to move to the target coordinate position. During galvanometer positioning, the laser outputs a laser beam according to a preset power curve, forming a preset marking trajectory on the workpiece surface. The laser status and galvanometer position feedback are monitored in real time during marking to ensure accurate execution of the marking trajectory. After completing the entire marking path, the laser marking machine controller generates a marking completion status message.
[0029] The programmable logic controller (PLC) collects key parameters during the marking process, including the actual marking trajectory coordinates, marking duration, laser power curve, and marking timestamp. These parameters are then bound to workpiece identification information to form a complete marking information record, which is stored in the database system. The marking information is stored in a time-series data format, providing a data foundation for quality traceability and production analysis.
[0030] Step S4: Image data of the marking area is acquired by a vision inspection system deployed at the back end of the marking station. An industrial camera captures high-contrast images under specific lighting conditions, and the images are transmitted to an image processing unit for preprocessing. Preprocessing includes grayscale conversion, region of interest extraction, and image enhancement algorithms to improve the accuracy of subsequent analysis. The image processing unit executes a marking quality feature extraction algorithm to calculate the geometric and optical features of the marking area.
[0031] Geometric features include the integrity, positional accuracy, and shape fidelity of the marking contour. Deviation values are calculated by comparing the actual marking contour with a standard template. Optical features primarily evaluate marking contrast and uniformity, obtaining a quality score by analyzing the grayscale distribution characteristics of the marking area and the background area. The system compares each feature parameter with preset quality standard thresholds and employs a multi-level judgment logic to comprehensively evaluate marking quality. When the judgment result is unqualified, the system records the current workpiece's marking information and defect characteristics, and simultaneously calculates the rejection delay based on the production line speed.
[0032] After receiving the quality judgment result, the programmable logic controller (PLC) starts a delay counter for precise timing. The counter counts based on a synchronization pulse signal, and when the count value reaches a preset rejection delay threshold, the controller sends an action command to the rejection device. The rejection device, using a pneumatic or electric actuator, removes the defective workpiece from the production line to a designated area. The entire rejection process is synchronized with the production line cycle time to ensure that it does not affect the normal processing of subsequent workpieces. After the rejection action is completed, the system updates production statistics, providing real-time data support for production management.
[0033] This invention provides a collaborative control method for laser marking on a production line. By establishing a collaborative mechanism between production line motion and marking control through synchronous pulse signals, it achieves precise matching between marking timing and workpiece position, thereby significantly improving the accuracy of marking position during movement. Based on real-time visual positioning and dynamic correction of the marking path, it effectively overcomes marking deviations caused by workpiece position fluctuations, improving the stability of the marking process. Through online judgment and closed-loop control of marking quality, it achieves automatic identification and rejection of defective workpieces, ensuring the consistency of final product quality. The collaborative timing method using pulse counting and threshold comparison ensures the synchronization of actions of multiple execution units during continuous production line operation, improving overall production efficiency. Through the synergistic effect of the above technologies, the continuous operation rhythm of the production line is maintained while ensuring marking accuracy, achieving a balance between accuracy and efficiency.
[0034] In one embodiment, a synchronization pulse signal synchronized with the production line displacement is acquired, and the synchronization pulse signal is used to control an imaging device to acquire motion images of the target workpiece. The offset between the real-time position of the workpiece in the motion image and a preset marking reference point is identified and calculated, including: The production line encoder is directly mounted on the output shaft or transmission roller of the production line drive motor, with the encoder shaft and drive shaft kept coaxial and fixed. The encoder generates a pulse signal for each specific rotation angle, and the number of pulses is strictly linearly proportional to the displacement of the production line.
[0035] The pulse signal is transmitted to the high-speed counting module of the programmable logic controller (PLC) via shielded twisted-pair cable. This module employs opto-isolation technology to eliminate electromagnetic interference. The high-speed counting module is configured in incremental counting mode, capturing and accumulating the rising edge of the pulse signal. The PLC internally includes an image acquisition trigger threshold register, which is preset via the human-machine interface and stored in non-volatile memory.
[0036] The comparator unit continuously compares the real-time pulse count value with the image acquisition trigger threshold. When the count value equals the threshold, the programmable logic controller sends a trigger signal to the industrial camera in the imaging device via the digital output module. The trigger signal uses a transistor transmission circuit to ensure the real-time performance and accuracy of the signal response.
[0037] Upon receiving a trigger signal, the industrial camera initiates the exposure process. The exposure time is dynamically adjusted according to the production line's movement speed to avoid motion blur. During image acquisition, a high-frequency pulsed light source is used for synchronous illumination, ensuring strict synchronization between the light source trigger signal and the camera's exposure signal. The industrial camera then transmits the acquired digital image to an image processing industrial control computer via the GigE Vision protocol.
[0038] Image data transmission uses the Jumbo frame format, effectively improving data transmission efficiency. To ensure real-time image acquisition, the system employs a ping-pong buffering mechanism, meaning that while the current frame is being transmitted, the camera has already prepared to acquire the next frame.
[0039] The system identifies and calculates the offset between the real-time position of the workpiece and the preset marking reference point in the moving image. After receiving the digital image, the image processing industrial control computer performs image preprocessing operations. Preprocessing includes bad pixel correction, flat field correction, and gamma correction to eliminate inherent noise and optical distortion from the camera sensor. After converting the image to grayscale, an adaptive thresholding algorithm is used for binarization, which can adapt to changes in lighting conditions. Workpiece contour extraction employs a combination of edge detection and contour tracking.
[0040] Image gradients are calculated using the Sobel operator, and then edge thinning is achieved using non-maximum suppression. The contour tracking algorithm starts from the maxima of the gradient magnitude map and tracks the complete contour according to the eight-neighbor connectivity principle. To improve contour localization accuracy, Gaussian fitting is used to achieve sub-pixel level edge localization. The extracted contour point set undergoes concavity / convexity analysis and polygon approximation processing to eliminate pseudo-contours caused by noise interference. The actual center coordinates of the workpiece are calculated based on the extracted contour point set. For regularly shaped workpieces, the geometric center method is used to calculate the centroid coordinates of the contour.
[0041] For irregularly shaped workpieces, the workpiece position is determined using the minimum bounding rectangle center or centroid algorithm. The coordinates of the preset marking reference point in the image coordinate system are obtained through offline calibration. The calibration process uses a standard calibration board to determine the correspondence between the image coordinate system and the physical coordinate system. The calculation of the position offset involves the transformation between the image coordinate system and the physical coordinate system. The pixel difference is calculated using the finite difference method, calculating the pixel deviations in the horizontal and vertical directions between the actual center coordinates and the reference point.
[0042] Camera calibration parameters include intrinsic and extrinsic matrices. The intrinsic matrix describes the camera's internal geometry, while the extrinsic matrix defines the transformation relationship between the camera coordinate system and the world coordinate system. A projection model established using these calibration parameters transforms the pixel coordinates of the two-dimensional image into three-dimensional physical space coordinates, ultimately yielding the position offset in the marking head coordinate system. This offset contains three degrees of freedom: two translational components and one rotational component within the plane, providing accurate compensation data for subsequent path correction.
[0043] Based on the position offset, all coordinate points in the pre-stored theoretical marking path are synchronously translated and transformed to generate a corrected marking path. This process is executed in the path planning module of the laser marking system, which receives position offset data from the vision positioning system. The position offset data contains two translation components and one rotation component, corresponding to the X-axis offset, Y-axis offset, and angular deflection in the marking head coordinate system, respectively.
[0044] The path planning module reads pre-stored theoretical marking path data from non-volatile memory. This data is stored in an ordered sequence of coordinate points, with each point containing X and Y coordinate values and the corresponding laser power parameters. The coordinate transformation process is implemented using matrix operations. For each coordinate point in the path, a homogeneous coordinate vector for that point is first constructed.
[0045] An affine transformation matrix, containing translation and rotation parameters, is generated based on the position offset data. The homogeneous coordinate vector is multiplied by the affine transformation matrix to obtain the transformed coordinate values. The laser power parameters remain constant during the transformation to ensure consistent marking energy. To ensure computational efficiency, matrix operations are performed in parallel using a hardware accelerator, allowing the transformation of a single coordinate point to be completed within nanoseconds. A real-time mechanism is implemented during path correction.
[0046] When the production line speed changes, the system dynamically adjusts the calculation priority to ensure that all path point transformation calculations are completed before the workpiece reaches the marking station. After completing the transformation of all coordinate points, the system checks the smoothness of the corrected path and optimizes the continuity of path transitions using a Bézier curve algorithm. The corrected marking path data is transmitted to the laser marking controller using a segmented caching mechanism; each corrected segment is transmitted immediately, achieving a streamlined operation of calculation and execution.
[0047] Pulse counting is performed based on a synchronous pulse signal, and the obtained real-time pulse count value is compared with a preset marking trigger threshold. When the real-time pulse count value reaches the marking trigger threshold, the laser marking equipment is driven to perform a marking operation on the target workpiece according to the corrected marking path. This process is executed by the marking trigger control module, which is integrated into the programmable logic controller.
[0048] A high-speed counter continuously accumulates and counts the encoder pulse signals. The counter uses a 32-bit ring counter structure to prevent count overflow. The marking trigger threshold is calculated based on the mechanical distance between the marking station and the vision station. This distance is converted into a corresponding number of pulses and stored in the threshold register. The marking trigger mechanism employs precise time synchronization technology.
[0049] When the real-time pulse count equals the marking trigger threshold, the comparator circuit generates a hardware interrupt signal. The interrupt service routine responds immediately, reading the corrected marking path data from the dual-port RAM. The path data is converted into a sequence of G-code instructions recognizable by the laser marking machine. The instructions include the galvanometer target position, laser switch status, and marking delay parameters. The instruction sequence is transmitted to the laser marking machine controller via a real-time Ethernet bus, with timing determinism ensured during transmission using a time-sensitive networking protocol.
[0050] Multiple safeguards are implemented during the marking process. After parsing the instruction sequence, the laser marking machine controller drives the galvanometer motor to move to the target position according to a preset acceleration curve. The position feedback system monitors the actual position of the galvanometer in real time and performs closed-loop comparison control with the target position. The laser output adopts power closed-loop control, and the laser power is monitored in real time through a photodetector to ensure stable marking energy. After completing the marking of the entire path, the controller generates a marking completion status word, which includes a marking success flag and error code information.
[0051] This embodiment achieves real-time and precise positioning of moving workpieces by precisely coordinating synchronous pulse signals with visual acquisition, effectively overcoming positioning errors caused by production line speed fluctuations. A dynamic correction mechanism for the marking path based on position offset enables the laser marking trajectory to adaptively compensate for workpiece position deviations, significantly improving the accuracy and consistency of marking positions. The collaborative control method using pulse counting and trigger thresholds ensures strict synchronization between the marking action and the production line cycle, avoiding the cumulative error problem inherent in traditional timing control. Through online judgment and closed-loop rejection control of marking quality, a complete quality assurance system is constructed, effectively preventing defective workpieces from flowing into subsequent processes. The entire control process forms a closed-loop collaboration of positioning-correction-execution-detection, maintaining continuous and efficient production line operation while ensuring marking accuracy.
[0052] In one embodiment, a corrected marking path is generated by synchronously translating all coordinate points in a pre-stored theoretical marking path according to the position offset, including: The horizontal and vertical offset components of the position offset are extracted. This process is executed in the path processing module of the laser marking equipment, which receives position offset data packets transmitted from the vision positioning system. The data packets are encapsulated in a fixed format, containing basic offset information and a checksum. After parsing the data packets, the path processing module first performs data validity verification, checking the match between the checksum and the data content.
[0053] After successful verification, the raw position offset data is extracted from the data packet. This data is stored in floating-point format and contains two data items: a horizontal offset component and a vertical offset component. The extraction of the horizontal and vertical offset components employs a data destructuring method. The position offset data is stored in memory as a structure, containing the offset magnitude and direction information. Specific data members within the structure are accessed directly through pointer operations to read the values of the horizontal and vertical offset components. During the reading process, a data range check is performed to ensure that the offset values are within a preset reasonable range. If the offset is detected to exceed the allowable range, an exception handling mechanism is activated, and the previously valid offset data is used for subsequent processing.
[0054] The extracted offset component values need to undergo unit standardization. Offsets are typically measured in millimeters, while the units of the marking path coordinate system may be micrometers or pulse equivalents. Based on a preset unit conversion factor, the offset component values are converted to units consistent with the theoretical marking path coordinates. The conversion process uses fixed-point arithmetic to ensure computational efficiency and avoid the precision loss associated with floating-point arithmetic. After unit conversion, the offset component values are stored in a designated register for subsequent coordinate transformations.
[0055] The algorithm iterates through each coordinate point stored in the theoretical marking path, reading the original x-coordinate and y-coordinate values for each point. This operation is performed by the coordinate access unit of the path processing module, which reads the theoretical marking path data stored in non-volatile memory via direct memory access. The theoretical marking path is stored as a linked list structure of coordinate points, with each node containing a pointer to the coordinate data and a link pointer to the next node.
[0056] The coordinate access unit traverses the linked list starting from the head node, accessing each coordinate point's data sequentially. A double-buffering mechanism ensures data continuity during the coordinate point data reading process. When processing the current coordinate point, the data for the next coordinate point is pre-read into the buffer. Each coordinate point's data structure contains an x-coordinate value and a y-coordinate value, stored in binary format.
[0057] Read operations are implemented through a memory-mapped interface, mapping the physical address of the memory to the processor's address space for high-speed data access. After the coordinate values are read, data format conversion is required, converting the stored binary data into a numerical format that the processor can process. Boundary checks and exception handling are performed during the traversal of coordinate points.
[0058] Maintain a coordinate point counter to record the number of processed coordinate points in real time. When the counter value exceeds the preset total number of coordinate points for the theoretical marking path, immediately terminate the traversal process and generate an error alarm. After each coordinate point is read, perform data validity verification to check whether the coordinate value is within the valid range of the marking workspace.
[0059] If abnormal coordinate values are detected, an error log is recorded and an interpolation algorithm is used to generate alternative coordinate values to ensure the continuity of the path correction process. Processing time is monitored during the traversal; if the processing time for a single coordinate point exceeds the limit, the system will automatically switch to a simplified calculation mode to ensure real-time performance.
[0060] The corrected x-coordinate value is obtained by algebraically adding each original x-coordinate value to the horizontal offset component. This coordinate transformation operation is performed in the arithmetic logic unit of the path processor, which is equipped with a dedicated hardware adder.
[0061] The processor reads the raw x-coordinate value of the current coordinate point from the data register. This value is stored in fixed-point number format, with the integer part representing millimeters and the decimal part representing micrometers. Simultaneously, it reads the horizontal offset component from the offset register. This component has been standardized to maintain the same unit of measurement as the coordinate value. The arithmetic logic unit performs binary addition on the two operands, employing a parallel adder structure with carry chain to ensure fast computation.
[0062] An overflow detection mechanism is implemented during addition operations. The overflow flag is set when the addition of two positive numbers results in a negative number, or vice versa. Upon overflow detection, a saturation operation mode is automatically activated, limiting the calculation result to the maximum or minimum allowed boundary values of the coordinates. The calculation result is rounded to the specified number of decimal places before being stored in a temporary register. Simultaneously, a correction log for that coordinate point is recorded, including the original coordinate value, offset components, and calculation result, for subsequent error analysis and quality traceability.
[0063] Each original ordinate value is algebraically added to the vertical offset component to obtain the corrected ordinate value. This process is executed in parallel with the horizontal coordinate correction, achieving synchronous calculation through the processor's dual arithmetic unit architecture. The ordinate value read channel is independent of the horizontal coordinate channel to avoid memory access conflicts. The vertical offset component is retrieved from a dedicated offset cache, which is connected to main memory via a high-speed bus to ensure timely data supply.
[0064] The addition operation on the ordinate uses the same arithmetic logic unit as the x-axis, but employs a separate computation pipeline. The processor performs addition operations on both the ordinate and x-axis simultaneously, improving computational efficiency through instruction-level parallelism. The same overflow detection and saturation handling mechanisms are implemented during the operation to ensure that the ordinate value remains within the valid range. The corrected ordinate value is stored in the temporary storage unit corresponding to the x-axis value, maintaining the integrity of the coordinate point.
[0065] The corrected x-coordinate and y-coordinate values corresponding to each coordinate point are combined to form a new coordinate point, which is then sorted and stored according to the coordinate point order in the theoretical marking path to form the corrected marking path. This process is executed by the data assembly unit, which reads the corrected x-coordinate and y-coordinate values from a temporary register.
[0066] Read operations are performed in the original order of the coordinate points, with sequential access memory addresses generated by an address generator. Each corrected x and y coordinate value is combined into a new data structure containing coordinate data and timestamp information. Storage of the new coordinate points employs a dynamic memory allocation strategy. Contiguous storage space is allocated in the memory pool based on the number of coordinate points along the theoretically marked path.
[0067] Each new coordinate point is sequentially written to the allocated memory space, maintaining the same order as the original path. Write protection is implemented during storage, and parity checks ensure the correctness of the data writes. After all coordinate points are stored, a descriptor for the corrected marked path is generated. This descriptor records the path's starting address, the number of coordinate points, and path attributes. After the corrected marked path is formed, integrity verification is performed. The verification process includes checking the number of coordinate points, checking storage continuity, and performing data checksum calculations.
[0068] Once verification is successful, the corrected marking path is marked as ready, and a path ready signal is sent to the marking execution unit. The entire path correction process is monitored in real time. If the processing time exceeds a preset threshold, an emergency processing mode will be automatically activated to ensure the timely execution of the marking operation.
[0069] This embodiment achieves precise correction of the theoretical marking path by extracting the horizontal and vertical components of the position offset and performing coordinate transformations on them separately, effectively overcoming the problem of inaccurate marking position caused by workpiece position deviation. By traversing each coordinate point in the theoretical marking path and algebraically adding the horizontal and vertical coordinates, the integrity and accuracy of the path correction are ensured, avoiding the cumulative errors that may occur with traditional overall translation. By recombining the corrected horizontal and vertical coordinate values and storing them in their original order, the continuity and smoothness of the marking path are maintained, enabling the laser marking process to accurately reproduce the preset marking trajectory. This path correction method ensures precise compensation for the position of each marking point through point-by-point calculation, significantly improving the consistency of the marking position.
[0070] In one embodiment, pulse counting is performed based on a synchronous pulse signal, and the obtained real-time pulse count value is compared with a preset marking trigger threshold. When the real-time pulse count value reaches the marking trigger threshold, the laser marking device is driven to perform a marking operation on the target workpiece according to the corrected marking path to obtain marking information, including: The system continuously monitors the synchronization pulse signal. When a rising edge of the synchronization pulse signal is detected, the pulse value is accumulated to generate a real-time pulse count. This is executed in the high-speed pulse counting module, which uses an opto-isolated input circuit to receive the pulse signal from the production line encoder. The input signal undergoes waveform shaping via a Schmitt trigger to eliminate signal edge jitter interference. The shaped digital signal is then sent to the edge detection circuit, which identifies rising edge events by comparing the level changes of adjacent sampling points.
[0071] Each detected rising edge triggers a single-cycle pulse, serving as the counter's counting enable signal. The pulse value accumulation is implemented using a 32-bit synchronous binary counter. The counter employs a clock-synchronized design, performing counting operations on the rising edge of the system master clock. When the counting enable signal is valid, the counter's current value is incremented by one, and the result is latched into the output register. The counter's clear input is connected to the initialization signal, automatically resetting to zero upon device power-on or reset.
[0072] The real-time pulse count value is transmitted to the central processing unit via a parallel data bus, and is simultaneously updated in real-time on the display module for operator monitoring. To ensure counting accuracy, a multi-factor verification mechanism is implemented. Within each pulse cycle, the counter performs a self-check, comparing the current count value with the expected range. When an anomaly is detected, an error correction algorithm is activated, intelligently compensating based on historical counting patterns. The count data employs cyclic redundancy check (CRC) encoding, verifying the integrity of data transmission through the checksum. The real-time pulse count value is also backed up to non-volatile memory to prevent data loss due to unexpected power outages.
[0073] The real-time pulse count value is compared with the marking trigger threshold. If the real-time pulse count value is less than the marking trigger threshold, the next synchronization pulse signal is recalculated. This comparison process is completed in the numerical comparison unit, which includes a numerical register, a threshold register, and a comparator circuit. The marking trigger threshold is preset through the human-machine interface and stored in non-volatile memory, and is loaded into the threshold register during initialization. The real-time pulse count value is updated to the numerical register in real time via the data bus.
[0074] The comparator circuit employs a parallel comparison architecture, simultaneously comparing the data in the value register and the threshold register. The comparison result is output as a three-bit status code: less than, equal to, or greater than. When the status code indicates "less than," the comparator generates a continue counting signal, which triggers the pulse counting module to prepare to receive the next pulse. The continue counting signal is simultaneously transmitted to the timing control unit, which generates the corresponding timing control sequence to coordinate the entire operation. The process of recalculating the next synchronization pulse signal involves a complete signal processing chain. Continuous monitoring of the pulse input channel is maintained, waiting for the arrival of the next valid pulse. The processing of each new pulse follows the same signal conditioning, edge detection, and counting accumulation process. During the waiting period, a timeout monitoring mechanism is implemented; if no new pulse is detected within a preset time, an alarm signal is generated, indicating a possible equipment failure or signal interruption. The entire comparison-wait-recalculation process is executed cyclically until the real-time pulse count value reaches or exceeds the marking trigger threshold.
[0075] When the real-time pulse count equals the marking trigger threshold, the laser marking equipment is controlled to scan and mark the target workpiece according to the corrected marking path, generating a marking completion signal. This trigger condition is generated by the equivalent output of the threshold comparator, and the signal is converted into an interrupt request signal through a signal conditioning circuit. The interrupt service routine responds immediately, reading the corrected marking path data from the dual-port random access memory.
[0076] The path data includes a sequence of coordinate points and motion parameters, which are transmitted to the laser marking equipment via a direct memory access channel. The laser marking equipment parses the received path data and converts it into galvanometer control commands and laser modulation signals. The galvanometer control commands contain the target position coordinates and motion velocity curve; these parameters are converted into analog voltage signals via a digital-to-analog converter, driving the galvanometer motor of the laser marking equipment to rotate.
[0077] The laser modulation signal controls the output power and pulse frequency of the laser marking equipment, ensuring that the marking energy matches the material properties. During the scanning and marking process, the actual position of the galvanometer of the laser marking equipment is monitored in real time, forming a closed-loop control with the target position. The generation of the marking completion signal is based on the monitoring of the path execution status. An execution progress counter is maintained to record the number of marking points completed. When the counter value matches the total number of points, the status monitoring circuit generates a marking completion pulse signal. This signal is transmitted to the main controller after opto-isolation, simultaneously triggering the status indicator light to update the display. The marking completion signal contains an execution result code to identify the success or abnormal status of the marking process.
[0078] Based on the marking completion signal, the trajectory coordinates, marking timestamp, and workpiece status parameters of the target workpiece during the marking process are recorded and integrated to obtain marking information. This process is executed in the data recording module, which receives the marking completion signal as the trigger condition for data acquisition.
[0079] Marking process parameters are synchronously acquired from multiple data sources: actual marking trajectory coordinates are read from position sensors, precise timestamps are obtained from a real-time clock module, and workpiece status parameters such as laser power and galvanometer position are read from the status monitoring unit. The data integration process employs a time alignment algorithm to align and correlate data from different sources according to their time sequence. Each data point is marked with a precise timestamp to ensure temporal consistency between trajectory coordinates and status parameters. The data recording format uses a structured storage scheme, comprising a file header, data body, and checksum.
[0080] The header records basic information about the marking task, the data body stores the specific marking process data, and the checksum is used to verify data integrity. Multiple protection mechanisms are implemented for the storage of marking information. Data is simultaneously written to non-volatile memory and buffer memory to prevent data loss due to unexpected power outages. The storage process employs a dual verification mechanism of pre-write verification and post-write read to ensure the accuracy of data recording. After storage is complete, a data recording completion signal is generated, which triggers the quality judgment module to start working. The entire marking information recording process is completed within strict time constraints to ensure synchronization with the production line cycle time.
[0081] This embodiment achieves precise synchronization between the marking trigger timing and production line displacement by continuously detecting the synchronization pulse signal and performing real-time pulse counting, effectively avoiding marking position deviations caused by production line speed fluctuations in traditional time control methods. A numerical comparison mechanism between the real-time pulse count value and the marking trigger threshold ensures that the marking action is triggered only when the workpiece accurately reaches the marking station, improving the repeatability of the marking position. Based on the correction marking path control, the laser marking equipment performs scanning marking, enabling the marking trajectory to adaptively compensate for workpiece position offsets, ensuring the integrity and consistency of the marking pattern. By recording and integrating the trajectory coordinates, timestamps, and status parameters during the marking process, a complete marking information record is formed, providing a data foundation for quality traceability and process optimization.
[0082] In one embodiment, when the real-time pulse count value equals the marking trigger threshold, the laser marking equipment is controlled to scan and mark the target workpiece according to the corrected marking path, generating a marking completion signal, including: The correction coordinate point sequence and motion parameters are extracted from the corrected marking path. This operation is performed in the path parsing module of the laser marking equipment, accessing the shared memory area storing the corrected marking path through a memory-mapped interface. The path data is encapsulated in a specific format, including a file header identifier, the number of coordinate points, and a block of motion parameters. The parsing module first reads the file header information to verify the integrity and validity of the data format. The verification process includes checksum calculation and version number verification to ensure that the data is not corrupted or that the versions are compatible. The extraction of the correction coordinate point sequence uses a segmented loading mechanism.
[0083] Based on the complexity of the marking path and memory capacity, the entire coordinate point sequence is divided into multiple data blocks. Each data block contains a fixed number of coordinate points, and the data blocks are linked by pointers. The parsing module loads the data blocks sequentially into a high-speed buffer, while simultaneously pre-fetching the next data block into a spare buffer, achieving seamless switching. The data structure of each coordinate point includes X-axis coordinates, Y-axis coordinates, and point attribute identifiers. This data is stored in binary format and byte-aligned during extraction. The extraction of motion parameters is performed synchronously with the coordinate point sequence.
[0084] The motion parameter block is stored at the end of the path data and includes the marking speed curve, acceleration parameters, and laser power configuration. The speed curve is stored in the form of a lookup table, recording the preset speed values for different path segments. The acceleration parameters include the maximum acceleration and jerk limit values of the galvanometer motor. The laser power configuration includes the base power value and the power modulation curve. The parsing module loads these parameters into the corresponding control registers, providing the parameter basis for subsequent marking operations.
[0085] The process iterates through each corrected coordinate point in the sequence, converting the current corrected coordinate point into motion control commands for the laser marking equipment. This traversal process is executed by the command generator module, which maintains a pointer to the current coordinate point, initially pointing to the beginning of the sequence. The command generator accesses each coordinate point sequentially, reading its position data and attribute information.
[0086] The traversal of coordinate points employs a depth-first strategy to ensure path continuity and directional consistency. The transformation process of motion control commands involves coordinate mapping and command encoding. The position data of each corrected coordinate point first undergoes a coordinate system transformation, mapping from the workpiece coordinate system to the deflection angle coordinate system of the laser galvanometer. The mapping process is based on a pre-calibrated transformation matrix, which is stored in non-volatile memory.
[0087] The converted angle data is quantized into digital command values for the galvanometer controller, representing the number of steps or angles the galvanometer motor needs to rotate. Motion control command generation also includes motion trajectory optimization. The command generator analyzes the motion path between adjacent coordinate points and uses interpolation algorithms to generate smooth transition trajectories. For straight path segments, linear interpolation is used to calculate the midpoint position; for curved path segments, spline interpolation is used to ensure curvature continuity.
[0088] The generated instruction sequence includes position, velocity, and acceleration instructions. These instructions are encapsulated according to a specific protocol format and transmitted to the laser marking equipment via a high-speed serial interface. Each instruction packet is appended with a timestamp and sequence number to ensure the sequential and timely execution of the instructions.
[0089] The laser emission time interval between adjacent corrected coordinate points is calculated based on the velocity parameter in the motion parameters. The preset marking speed parameter is read from the motion parameter register group. The velocity parameter is expressed as displacement per unit time and stored as a fixed-precision floating-point number. The spatial distance between adjacent coordinate points is calculated using the Euclidean distance formula to determine the straight-line length between the two points.
[0090] The distance calculation result is divided by the velocity parameter to obtain the theoretical travel time. The calculation of the laser emission time interval needs to consider the dynamic characteristics of the equipment. The acceleration parameters and jerk limits of the galvanometer motor are read, and the time allocation of the acceleration, constant speed, and deceleration phases is calculated according to the kinematic model. For short-distance movement, the proportion of the acceleration phase is increased to ensure positioning stability; for long-distance movement, the proportion of the constant speed phase is extended to improve marking efficiency.
[0091] The calculation process employs an iterative optimization algorithm to minimize the total motion time while satisfying the mechanical constraints of the equipment. The accuracy calibration of the time interval is achieved through a hardware timer. The calculated time value is converted into the counting period value of the hardware timer, a conversion based on the system master clock frequency. The timer is configured in single-trigger mode, with each time interval corresponding to an independent timer setting. The calculated time parameters are stored in a FIFO buffer for sequential reading and execution by the laser controller. A water level monitoring system is implemented in the buffer to prevent data overflow or interruption.
[0092] When controlling the laser marking equipment to scan and mark the target workpiece, the motion control command moves the laser marking equipment to the target position of the correction coordinate point, and the laser emission time of the laser marking equipment on the target workpiece is controlled according to the laser emission time interval. This process is executed collaboratively by the motion control module and the laser control module.
[0093] The motion control module parses the received motion control commands and decomposes them into X-axis and Y-axis displacement components. The displacement of each axis is smoothed by a digital filter to eliminate mechanical vibrations caused by sudden changes in the command. The galvanometer positioning control employs a closed-loop servo mechanism. Simultaneously with the position command being sent to the galvanometer driver, a high-precision encoder provides real-time feedback on the actual angle of the galvanometer. The control algorithm compares the commanded position with the feedback position and generates a correction signal to drive the motor. A positioning completion signal is generated by a position error comparator; when the position error is less than a set threshold, positioning is considered complete.
[0094] Laser emission control is strictly synchronized with galvanometer movement. A positioning completion signal triggers the laser enable circuit and simultaneously starts a hardware timer to control the emission time. The laser power controller modulates the laser output according to a preset power curve to ensure consistent marking depth. During emission, laser power feedback is monitored in real time, and the drive current is dynamically adjusted via a PID controller to maintain stable power. Once the emission time is reached, the timer generates an interrupt signal to shut down the laser output.
[0095] After marking the last corrected coordinate point in the corrected coordinate point sequence is completed, a marking completion signal is generated and the real-time pulse count is reset. Marking completion detection is implemented by a sequence counter, initially set to the total number of coordinate points. The counter automatically decrements by one after each coordinate point marking operation is completed. When the counter value reaches zero, the status detection circuit generates a marking completion pulse signal.
[0096] The generation of the marking completion signal includes a status verification step. The system checks the marking quality parameters at the final coordinate point, including the deviation between the actual marking position and the target position, and laser power stability indicators. If all parameters are within acceptable ranges, a normal marking completion signal is generated; if an anomaly is detected, a completion signal with an error code is generated. The completion signal is transmitted to the main controller via optical isolation. The real-time pulse count value reset operation is triggered synchronously with the marking completion signal.
[0097] The reset circuit generates a fixed-width reset pulse to zero the counter's current value. Before the reset operation, the current count value is backed up to the historical record register for production statistics and analysis. After the reset is complete, it automatically enters the ready state, waiting for the start signal for the next marking cycle. The entire state transition process is completed under strict time sequence control to ensure precise synchronization with the production line cycle time.
[0098] This embodiment extracts the sequence of corrected coordinate points and motion parameters from the corrected marking path, enabling precise analysis of the geometric features and dynamic characteristics of the marking trajectory, ensuring the integrity and accuracy of path execution during the marking process. By traversing the sequence of corrected coordinate points and converting each coordinate point into motion control commands for the laser marking device, precise point-to-point control of the marking action is achieved, avoiding trajectory deviations that may occur in traditional batch processing. By calculating the laser emission time interval between adjacent coordinate points based on the velocity parameters in the motion parameters, the timing distribution of laser energy is optimized, ensuring the uniformity and consistency of marking depth. By synchronously controlling the device movement and laser emission time during the scanning marking process, precise coordination between mechanical motion and optical output is achieved, improving marking efficiency and quality stability.
[0099] In one embodiment, the laser marking equipment is controlled to move to the target position of the corrected coordinate point according to motion control commands, and the laser marking time of the laser marking equipment on the target workpiece is controlled according to the laser emission time interval, including: Motion control commands are parsed into vertical and horizontal displacement components. This parsing process is executed in the command decoding module, which receives motion control command data packets from the path planner. The data packets are encapsulated using a standard communication protocol and include a frame header identifier, command type code, and data payload. The decoding module first performs frame header detection to verify the start boundary and integrity of the data packet. The verification process includes cyclic redundancy check calculation and sequence number verification to ensure the accuracy of data transmission. Parsing motion control commands involves command destructuring and parameter extraction. The data payload contains compressed coordinate information and control parameters, which need to be decompressed to restore the original data. The decompressed data structure contains absolute coordinate values or relative displacements, which are processed according to the command type code.
[0100] For absolute coordinate commands, the X and Y axis coordinate values are read directly; for relative displacement commands, incremental calculations are performed based on the current coordinates. Coordinate values are stored in fixed-point number format, including integer and fractional parts, ensuring the accuracy of displacement control. The separation of the vertical and horizontal axis displacement components is achieved through data masking operations. The command decoder is equipped with a bitmask register for extracting data within a specific bit range.
[0101] The vertical axis displacement component corresponds to the high 16 bits of the data, and the horizontal axis displacement component corresponds to the low 16 bits. The extracted displacement components are stored in their respective output registers, and a data range check is performed to ensure that the displacement is within the driver's allowed operating range. If an out-of-range value is detected, the decoder generates an error flag and interrupts the execution of the current instruction.
[0102] The vertical axis displacement component is input to the vertical axis driver of the laser marking equipment, and the horizontal axis displacement component is input to the horizontal axis driver. This process is implemented through a digital-to-analog conversion interface, with the displacement component data transmitted from the output register to the DAC module. The DAC module adopts a segmented architecture, with the high byte processing the integer part and the low byte processing the fractional part to ensure conversion accuracy.
[0103] The conversion clock is synchronized with the system master clock to avoid timing deviations. Differential signal transmission is used at the input interfaces of the vertical and horizontal axis drivers to enhance anti-interference capabilities. Displacement component data is converted by a DAC to generate corresponding analog voltage signals. These voltage signals are then conditioned by an operational amplifier, including amplitude adjustment and bias compensation. The conditioned signals are transmitted to the driver control port via shielded twisted-pair cable, with impedance matching implemented along the signal transmission path to reduce signal reflections.
[0104] After receiving the displacement signal, the driver enters the position control mode. The internal position controller compares the commanded position with the encoder feedback position, generating a PWM control signal to drive the motor. Control parameters include proportional gain, integral time, and derivative coefficients, which are pre-tuned according to the load characteristics. The drive enable signal is triggered after the displacement signal stabilizes, ensuring accurate motor positioning at startup. The displacement completion signal is generated by the driver's position comparator; when the position error is less than a set threshold, the movement of that axis is considered complete.
[0105] The position feedback signals from the vertical and horizontal axis drives are read, and the difference between the position feedback signals and the correction coordinate points is calculated to obtain the position deviation value. This process is implemented through a high-precision encoder interface module, which is equipped with a dual-channel synchronous sampling circuit.
[0106] Each drive is equipped with a production line encoder that generates quadrature pulse signals, which are converted into digital position information by a differential receiver. The sampling circuit is triggered on a unified clock edge to ensure synchronization of the two-axis position data. The processing of the position feedback signal includes signal conditioning and numerical conversion. The raw pulse signal is passed through a quadruple frequency decoding circuit, increasing the basic resolution by four times. The decoded count value is converted into the actual displacement using a linearization calibration table, which stores the encoder's nonlinear error compensation parameters. The converted position value is stored in floating-point format, containing the displacement value in millimeters and the direction indication. The difference calculation is performed in a digital signal processor. The processor reads the theoretical position of the target coordinate point from the register and performs an algebraic subtraction operation with the feedback position. The calculation process uses a fixed-point arithmetic accelerator to ensure completion within microseconds. The position deviation value contains two components: radial deviation and angular deviation, representing the magnitude and direction of the position error, respectively. The calculation result is stored in the deviation register, and the status flag is updated simultaneously.
[0107] The system determines whether the position deviation is less than a preset position tolerance threshold. If it is, it sends an output light signal to the laser controller of the laser marking equipment. This determination process is implemented by a digital comparator circuit, which is equipped with a programmable threshold register. The position tolerance threshold is preset according to the marking accuracy requirements and stored in non-volatile memory.
[0108] During initialization, a threshold is loaded into the comparator register, supporting dynamic adjustment at runtime. The comparator circuit employs a parallel comparison architecture, simultaneously comparing the absolute value of the position deviation with the threshold. The comparison result updates the status register in real time; when the deviation is less than the threshold, the status bit is set. Changes in the status bit trigger an interrupt generation circuit, generating a light enable signal. This enable signal is transmitted to the laser control board after opto-isolation, ensuring electrical isolation safety.
[0109] The transmission of the emitted light signal employs a handshake protocol. Upon receiving the enable signal, the laser controller returns an acknowledgment signal. A handshake timeout monitoring circuit ensures the reliability of signal transmission; if no acknowledgment is received within a preset time, the light signal is retransmitted. The emitted light signal includes a power level parameter, which is preset based on the characteristics of the marking material and transmitted to the laser power controller via a serial communication interface.
[0110] During the valid period of the laser emission signal, the laser marking equipment is controlled to perform laser marking on the target workpiece and time interval timing. When the time interval timing reaches the laser emission interval, a shutdown signal is sent to the laser controller to stop the laser marking. During the valid period of the laser emission signal, the laser power control module initiates a power ramp-up sequence.
[0111] The power controller gradually increases the laser diode drive current according to a preset slope to avoid thermal shock caused by sudden power changes. After the power stabilizes, it enters a constant power mode, where a PID controller maintains the stability of the output power. The time interval timing is implemented by a high-precision hardware timer. The timer is configured in decrementing counting mode, with its initial value set to the number of clock cycles corresponding to the laser emission time interval. The system master clock is divided and supplied to the timer to ensure timing accuracy at the microsecond level.
[0112] During the timing process, a watchdog circuit monitors the timer's running status to prevent timing errors caused by program overrun. When the timer count reaches zero, an interrupt request signal is generated. The interrupt service routine executes a shutdown sequence: first, a power ramp is initiated to reduce the laser power at a preset slope; after the power drops to a safe threshold, a shutdown command is sent to the laser controller; the shutdown command includes a security checksum to ensure the command's validity. After the laser controller executes the shutdown operation, it returns a status confirmation signal, completing the entire marking cycle. The timer automatically resets, preparing for the next marking operation.
[0113] This embodiment achieves precise decoupling of marking point control by parsing motion control commands into vertical and horizontal axis displacement components and inputting them to their respective drivers, effectively improving the positioning accuracy and response speed of the galvanometer system. A closed-loop control system is constructed using real-time difference calculation between the position feedback signal and the target coordinate point, dynamically compensating for position deviations caused by mechanical transmission errors and environmental interference. A preset position tolerance threshold judgment mechanism ensures the positioning accuracy at the moment of laser emission, avoiding quality problems caused by starting marking before the galvanometer system has stabilized.
[0114] In one embodiment, the quality of the marked target workpiece is judged based on the marking information. If the workpiece is judged to be unqualified, it is discarded, including: The marking trajectory coordinate set is extracted from the marking information. The coordinate deviation of each point in this set is calculated by comparing it with a pre-stored standard marking trajectory template. This extraction process is executed in the data parsing module, which accesses the database or memory area storing the marking information. The marking information is stored in a structured format, containing the marking trajectory coordinate sequence, timestamp, and quality parameters. The parsing module identifies the coordinate data segments in the data packet and reads the coordinate point sequence through pointer operations. The coordinate data is stored using an array or linked list structure, with each element containing horizontal and vertical coordinate values and attribute identifiers.
[0115] During the reading process, data integrity checks are performed, verifying checksums or cyclic redundancy codes to ensure the data is not corrupted. Extracting the set of marked trajectory coordinates involves data filtering and formatting. The raw coordinate data may contain auxiliary information or noisy points; the parsing module applies a filtering algorithm to retain valid trajectory points. The filtering criteria are based on the attribute markers of the coordinate points, such as the starting point, path points, and ending points of the marking.
[0116] The formatting process converts coordinate values to a standardized unit of measurement, typically millimeters or micrometers in the marking head coordinate system. The converted coordinate points are arranged in chronological or spatial order, forming a standardized coordinate set. A pre-stored standard marking trajectory template is loaded from non-volatile memory. The template data is generated through offline calibration and contains a coordinate sequence of the ideal marking path.
[0117] The loading process includes version verification and compatibility checks to ensure the template matches the current marking task. The template coordinates are aligned with the extracted trajectory coordinates using coordinate system alignment, eliminating coordinate system differences through feature point matching or least squares fitting. Point-by-point coordinate deviation calculation is performed in the arithmetic logic unit. The calculation process iterates through each point in the coordinate set, performing algebraic subtraction between the actual marking coordinates and the corresponding point coordinates in the template. For each coordinate point, the horizontal and vertical coordinate deviations are calculated separately.
[0118] The deviation values are stored in absolute form, retaining the sign information to indicate the direction of the deviation. Outlier detection is implemented during the calculation process; when a coordinate point is missing or invalid, an interpolation algorithm is used to generate a replacement value to ensure the continuity of the deviation sequence.
[0119] Each trajectory deviation is compared to a preset allowable deviation threshold, and the number of out-of-limit coordinate points exceeding the threshold is counted. This comparison process is implemented by a numerical comparator module, which is equipped with a threshold register to store the allowable deviation threshold. The threshold is preset according to the marking accuracy requirements and may vary depending on the marking content or material characteristics. The comparator reads the absolute value of each trajectory deviation and compares it with the threshold. The comparison operation adopts a parallel processing architecture to improve efficiency.
[0120] Multiple comparator units simultaneously process the deviation values of different coordinate points and output comparison result flags. Each comparison result flag indicates whether the deviation at that point exceeds the limit, and the flag is stored in the result register. Real-time monitoring is implemented during the comparison process to detect sudden changes or continuous exceedance patterns in the deviation values and identify systematic errors. The number of coordinate points exceeding the limit is counted by a counter circuit. The counter is initially set to zero, and increments when a comparison result flag indicates an exceedance. The counting process traverses the entire sequence of coordinate points to ensure that each point is processed.
[0121] The counter employs a ring-shaped buffer structure to prevent overflow. Statistical results are stored as integers, representing the total number of out-of-limit points. After statistical analysis, a quality assessment report is generated. The report includes the number of out-of-limit points, their locations, and the maximum deviation. The report data is stored in a quality database to provide a basis for subsequent process optimization. The entire comparison and statistical process is executed under strict time control to ensure synchronization with the production line cycle time.
[0122] If the number of out-of-limit coordinate points exceeds a preset fault tolerance threshold, the target workpiece is marked as a defective workpiece, and a rejection instruction for the defective workpiece is generated based on the marking information and the synchronization pulse signal. This judgment process is executed in the quality decision module, which is equipped with a fault tolerance threshold register. The threshold is preset according to product grade requirements and stored in non-volatile memory. The decision module compares the statistically obtained number of out-of-limit points with the threshold, using a digital comparator circuit to achieve real-time judgment. When the number of out-of-limit points exceeds the threshold, the defective flag in the status flag register is set.
[0123] The flag setting triggers an interrupt service routine, which accesses the marking information database and reads the identification information of the current workpiece. This identification information includes the workpiece serial number, marking timestamp, and production batch number. These data are bound to a non-conforming flag to form a quality record. Simultaneously, the record is written to the quality database, and real-time production statistics are updated. The generation of rejection instructions is based on the correspondence between marking completion time and production line displacement. The marking completion timestamp in the marking information is read, and combined with the production line speed, the displacement distance of the workpiece from the marking station to the rejection station is calculated. This distance is converted into a corresponding number of pulses, serving as the basis for the rejection delay. Real-time counting of the synchronization pulse signal provides a precise timing reference, ensuring that the rejection instruction is accurately triggered when the workpiece arrives at the rejection station.
[0124] The rejection command is sent to the corresponding rejection execution device, which then removes the defective workpiece from the production line. Command transmission is achieved via an industrial fieldbus, employing a master-slave communication architecture. The master controller encapsulates the rejection command into a protocol data frame, the frame structure of which includes the target device address, command code, and parameter information. The data frame is transmitted through a physical layer interface, using differential signal transmission to enhance anti-interference capabilities. After receiving the command, the rejection execution device performs command parsing and verification. The parsing process verifies the integrity and validity of the data frame, including address matching, checksum verification, and validation.
[0125] After successful verification, the actuator drive mechanism enters the ready state. The drive mechanism typically uses pneumatic or electric actuators, and the actuator controller sets the stroke and force according to the command parameters. The execution of the rejection action is strictly synchronized with the production line cycle time.
[0126] Upon receiving a trigger signal, the actuator completes the push-out and reset actions according to a preset motion curve. During the action, the position sensor monitors the actuator status in real time to ensure the action is completed correctly. After rejection, the actuator returns a status signal, and the main controller updates the workpiece status to "rejected." The entire rejection process is completed within milliseconds, ensuring uninterrupted production line operation.
[0127] This embodiment achieves quantitative evaluation of marking quality by extracting trajectory coordinates from the marking information and calculating point-by-point deviations with a standard template, overcoming the subjective differences inherent in traditional manual inspection. A dual judgment mechanism employing both allowable deviation thresholds and fault tolerance thresholds ensures the accuracy requirements of key points while allowing reasonable errors in non-critical areas, thus improving the scientific rigor of quality judgment. The collaborative processing of marking information and synchronous pulse signals to generate rejection instructions ensures precise synchronization between the identification and rejection of defective workpieces, avoiding the cumulative errors of traditional delayed rejection.
[0128] Reference Figure 2 As shown, the present invention also provides a production line laser marking collaborative control device, applicable to the production line laser marking collaborative control method of any of the above-mentioned methods, comprising: The acquisition module is used to acquire a synchronization pulse signal that is synchronized with the production line displacement. The synchronization pulse signal triggers the image device to acquire the motion image of the target workpiece, and identifies and calculates the position offset between the real-time position of the workpiece and the preset marking reference point in the motion image. The analysis module is used to synchronously translate all coordinate points in the pre-stored theoretical marking path according to the position offset, and generate a corrected marking path. The association module is used to count pulses based on the synchronous pulse signal and compare the obtained real-time pulse count value with the preset marking trigger threshold. When the real-time pulse count value reaches the marking trigger threshold, the laser marking equipment is driven to perform marking operation on the target workpiece according to the corrected marking path to obtain marking information. The processing module is used to judge the quality of the marked target workpiece based on the marking information. If the workpiece is judged to be unqualified, it is rejected.
[0129] Reference Figure 3 As shown, the present invention also provides a production line laser marking collaborative control device, comprising: Memory, used to store programs; A processor is used to execute programs to implement the various steps of a collaborative control method for laser marking on a production line, which includes any of the above-mentioned features.
[0130] The present invention also provides a storage medium storing computer instructions for causing a computer to perform any of the methods described above.
[0131] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the devices and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0132] In this embodiment, the processor and memory can be connected via a bus or other means. The memory may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive. The processor may be a general-purpose processor, such as a central processing unit, digital signal processor, application-specific integrated circuit, or one or more integrated circuits configured to implement embodiments of the present invention.
[0133] The above description is only a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A collaborative control method for laser marking on a production line, characterized in that, include: Acquire a synchronization pulse signal that is synchronized with the production line displacement, trigger an image device to acquire a motion image of the target workpiece through the synchronization pulse signal, and identify and calculate the position offset between the real-time position of the workpiece and the preset marking reference point in the motion image; Based on the position offset, all coordinate points in the pre-stored theoretical marking path are synchronously translated and transformed to generate a corrected marking path; Based on the synchronous pulse signal, pulse counting is performed, and the obtained real-time pulse count value is compared with the preset marking trigger threshold. When the real-time pulse count value reaches the marking trigger threshold, the laser marking device is driven to perform marking operation on the target workpiece according to the corrected marking path to obtain marking information. Based on the marking information, the quality of the marked target workpiece is judged. If it is judged to be an unqualified workpiece, the unqualified workpiece is removed.
2. The collaborative control method for laser marking on a production line according to claim 1, characterized in that, The process of acquiring a synchronization pulse signal synchronized with the production line displacement, controlling an image device to acquire motion images of the target workpiece using the synchronization pulse signal, and identifying and calculating the positional offset between the real-time position of the workpiece and a preset marking reference point in the motion image includes: The synchronous pulse signal output by the production line encoder deployed on the production line is image counted to obtain an image count value. When the image count value reaches a preset image acquisition trigger value, an acquisition command is sent to the image device to acquire the motion image. Extract the contour feature point set of the target workpiece from the motion image, and calculate the actual center coordinates of the contour feature point set in the preset image coordinate system; Calculate the pixel difference between the actual center coordinates and the marking reference point in the horizontal and vertical coordinate directions of the image; The pixel difference is converted into the position offset based on the calibration parameters of the image device.
3. The collaborative control method for laser marking on a production line according to claim 1, characterized in that, The step of synchronously translating all coordinate points in the pre-stored theoretical marking path according to the position offset to generate a corrected marking path includes: Extract the horizontal and vertical offset components from the position offset; Iterate through each coordinate point stored in the theoretical marking path and read the original x-coordinate value and original y-coordinate value of each coordinate point; Each of the original horizontal coordinate values is algebraically added to the horizontal offset component to obtain the corrected horizontal coordinate value; The original ordinate value is algebraically added to the vertical offset component to obtain the corrected ordinate value; The corrected abscissa and corrected ordinate values corresponding to each coordinate point are combined to form a new coordinate point, which is then sorted and stored according to the order of the coordinate points in the theoretical marking path to form the corrected marking path.
4. The collaborative control method for laser marking on a production line according to claim 1, characterized in that, The process involves counting pulses based on the synchronous pulse signal and comparing the resulting real-time pulse count with a preset marking trigger threshold. When the real-time pulse count reaches the marking trigger threshold, the laser marking device is driven to perform a marking operation on the target workpiece according to the corrected marking path, thereby obtaining marking information, including: The synchronization pulse signal is continuously monitored. When the rising edge of the synchronization pulse signal is detected, the pulse value of the synchronization pulse signal is accumulated to generate the real-time pulse count value. The real-time pulse count value is compared with the marking trigger threshold. When the real-time pulse count value is less than the marking trigger threshold, the next synchronization pulse signal is recalculated. When the real-time pulse count value is equal to the marking trigger threshold, the laser marking equipment is controlled to scan and mark the target workpiece according to the corrected marking path, and a marking completion signal is generated. Based on the marking completion signal, the trajectory coordinates, marking timestamps, and workpiece status parameters of the target workpiece during the marking process are recorded and integrated to obtain the marking information.
5. The collaborative control method for laser marking on a production line according to claim 4, characterized in that, When the real-time pulse count value equals the marking trigger threshold, the laser marking device is controlled to scan and mark the target workpiece according to the corrected marking path, generating a marking completion signal, including: Extract the corrected coordinate point sequence and motion parameters from the corrected marking path; Traverse each of the corrected coordinate points in the sequence of corrected coordinate points and convert the current corrected coordinate point into a motion control command for the laser marking device; The laser emission time interval between adjacent corrected coordinate points is calculated based on the velocity parameter in the motion parameters. When controlling the laser marking equipment to scan and mark the target workpiece, the laser marking equipment is controlled to move to the target position of the corrected coordinate point according to the motion control command, and the laser emission time of the laser marking equipment on the target workpiece is controlled according to the laser emission time interval. After the marking operation of the last corrected coordinate point in the corrected coordinate point sequence is completed, a marking completion signal is generated and the real-time pulse count value is reset.
6. The collaborative control method for laser marking on a production line according to claim 5, characterized in that, The step of controlling the laser marking device to move to the target position of the corrected coordinate point according to the motion control command, and controlling the laser marking time of the laser marking device on the target workpiece according to the laser emission time interval, includes: The motion control command is parsed into vertical axis displacement components and horizontal axis displacement components; The longitudinal axis displacement component is input to the longitudinal axis driver of the laser marking equipment, and the transverse axis displacement component is input to the transverse axis driver. Read the position feedback signals of the vertical axis driver and the horizontal axis driver, calculate the difference between the position feedback signal and the correction coordinate point, and obtain the position deviation value. Determine whether the position deviation value is less than a preset position tolerance threshold. If it is less, send an output light signal to the laser controller of the laser marking equipment. During the valid period of the light emission signal, the laser marking equipment is controlled to perform laser marking and time interval timing on the target workpiece. When the time interval timing reaches the laser light emission time interval, a shutdown signal is sent to the laser controller to stop the laser marking.
7. The collaborative control method for laser marking on a production line according to claim 1, characterized in that, The process of judging the quality of the marked target workpiece based on the marking information, and removing the unqualified workpiece if it is determined to be a defective workpiece, includes: Extract the marking trajectory coordinate set from the marking information, and calculate the point-by-point coordinate deviation between the marking trajectory coordinate set and the pre-stored standard marking trajectory template to obtain the trajectory deviation of each point. Each trajectory deviation is compared with a preset allowable deviation threshold, and the number of out-of-limit coordinate points exceeding the allowable deviation threshold is counted. If the number of out-of-limit coordinate points exceeds a preset fault tolerance threshold, the target workpiece is marked as a defective workpiece, and a rejection instruction for the defective workpiece is generated based on the marking information and the synchronization pulse signal. The rejection instruction is sent to the corresponding rejection execution device, which then drives the rejection execution device to remove the defective workpiece from the production line.
8. A collaborative control device for laser marking on a production line, characterized in that, The production line laser marking collaborative control method applied to any one of claims 1-7 includes: The acquisition module is used to acquire a synchronization pulse signal that is synchronized with the production line displacement, and to trigger an image device to acquire a motion image of the target workpiece through the synchronization pulse signal, and to identify and calculate the position offset between the real-time position of the workpiece and the preset marking reference point in the motion image. The analysis module is used to synchronously translate all coordinate points in the pre-stored theoretical marking path according to the position offset to generate a corrected marking path. The association module is used to count pulses based on the synchronization pulse signal and compare the obtained real-time pulse count value with a preset marking trigger threshold. When the real-time pulse count value reaches the marking trigger threshold, the laser marking device is driven to perform marking operation on the target workpiece according to the corrected marking path to obtain marking information. The processing module is used to perform quality judgment on the target workpiece after marking based on the marking information. If the workpiece is judged to be unqualified, the unqualified workpiece is removed.
9. A collaborative control device for laser marking on a production line, characterized in that, include: Memory, used to store programs; A processor is used to execute the program to implement the various steps of the collaborative control method for laser marking on a production line as described in any one of claims 1-7.
10. A storage medium, characterized in that, The computer contains computer instructions for causing the computer to perform the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Multi-production-line laser marking control method, device and system and medium
CN115351430A
Laser marking method and system based on pulse control and storage medium
CN115815846A
Visual positioning laser marking method and system for object in motion state
CN116851929A
Laser engraving method and system for automatically correcting coordinates of galvanometer and camera
CN121042721A
Laser machining quality monitoring method and monitoring assembly, and machining device and storage medium
WO2024027198A1