An XY double-axis heat sealing position dynamic compensation method based on fly visual guidance
Patent Information
- Application Number
- CN202611157420.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-31
- Publication Date
- 2026-10-30
AI Technical Summary
[0008]软件层面的传输延迟无法满足超高速响应需求,现有方案在控制器与伺服之间的数据传输多依赖操作系统调度和标准通讯协议(如EtherCAT、EtherNET),响应延迟处于微秒至毫秒级
[0019]本申请实施例提供的一种基于飞拍视觉引导的XY双轴热封位置动态补偿方法,包括:响应于被封装工件到达CCD视场中心区域所产生的硬件触发信号,并基于该硬件触发信号同步锁存XY两轴伺服编码器的瞬时位置,记为第一实际位置;获取响应于所述硬件触发信号而曝光的图像帧,并读取经视觉检测所得的、被封装工件的圆角中心在像素域的位置偏差;将所述位置偏差代入预先确定的仿射变换矩阵,得到物理空间下的视觉偏差,所述仿射变换矩阵描述CCD像素坐标系与XY平台物理坐标系之间的线性映射关系;在完成物理空间下的视觉偏差计算后,读取当前时刻XY两轴伺服编码器的第二实际位置;根据XY两轴伺服编码器的第一实际位置和第二实际位置,计算XY运动平台已经实际发生的位移量,按照以下公式计算最终下发至伺服驱动器的补偿指令值:ΔX_cmd=ΔX_v-ΔX_m,ΔY_cmd=ΔY_v-ΔY_m;其中,(ΔX_v,ΔY_v)为物理空间下的视觉偏差,ΔX_m为X轴已经实际发生的位移量,ΔY_m为Y轴已经实际发生的位移量;控制器将补偿指令值封装为紧凑指令帧,所述紧凑指令帧包含轴号、补偿脉冲数、时间戳、CRC校验码,通过并行总线将指令帧直接写入伺服驱动器的指令缓存寄存器,以使伺服驱动器在接收到所述紧凑指令帧后的首个时钟周期内,将该补偿指令值累加到位置环误差累加器中,执行位置修正,所述时钟周期是伺服驱动器内部晶体振荡器发出的基础脉冲信号。本申请的方法能够实现对工件位置的精准补偿。
Smart Images

Figure CN123010862A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of position compensation technology, specifically to a dynamic compensation method for XY dual-axis heat sealing position based on aerial photography vision guidance. Background Technology
[0002] With the continuous improvement of industrial automation, CCD (Charge Coupled Device) vision guidance technology has been widely used in heat-sealing packaging equipment. A CCD camera typically includes a CCD sensor, drive circuit, signal processing circuit, interface circuit, housing, and mechanical-optical interface. In scenarios such as rounded corner heat-sealing machines, the vision system is usually responsible for detecting positional deviations of the workpiece being packaged (such as packaging bags or films) and guiding motion actuators (such as XY platforms or heat-sealing blades) to perform positional compensation, ensuring precise alignment of the sealing trajectory with the workpiece contour. Currently, existing technologies involving CCD vision-guided heat-sealing positioning and compensation can be mainly categorized as follows: Static compensation schemes based on CCD vision positioning perform image detection and position correction while the workpiece is stationary. For example, CCD vision positioning is used in turret-type blue film taping equipment, combined with an XYθ platform for position compensation to improve mounting accuracy. Another example is the heat-sealing moving mechanism patent of Tianzheng Machinery's bag-making machine, which compensates for the film's positional deviation when the CCD vision lens assembly detects a deviation in the markings on the film, thereby achieving precise heat sealing. Furthermore, in the semiconductor packaging field, a dual-CCD vision system combined with a UVW motion platform can achieve micron-level alignment. The system decomposes the positional deviation into X / Y axis translation and rotation angle, which the motion platform compensates for in real time based on the calculation results. A common feature of these schemes is that the workpiece is stationary or quasi-stationary during image capture and compensation execution, eliminating the time lag caused by workpiece movement between vision acquisition, deviation calculation, and compensation execution.
[0003] Continuous compensation schemes based on photoelectric sensors or mark tracking do not rely on CCD vision but instead use photoelectric sensors or printed marks for positioning. For example, a printing and packaging series controller automatically controls the output of the compensation motor based on the relative positional relationship between the detection input signal from the photoelectric eye and the signal from the heat-sealing and cutting knife sensor, using a fuzzy logic control algorithm to solve for the optimal control quantity. This type of scheme has a fast response speed, but its positioning accuracy is limited by the sensor accuracy, making it difficult to meet the alignment requirements of complex contours such as rounded corners.
[0004] Fly-vision visual positioning and compensation solutions refer to a visual acquisition method that captures images of a workpiece during continuous movement without interruption. Existing fly-vision related technologies include: a servo fly-vision control method that addresses accuracy issues through FPGA timers and delay compensation mechanisms; a dynamic fly-vision high-precision positioning method based on Mark point marking, which uses real-time image acquisition and performs image calibration and positioning compensation by calculating Mark point position deviations; a fly-vision compensation method that corrects the image information of the fly-vision workpiece and uses the corrected image information as a reference for execution; and Elmo's fly-vision solution, which proposes completing a closed loop of "taking a picture - calculating correction - executing a new position" during high-speed movement. The representative technical features of this type of solution are: the workpiece is photographed during movement, the vision system calculates the deviation after taking the picture, and the controller issues compensation commands based on the deviation.
[0005] Based on the above analysis, these existing technologies share the following common shortcomings: The time lag blind spot causes misalignment of the compensation target. In aerial photography scenarios, there is an unavoidable time delay from when the CCD triggers the image capture (T0) to when the controller actually sends the compensation command to the servo for execution (T1) (image transmission, AOI (Automated Optical Inspection) calculation, bus communication, etc.). During this time, the packaged workpiece moves continuously with the conveyor belt or motion platform. Existing technologies directly use the visual deviation measured at T0 as the compensation command for T1, without considering the actual displacement of the workpiece during the T0-T1 time period, resulting in the compensation position lagging behind the actual position of the workpiece. This deviation worsens linearly with increasing conveyor speed.
[0006] The lack of a precise latching mechanism for the position at the moment of image capture means that existing solutions typically only record the trigger signal or image frame number when the image is captured, without performing hardware-level precise latching of the servo encoder position at the moment of image capture. This results in a lack of precise starting reference points when subsequently calculating "workpiece displacement," requiring estimation or approximation, which limits accuracy.
[0007] The compensation calculation does not fully utilize real-time encoder feedback. Existing solutions mainly rely on visual deviation and preset compensation parameters, failing to incorporate the "current real-time encoder position" as a dynamic variable into the compensation formula. The compensation amount is a fixed "open-loop" value, rather than a "closed-loop" value that dynamically adjusts with the actual position of the workpiece.
[0008] Software-level transmission latency cannot meet the requirements of ultra-high-speed response. Existing solutions rely heavily on operating system scheduling and standard communication protocols (such as EtherCAT and EtherNET) for data transmission between the controller and the servo, resulting in response latency in the microsecond to millisecond range. When the system requires nanosecond-level command issuance, the existing software architecture exhibits significant bottlenecks. Summary of the Invention
[0009] To achieve precise compensation of workpiece position, in a first aspect, embodiments of this application provide a method for dynamic compensation of XY dual-axis heat sealing position based on aerial photography vision guidance, the method comprising: In response to the hardware trigger signal generated when the packaged workpiece reaches the center area of the CCD field of view, the instantaneous position of the XY two-axis servo encoder is synchronously latched based on the hardware trigger signal and recorded as the first actual position. Acquire the image frame exposed in response to the hardware trigger signal, and read the position deviation of the rounded corner center of the packaged workpiece in the pixel domain obtained by visual inspection; Substituting the positional deviation into a predetermined affine transformation matrix yields the visual deviation in physical space. The affine transformation matrix describes the linear mapping relationship between the CCD pixel coordinate system and the XY platform physical coordinate system. After completing the visual deviation calculation in physical space, read the second actual position of the XY two-axis servo encoder at the current moment; Based on the first and second actual positions of the XY two-axis servo encoders, the actual displacement of the XY motion platform is calculated, and the final compensation command value sent to the servo drive is calculated according to the following formula: ΔX_cmd=ΔX_v-ΔX_m, ΔY_cmd=ΔY_v-ΔY_m; Where (ΔX_v, ΔY_v) is the visual deviation in physical space, ΔX_m is the actual displacement that has occurred along the X-axis, and ΔY_m is the actual displacement that has occurred along the Y-axis; The controller encapsulates the compensation command value into a compact command frame, which includes the axis number, the number of compensation pulses, the timestamp, and the CRC check code. The command frame is directly written into the command buffer register of the servo driver through the parallel bus, so that the servo driver accumulates the compensation command value into the position loop error accumulator within the first clock cycle after receiving the compact command frame or at the beginning of multiple servo control cycles, and performs position correction.
[0010] In one possible implementation, the step of responding to a hardware trigger signal generated when the packaged workpiece reaches the center region of the CCD field of view, and synchronously latching the instantaneous position of the XY-axis servo encoder based on the hardware trigger signal, and recording it as the first actual position, includes: When the packaged workpiece moves with the conveyor belt to the center area of the CCD field of view, the controller sends a camera hardware trigger signal. The trigger signal is simultaneously transmitted to the position latch input ports of the X-axis servo driver and the Y-axis servo driver through the hardware splitter. This allows the internal hardware circuits of the X-axis servo driver and the Y-axis servo driver to latch the current value of the encoder count register into a dedicated latch register when they receive the rising edge of the latch signal. The current value is then sent back to the controller via EtherCAT or PCIe. The current value is obtained as the first actual position of the XY two-axis servo encoder.
[0011] In one possible implementation, the affine transformation matrix is determined as follows: Control the XY motion platform to move sequentially to at least 9 feature points on the calibration board, and record the pixel coordinates (u, v) and physical coordinates (X, Y) of each feature point; Based on the pixel coordinates (u, v) and physical coordinates (X, Y) of each feature point, an affine transformation matrix is fitted using the least squares method to establish a linear mapping relationship between the CCD pixel coordinate system and the XY platform physical coordinate system; the affine transformation matrix includes the X-axis scaling factor, the Y-axis scaling factor, and the orthogonality correction factor between the two axes.
[0012] In one possible implementation, substituting the positional deviation into a predetermined affine transformation matrix to obtain the visual deviation in physical space includes: Substituting the positional deviations (Δu, Δv) into a predetermined affine transformation matrix, the visual deviation of the positional deviation in physical space is obtained using the following formula: ΔX_v=a.Δu+b.Δv, ΔY_v=c.Δu+d.Δv; Where a is the X-axis scaling factor, d is the Y-axis scaling factor, and b and c are the orthogonality correction factors between the two axes.
[0013] In one possible implementation, the method further includes: Determine whether the compensation command value exceeds the preset safety threshold; If the compensation command value does not exceed the preset safety threshold, the compensation command value is accumulated into the position loop error accumulator all at once; If the compensation command value exceeds the preset safety threshold, the compensation command value is split into multiple micro-compensation values, and these multiple micro-compensation values are continuously accumulated into the position loop error accumulator. A deviation over-limit warning signal is then sent to the host computer to notify the operator to check the materials.
[0014] In one possible implementation, the step of accumulating the compensation command value into a position loop error accumulator within the first clock cycle after receiving the compact command frame or at the start of multiple servo control cycles, and performing position correction, includes: In the case where the compensation command value is accumulated into the position loop error accumulator all at once, the compensation command value is accumulated into the position loop error accumulator in the first clock cycle after receiving the compact command frame. When the servo control cycle arrives, the speed command and torque current command are calculated according to the compensation command value in the accumulator. The motor is driven to rotate according to the calculated speed command and torque current command to achieve position correction. For cases where multiple micro-compensation values are continuously accumulated into the position loop error accumulator, after receiving the compact command frame, at the start of multiple servo control cycles, multiple micro-compensation values are continuously accumulated into the position loop error accumulator. In each servo control cycle, speed commands and torque current commands are calculated based on the micro-compensation values in the accumulator. The motor is then driven to rotate according to the calculated speed commands and torque current commands to achieve position correction.
[0015] In one possible implementation, the controller employs an ARM+FPGA heterogeneous architecture.
[0016] Secondly, embodiments of this application provide an XY dual-axis heat-sealing position dynamic compensation device based on aerial photography vision guidance, the device comprising: The first actual position acquisition module is used to respond to the hardware trigger signal generated when the packaged workpiece reaches the center area of the CCD field of view, and synchronously latch the instantaneous position of the XY two-axis servo encoder based on the hardware trigger signal, which is recorded as the first actual position. The position deviation acquisition module is used to acquire the image frame exposed in response to the hardware trigger signal, and read the position deviation of the rounded corner center of the packaged workpiece in the pixel domain obtained by visual inspection. The visual deviation acquisition module is used to substitute the positional deviation into a predetermined affine transformation matrix to obtain the visual deviation in physical space. The affine transformation matrix describes the linear mapping relationship between the CCD pixel coordinate system and the XY platform physical coordinate system. The second actual position acquisition module is used to read the second actual position of the XY two-axis servo encoder at the current moment after completing the visual deviation calculation in physical space. The compensation command value acquisition module is used to calculate the actual displacement of the XY motion platform based on the first and second actual positions of the XY two-axis servo encoders, and calculate the final compensation command value sent to the servo driver according to the following formula: ΔX_cmd=ΔX_v-ΔX_m, ΔY_cmd=ΔY_v-ΔY_m; where (ΔX_v, ΔY_v) is the visual deviation in physical space, ΔX_m is the actual displacement of the X-axis, and ΔY_m is the actual displacement of the Y-axis; The writing module is used by the controller to encapsulate the compensation command value into a compact command frame. The compact command frame includes the axis number, the number of compensation pulses, the timestamp, and the CRC check code. The command frame is directly written into the command buffer register of the servo driver through the parallel bus, so that the servo driver accumulates the compensation command value into the position loop error accumulator within the first clock cycle after receiving the compact command frame or at the beginning of multiple servo control cycles, and performs position correction.
[0017] In one possible implementation, the device further includes: The judgment module is used to determine whether the compensation command value exceeds the preset safety threshold; The safety module is used to accumulate the compensation instruction value into the position loop error accumulator all at once when the compensation instruction value does not exceed the preset safety threshold; when the compensation instruction value exceeds the preset safety threshold, the compensation instruction value is split into multiple micro-compensation values, and the multiple micro-compensation values are continuously accumulated into the position loop error accumulator, and a deviation over-limit warning signal is sent to the host computer to notify the operator to check the materials.
[0018] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, is any of the aforementioned XY dual-axis heat-sealing position dynamic compensation methods based on aerial photography vision guidance.
[0019] This application provides a method for dynamic compensation of XY dual-axis heat sealing position based on aerial photography vision guidance, comprising: responding to a hardware trigger signal generated when the packaged workpiece reaches the center region of the CCD field of view, and synchronously latching the instantaneous position of the XY dual-axis servo encoder based on the hardware trigger signal, denoted as the first actual position; acquiring an image frame exposed in response to the hardware trigger signal, and reading the position deviation of the rounded corner center of the packaged workpiece in the pixel domain obtained by visual detection; substituting the position deviation into a predetermined affine transformation matrix to obtain the visual deviation in physical space, wherein the affine transformation matrix describes the linear mapping relationship between the CCD pixel coordinate system and the XY platform physical coordinate system; after completing the visual deviation calculation in physical space, reading the second actual position of the XY dual-axis servo encoder at the current moment; and calculating the position deviation based on the first and second actual positions of the XY dual-axis servo encoder. The actual displacement of the XY motion platform is calculated, and the final compensation command value sent to the servo driver is calculated according to the following formulas: ΔX_cmd = ΔX_v - ΔX_m, ΔY_cmd = ΔY_v - ΔY_m; where (ΔX_v, ΔY_v) is the visual deviation in physical space, ΔX_m is the actual displacement of the X-axis, and ΔY_m is the actual displacement of the Y-axis. The controller encapsulates the compensation command value into a compact command frame, which includes the axis number, the number of compensation pulses, a timestamp, and a CRC checksum. The command frame is directly written into the instruction buffer register of the servo driver through a parallel bus, so that the servo driver accumulates the compensation command value into the position loop error accumulator within the first clock cycle after receiving the compact command frame, and performs position correction. The clock cycle is the basic pulse signal emitted by the crystal oscillator inside the servo driver. The method of this application can achieve accurate compensation of the workpiece position. Attached Figure Description
[0020] Figure 1 A schematic flowchart of a method for dynamic compensation of XY dual-axis heat sealing position based on aerial photography vision guidance is provided for an embodiment of this application. Figure 2 This is a schematic diagram of a dynamic compensation device for XY dual-axis heat sealing position based on aerial photography vision guidance, provided in an embodiment of this application. Detailed Implementation
[0021] Firstly, see [the following] Figure 1 This application provides an embodiment of a method for dynamic compensation of XY dual-axis heat sealing position based on aerial photography vision guidance. The method includes: S101, responds to the hardware trigger signal generated when the packaged workpiece reaches the center area of the CCD field of view, and synchronously latches the instantaneous position of the XY two-axis servo encoder based on the hardware trigger signal, which is recorded as the first actual position.
[0022] When the packaged workpiece moves with the conveyor belt to the center area of the CCD field of view, the controller sends a camera hardware trigger signal. The trigger signal is simultaneously transmitted to the position latch input ports of the X-axis servo driver and the Y-axis servo driver through the hardware splitter. This allows the internal hardware circuits of the X-axis servo driver and the Y-axis servo driver to latch the current value of the encoder count register into a dedicated latch register when they receive the rising edge of the latch signal. The current value is then sent back to the controller via EtherCAT or PCIe. The current value is obtained as the first actual position of the XY two-axis servo encoder.
[0023] The central region of the CCD field of view is the imaging area on the CCD sensor target surface that coincides with or is closest to the optical axis of the optical system. In an optical imaging system, this region is usually the part with the best image quality and the most stable performance. At the same moment the CCD triggers the image capture, the actual positions (X0, Y0) of the X and Y axis servo encoders are synchronously latched through hardware split signals, providing a precise starting reference point for subsequent differential calculations.
[0024] When the packaged workpiece moves with the conveyor belt to the center of the CCD's field of view, the controller sends a camera hardware trigger signal. Simultaneously, this trigger signal is transmitted via a hardware splitter to the position latch input ports of the X-axis and Y-axis servo drives. Upon receiving the rising edge of the latch signal, the servo drive's internal hardware circuitry immediately latches the current encoder count register value into a dedicated latch register and transmits it back to the controller via a high-speed synchronization bus (such as EtherCAT or PCIe). This value is recorded as the first actual position (X0, Y0), and this position data is software-bound to the corresponding frame image (with an absolute timestamp T0).
[0025] S102, acquire the image frame exposed in response to the hardware trigger signal, and read the position deviation of the rounded corner center of the packaged workpiece in the pixel domain obtained by visual inspection.
[0026] The controller reads the output of the frame image from the AOI vision processing module, namely the positional deviation (Δu, Δv) of the rounded corner center in the pixel domain.
[0027] S103, Substitute the positional deviation into a predetermined affine transformation matrix to obtain the visual deviation in physical space.
[0028] The affine transformation matrix describes the linear mapping relationship between the CCD pixel coordinate system and the XY platform physical coordinate system. Substituting the positional deviation into the predetermined affine transformation matrix, the physical spatial deviation (ΔX_v, ΔY_v) based on time T0 is calculated.
[0029] The affine transformation matrix is determined in the following way: Control the XY motion platform to move sequentially to at least 9 feature points on the calibration board, and record the pixel coordinates (u, v) and physical coordinates (X, Y) of each feature point; Based on the pixel coordinates (u, v) and physical coordinates (X, Y) of each feature point, an affine transformation matrix is fitted using the least squares method to establish a linear mapping relationship between the CCD pixel coordinate system and the XY platform physical coordinate system; the affine transformation matrix includes the X-axis scaling factor, the Y-axis scaling factor, and the orthogonality correction factor between the two axes.
[0030] During the equipment debugging phase, the XY motion platform is controlled to sequentially move to at least 9 feature points (uniformly distributed in 3×3) on the calibration plate. The pixel coordinates (u, v) and physical coordinates (X, Y) of each feature point are recorded. An affine transformation matrix is fitted using the least squares method to establish a linear mapping relationship between the CCD pixel coordinate system and the XY platform physical coordinate system (unit: mm or pulse count). This matrix includes X-axis scaling coefficients, Y-axis scaling coefficients, and orthogonality correction coefficients between the two axes. The pixel deviations (Δu, Δv) of the subsequent visual output can be directly transformed using this matrix to obtain the visual deviation (ΔX_v, ΔY_v) in physical space.
[0031] Specifically, this can include substituting the positional deviations (Δu, Δv) into a predetermined affine transformation matrix to obtain the visual deviation of the positional deviations in physical space using the following formula: ΔX_v=a.Δu+b.Δv, ΔY_v=c.Δu+d.Δv; Where a is the X-axis scaling factor, d is the Y-axis scaling factor, and b and c are the orthogonality correction factors between the two axes.
[0032] The orthogonality correction coefficient between the two axes is used to correct errors caused by the X and Y axes not being perfectly perpendicular (90°) in mechanical installation. In ideal mechanical design, the X-axis guide rail and the Y-axis guide rail must be strictly perpendicular (orthogonal). However, in actual machining and assembly, there will always be a slight angular deviation (such as an included angle of 89.98° or 90.02°). If this deviation is ignored, when trying to make the heat sealing tool move in a straight line in the X direction, it will actually move at a slight angle, resulting in inaccurate fillet alignment. If the X and Y axes are perfectly perpendicular, the orthogonality correction coefficient between the two axes will approach 0; as long as there is a slight skew, the orthogonality correction coefficient between the two axes will automatically generate a small value, compensating for the pixel offset in the Y direction into the X command, ensuring that the trajectory of the machine is an absolutely straight line and a perfect circle in physical space.
[0033] S104, after completing the visual deviation calculation in physical space, reads the second actual position of the XY two-axis servo encoder at the current moment.
[0034] When the controller completes the calculation in step S103 and is ready to issue the compensation command, it reads the second actual position (X1, Y1) of the XY two-axis servo encoder at the current time (T1). The method for obtaining the second actual position is the same as that for the first actual position.
[0035] S105, based on the first and second actual positions of the XY two-axis servo encoders, calculate the actual displacement of the XY motion platform, and calculate the final compensation command value sent to the servo drive according to the following formula: ΔX_cmd=ΔX_v-ΔX_m, ΔY_cmd=ΔY_v-ΔY_m.
[0036] Where (ΔX_v, ΔY_v) represents the visual deviation in physical space, ΔX_m represents the actual displacement that has occurred along the X-axis, and ΔY_m represents the actual displacement that has occurred along the Y-axis.
[0037] Calculate the actual displacement of the XY motion platform from the time of taking the picture T0 to the current time T1: ΔX_m=X1-X0, ΔY_m=Y1-Y0.
[0038] ΔX_cmd = ΔX_v - ΔX_m, ΔY_cmd = ΔY_v - ΔY_m represent the true deviation between the current actual position of the workpiece and the visual photograph, which is equal to the old deviation measured visually minus the distance the workpiece has traveled during this time. After this differential calculation, regardless of the fluctuation of system delay, the compensation value always accurately points to the "current position" of the workpiece. At the moment of preparing to issue the compensation command, the current encoder position (X1, Y1) is read, and the final compensation value is calculated according to the above formula, accurately deducting the displacement that the workpiece has traveled after taking the picture, so that the compensation command always points to the "current actual position" of the workpiece. Incorporating real-time encoder feedback into the closed-loop compensation calculation: the compensation amount is dynamically updated with the actual position of the workpiece, without relying on delay statistics or self-learning approximation, fundamentally eliminating the time difference blind spot.
[0039] S106, the controller encapsulates the compensation instruction value into a compact instruction frame and writes the instruction frame directly into the instruction cache register of the servo driver through the parallel bus, so that the servo driver accumulates the compensation instruction value into the position loop error accumulator within the first clock cycle after receiving the compact instruction frame or at the beginning of multiple servo control cycles, and performs position correction.
[0040] The compact instruction frame includes the axis number, the number of compensation pulses, the timestamp, and the CRC checksum.
[0041] In one example, the method further includes: Determine whether the compensation command value exceeds the preset safety threshold; If the compensation command value does not exceed the preset safety threshold, the compensation command value is accumulated into the position loop error accumulator all at once; If the compensation command value exceeds the preset safety threshold, the compensation command value is split into multiple micro-compensation values, and these multiple micro-compensation values are continuously accumulated into the position loop error accumulator. A deviation over-limit warning signal is then sent to the host computer to notify the operator to check the materials.
[0042] If the calculated compensation amount is large, and the motor rushes forward to make up the difference in one go, two results will occur: mechanical impact, damaging the XY platform; and sealing wrinkles. Therefore, this application presets a safety threshold (±T_max, for example, ±0.50mm). It then determines whether both |ΔX_cmd| and |ΔY_cmd| are ≤T_max.
[0043] Case 1 (Normal): ΔX_cmd and ΔY_cmd are superimposed on the current position target instruction of the servo driver at once, and a fast correction is performed.
[0044] Case 2 (Over-limit): Divide ΔX_cmd and ΔY_cmd into N micro-compensation quantities (e.g., N=5) proportionally, output them sequentially in the subsequent N control cycles, and send a "deviation over-limit warning" signal to the host computer to prompt the operator to check the materials.
[0045] In one example, for the case where the compensation command value is accumulated into the position loop error accumulator all at once, in the first clock cycle after receiving the compact command frame, the compensation command value is accumulated into the position loop error accumulator. When the servo control cycle arrives, the speed command and torque current command are calculated based on the compensation command value in the accumulator. The motor is driven to rotate according to the calculated speed command and torque current command to achieve position correction. For cases where multiple micro-compensation values are continuously accumulated into the position loop error accumulator, after receiving the compact command frame, at the start of multiple servo control cycles, multiple micro-compensation values are continuously accumulated into the position loop error accumulator. In each servo control cycle, speed commands and torque current commands are calculated based on the micro-compensation values in the accumulator. The motor is then driven to rotate according to the calculated speed commands and torque current commands to achieve position correction.
[0046] After the compensation command value is accumulated in the position loop error accumulator, when position compensation begins, a speed command is first generated based on this error value to tell the motor how fast it should rotate to eliminate the position deviation. A torque command is then generated based on the speed command and the speed error of the current speed to tell the motor how much force it should exert to reach the target speed. Based on the torque command and the current error of the current, the final pulse-width modulation (PWM) duty cycle is calculated, which directly controls the inverter switch to drive the motor to rotate.
[0047] The clock cycle is the fundamental pulse signal generated by the crystal oscillator inside the servo driver. The servo control cycle is generally much larger than the clock cycle; for example, the clock cycle can be 5 ns, while the servo control cycle is 200 μs, or 200,000 ns.
[0048] The controller employs an ARM+FPGA heterogeneous architecture. The ARM processor calculates the compensation instruction value and encapsulates it into a compact instruction frame (containing axis number, compensation pulse count, timestamp, and CRC (Cyclic Redundancy Check) code). The FPGA bypasses the operating system kernel and TCP / IP protocol stack, directly writing the instruction frame into the servo driver's instruction cache register via a parallel bus. The physical delay from "calculation complete" to "writing to servo register" for a single instruction is controlled within 5ns. The servo driver accumulates the compensation value into the position loop error accumulator in the next clock cycle. This nanosecond-level instruction injection method, using FPGA hardware direct writing to the servo register, bypasses the operating system scheduling and protocol stack, achieving ultra-low latency instruction issuance at the 5ns level.
[0049] This application provides a method for dynamic compensation of XY dual-axis heat sealing position based on aerial photography vision guidance, comprising: responding to a hardware trigger signal generated when the packaged workpiece reaches the center region of the CCD field of view, and synchronously latching the instantaneous position of the XY dual-axis servo encoder based on the hardware trigger signal, denoted as the first actual position; acquiring an image frame exposed in response to the hardware trigger signal, and reading the position deviation of the rounded corner center of the packaged workpiece in the pixel domain obtained by visual detection; substituting the position deviation into a predetermined affine transformation matrix to obtain the visual deviation in physical space, wherein the affine transformation matrix describes the linear mapping relationship between the CCD pixel coordinate system and the XY platform physical coordinate system; after completing the visual deviation calculation in physical space, reading the second actual position of the XY dual-axis servo encoder at the current moment; and calculating the position deviation based on the first and second actual positions of the XY dual-axis servo encoder. The actual displacement of the XY motion platform is calculated, and the final compensation command value sent to the servo driver is calculated according to the following formulas: ΔX_cmd = ΔX_v - ΔX_m, ΔY_cmd = ΔY_v - ΔY_m; where (ΔX_v, ΔY_v) is the visual deviation in physical space, ΔX_m is the actual displacement of the X-axis, and ΔY_m is the actual displacement of the Y-axis. The controller encapsulates the compensation command value into a compact command frame, which includes the axis number, the number of compensation pulses, a timestamp, and a CRC checksum. The command frame is directly written into the instruction buffer register of the servo driver through a parallel bus, so that the servo driver accumulates the compensation command value into the position loop error accumulator within the first clock cycle after receiving the compact command frame, and performs position correction. The clock cycle is the basic pulse signal emitted by the crystal oscillator inside the servo driver. The method of this application can achieve accurate compensation of the workpiece position.
[0050] Compared with existing technologies, the advantages of this application are reflected in the following aspects: By completely eliminating the blind spot caused by the time difference in aerial photography, differential compensation is achieved through the introduction of "position latching at the moment of image capture" and "current real-time position feedback," which in principle eliminates the time delay between visual acquisition and command execution. Regardless of fluctuations in conveyor speed, the compensation command always points to the current actual position of the workpiece, resulting in a significant improvement in XY corner alignment accuracy.
[0051] Pure XY decoupling involves extremely low computational load. This solution does not involve complex rotation matrix or trigonometric function operations, but only simple addition and subtraction. The calculation latency is on the nanosecond level, perfectly adapting to the 5ns ultra-high-speed response requirement, without adding extra computational burden to the controller.
[0052] The graded safety protection enhances equipment stability. When excessive material placement deviation is detected, the large compensation amount is automatically broken down into multiple slow compensation steps. This avoids mechanical impact and corner sealing wrinkles caused by a single large stroke movement, and also prevents equipment shutdown, thus balancing accuracy and safety.
[0053] Breaking through the bottlenecks of traditional software communication, a solution of direct writing servo registers in FPGA hardware, combined with a compact instruction frame design, was adopted to achieve instruction issuance at the 5ns level, completely eliminating the millisecond / microsecond level uncertain delays caused by operating system scheduling and Ethernet protocol stack.
[0054] Secondly, see Figure 2 This application provides an XY dual-axis heat-sealing position dynamic compensation device based on aerial photography vision guidance, the device comprising: The first actual position acquisition module 101 is used to respond to the hardware trigger signal generated when the packaged workpiece reaches the center area of the CCD field of view, and synchronously latch the instantaneous position of the XY two-axis servo encoder based on the hardware trigger signal, which is recorded as the first actual position. The position deviation acquisition module 102 is used to acquire the image frame exposed in response to the hardware trigger signal, and read the position deviation of the rounded corner center of the packaged workpiece in the pixel domain obtained by visual inspection. The visual deviation acquisition module 103 is used to substitute the position deviation into a predetermined affine transformation matrix to obtain the visual deviation in physical space. The affine transformation matrix describes the linear mapping relationship between the CCD pixel coordinate system and the XY platform physical coordinate system. The second actual position acquisition module 104 is used to read the second actual position of the XY two-axis servo encoder at the current moment after completing the visual deviation calculation in the physical space. The compensation command value acquisition module 105 is used to calculate the actual displacement of the XY motion platform based on the first and second actual positions of the XY two-axis servo encoders, and calculate the final compensation command value sent to the servo drive according to the following formula: ΔX_cmd=ΔX_v-ΔX_m, ΔY_cmd=ΔY_v-ΔY_m; where (ΔX_v, ΔY_v) is the visual deviation in physical space, ΔX_m is the actual displacement of the X-axis, and ΔY_m is the actual displacement of the Y-axis; The writing module 106 is used by the controller to encapsulate the compensation instruction value into a compact instruction frame. The compact instruction frame includes the axis number, the number of compensation pulses, the timestamp, and the CRC check code. The instruction frame is directly written into the instruction cache register of the servo driver through the parallel bus, so that the servo driver accumulates the compensation instruction value into the position loop error accumulator within the first clock cycle after receiving the compact instruction frame or at the beginning of multiple servo control cycles, and performs position correction.
[0055] In one possible implementation, the device further includes: The judgment module is used to determine whether the compensation command value exceeds the preset safety threshold; The safety module is used to accumulate the compensation instruction value into the position loop error accumulator all at once when the compensation instruction value does not exceed the preset safety threshold; when the compensation instruction value exceeds the preset safety threshold, the compensation instruction value is split into multiple micro-compensation values, and the multiple micro-compensation values are continuously accumulated into the position loop error accumulator, and a deviation over-limit warning signal is sent to the host computer to notify the operator to check the materials.
[0056] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the above-mentioned XY dual-axis heat-sealing position dynamic compensation methods based on aerial photography vision guidance.
[0057] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0058] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0059] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device embodiments are described simply because they are similar to the method embodiments; relevant parts can be referred to the descriptions of the method embodiments.
[0060] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes to the above embodiments within the scope of the present invention without departing from the principles and spirit of the present invention.
Claims
1. A method for dynamic compensation of XY dual-axis heat sealing position based on aerial photography vision guidance, characterized in that, The method includes: In response to the hardware trigger signal generated when the packaged workpiece reaches the center area of the CCD field of view, the instantaneous position of the XY two-axis servo encoder is synchronously latched based on the hardware trigger signal and recorded as the first actual position. Acquire the image frame exposed in response to the hardware trigger signal, and read the position deviation of the rounded corner center of the packaged workpiece in the pixel domain obtained by visual inspection; Substituting the positional deviation into a predetermined affine transformation matrix yields the visual deviation in physical space. The affine transformation matrix describes the linear mapping relationship between the CCD pixel coordinate system and the XY platform physical coordinate system. After completing the visual deviation calculation in physical space, read the second actual position of the XY two-axis servo encoder at the current moment; Based on the first and second actual positions of the XY two-axis servo encoders, the actual displacement of the XY motion platform is calculated, and the final compensation command value sent to the servo drive is calculated according to the following formula: ΔX_cmd=ΔX_v-ΔX_m, ΔY_cmd=ΔY_v-ΔY_m; Where (ΔX_v, ΔY_v) is the visual deviation in physical space, ΔX_m is the actual displacement that has occurred along the X-axis, and ΔY_m is the actual displacement that has occurred along the Y-axis; The controller encapsulates the compensation command value into a compact command frame, which includes the axis number, the number of compensation pulses, the timestamp, and the CRC check code. The command frame is directly written into the command buffer register of the servo driver through the parallel bus, so that the servo driver accumulates the compensation command value into the position loop error accumulator within the first clock cycle after receiving the compact command frame or at the beginning of multiple servo control cycles, and performs position correction.
2. The method according to claim 1, characterized in that, The hardware trigger signal generated in response to the encapsulated workpiece reaching the center region of the CCD field of view, and the instantaneous position of the XY two-axis servo encoder synchronously latched based on the hardware trigger signal, denoted as the first actual position, includes: When the packaged workpiece moves with the conveyor belt to the center area of the CCD field of view, the controller sends a camera hardware trigger signal. The trigger signal is simultaneously transmitted to the position latch input ports of the X-axis servo driver and the Y-axis servo driver through the hardware splitter. This allows the internal hardware circuits of the X-axis servo driver and the Y-axis servo driver to latch the current value of the encoder count register into a dedicated latch register when they receive the rising edge of the latch signal. The current value is then sent back to the controller via EtherCAT or PCIe. The current value is obtained as the first actual position of the XY two-axis servo encoder.
3. The method according to claim 1, characterized in that, The affine transformation matrix is determined in the following way: Control the XY motion platform to move sequentially to at least 9 feature points on the calibration board, and record the pixel coordinates (u, v) and physical coordinates (X, Y) of each feature point; Based on the pixel coordinates (u, v) and physical coordinates (X, Y) of each feature point, an affine transformation matrix is fitted using the least squares method to establish a linear mapping relationship between the CCD pixel coordinate system and the XY platform physical coordinate system; the affine transformation matrix includes the X-axis scaling factor, the Y-axis scaling factor, and the orthogonality correction factor between the two axes.
4. The method according to claim 3, characterized in that, The step of substituting the positional deviation into a predetermined affine transformation matrix to obtain the visual deviation in physical space includes: Substituting the positional deviations (Δu, Δv) into a predetermined affine transformation matrix, the visual deviation of the positional deviation in physical space is obtained using the following formula: ΔX_v=a.Δu+b.Δv, ΔY_v=c.Δu+d.Δv; Where a is the X-axis scaling factor, d is the Y-axis scaling factor, and b and c are the orthogonality correction factors between the two axes.
5. The method according to claim 1, characterized in that, The method further includes: Determine whether the compensation command value exceeds the preset safety threshold; If the compensation command value does not exceed the preset safety threshold, the compensation command value is accumulated into the position loop error accumulator all at once; If the compensation command value exceeds the preset safety threshold, the compensation command value is split into multiple micro-compensation values, and these multiple micro-compensation values are continuously accumulated into the position loop error accumulator. A deviation over-limit warning signal is then sent to the host computer to notify the operator to check the materials.
6. The method according to claim 5, characterized in that, Within the first clock cycle after receiving the compact command frame or at the start of multiple servo control cycles, the compensation command value is accumulated into the position loop error accumulator to perform position correction, including: In the case where the compensation command value is accumulated into the position loop error accumulator all at once, the compensation command value is accumulated into the position loop error accumulator in the first clock cycle after receiving the compact command frame. When the servo control cycle arrives, the speed command and torque current command are calculated according to the compensation command value in the accumulator. The motor is driven to rotate according to the calculated speed command and torque current command to achieve position correction. For cases where multiple micro-compensation values are continuously accumulated into the position loop error accumulator, after receiving the compact command frame, at the start of multiple servo control cycles, multiple micro-compensation values are continuously accumulated into the position loop error accumulator. In each servo control cycle, speed commands and torque current commands are calculated based on the micro-compensation values in the accumulator. The motor is then driven to rotate according to the calculated speed commands and torque current commands to achieve position correction.
7. The method according to claim 1, characterized in that, The controller adopts an ARM+FPGA heterogeneous architecture.
8. A dynamic compensation device for XY dual-axis heat sealing position based on aerial photography vision guidance, characterized in that, The device includes: The first actual position acquisition module is used to respond to the hardware trigger signal generated when the packaged workpiece reaches the center area of the CCD field of view, and synchronously latch the instantaneous position of the XY two-axis servo encoder based on the hardware trigger signal, which is recorded as the first actual position. The position deviation acquisition module is used to acquire the image frame exposed in response to the hardware trigger signal, and read the position deviation of the rounded corner center of the packaged workpiece in the pixel domain obtained by visual inspection. The visual deviation acquisition module is used to substitute the positional deviation into a predetermined affine transformation matrix to obtain the visual deviation in physical space. The affine transformation matrix describes the linear mapping relationship between the CCD pixel coordinate system and the XY platform physical coordinate system. The second actual position acquisition module is used to read the second actual position of the XY two-axis servo encoder at the current moment after completing the visual deviation calculation in physical space. The compensation command value acquisition module is used to calculate the actual displacement of the XY motion platform based on the first and second actual positions of the XY two-axis servo encoders, and calculate the final compensation command value sent to the servo driver according to the following formula: ΔX_cmd=ΔX_v-ΔX_m, ΔY_cmd=ΔY_v-ΔY_m; where (ΔX_v, ΔY_v) is the visual deviation in physical space, ΔX_m is the actual displacement of the X-axis, and ΔY_m is the actual displacement of the Y-axis; The writing module is used by the controller to encapsulate the compensation command value into a compact command frame. The compact command frame includes the axis number, the number of compensation pulses, the timestamp, and the CRC check code. The command frame is directly written into the command buffer register of the servo driver through the parallel bus, so that the servo driver accumulates the compensation command value into the position loop error accumulator within the first clock cycle after receiving the compact command frame or at the beginning of multiple servo control cycles, and performs position correction.
9. The apparatus according to claim 8, characterized in that, The device further includes: The judgment module is used to determine whether the compensation command value exceeds the preset safety threshold; The safety module is used to accumulate the compensation instruction value into the position loop error accumulator all at once when the compensation instruction value does not exceed the preset safety threshold; when the compensation instruction value exceeds the preset safety threshold, the compensation instruction value is split into multiple micro-compensation values, and the multiple micro-compensation values are continuously accumulated into the position loop error accumulator, and a deviation over-limit warning signal is sent to the host computer to notify the operator to check the materials.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-7.
