Cylindrical surface splicing seam self-adapting calibration and closed-loop alignment control method and system
Patent Information
- Application Number
- CN202611184747.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-06
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2046-08-06
AI Technical Summary
[0004]针对现有技术的不足,本申请提出了圆柱表面拼接缝自适应标定与闭环对齐控制方法和系统,能够精准提取拼接缝,消除了人工配置方向错误的风险,避免了高速连续旋转带来的急停超调问题,提高了系统的安全运行等级
1、本发明中,有效过滤了金属表面反光、油污、划痕等虚假边缘干扰,能够精准提取拼接缝,降低图像处理耗时;
Smart Images

Figure CN122691105B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial intelligent manufacturing technology, specifically to a method and system for adaptive calibration and closed-loop alignment control of splice seams on cylindrical surfaces. Background Technology
[0002] Industrial automation equipment has been widely used in industries such as new energy manufacturing, automotive parts processing, pressure vessel welding, and precision pipe manufacturing. In industrial production scenarios, surface treatment of cylindrical, tubular, and coiled workpieces is a very basic and core process.
[0003] In existing technologies, the global Canny edge detection algorithm is usually used to extract the seam edges, and then Hough transform is used for straight line fitting. However, this method is sensitive to the specular reflection, oil stains and scratches on the metal surface, which will produce a large number of false edges and the fitting deviation is large. At the same time, existing solutions mostly use high-speed continuous rotation to search for splicing seams, which has a large mechanical overshoot during emergency stops and lacks a fault safety mechanism. When the hardware link is abnormal, it will cause the workpiece to rotate endlessly. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this application proposes an adaptive calibration and closed-loop alignment control method and system for cylindrical surface splice seams. This method can accurately extract splice seams, eliminate the risk of incorrect orientation settings by manual configuration, avoid overshoot problems caused by sudden stops during high-speed continuous rotation, and improve the safety level of the system.
[0005] The following is the technical solution of the present invention: an adaptive calibration and closed-loop alignment control method for splicing seams on cylindrical surfaces, comprising the following steps: S1. Acquire the original image of the cylindrical surface, extract the high-precision pixel coordinates of the splicing seam, and output structured data containing the seam detection status, positioning coordinates and feature parameters. S2. Through trial motion and adaptive step multiplication mechanism, calculate the comprehensive conversion coefficient between pixel displacement and motor rotation steps, identify the correspondence between motor motion direction and pixel coordinate system, and generate local calibration parameters. S3. When the seam does not enter the camera's field of view, drive the motor to perform directional discrete stepping search based on calibration parameters, and perform safety self-diagnosis by limiting the maximum number of iterations. S4. After detecting the seam, calculate the effective conversion rate after perspective projection correction based on the current position of the seam, and generate discrete pulse commands in combination with the zero-step dead zone compensation mechanism to drive the motor to complete closed-loop iterative alignment. S5. After the alignment process is completed, a multi-dimensional quantitative evaluation report is generated, and the alignment results and status signals are output to the external control system through the industrial bus.
[0006] As a preferred embodiment of the present invention, S1 includes the following steps: S101. Acquire the original color image of the cylindrical surface and convert it to a grayscale image; S102. Locate the seam area using a lightweight target detection algorithm or template matching algorithm, and generate a local grayscale image; S103. Enhance the seam edge by using directional morphological operators, and under spatial geometric prior constraints, use dynamic programming algorithm to search for the optimal set of gray-scale cumulative energy representing the seam center; S104. Use a robust estimation algorithm to fit a straight line to the path point set and output the equation of the best fitted straight line. S105. Calculate the median of the abscissa of the path point set as the seam positioning coordinate, and output structured data containing the seam detection status, positioning coordinates and feature parameters.
[0007] As a preferred embodiment of the present invention, S2 includes the following steps: S201. Obtain the initial pixel position of the seam when the motor is stationary. If no valid seam is detected, throw an exception prompt to manually fine-tune the workpiece. S202, Send a positive pulse command for the calibrated number of steps to the motor driver, and wait for the preset stabilization time after the motor stops; S203. Acquire the stabilized image, obtain the new coordinates of the seam, and calculate the pixel displacement caused by the trial movement; S204. If the absolute value of the pixel displacement is less than the preset signal-to-noise ratio threshold, then reverse back to the initial state, and double the calibration step number before re-executing the trial movement until the threshold requirement is met or the maximum number of attempts is reached. S205. Calculate the comprehensive conversion coefficient based on the final calibration steps and pixel displacement, and determine the motion direction indicator factor by the displacement sign; S206. Write the comprehensive conversion coefficient and motion direction indicator factor into a local JSON file.
[0008] As a preferred embodiment of the present invention, S3 includes the following steps: S301. After system startup, it enters IDLE state and receives alignment task instructions. S302. Read the visual inspection results. If a valid seam is detected, proceed directly to the ALIGNING state. S303. If no valid seam is detected, enter the SEARCHING state and send an off-track advance pulse command according to the preset search step size and the calibrated direction indicator factor. S304. After each pulse is sent, an image is acquired and the seam is detected. If a seam is detected, the motor is stopped immediately and the motor enters the ALIGNING state. S305. If the cumulative number of search rounds exceeds the maximum number of iterations and no seam is detected, the system enters the ERROR state, triggers an audible and visual alarm, and sends a stop signal to the external PLC.
[0009] As a preferred embodiment of the present invention, S4 includes the following steps: S401. Calculate the pixel residual between the current seam column coordinates and the target column coordinates, where the target column coordinates are the image center column coordinates; S402. If the absolute value of the pixel residual is less than or equal to the alignment tolerance, then the alignment is complete and the system enters the ALIGNED state. S403. Calculate the effective conversion rate at the current position based on the current absolute column coordinates of the seam and the camera pixel focal length. S404. Calculate the ideal control steps based on the pixel residual and effective conversion rate, and multiply by the motion direction indicator factor to ensure the correct rotation direction; S405. Round the ideal number of steps to the actual number of discrete pulses sent. S406. If the calculated actual number of pulses is 0 and the absolute value of the pixel residual is still greater than the alignment tolerance, then a single-step pulse with the same sign as the residual is forcibly sent to break the deadlock state. S407: Send the actual number of pulses to the motor, wait for the motor to stabilize, and then return to S401 for the next iteration.
[0010] As a preferred embodiment of the present invention, in S103, each column of the ROI image is regarded as a node, the transfer cost between adjacent columns is determined by the gray-level gradient difference and the position offset, and the minimum cumulative energy path from the top to the bottom of the image is found by dynamic programming to obtain the path point set. In S104, the Huber M-estimator combined with the absolute deviation median algorithm is used to fit a straight line to the path point set. The Huber M-estimator is used to remove outliers, and the absolute deviation median algorithm is used to estimate the scale of the fitting residuals.
[0011] As a preferred embodiment of the present invention, in S205, the comprehensive conversion coefficient is calculated, and the expression is as follows: , In the above formula, For comprehensive conversion factors, For pixel displacement, This is the final number of steps; The motion direction indicator factor is calculated using the following expression: , when A positive pulse >0 causes the seam to move to the right in the image. ; when <0, a positive pulse drive moves the seam to the left in the image. .
[0012] As a preferred embodiment of the present invention, in S305, the expression for the maximum number of iterations is as follows: , In the above formula, The maximum number of iterations. This represents the total number of steps required for the stepper motor to complete one full revolution. This represents the step size for a single search.
[0013] In a preferred embodiment of the present invention, in S403, the effective conversion rate is calculated, and the expression is as follows: , In the above formula, The effective conversion rate for the current location. For comprehensive conversion factors, For the angle of view, The coordinates of the current seam column. The column coordinates of the image center. The focal length is the camera's pixel count.
[0014] An adaptive calibration and closed-loop alignment control system for cylindrical surface splice seams includes: The visual sensing module is used to acquire the original image of the cylindrical surface, extract the high-precision pixel coordinates of the splicing seam, and output structured data containing the seam detection status, positioning coordinates and feature parameters. The adaptive calibration module is used to calculate the comprehensive conversion coefficient between pixel displacement and motor rotation steps through trial motion and adaptive step multiplication mechanism, identify the correspondence between motor motion direction and pixel coordinate system, generate local calibration parameters, and is electrically connected to the vision sensing module. The finite state machine search module is used to drive the motor to perform directional discrete step search based on calibration parameters when the stitching seam does not enter the camera's field of view, and performs safety self-diagnosis by limiting the maximum number of iterations. It is electrically connected to the vision sensing module and the adaptive calibration module. The nonlinear closed-loop control module is used to calculate the effective conversion rate after perspective projection correction based on the current position of the seam after detecting the seam. It generates discrete pulse commands in combination with the zero-step dead zone compensation mechanism to drive the motor to complete the closed-loop iterative alignment. It is electrically connected to the vision sensing module, the adaptive calibration module and the finite state machine search module. The comprehensive evaluation output module is used to generate a multi-dimensional quantitative evaluation report after the alignment process is completed, and outputs the alignment results and status signals to the external control system through the industrial bus. It is electrically connected to the vision sensing module, adaptive calibration module, finite state machine search module and nonlinear closed-loop control module.
[0015] The beneficial effects of this invention are: 1. In this invention, false edge interference such as reflections, oil stains, and scratches on metal surfaces is effectively filtered out, and splicing seams can be accurately extracted, reducing image processing time; 2. In this invention, the comprehensive conversion coefficient and motion direction factor can be calculated through a single trial movement, eliminating the risk of incorrect direction configuration by manual configuration and lowering the threshold for equipment installation and production changeover maintenance; 3. In this invention, zero-step dead zone compensation forces single-step fine-tuning logic to break the deadlock state of traditional proportional control. Combined with reasonable tolerance constraints and smooth damping, the steady-state error of the system is eliminated, limit cycle oscillation is avoided, and alignment accuracy is improved. 4. In this invention, the problem of emergency stop overshoot caused by high-speed continuous rotation is avoided. At the same time, by setting a safety self-diagnosis logic with a maximum number of iterations, endless rotation when the hardware link is abnormal is effectively prevented, thereby improving the safety operation level of the system. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of the system of the present invention; Figure 2 This is a schematic diagram of the visual sensing module of the system of the present invention; Figure 3 This is a schematic diagram of the adaptive calibration module of the system of the present invention; Figure 4 This is a schematic diagram of the finite state machine search module of the system of the present invention; Figure 5 This is a schematic diagram of the nonlinear closed-loop control module of the system of the present invention; Figure 6 This is a schematic diagram of the system comprehensive evaluation output module of the present invention; Figure 7 This is a flowchart illustrating the framework of the present invention; Figure 8 This is a flowchart of the control state machine of the method of the present invention; Figure 9 This is a flowchart of the closed-loop pulse calculation method of the present invention; Figure 10 This is a flowchart of the method of the present invention; In the diagram: 1. Visual sensing module; 101. Image acquisition unit; 102. ROI localization unit; 103. Constraint optimization unit; 104. Robust fitting unit; 105. Interface output unit; 2. Adaptive calibration module; 201. Initial state acquisition unit; 202. Trial motion control unit; 203. Adaptive step doubling unit; 204. Calibration parameter calculation unit; 205. Calibration data persistence unit; 3. Finite state machine search module; 301. State management unit 302. Search step size configuration unit; 303. Directional search execution unit; 304. Safety self-diagnosis unit; 4. Nonlinear closed-loop control module; 401. Residual calculation unit; 402. Perspective projection correction unit; 403. Ideal step number calculation unit; 404. Discrete pulse conversion unit; 405. Zero-step dead zone compensation unit; 5. Comprehensive evaluation output module; 501. Data acquisition unit; 502. Quality evaluation unit; 503. Data storage unit; 504. Bus communication unit. Detailed Implementation
[0017] To make the technical problems solved by the present invention, the technical solutions adopted, and the technical effects achieved clearer, the technical solutions of the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] Example 1
[0019] like Figures 1 to 9 As shown, the adaptive calibration and closed-loop alignment control system for the splice seam of the cylindrical surface includes: The visual sensing module 1 is used to acquire the original image of the cylindrical surface, extract the high-precision pixel coordinates of the splicing seam, and output structured data containing the seam detection status, positioning coordinates and feature parameters. The adaptive calibration module 2 is used to calculate the comprehensive conversion coefficient between pixel displacement and motor rotation steps through trial movement and adaptive step multiplication mechanism, identify the correspondence between motor movement direction and pixel coordinate system, generate local calibration parameters, and is electrically connected to the vision sensing module 1. Finite state machine search module 3 is used to drive the motor to perform directional discrete step search based on calibration parameters when the splicing seam does not enter the camera's field of view, and to perform safety self-diagnosis by limiting the maximum number of iterations. It is electrically connected to vision sensing module 1 and adaptive calibration module 2. The nonlinear closed-loop control module 4 is used to calculate the effective conversion rate after perspective projection correction based on the current position of the seam after detecting the seam, and generate discrete pulse commands in combination with the zero-step dead zone compensation mechanism to drive the motor to complete the closed-loop iterative alignment. It is electrically connected to the vision sensing module 1, the adaptive calibration module 2 and the finite state machine search module 3. The comprehensive evaluation output module 5 is used to generate a multi-dimensional quantitative evaluation report after the alignment process is completed, and outputs the alignment results and status signals to the external control system through the industrial bus. It is electrically connected to the above modules.
[0020] In this embodiment, the visual sensing module 1 is used to acquire the original image of the cylindrical surface, extract the high-precision pixel coordinates of the splicing seam, and output structured data containing the seam detection status, positioning coordinates, and feature parameters. The visual sensing module 1 includes an image acquisition unit 101, an ROI positioning unit 102, a constraint optimization unit 103, a robust fitting unit 104, and an interface output unit 105.
[0021] Image acquisition unit 101 is used to acquire the original color image of the cylindrical surface and convert it into a grayscale image. It consists of an industrial camera, a fixed-focus lens, and a ring light source. The industrial camera is mounted directly above the cylindrical workpiece, the optical axis of the fixed-focus lens is perpendicular to the tangent direction of the cylindrical surface, and the ring light source provides diffuse illumination. Image acquisition unit 101 acquires the original color image of the cylindrical surface and converts it into an 8-bit grayscale image, which is then transmitted to ROI positioning unit 102.
[0022] The ROI localization unit 102 is used to locate the approximate area of the seam using a lightweight target detection algorithm or template matching algorithm, and generate a local grayscale image to mask the background and global interference. Employing a lightweight YOLOv5n target detection algorithm, after receiving the original grayscale image, the ROI localization unit 102 detects the approximate location of the seam, generates a rectangular ROI region, and outputs the local grayscale image of this region to the constraint optimization unit 103. ROI localization masks the background area and most of the global interference.
[0023] The constraint optimization unit 103 is used to enhance the seam edges within the ROI using directional morphological operators and, under spatial geometric prior constraints, employs a dynamic programming algorithm to search for the optimal set of path points representing the seam center based on cumulative gray-level energy. Each column of the ROI image is considered a node, and the transfer cost between adjacent columns is determined by the gray-level gradient difference and positional offset. Dynamic programming is used to find the path with the minimum cumulative energy from the top to the bottom of the image, thus obtaining the path point set. .
[0024] Robust fitting unit 104 is used to fit a straight line to the path point set using the Huber M-estimator combined with the Median Absolute Deviation (MAD) algorithm. This process removes noise from surface oil, scratches, and metallic reflections, outputting the optimal fitted straight line equation. The Huber M-estimator is robust to outliers and effectively removes noise from surface oil, scratches, and metallic reflections. The MAD algorithm is used to estimate the scale of the fitting residuals, further improving the stability of the fit. The final output is the optimal fitted straight line equation. .
[0025] Interface output unit 105 is used to calculate the median of the abscissa of the path point set as the joint positioning coordinates and output structured data. (The calculation of the median of the abscissa of the path point set as the joint positioning coordinates is repeated.) The median is more resistant to the effects of local abrupt changes than the mean. Simultaneously, the average gray-level gradient value of the path points of the seam's average energy is calculated. Root mean square of straightness fitting error and fitting residual Standard deviation of path points and standard deviation of path point x-coordinates Output structured data ,in, This is a Boolean value indicating whether a valid seam was detected.
[0026] In this embodiment, the adaptive calibration module 2 is used to calculate the comprehensive conversion coefficient between pixel displacement and motor rotation steps through trial motion and an adaptive step multiplication mechanism, identify the correspondence between the motor motion direction and the pixel coordinate system, generate local calibration parameters, and is electrically connected to the vision sensing module 1. The adaptive calibration module 2 includes an initial state acquisition unit 201, a trial motion control unit 202, an adaptive step multiplication unit 203, a calibration parameter calculation unit 204, and a calibration data persistence unit 205.
[0027] The initial state acquisition unit 201 is used to acquire the initial pixel position of the seam when the motor is stationary. It sends a stop command to the motor driver to keep the motor stationary, and then sends an image acquisition request to the vision sensing module 1 to acquire the initial pixel position of the seam. ,if If the value is False, an exception will be thrown, prompting the operator to manually fine-tune the workpiece so that the seam is within the camera's field of view.
[0028] The tentative motion control unit 202 sends a positive pulse command for a calibrated number of steps to the motor driver and waits for a preset stabilization time after the motor stops. It sends the calibrated number of steps to the motor driver. Upon receiving a positive pulse command, the motor stops and waits... Milliseconds eliminate image jitter caused by mechanical transmission residual vibration and belt tension, improving the clarity of the acquired image.
[0029] The adaptive step doubling unit 203 is used to calculate the pixel displacement generated by the trial movement. If the absolute value of the displacement is less than the preset signal-to-noise ratio threshold, it backs down and doubles the calibrated step count before retesting until the threshold requirement is met or the maximum number of attempts is reached. An image acquisition request is sent to the visual sensing module 1 to obtain the new coordinates of the seam. Calculate pixel displacement To eliminate the physical backlash of the stepper motor drive gears and the quantization noise caused by image discretization, the calibration process requires that the absolute value of the generated pixel displacement must meet certain conditions. Pixels. If this condition is not met, a reverse pulse is sent to the motor. This returns the system to its initial state, eliminating accumulated deviations; then the number of calibration steps is multiplied. The test will return to the tentative motion control unit 202 for retesting. The maximum number of attempts is 4. If sufficient displacement cannot be generated, the hardware transmission or vision detection link will be determined to be abnormal and an alarm will be triggered.
[0030] The calibration parameter calculation unit 204 is used to calculate the comprehensive conversion coefficient based on the final number of calibration steps and pixel displacement, and to determine the motion direction indicator factor through the displacement sign. After successful calibration, the comprehensive conversion coefficient is calculated. The unit is pixels per step, according to The sign determines the direction of motion indicator factor :if A positive pulse >0 causes the seam to move to the right in the image. ;if <0, a positive pulse drive moves the seam to the left in the image. By introducing a direction indicator factor The control algorithm automatically aligns the physical wiring direction of the motor with the image pixel coordinate system, eliminating the risk of incorrect manual configuration.
[0031] The calibration data persistence unit 205 is used to write the conversion coefficients and direction factors to a local file for subsequent control processes. The calculated conversion coefficients are then... and direction indicator factor The calibration parameters are written to a local JSON file named calibration.json. The system automatically reads the calibration parameters from this file each time it starts, eliminating the need for recalibration every time. When the production line switches product models or the equipment undergoes maintenance, the parameters only need to be updated by running the one-click calibration program once.
[0032] In this embodiment, the finite state machine search module 3 is used to drive the motor to perform directional discrete step search based on calibration parameters when the stitching seam does not enter the camera's field of view, and to perform safety self-diagnosis by limiting the maximum number of iterations. It is electrically connected to the vision sensing module 1 and the adaptive calibration module 2. The finite state machine search module 3 includes a state management unit 301, a search step size configuration unit 302, a directional search execution unit 303, and a safety self-diagnosis unit 304.
[0033] The state management unit 301 is used to maintain the system's state space and trigger state transitions based on visual inspection results and search progress. Maintaining the system's state space. A state transition is triggered based on the visual detection results and search progress. The state transition logic is as follows: When transitioning from IDLE to SEARCHING state, after starting the alignment task, if the vision module's detection state IsSeamDetected=False, it switches to search mode. When transitioning from SEARCHING to ALIGNING, during the active rotation search process, once IsSeamDetected=True in a certain frame of the image, the system immediately locks the motor, terminates the search, and enters the alignment mode. When transitioning from the SEARCHING state to the ERROR state, if the cumulative number of search rounds exceeds the set limit and no seam is found, the state machine switches to the error state and reports an error to the PLC. When transitioning from ALIGNING to ALIGNED, the system enters the alignment complete state when the seam pixel residual is less than or equal to the alignment tolerance. When the system transitions to the ERROR state from any state, it immediately switches to the error state if a hardware failure, communication interruption, or other serious anomaly occurs.
[0034] The search step size configuration unit 302 is used to configure the single search step size according to the cylinder radius and the lens field of view, so that a single search corresponds to a workpiece rotation of 30° to 45°. The single search step size is configured based on the cylinder radius R and the lens field of view (FOV). Typically, a single search corresponds to a workpiece rotation of 30° to 45°, and the calculation expression is as follows: ,in, This represents the total number of steps required for the stepper motor to complete one full revolution.
[0035] The directional search execution unit 303 is used to send discrete stepping pulse commands according to a calibrated direction indication factor in the SEARCHING state. In the SEARCHING state, according to the calibrated direction indication factor... Send an offline pulse command, i.e. By using discrete stepping instead of continuous rotation, the problem of overshoot during emergency stops at high speeds is avoided.
[0036] The safety self-diagnostic unit 304 calculates the maximum number of iterations. If the cumulative number of search rounds exceeds the maximum number of iterations and no seam is detected, an ERROR state is triggered, and an alarm is sent to the external system. (Calculation of the maximum number of iterations) Multiply by a safety factor of 1.2 to cover the entire 360° range. When the cumulative number of search rounds r > When this happens, the system shuts down, triggers the ERROR status, and sends an alarm signal to the external PLC.
[0037] In this embodiment, the nonlinear closed-loop control module 4 is used to calculate the effective conversion rate after perspective projection correction based on the current position of the seam after detecting the seam, and generate discrete pulse commands in conjunction with the zero-step dead zone compensation mechanism to drive the motor to complete the closed-loop iterative alignment. It is electrically connected to the vision sensing module 1, the adaptive calibration module 2, and the finite state machine search module 3. The nonlinear closed-loop control module 4 includes a residual calculation unit 401, a perspective projection correction unit 402, an ideal step calculation unit 403, a discrete pulse conversion unit 404, and a zero-step dead zone compensation unit 405.
[0038] The residual calculation unit 401 is used to calculate the pixel residual between the current seam column coordinates and the target column coordinates. It receives the current seam coordinates output by the visual sensing module 1. Calculate its coordinates relative to the target column. Pixel residual , Set as the column coordinates of the image center ,in, This represents the image width.
[0039] The perspective projection correction unit 402 is used to calculate the effective conversion rate of the current position in real time based on the current absolute column coordinates of the seam and the camera pixel focal length, compensating for nonlinear stretching distortion at the edge of the field of view. The calculation is based on the current absolute column coordinates of the seam. and camera pixels and focal length The effective conversion rate of the current position is calculated in real time. First, the line-of-sight deflection angle is calculated. Then, the effective conversion rate is calculated based on the first-order perspective projection nonlinear correction equation. When the camera has an extremely long focal length and a narrow field of view, you can set... At this point, the system degenerates into a linear control model. .
[0040] The ideal step calculation unit 403 is used to calculate the ideal control steps based on the pixel residual and the effective conversion rate. and effective conversion rate Calculate the ideal number of control steps Where, multiplied by the direction indicator factor This is to ensure that the direction of the motor's rotation is consistent with the direction of the pixel residual.
[0041] The discrete pulse conversion unit 404 is used to round the ideal step number to the actual number of discrete pulses sent. The stepper motor driver only receives integer pulses and converts the ideal step number... Rounding gives the actual number of discrete pulses transmitted. .
[0042] The zero-step dead zone compensation unit 405 is used to force the transmission of a single-step pulse with the same sign as the residual when the calculated actual pulse count is 0 and the pixel residual is still greater than the alignment tolerance, thereby breaking the deadlock state. And the absolute value of the pixel residual At this point, the system enters a zero-step dead zone state. Forcing a setting at this time... Send a single-step pulse in the direction of the residual to break the deadlock.
[0043] In this embodiment, the comprehensive evaluation output module 5 is used to generate a multi-dimensional quantitative evaluation report after the alignment process is completed, and outputs the alignment results and status signals to the external control system via an industrial bus, electrically connecting the above modules. The comprehensive evaluation output module 5 includes a data acquisition unit 501, a quality evaluation unit 502, a data storage unit 503, and a bus communication unit 504.
[0044] Data acquisition unit 501 collects the final state, seam positioning coordinates, final residual, cumulative steps, average seam energy, and straightness fitting error during the alignment process. It also collects various parameters after the alignment process is completed, including the system's final state. Joint inspection mark Alignment completion mark Final joint coordinates Final pixel residual Cumulative steps Average energy of seams and straightness fitting error .
[0045] The quality assessment unit 502 is used to determine whether the alignment quality is acceptable based on a preset threshold and to generate an abnormality warning signal. The alignment quality is determined to be acceptable based on the preset threshold. and If the alignment tolerance is less than or equal to the tolerance, then... If it is deemed qualified, then it is deemed qualified; otherwise This is deemed unqualified. Simultaneously, abnormal warnings are issued based on various parameters, including: If the cumulative number of action steps for workpieces in the same batch An abnormally large increase suggests that the drive belt is slipping or the roller clamping force is insufficient. If the average energy of the joint An abnormally low value will trigger maintenance alarms for issues such as camera lens contamination, reduced light source brightness, or surface reflection. If the straightness fitting error If the size is too large, the seam will not be straight, and the workpiece may have wavy edges or severe deformation, requiring manual sorting.
[0046] Data storage unit 503 is used to record all parameters of this alignment into the production report for subsequent traceability and statistical analysis. It records all parameters of this alignment into the production database to generate a production report for subsequent quality traceability and statistical analysis.
[0047] The bus communication unit 504 is used to send alignment results and status signals to a PLC or host computer control system via Profinet, Modbus, or Industrial Ethernet. Alignment results and status signals are sent to the PLC or host computer control system via Profinet Industrial Ethernet. Only when... Only when the downstream welding, marking, or labeling mechanism is activated is the logic interlocking of the production process achieved.
[0048] Example 2 like Figure 10 As shown, the adaptive calibration and closed-loop alignment control method for the splice seam on the cylindrical surface includes the following steps: S1. Acquire the original image of the cylindrical surface, extract the high-precision pixel coordinates of the splicing seam, and output structured data containing the seam detection status, positioning coordinates and feature parameters. S2. Through trial motion and adaptive step multiplication mechanism, calculate the comprehensive conversion coefficient between pixel displacement and motor rotation steps, identify the correspondence between motor motion direction and pixel coordinate system, and generate local calibration parameters. S3. When the seam does not enter the camera's field of view, drive the motor to perform directional discrete stepping search based on calibration parameters, and perform safety self-diagnosis by limiting the maximum number of iterations. S4. After detecting the seam, calculate the effective conversion rate after perspective projection correction based on the current position of the seam, and generate discrete pulse commands in combination with the zero-step dead zone compensation mechanism to drive the motor to complete closed-loop iterative alignment. S5. After the alignment process is completed, a multi-dimensional quantitative evaluation report is generated, and the alignment results and status signals are output to the external control system through the industrial bus.
[0049] In step S1, the original image of the cylindrical surface is acquired, the high-precision pixel coordinates of the splicing seam are extracted, and structured data containing the seam detection status, positioning coordinates, and feature parameters is output, including the following steps: S101. Acquire the original color image of the cylindrical surface and convert it to a grayscale image; The image acquisition unit 101 acquires the original color image of the cylindrical surface and converts it into an 8-bit grayscale image.
[0050] S102. Locate the seam area using a lightweight target detection algorithm or template matching algorithm, and generate a local grayscale image; For local positioning, an industrial camera acquires raw images. The lightweight YOLOv5n algorithm is used to locate the Region of Interest (ROI) of the seam and output a local grayscale image. .
[0051] S103. Enhance the seam edge by using directional morphological operators, and under spatial geometric prior constraints, use dynamic programming algorithm to search for the optimal set of gray-scale cumulative energy representing the seam center; Constraint optimization is performed by applying horizontal directional morphological operators to enhance the seam edges within the ROI. Then, under spatial geometric prior constraints, a dynamic programming algorithm is used to search for the optimal set of path points with accumulated gray-level energy. .
[0052] S104. Use a robust estimation algorithm to fit a straight line to the path point set and output the equation of the best fitted straight line. Robust fitting is performed by using the Huber-M estimator combined with the MAD algorithm to fit a straight line to the path point set, thus obtaining the optimal fitted straight line. .
[0053] S105. Calculate the median of the abscissa of the path point set as the seam positioning coordinate, and output structured data containing the seam detection status, positioning coordinate and feature parameters. Output coordinates and calculate the median of the x-coordinates of the path point set as the seam positioning coordinates. It outputs structured data, as shown in the following expression: , In the above formula, It is a Boolean value. This represents the average grayscale gradient value. It is the root mean square. Standard deviation, Use the coordinates to locate the seam.
[0054] In step S2, through trial motion and an adaptive step multiplication mechanism, the comprehensive conversion coefficient between pixel displacement and motor rotation steps is calculated, and the correspondence between the motor motion direction and the pixel coordinate system is identified to generate local calibration parameters, including the following steps: S201. Obtain the initial pixel position of the seam when the motor is stationary. If no valid seam is detected, throw an exception prompt to manually fine-tune the workpiece. Obtain the initial state, keep the motor stationary, capture the initial image, and obtain the initial pixel position of the seam. If no seam is detected, an error message will be displayed prompting manual fine-tuning.
[0055] S202, Send a positive pulse command for the calibrated number of steps to the motor driver, and wait for the preset stabilization time after the motor stops; Make a trial movement and send a signal to the motor. A positive pulse is applied to the motor, and the motor waits after stopping. Milliseconds to eliminate mechanical aftershocks. The positive pulse is set to 200 steps by default, positive.
[0056] 203. Acquire the stabilized image, obtain the new coordinates of the seam, and calculate the pixel displacement caused by the trial motion; Displacement calculations are performed, a new image is acquired after stabilization, and the new coordinates of the joint are obtained. Calculate pixel displacement .
[0057] S204. If the absolute value of the pixel displacement is less than the preset signal-to-noise ratio threshold, then reverse back to the initial state, and double the calibration step number before re-executing the trial movement until the threshold requirement is met or the maximum number of attempts is reached. Perform adaptive step doubling, if If the pixel count is less than 10, a reverse signal is sent to the motor. Step pulses are returned to the initial state, and the calibration step count is multiplied. After step S202, return to step S202. The maximum number of attempts is 4.
[0058] S205. Calculate the comprehensive conversion coefficient based on the final calibration steps and pixel displacement, and determine the motion direction indicator factor by the displacement sign; Perform parameter calculation and determine the comprehensive conversion coefficients, as shown in the following expression: , In the above formula, For comprehensive conversion factors, For pixel displacement, This represents the final number of steps.
[0059] according to The sign determines the direction of motion indicator factor .
[0060] S206. Write the comprehensive conversion coefficient and motion direction indicator factor into a local JSON file; To persist data, and Write it to the local calibration.json file.
[0061] In step S3, when the seam is not in the camera's field of view, the drive motor performs a directional discrete step search based on calibration parameters, and performs a safety self-diagnosis by limiting the maximum number of iterations, including the following steps: S301. After system startup, it enters IDLE state and receives alignment task instructions. After the system starts up, it enters the IDLE state and receives alignment task instructions.
[0062] S302. Read the visual inspection results. If a valid seam is detected, proceed directly to the ALIGNING state. Read the detection result of visual sensing module 1. If IsSeamDetected=True, then directly enter the ALIGNING state. S303. If no valid seam is detected, enter the SEARCHING state and send an off-track advance pulse command according to the preset search step size and the calibrated direction indicator factor. If IsSeamDetected=False, then enter the SEARCHING state and perform a search based on the preset search step size. and direction indicator factor Send out discrete pulses.
[0063] S304. After each pulse is sent, an image is acquired and the seam is detected. If a seam is detected, the motor is stopped immediately and the motor enters the ALIGNING state. After each pulse is sent, an image is acquired and the seam is detected. If a seam is detected, the motor is stopped immediately and the motor enters the ALIGNING state.
[0064] S305. If the cumulative number of search rounds exceeds the maximum number of iterations and no seam is detected, the system enters the ERROR state, triggers an audible and visual alarm, and sends a stop signal to the external PLC. If the cumulative number of search rounds exceeds the maximum number of iterations If no seam is detected, the system enters the ERROR state, triggering an audible and visual alarm and sending a stop signal to the PLC.
[0065] In step S4, after detecting the seam, the effective conversion rate after perspective projection correction is calculated based on the current position of the seam. A discrete pulse command is generated using the zero-step dead zone compensation mechanism to drive the motor and complete the closed-loop iterative alignment. This includes the following steps: S401. Calculate the pixel residual between the current seam column coordinates and the target column coordinates, where the target column coordinates are the image center column coordinates; Perform residual calculations and calculate the current joint coordinates. with target coordinates Pixel residual .
[0066] S402. If the absolute value of the pixel residual is less than or equal to the alignment tolerance, then the alignment is complete and the system enters the ALIGNED state. Perform a convergence check if If the value is ≤3 pixels, then alignment is complete and the device enters the ALIGNED state.
[0067] S403. Calculate the effective conversion rate at the current position based on the current absolute column coordinates of the seam and the camera pixel focal length. To perform perspective projection correction, calculate the line-of-sight angle based on the current coordinates of the seam, as shown in the following expression: , In the above formula, For the angle of view, The coordinates of the current seam. The column coordinates of the image center. The focal length is the camera's pixel count.
[0068] Then calculate the effective conversion rate, as shown in the following expression: , In the above formula, For effective conversion rate, This is the comprehensive conversion coefficient.
[0069] S404. Calculate the ideal control steps based on the pixel residual and effective conversion rate, and multiply by the motion direction indicator factor to ensure the correct rotation direction; The ideal control steps are calculated using the following expression: , In the above formula, To ideally control the number of steps, For pixel residuals, This is the motion direction indicator factor.
[0070] S405. Round the ideal number of steps to the actual number of discrete pulses sent. To perform discrete pulse conversion, the ideal number of steps is rounded to obtain the actual number of pulses, as shown in the following expression: , In the above formula, This represents the actual number of pulses.
[0071] S406. If the calculated actual number of pulses is 0 and the absolute value of the pixel residual is still greater than the alignment tolerance, then a single-step pulse with the same sign as the residual is forcibly sent to break the deadlock state. Perform zero-step dead zone compensation, if =0 and >3 pixels, then force setting .
[0072] S407. Send the actual number of pulses to the motor, wait for the motor to stabilize, and then return to step S401 for the next iteration. Send pulses to the motor. After 1 pulse, wait for the motor to stabilize and then return to step S401 for the next iteration.
[0073] In step S5, after the alignment process is completed, a multi-dimensional quantitative evaluation report is generated, and the alignment results and status signals are output to the external control system via the industrial bus, including the following steps: S501. Collect various parameters after the alignment process is completed, including the final system state, seam detection mark, alignment completion mark, final seam coordinates, final pixel residual, cumulative action steps, seam average energy, and straightness fitting error. Collect various parameters during the alignment process, including the final state of the system. Joint inspection mark Alignment completion mark Final joint coordinates Final pixel residual Cumulative steps Average energy of seams and straightness fitting error .
[0074] S502. Determine whether the alignment quality is qualified based on the preset threshold, and generate an abnormal warning signal; The alignment quality is judged to be qualified based on a preset threshold, and an abnormal warning signal is generated. if and If the alignment tolerance is less than or equal to the tolerance, then... =True, indicating a pass; otherwise... =False, indicating non-compliance. Simultaneously, anomaly warnings are issued based on various parameters, including: If the cumulative number of action steps for workpieces in the same batch An abnormally large increase suggests that the drive belt is slipping or the roller clamping force is insufficient. If the average energy of the joint An abnormally low value will trigger maintenance alarms for issues such as camera lens contamination, reduced light source brightness, or surface reflection. If the straightness fitting error If the size is too large, the seam will not be straight, and the workpiece may have wavy edges or severe deformation, requiring manual sorting.
[0075] S503. Record all parameters of this alignment into the production database to generate a production report, and send the alignment results and status signals to the external control system via the industrial bus. Only when the alignment is qualified are the downstream welding, marking or labeling mechanisms allowed to start. All parameters are recorded in the production database to generate production reports; the alignment results and status signals are sent to the PLC via the Profinet bus. If the alignment is qualified, the downstream process is allowed to start; otherwise, a shutdown alarm is triggered.
[0076] This invention effectively filters out false edge interference such as reflections, oil stains, and scratches on metal surfaces, accurately extracting splicing seams and reducing image processing time. It can calculate the comprehensive conversion coefficient and motion direction factor with a single trial movement, eliminating the risk of manual direction errors and lowering the barrier to equipment installation and maintenance. Through zero-step dead zone compensation, the forced single-step fine-tuning logic breaks the deadlock state of traditional proportional control. Combined with reasonable tolerance constraints and smooth damping, it eliminates the steady-state error of the system, avoids limit cycle oscillations, and improves alignment accuracy. It avoids the overshoot problem caused by sudden stops due to high-speed continuous rotation. Furthermore, by setting a safety self-diagnostic logic with a maximum number of iterations, it effectively prevents endless rotation when hardware links are abnormal, improving the system's safe operating level.
[0077] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Clearly, those skilled in the art can make various alterations and variations to the invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of equivalents of the invention, the invention is also intended to include these modifications and variations.
Claims
1. A method for adaptive calibration and closed-loop alignment control of splice seams on cylindrical surfaces, characterized in that, Includes the following steps: S1. Acquire the original image of the cylindrical surface, extract the high-precision pixel coordinates of the splicing seam, and output structured data containing the seam detection status, positioning coordinates and feature parameters. S2. Through trial motion and adaptive step multiplication mechanism, calculate the comprehensive conversion coefficient between pixel displacement and motor rotation steps, identify the correspondence between motor motion direction and pixel coordinate system, and generate local calibration parameters. S3. When the seam does not enter the camera's field of view, drive the motor to perform directional discrete stepping search based on calibration parameters, and perform safety self-diagnosis by limiting the maximum number of iterations. S4. After detecting the seam, calculate the effective conversion rate after perspective projection correction based on the current position of the seam, and generate discrete pulse commands in combination with the zero-step dead zone compensation mechanism to drive the motor to complete closed-loop iterative alignment. S5. After the alignment process is completed, a multi-dimensional quantitative evaluation report is generated, and the alignment results and status signals are output to the external control system through the industrial bus.
2. The adaptive calibration and closed-loop alignment control method for cylindrical surface splice seams according to claim 1, characterized in that, S1 includes the following steps: S101. Acquire the original color image of the cylindrical surface and convert it to a grayscale image; S102. Locate the seam area using a lightweight target detection algorithm or template matching algorithm, and generate a local grayscale image; S103. Enhance the seam edge by using directional morphological operators, and under spatial geometric prior constraints, use dynamic programming algorithm to search for the optimal set of gray-scale cumulative energy representing the seam center; S104. Use a robust estimation algorithm to fit a straight line to the path point set and output the equation of the best fitted straight line. S105. Calculate the median of the abscissa of the path point set as the seam positioning coordinate, and output structured data containing the seam detection status, positioning coordinates and feature parameters.
3. The adaptive calibration and closed-loop alignment control method for cylindrical surface splice seams according to claim 1, characterized in that, S2 includes the following steps: S201. Obtain the initial pixel position of the seam when the motor is stationary. If no valid seam is detected, throw an exception prompt to manually fine-tune the workpiece. S202, Send a positive pulse command for the calibrated number of steps to the motor driver, and wait for the preset stabilization time after the motor stops; S203. Acquire the stabilized image, obtain the new coordinates of the seam, and calculate the pixel displacement caused by the trial movement; S204. If the absolute value of the pixel displacement is less than the preset signal-to-noise ratio threshold, then reverse back to the initial state, and double the calibration step number before re-executing the trial movement until the threshold requirement is met or the maximum number of attempts is reached. S205. Calculate the comprehensive conversion coefficient based on the final calibration steps and pixel displacement, and determine the motion direction indicator factor by the displacement sign; S206. Write the comprehensive conversion coefficient and motion direction indicator factor into a local JSON file.
4. The adaptive calibration and closed-loop alignment control method for cylindrical surface splice seams according to claim 1, characterized in that, S3 includes the following steps: S301. After system startup, it enters IDLE state and receives alignment task instructions. S302. Read the visual inspection results. If a valid seam is detected, proceed directly to the ALIGNING state. S303. If no valid seam is detected, enter the SEARCHING state and send an off-track advance pulse command according to the preset search step size and the calibrated direction indicator factor. S304. After each pulse is sent, an image is acquired and the seam is detected. If a seam is detected, the motor is stopped immediately and the motor enters the ALIGNING state. S305. If the cumulative number of search rounds exceeds the maximum number of iterations and no seam is detected, the system enters the ERROR state, triggers an audible and visual alarm, and sends a stop signal to the external PLC.
5. The adaptive calibration and closed-loop alignment control method for cylindrical surface splice seams according to claim 1, characterized in that, S4 includes the following steps: S401. Calculate the pixel residual between the current seam column coordinates and the target column coordinates, where the target column coordinates are the image center column coordinates; S402. If the absolute value of the pixel residual is less than or equal to the alignment tolerance, then the alignment is complete and the system enters the ALIGNED state. S403. Calculate the effective conversion rate at the current position based on the current absolute column coordinates of the seam and the camera pixel focal length. S404. Calculate the ideal control steps based on the pixel residual and effective conversion rate, and multiply by the motion direction indicator factor to ensure the correct rotation direction; S405. Round the ideal number of steps to the actual number of discrete pulses sent. S406. If the calculated actual number of pulses is 0 and the absolute value of the pixel residual is still greater than the alignment tolerance, then a single-step pulse with the same sign as the residual is forcibly sent to break the deadlock state. S407: Send the actual number of pulses to the motor, wait for the motor to stabilize, and then return to S401 for the next iteration.
6. The adaptive calibration and closed-loop alignment control method for cylindrical surface splice seams according to claim 2, characterized in that, In S103, each column of the ROI image is regarded as a node. The transfer cost between adjacent columns is determined by the gray-level gradient difference and the position offset. The minimum cumulative energy path from the top to the bottom of the image is found through dynamic programming, and the path point set is obtained. In S104, the Huber M-estimator combined with the absolute deviation median algorithm is used to fit a straight line to the path point set. The Huber M-estimator is used to remove outliers, and the absolute deviation median algorithm is used to estimate the scale of the fitting residuals.
7. The adaptive calibration and closed-loop alignment control method for cylindrical surface splice seams according to claim 3, characterized in that, In S205, the comprehensive conversion factor is calculated using the following expression: , In the above formula, For comprehensive conversion factors, For pixel displacement, This is the final number of steps; The motion direction indicator factor is calculated using the following expression: , when A positive pulse >0 causes the seam to move to the right in the image. ; when <0, a positive pulse drive moves the seam to the left in the image. .
8. The adaptive calibration and closed-loop alignment control method for cylindrical surface splice seams according to claim 4, characterized in that, In S305, the expression for the maximum number of iterations is as follows: , In the above formula, The maximum number of iterations. This represents the total number of steps required for the stepper motor to complete one full revolution. This represents the step size for a single search.
9. The adaptive calibration and closed-loop alignment control method for cylindrical surface splice seams according to claim 5, characterized in that, In S403, the effective conversion rate is calculated using the following expression: , In the above formula, The effective conversion rate for the current location. For comprehensive conversion factors, For the angle of view, The coordinates of the current seam column. The column coordinates of the image center. The focal length is the camera's pixel count.
10. An adaptive calibration and closed-loop alignment control system for cylindrical surface splicing seams, applicable to the adaptive calibration and closed-loop alignment control method for cylindrical surface splicing seams as described in any one of claims 1-9, characterized in that, include: The visual sensing module is used to acquire the original image of the cylindrical surface, extract the high-precision pixel coordinates of the splicing seam, and output structured data containing the seam detection status, positioning coordinates and feature parameters. The adaptive calibration module is used to calculate the comprehensive conversion coefficient between pixel displacement and motor rotation steps through trial motion and adaptive step multiplication mechanism, identify the correspondence between motor motion direction and pixel coordinate system, generate local calibration parameters, and is electrically connected to the vision sensing module. The finite state machine search module is used to drive the motor to perform directional discrete step search based on calibration parameters when the stitching seam does not enter the camera's field of view, and performs safety self-diagnosis by limiting the maximum number of iterations. It is electrically connected to the vision sensing module and the adaptive calibration module. The nonlinear closed-loop control module is used to calculate the effective conversion rate after perspective projection correction based on the current position of the seam after detecting the seam. It generates discrete pulse commands in combination with the zero-step dead zone compensation mechanism to drive the motor to complete the closed-loop iterative alignment. It is electrically connected to the vision sensing module, the adaptive calibration module and the finite state machine search module. The comprehensive evaluation output module is used to generate a multi-dimensional quantitative evaluation report after the alignment process is completed, and outputs the alignment results and status signals to the external control system through the industrial bus. It is electrically connected to the vision sensing module, adaptive calibration module, finite state machine search module and nonlinear closed-loop control module.
Citation Information
Patent Citations
Video double-gun welding path planning control method based on synchronous visual identification
CN120742780A
Calibration method for assembling light source modules, projection method, and 3D printing method
WO2023041009A1