Method and system for extracting weld features and automatically generating welding trajectories for special-shaped components
Through line laser sensor scanning and secondary differential processing, combined with the Douglas-Peucker algorithm, the welding path of complex special-shaped components is autonomously generated, solving the problem of relying on manual operation in existing technologies and realizing an efficient and automated welding process.
Patent Information
- Application Number
- CN202411881358.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-12-19
AI Technical Summary
Existing technologies make it difficult to achieve automated and intelligent welding of complex and special-shaped components. They are unable to autonomously generate welding paths and rely on manual operations, resulting in low efficiency and inconsistent quality.
By establishing a three-dimensional coordinate system, using a line laser sensor to scan the workpiece, performing secondary difference and filtering processing to extract the weld groove feature points, calculating the welding gun posture angle, generating the welding trajectory, and using the Douglas-Peucker algorithm to compress the data points and autonomously generate the welding path.
It realizes the autonomous generation of welding trajectories and parameters for complex special-shaped components, improves the degree of welding automation, simplifies the operation process, and improves production efficiency and consistency of welding quality.
Smart Images

Figure CN119426873B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent welding manufacturing of small batches of complex parts, and in particular to a method and system for extracting weld features and automatically generating welding trajectories of special-shaped components. Background Art
[0002] In the aerospace, shipbuilding, and energy manufacturing sectors, welding automation and intelligent technologies play a key role, effectively improving production efficiency. However, current welding automation is often only suitable for workpieces with simple, specific shapes. For some complex, special-shaped components in actual production, it is difficult to achieve automated and intelligent welding due to their complex geometry and the gradual change in welding depth with the shape of the workpiece. Currently, welding still relies on manual labor, which greatly limits the improvement of production efficiency and the consistency of welding quality. Therefore, there is a need for a method that collects data from complex components through certain sensing methods, analyzes and processes the data to autonomously generate welding paths, realizes autonomous positioning and welding of complex structures, and effectively improves the efficiency and quality of welding of complex components.
[0003] In the Chinese patent document with publication number CN113814528A, an interactive weld curve extraction and automatic trajectory generation method is disclosed. The method calibrates the robot vision system and establishes a mathematical mapping relationship between the pixel coordinates of the RGB-D image of the weld and the three-dimensional coordinates of the world coordinate system. Based on the calibrated robot vision system, the phase field distribution of the grating fringe image is extracted, the object point height of the object point on the weld is calculated, and a mathematical mapping relationship between the object point height and the phase is established. The weld position on the weld is continuously annotated. A region of interest is set, and the minimum bounding box of the weld area is obtained based on the annotated trace of the weld. The center line of the annotated trace is extracted to form a characteristic curve. The characteristic curve is discretized to generate a set of path points, and the path point set is fitted to generate a welding trajectory. However, this patent document requires manual annotation of the welding position and cannot solve the problem of spatial weld curve extraction and trajectory generation for complex special-shaped components.
[0004] Chinese patent publication CN117921670A discloses a method for autonomous, teaching-free welding robot operation based on a data model and a visual system. The method is designed to implement intelligent, autonomous welding operations on a complete robotic system consisting of a six-axis industrial robot with a computer programming control interface, an external axis ground rail, a supporting robotic welder, a welding torch, a line laser sensor, and a 3D structured light camera. However, this method relies on an idealized workpiece model, making it difficult to compensate for deviations between the imported idealized model and the actual workpiece weld. Furthermore, the process is cumbersome and cannot address the problem of autonomously generating welding paths for complex spatial welds.
[0005] The article DOI: 10.1016 / j.jmapro.2019.02.010 proposes a method to reconstruct a three-dimensional curved weld spatial model through line laser scanning and plan the welding path based on the model. However, due to the existence of blind spots in the field of view, it is difficult to obtain weld information in all positions, and it is also not suitable for the complex spatial welds mentioned above. Summary of the Invention
[0006] In view of the defects in the prior art, the purpose of the present invention is to provide a method and system for extracting weld features and automatically generating welding trajectories for special-shaped components.
[0007] According to the present invention, a method for extracting weld features of a special-shaped component and automatically generating a welding trajectory comprises:
[0008] Step S1: Establish a three-dimensional coordinate system and calculate the initial scanning position coordinates of the sensor;
[0009] Step S2: moving the sensor to the initial scanning position coordinates and collecting workpiece data;
[0010] Step S3: performing secondary difference on the collected workpiece data to extract weld groove feature points;
[0011] Step S4: Calculate the welding gun posture angle according to the weld groove feature points;
[0012] Step S5: Obtain welding path coordinates based on the welding gun posture angle and generate a welding trajectory.
[0013] Preferably, step S1 includes the following sub-steps:
[0014] Step S1.1: Scan the top area of the workpiece; drive the robot so that the laser sensor is located directly above the workpiece, project a laser stripe at the center of the weld groove, and scan a distance along the y-axis to obtain point cloud data of the weld groove in the top area;
[0015] Step S1.2: Obtain the vertex coordinates of the weld by using quadratic difference combined with filtering and denoising;
[0016] Step S1.3: Calculate the height of the weld center of each row, and then use the random sampling consistency method to fit the height of the weld center of all rows. The coordinate of the highest point of the fitting curve in the y-axis direction is , the corresponding weld center coordinates are the initial scanning position coordinates of the sensor ( , , ).
[0017] Preferably, the step S1.2 includes the following sub-steps:
[0018] Step S1.2.1: Perform moving average filtering on the collected point cloud data row by row to remove noise, calculate the first-order difference, and perform median filtering and Gaussian filtering on the differenced data again;
[0019] Step S1.2.2: Calculate the second-order difference of the differential filtered data again, and perform median filtering and Gaussian filtering;
[0020] Step S1.2.3: Find the minimum value of the second-order difference data of the groove;
[0021] The points corresponding to the minimum values are the left and right characteristic points of the upper edge of the weld groove;
[0022] The center of the left and right characteristic points is the center of the weld;
[0023] Based on this, the center position of the weld seam of each row of weld seam contour is obtained , and the corresponding height .
[0024] Preferably, step S2 includes the following sub-steps:
[0025] Step S2.1: Move the sensor to the initial scanning position; calculate the coordinates ( , , ) is sent to the robot, which controls the robot's movement so that the center of the sensor's laser stripe is aligned with the center of the weld at the highest point and at a certain height from the workpiece;
[0026] Step S2.2: The rotary positioner rotates the workpiece around the x-axis until the rotation angle is greater than 360°;
[0027] The sensor collects the groove contour point cloud data when the positioner starts to rotate, and ends the data collection synchronously when the positioner stops rotating.
[0028] Preferably, step S3 includes the following sub-steps:
[0029] Step S3.1: Perform moving average filtering on the collected point cloud data row by row to remove noise, calculate the first-order difference, and perform median filtering and Gaussian filtering on the differenced data;
[0030] Step S3.2: Calculate the second-order difference of the differential filtered data, and perform median filtering and Gaussian filtering again;
[0031] Step S3.3: Find the minimum value of the second-order difference data of the groove;
[0032] The points corresponding to the minimum values are the left and right characteristic points of the upper edge of the weld groove;
[0033] The center of the left and right characteristic points is the center of the weld;
[0034] Based on this, the center position of the weld in each row is obtained , and the height corresponding to this position is .
[0035] Preferably, step S4 includes the following sub-steps:
[0036] Step S4.1: Calculate the relative height of the weld center at 90° and 180° relative to the initial scan position , :
[0037]
[0038]
[0039] Among them, n represents the number of rows scanned in all positions, and round represents rounding up. represents the weld center height value of the i-th row, Indicates the weld center height when i=round(n*0.5); Indicates the weld center height value of the data in row 1;
[0040] Step S4.2: Use Newton's method to solve the equations to calculate the center of rotation ( , ):
[0041]
[0042]
[0043] Where a and b represent the actual size information of the workpiece, b is the length of the major axis, and a is the length of the minor axis;
[0044] Step S4.3: Make the welding gun always in the normal direction of the workpiece contour, and the welding gun posture angle at any contour position The calculation method is as follows:
[0045]
[0046]
[0047]
[0048]
[0049]
[0050] Among them, t represents the interval t rows of data points, represents the angles corresponding to adjacent t rows, represents the rotation angle, Indicates the distance from the workpiece rotation center to the scanning position when the i-th row of data is scanned;
[0051] The obtained welding posture data are filtered using moving median and fitted with cubic smoothing spline curve to obtain the welding posture angle of each feature point in the entire welding path.
[0052] Preferably, step S5 includes the following sub-steps:
[0053] Step S5.1: Center the weld As a waypoint x Coordinates, weld height at center position As a waypoint z Coordinates, respectively get the path points of the entire weld x and z Coordinates with rotation angle The change curve of i and rotation angle The relationship is:
[0054]
[0055] in, n Represents the number of rows scanned for the entire weld; the data is filtered using the segmented data fitting method to ultimately form the complete welding path coordinates ( , );
[0056] Step S5.2: Use the Douglas-Peucker algorithm or take points according to the planned rotation angle interval to compress the number of key points and obtain the coordinates of the key points of the welding path: rotation angle and x , z Coordinate point pair ( , );
[0057] Step S5.3: According to the number of rows corresponding to the compressed key points, find the welding gun posture angle corresponding to the corresponding rotation angle, and obtain the welding gun posture angle corresponding to the welding path feature point ;
[0058] Step S5.4: According to the obtained position and posture data of the welding path feature points ( , , ), forming a robot program; the generated ( , , ) array is sent to the programmed robot welding path program, replacing the position and posture of the corresponding position data point. When the workpiece rotates Angle, the welding gun should be adjusted accordingly ( , ).
[0059] Preferably, in step S5.4, if the welding parameters at each position are different, the process parameters at the corresponding position are searched and replaced according to the set process database to complete the autonomous matching generation of the welding path and process parameters.
[0060] According to the present invention, a system for extracting weld features of special-shaped components and automatically generating welding trajectories includes:
[0061] Robots, robot control cabinets, positioners, line laser sensors, sensor controllers and industrial computers;
[0062] The line laser sensor is fixed to the end of the robot in an eye-on-hand manner to collect point cloud data of the weld groove contour;
[0063] The industrial computer completes the collection and transmission of point cloud data based on the sensor controller;
[0064] After the data is transmitted to the industrial computer, it is processed by the algorithm to generate trajectory posture control points and transmitted to the robot control cabinet;
[0065] The robot control cabinet is used to control the robot and the positioner to perform welding.
[0066] Preferably, the positioner can drive the workpiece to rotate along the x-axis, and the workpiece is fixed thereon with the axis of symmetry pointing vertically downward.
[0067] Compared with the prior art, the present invention has the following beneficial effects:
[0068] 1. The present invention realizes the autonomous generation of welding trajectory and welding parameter matching for complex special-shaped components, solves the problems of traditional methods such as reliance on manual teaching, low efficiency, poor precision, and inability to guarantee welding quality, and greatly improves the degree of automation of welding.
[0069] 2. The present invention only needs to rotate the workpiece while the sensor remains basically stationary to complete welding. Compared with the method of fixing the workpiece and moving the sensor to scan and generate welding, the operation of the present invention is simpler and more reliable, and has better practicality.
[0070] 3. The present invention adopts the Douglas-Peucker algorithm to greatly compress data points, greatly reducing the number of welding feature points without sacrificing path tracking accuracy, while reducing the complexity of the robot program and improving the generation efficiency of the robot welding program, which has good application prospects.
[0071] The present invention automatically obtains the position information and groove information of the weld through sensors and independently generates the welding trajectory, so that the programming and parameter matching of complex welds no longer rely on manual labor, significantly improving the production efficiency of welding and ensuring the consistency of product welding quality.
[0072] Other beneficial effects of the present invention will be explained through the introduction of specific technical features and technical solutions in the specific implementation methods. Those skilled in the art should be able to understand the beneficial technical effects brought about by the introduction of these technical features and technical solutions. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Other features, objects and advantages of the present invention will become more apparent upon reading the detailed description of non-limiting embodiments with reference to the following drawings:
[0074] Figure 1 Schematic diagram of the scanning method for calculating the highest point of a workpiece in the present invention.
[0075] Figure 2 Schematic diagram of weld groove feature point extraction based on quadratic difference in the present invention.
[0076] Figure 3 Schematic diagram of the all-position weld groove scanning method in the present invention.
[0077] Figure 4 Schematic diagram of the scanning position when calculating the rotation center in the present invention.
[0078] Figure 5 Schematic diagram of the calculation of the rotation center in the present invention.
[0079] Figure 6 Schematic diagram of the change of welding gun posture angle in the present invention.
[0080] Figure 7 Schematic diagram of the change in the center position of the weld in the z direction in the present invention.
[0081] Figure 8 Schematic diagram of the change in the weld center position in the x direction in the present invention.
[0082] Figure 9 This is a schematic diagram of the welding path and posture changes generated in the present invention.
[0083] Figure 10 It is a schematic diagram of the overall process of the present invention. DETAILED DESCRIPTION
[0084] The present invention will be described in detail below with reference to specific embodiments. The following examples will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those skilled in the art, several changes and improvements can be made without departing from the scope of the present invention. These all fall within the scope of protection of the present invention.
[0085] The experimental device of the present invention consists of: a six-axis industrial robot, a robot control cabinet, a positioner, a line laser sensor, a sensor controller, an industrial computer, etc. The connection relationship is: the line laser sensor is fixed to the end of the robot in an "eye on hand" manner. The industrial computer collects and transmits point cloud data through the sensor controller. After the data is transmitted to the industrial computer, it is processed by the algorithm to generate trajectory posture control points, which are transmitted to the robot control cabinet. The robot control cabinet controls the robot and the positioner to achieve welding. For the convenience of expression, the following is established: Figure 1 The coordinate system used to illustrate the x, y, and z directions is defined as follows: the x-axis is perpendicular to the workpiece mounting plane and pointing outward, the y-axis is perpendicular to the x-axis and pointing rightward, and the z-axis is perpendicular to the x-axis and pointing upward. The workpiece is fixed to the positioner with its axis of symmetry pointing vertically downward and can be rotated along the x-axis by the positioner.
[0086] A method for extracting weld features of special-shaped components and automatically generating welding trajectories, comprising:
[0087] Step S1: Determine the initial scanning position of the sensor.
[0088] Step S1.1: Scan the top area of the workpiece: First, the driving robot drives the laser sensor to be located directly above the workpiece, with the laser stripe projected near the center of the weld groove. The sensor then scans a distance along the y-axis (weld direction) to obtain point cloud data of the weld groove in the top area.
[0089] Step S1.2: Calculation of weld center point: Calculate the weld vertex by using quadratic difference combined with filtering and denoising.
[0090] Step S1.2.1: Perform moving average filtering on the collected point cloud data row by row (a row of weld point cloud data represents the cross-sectional profile information of the weld) to remove noise, then calculate the first-order difference, and perform median filtering and Gaussian filtering on the differenced data again;
[0091] Step 1.2.2: On this basis, calculate the second-order difference of the differential filtered data, and perform median filtering and Gaussian filtering;
[0092] Step 1.2.3: Find the minimum value of the second-order difference data of the groove. The corresponding point of the minimum value is the left and right feature points of the upper edge of the weld groove. The center of the left and right feature points is the center of the weld. In this way, the weld center position of each row of weld contour is obtained. , and the corresponding height .
[0093] Step 1.3: Calculate the coordinates of the highest weld center: Calculate the height of the weld center of each row, and then use the random sampling consensus method (RANSAC) to fit the height of the weld center of all rows. The y-axis coordinate of the highest point of the fitting curve is obtained as , the corresponding weld center coordinates are ( , , ), which is the initial position of the sensor scanning.
[0094] Step S2: Scanning the complete contour of the workpiece weld;
[0095] Step S2.1: Move the sensor to the initial scanning position.
[0096] The coordinates of the highest point of the weld center calculated in step S1 ( , , ) is sent to the robot, which controls the robot's movement so that the center of the sensor laser stripe is aligned with the center of the weld at the highest point and at a certain height from the workpiece.
[0097] Step S2.2: Data acquisition.
[0098] The positioner is rotated to rotate the workpiece around the x-axis. At the same time, the system triggers the sensor to start collecting the groove contour point cloud data. When the workpiece rotates >360°, the positioner stops rotating and the sensor ends data collection synchronously.
[0099] Step S3: Extracting groove feature points;
[0100] Step S3.1: Perform moving average filtering on the collected point cloud data row by row (a row of weld point cloud data represents the cross-sectional profile information of the weld) to remove noise, then calculate the first-order difference, and perform median filtering and Gaussian filtering on the differenced data again;
[0101] Step 3.2: On this basis, the second-order difference of the differential filter data is calculated, and median filtering and Gaussian filtering are performed;
[0102] Step 3.3: Find the minimum value of the second-order difference data of the groove. The point corresponding to the minimum value is the left and right feature points of the upper edge of the weld groove. The center of the left and right feature points is the center of the weld. In this way, the center position of the weld in each row is obtained. , the height corresponding to this position is .
[0103] Step S4: Calculation of welding gun posture angle:
[0104] Step S4.1: Calculate the relative height of the weld center at 90° and 180°:
[0105] Calculate the relative height of the weld center at 90° and 180° relative to the scanning start position , .
[0106]
[0107]
[0108] Among them, n represents the number of rows scanned in all positions, and round represents rounding up. represents the weld center height value of the i-th row, Indicates the weld center height when i=round(n*0.5); Indicates the weld center height value of the data in row 1.
[0109] Step S4.2: Calculate the center of rotation. Use Newton's iteration method to solve the equations and calculate the center of rotation ( , ). The calculation formula is as follows:
[0110]
[0111]
[0112] Among them, a and b represent the actual size information of the workpiece, b is the length of the major axis, and a is the length of the minor axis.
[0113] Step S4.3: Calculation of welding gun posture. In order to ensure welding quality, the welding gun should always be in the normal direction of the workpiece contour. The welding gun posture angle at any contour position is The calculation method is as follows:
[0114]
[0115]
[0116]
[0117]
[0118]
[0119] Among them, t represents the interval t rows of data points, represents the angles corresponding to adjacent t rows, represents the rotation angle, It indicates the distance from the workpiece rotation center to the scanning position when the i-th row of data is obtained by scanning, such as Figure 5 shown.
[0120] Furthermore, for the obtained welding posture data, moving median filtering is first used, and then cubic smoothing spline curve fitting is used to obtain the welding posture angle of each feature point in the entire complete welding path.
[0121] Step S5: generating welding tracks.
[0122] Step 5.1: Generate welding path points. Place the center of the weld (i.e., the center of the left and right feature points extracted in step S3) as the x-coordinate of the path point, and the weld height at the center position As the z coordinate of the path point, the x and z coordinates of the path point of the entire weld can be obtained along with the rotation angle. The change curve of i and rotation angle The relationship is:
[0123]
[0124] Where n represents the number of rows scanned for the entire weld seam.
[0125] The data is filtered using the segmented data fitting method. Specifically, median filtering + cubic smoothing spline fitting is used in the middle part where the curvature changes greatly, and random sampling consistency fitting can be used in the small range at both ends where the curvature changes less. Finally, the complete welding path coordinates are formed ( , ).
[0126] Step 5.2: Compression of welding path points. To facilitate the autonomous generation of robot programs, the number of data points should be compressed as much as possible without affecting the trajectory accuracy. There are two methods to compress path points:
[0127] Method 1: Use the Douglas-Peucker algorithm (hereinafter referred to as the DP algorithm) to compress the data;
[0128] Method 2: Take points according to the planned rotation angle interval, such as taking a path point every 6°, thereby compressing the number of key points.
[0129] In Method 1, the DP algorithm is a classic algorithm for thinning linear features. Using it to process a large number of redundant geometric data points can not only achieve the purpose of data reduction but also largely retain the skeleton of the geometric shape. The basic idea of the algorithm is as follows: Connect the first point and the last point of the curve to form a straight line, and calculate the maximum distance from all intermediate points to this straight line ; if < D (preset threshold), then only the first and the last points of this segment are retained, and the processing of this segment ends; otherwise, use the corresponding intermediate point to divide the curve into two segments, and repeat the previous two steps for these two segments. After the recursion ends, connect the retained points in sequence to form the simplified curve. It can be seen that the DP algorithm realizes curve compression by presetting the threshold D
[0130] After compression, the coordinates of the key points of the welding path can be obtained: the rotation angle and the x, z coordinate pairs ( , ).
[0131] Step S5.3: Extract the pose angles corresponding to the feature points: According to the row numbers corresponding to the key points after compression in Step S5.1, find the welding torch pose angles corresponding to the corresponding rotation angles to obtain the welding torch pose angles corresponding to the feature points of the welding path .
[0132] Step S5.4: Generate the robot program
[0133] According to the obtained pose data pairs of the feature points of the welding path ( , , ), form the robot program. Send the generated ( , , ) array to the programmed robot welding path program, replace the positions and poses of the data points at the corresponding positions, and the welding torch can be adjusted correspondingly ( ) when the workpiece rotates , ).
[0134] If the welding parameters at each position are different, then according to the set process database, search for and replace the process parameters at the corresponding positions, and finally realize the autonomous matching and generation of the welding path and process parameters
[0135] The present invention realizes the autonomous generation of the welding trajectory and the matching of welding parameters for complex shaped components, solves the problems of traditional methods such as relying on manual teaching, low efficiency, poor accuracy, and inability to guarantee welding quality, and greatly improves the automation degree of welding
[0136] The above is a basic embodiment of the present invention. The technical solution of the present invention is further described below through a preferred embodiment.
[0137] Example 1
[0138] Reference Figure 10 As shown, a method for extracting weld feature points of complex special-shaped components and generating welding gun trajectories includes the following steps:
[0139] Step S1: Determine the initial scanning position of the sensor.
[0140] Step S1.1: Scan the top area of the workpiece. The workpiece is kept stationary with its axis of symmetry pointing vertically downward. Adjust the position of the line laser sensor so that it is directly above the workpiece and the line laser range can cover the weld area. The sensor moves along the y-axis to complete the scan, as shown in the following example. Figure 1 As shown in Figure 2. In this example, the laser sensor scans along a straight line at a speed of v = 0.1 m / s, with a scanning frequency of f = 1000 Hz. The scan generates 2000 rows of data, each with 3200 columns, and a column spacing of 0.025 mm. The row spacing is calculated based on the laser displacement sensor's scanning speed and frequency: v / f = 0.1 mm.
[0141] Step S1.2: Calculate the center point of the weld. Calculate the center point of the weld by using quadratic difference combined with filtering and denoising.
[0142] Specifically include:
[0143] Step S1.2.1: Apply a moving average filter to the point cloud data row by row (a row of the point cloud data represents the cross-sectional profile of the weld) with a window size of 5×1. First-order differences are then taken, and the differenced data is subjected to median filtering and Gaussian filtering. Gaussian filters are a type of linear smoothing filter whose weights are selected based on the shape of the Gaussian function. Median filtering replaces the value of a point in a digital image or digital sequence with the median of the values of all points in its neighborhood, aligning the surrounding pixel values with the true value and thus eliminating isolated noise points. Gaussian smoothing filters are very effective for suppressing normally distributed noise.
[0144] Step 1.2.2: On this basis, calculate the second-order difference of the differential filtered data, and perform median filtering and Gaussian filtering.
[0145] Step 1.2.3: Find the minimum value of the second-order difference data of the groove. The point corresponding to the minimum value is the left and right characteristic points of the upper edge of the weld groove, such as Figure 2 As shown. The center of the left and right feature points is the center of the weld. The center position of each row of welds is obtained from this. , the corresponding height is .
[0146] Step 1.3: Calculate the coordinates of the highest weld center. Calculate the height of the weld center for each row. Then, use the least squares method based on the random sampling consensus algorithm (RANSAC) to fit the weld center height variation curve. Obtain the fitting curve formula and calculate the coordinates of the curve's extreme points. The fitting formula is as follows:
[0147]
[0148] In this embodiment, the curve fitting method based on the random sampling consensus algorithm is as follows: 20 points are randomly selected and curve fitting is performed on these 20 points. The distance from other points in the point set to the fitted curve is calculated, and a threshold is set. Points with a distance greater than the threshold are considered outliers and discarded; points with a distance less than the threshold are considered inliers, and the number of inliers is counted. The curve fitting is then repeated based on the new inliers, and multiple iterations are repeated. The fitted curve with the largest number of inliers is selected, and this curve is considered the optimal fit curve. The number of iterations is set to 500. Ultimately, only the polynomial with the highest accuracy, i.e., the one with the fewest pixels that deviate from the fitted curve, is retained as the fitting result. If the distance between a pixel and the fitted curve exceeds 0.2, the point is considered off the curve.
[0149] The position of the highest point of the fitting curve in the y-axis direction is , accordingly, the coordinates of the weld center corresponding to this position are ( , , ).
[0150] Step S2: Scanning the complete contour of the workpiece weld;
[0151] Step S2.1: Move the sensor to the set initial position. Set the coordinates of the highest point of the weld center calculated in step S1 ( , , ) is sent to the robot, which controls its movement so that the center of the sensor laser line is aligned with the center of the weld at the highest point, at a certain height above the workpiece. This position serves as the sensor's initial position for top scanning.
[0152] Step S2.2: Data acquisition. The positioner rotates to rotate the workpiece around the x-axis. When the workpiece starts to rotate, the system synchronously triggers the sensor to collect groove data in real time. When the workpiece rotates ≥ 360°, the positioner stops rotating and the sensor synchronously ends data acquisition. Figure 3 As shown in the figure, the sensor scan frequency is 1000 Hz, and the point cloud data size is 21,000 rows and 3,200 columns.
[0153] Step S3: Extracting groove feature points;
[0154] Step S3.1: Perform a moving average filter on the point cloud data row by row (a row of the point cloud data represents the cross-sectional information of the weld) with a window size of 5 × 1. Then, calculate the first-order difference, and perform median filtering and Gaussian filtering on the differenced data.
[0155] Step 3.2: On this basis, the second-order difference of the differential filtered data is calculated, and median filtering and Gaussian filtering are performed.
[0156] Step 3.3: Find the minimum value of the second-order difference data of the groove. The point corresponding to the minimum value is the left and right feature points of the upper edge of the weld groove. The center of the left and right feature points is the center of the weld. In this way, the center position of the weld in each row is obtained. , the corresponding height is .
[0157] Step S4: Calculation of welding gun posture angle:
[0158] Step S4.1: Calculate the relative height of the welds at 90° and 180° positions on the component:
[0159] Calculate the relative height of 90° and 180° relative to the starting point respectively , ,like Figure 4 shown.
[0160]
[0161]
[0162] Wherein, n represents the number of rows scanned in all positions, which is 21000 in this embodiment, and round represents rounding up. represents the weld center height value of the i-th row, Indicates the weld center height when i=round(n*0.5); Indicates the weld center height value of the data in row 1.
[0163] Step S4.2: Calculate the rotation center, such as Figure 5 shown.
[0164]
[0165]
[0166] Among them, a and b represent the actual size information of the workpiece, b is the length of the major axis, and a is the length of the minor axis.
[0167] The Newton iteration method is used to solve the equations to get ,
[0168] Step S4.3: Calculation of welding gun posture. In order to ensure welding quality, the welding gun should always be in the normal direction of the workpiece contour. The welding gun posture angle at any contour position is The calculation method is as follows:
[0169]
[0170]
[0171]
[0172]
[0173]
[0174] Among them, t means that data points are taken at intervals of t rows. represents the angles corresponding to adjacent t rows. Indicates the rotation angle. It indicates the distance from the workpiece rotation center to the scanning position when the i-th row of data is obtained by scanning, such as Figure 5 shown.
[0175] For the obtained welding posture data, a moving median filter is first used, and the median filter window size is 300×1. Then a cubic spline curve is used for fitting to obtain the smoothed welding posture angle data of all scanning positions of the entire workpiece space weld. Cubic smoothing spline is a curve smoothing algorithm for two-dimensional data. The smoothing parameter p directly determines the characteristics of the final fitting spline curve, that is, the weight ratio of the fitting accuracy of the original data and the smoothness of the curve itself. The fitting focuses on global data and has strong flexibility. In this embodiment, p=1× The smoothed curve is as follows Figure 6 shown.
[0176] Step S5: generating welding tracks.
[0177] Step 5.1: Generate welding path points. Place the center of the weld (i.e., the center of the left and right feature points extracted in step S3) as the x-coordinate of the path point, and the weld height at the center position As the z coordinate of the path point, the x and z coordinates of the entire weld path and the rotation angle can be obtained. The change curve of i and rotation angle The relationship is:
[0178]
[0179] Where n represents the number of rows scanned in all positions.
[0180] The data is filtered by using the method of piecewise data fitting. Specifically: in the middle part with large curvature changes, median filtering + cubic smoothing spline fitting is used. The median filtering window size is 300×1, and the cubic smoothing spline parameter p = 1× ; in a small range at both ends with small curvature changes, the random sample consensus method can be used for fitting, and finally the complete welding path coordinates are formed ( , ,,). The smoothed effect is as shown in Figure 7 and Figure 8 .
[0181] Step 5.2: Compression of welding path points. To facilitate the autonomous formation of a robot program, the number of data points should be compressed as much as possible without affecting the trajectory accuracy. Two methods can be used to compress the path points:
[0182] Method 1: The Douglas - Peucker algorithm (hereinafter referred to as the DP algorithm) is used to compress the data. In this embodiment, the threshold D = 0.46 is selected. The number of points after compression is 64, and the compression rate reaches 99.7%. The corresponding conversion relationship between the number of rows of data and the rotation angle is: [[ID=二十]]= number of rows / total number of rows × 360°, and the -z and -x curves are plotted;
[0183] Method 2: Points are taken at the planned rotation angle intervals. For example, a path point is taken every 6°, so as to greatly compress the key feature points of the welding path. For some regions with curvature changes, points can be taken at 3° intervals, and thus the number of key data points is also 64.
[0184] In Method 1, the DP algorithm is a classic algorithm for thinning linear features. Using it to process a large number of redundant geometric data points can not only achieve the purpose of data volume reduction, but also largely retain the skeleton of the geometric shape. The basic idea of the algorithm is as follows: Connect the first point and the last point of the curve to form a straight line, and calculate the maximum distance from all intermediate points to this straight line; if < D (preset threshold), then only the first and last points of this segment are retained, and the processing of this segment ends; otherwise, the curve is divided into two segments by the corresponding intermediate point, and the previous two steps are repeated for these two segments. Until the recursion ends, the retained points are connected in sequence to form the simplified curve. It can be seen that the DP algorithm realizes curve compression by presetting the threshold D.
[0185] After compression, the coordinates of the key points of the welding path can be obtained: the rotation angle and the x, z coordinate pairs ( , ), the k value in this embodiment is 64.
[0186] Step S5.3: Extract the posture angle corresponding to the feature point. According to the number of rows corresponding to the compressed key points in step S5.1, find the welding gun posture angle corresponding to the corresponding rotation angle, and obtain the welding gun posture angle corresponding to the welding path feature point .
[0187] Step S5.4 generates the robot program. Figure 9 As shown, according to the pose data of the welding path feature points ( , , ), forming a robot program, and generating ( , , ) array is sent to the programmed robot welding path program, and the position and posture of the corresponding position data points are replaced to realize the rotation of the workpiece Angle, the welding gun should be adjusted accordingly ( , If the welding parameters at each position are different, the process parameters at the corresponding position will be searched and replaced according to the set process database, ultimately achieving autonomous matching and generation of welding paths and process parameters.
[0188] The present invention can complete welding by simply rotating the workpiece while the sensor remains basically stationary. Compared with the method of generating welding by fixing the workpiece and moving the sensor for scanning, the operation of the present invention is simpler and more reliable, and has better practicality. The Douglas-Peucker algorithm is used to greatly compress data points, greatly reducing the number of welding feature points without sacrificing path tracking accuracy. At the same time, the complexity of the robot program is reduced, the generation efficiency of the robot welding program is improved, and it has good application prospects.
[0189] Those skilled in the art will appreciate that, in addition to implementing the system and its various devices, modules, and units provided by the present invention in purely computer-readable program code, it is entirely possible to implement the same functions of the system and its various devices, modules, and units provided by the present invention in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered a hardware component, and the devices, modules, and units included therein for implementing various functions can also be considered as structures within the hardware component; the devices, modules, and units for implementing various functions can also be considered as both software modules implementing the method and structures within the hardware component.
[0190] The above describes specific embodiments of the present invention. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art may make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. The embodiments of this application and the features in the embodiments may be combined with each other in any manner unless there is a conflict.
Claims
1. A method for extracting weld features of special-shaped components and automatically generating welding trajectories, characterized in that: include: Step S1: Establish a three-dimensional coordinate system and calculate the initial scanning position coordinates of the sensor; Step S2: moving the sensor to the initial scanning position coordinates and collecting workpiece data; Step S3: performing secondary difference on the collected workpiece data to extract weld groove feature points; Step S4: Calculate the welding gun posture angle according to the weld groove feature points; Step S5: obtaining welding path coordinates based on the welding gun posture angle and generating a welding trajectory; The step S1 includes the following sub-steps: Step S1.1: Scan the top area of the workpiece; drive the robot so that the laser sensor is located directly above the workpiece, project a laser stripe at the center of the weld groove, and scan a distance along the y-axis to obtain point cloud data of the weld groove in the top area; Step S1.2: Obtain the vertex coordinates of the weld by using quadratic difference combined with filtering and denoising; Step S1.3: Calculate the height of the weld center of each row, and then use the random sampling consistency method to fit the height of the weld center of all rows. The coordinate of the highest point of the fitting curve in the y-axis direction is , the corresponding weld center coordinates are the initial scanning position coordinates of the sensor ( , , ); The step S1.2 includes the following sub-steps: Step S1.2.1: Perform moving average filtering on the collected point cloud data row by row to remove noise, calculate the first-order difference, and perform median filtering and Gaussian filtering on the differenced data again; Step S1.2.2: Calculate the second-order difference of the differential filtered data again, and perform median filtering and Gaussian filtering; Step S1.2.3: Find the minimum value of the second-order difference data of the groove; The points corresponding to the minimum values are the left and right characteristic points of the upper edge of the weld groove; The center of the left and right characteristic points is the center of the weld; Based on this, the center position of the weld seam of each row of weld seam contour is obtained , and the corresponding height ; The step S2 includes the following sub-steps: Step S2.1: Move the sensor to the initial scanning position; calculate the coordinates ( , , ) is sent to the robot, which controls the robot's movement so that the center of the sensor's laser stripe is aligned with the center of the weld at the highest point and at a certain height from the workpiece; Step S2.2: The rotary positioner rotates the workpiece around the x-axis until the rotation angle is greater than 360°; The sensor collects the groove contour point cloud data when the positioner starts to rotate, and ends the data collection synchronously when the positioner stops rotating; The step S4 includes the following sub-steps: Step S4.1: Calculate the relative height of the weld center at 90° and 180° relative to the initial scan position , : Among them, n represents the number of rows scanned in all positions, and round represents rounding up. represents the weld center height value of the i-th row, Indicates the weld center height when i=round(n*0.5); Indicates the weld center height value of the data in row 1; Step S4.2: Use Newton's method to solve the equations to calculate the center of rotation ( , ): Where a and b represent the actual size information of the workpiece, b is the length of the major axis, and a is the length of the minor axis; Step S4.3: Make the welding gun always in the normal direction of the workpiece contour, and the welding gun posture angle at any contour position The calculation method is as follows: Among them, t represents the interval t rows of data points, represents the angles corresponding to adjacent t rows, represents the rotation angle, Indicates the distance from the workpiece rotation center to the scanning position when the i-th row of data is scanned; The obtained welding posture data is filtered using a moving median filter and fitted with a cubic smoothing spline curve to obtain the welding posture angle of each feature point in the entire welding path. The step S5 includes the following sub-steps: Step S5.1: Center the weld As a waypoint x Coordinates, weld height at center position As a waypoint z Coordinates, respectively get the path points of the entire weld x and z Coordinates with rotation angle The change curve of i and rotation angle The relationship is: in, n Represents the number of rows scanned for the entire weld; the data is filtered using the segmented data fitting method to ultimately form the complete welding path coordinates ( , ); Step S5.2: Use the Douglas-Peucker algorithm or take points according to the planned rotation angle interval to compress the number of key points and obtain the coordinates of the key points of the welding path: rotation angle and x , z Coordinate point pair ( , ); Step S5.3: According to the number of rows corresponding to the compressed key points, find the welding gun posture angle corresponding to the corresponding rotation angle, and obtain the welding gun posture angle corresponding to the welding path feature point ; Step S5.4: According to the obtained position and posture data of the welding path feature points ( , , ), forming a robot program; the generated ( , , ) array is sent to the programmed robot welding path program, replacing the position and posture of the corresponding position data point. When the workpiece rotates Angle, the welding gun should be adjusted accordingly ( , ).
2. The method for extracting weld features and automatically generating welding trajectories of special-shaped components according to claim 1, characterized in that: The step S3 includes the following sub-steps: Step S3.1: Perform moving average filtering on the collected point cloud data row by row to remove noise, calculate the first-order difference, and perform median filtering and Gaussian filtering on the differenced data; Step S3.2: Calculate the second-order difference of the differential filtered data, and perform median filtering and Gaussian filtering again; Step S3.3: Find the minimum value of the second-order difference data of the groove; The points corresponding to the minimum values are the left and right characteristic points of the upper edge of the weld groove; The center of the left and right characteristic points is the center of the weld; Based on this, the center position of the weld in each row is obtained , and the height corresponding to this position is .
3. The method for extracting weld features and automatically generating welding trajectories of special-shaped components according to claim 1, characterized in that: In step S5.4, if the welding parameters at each position are different, the process parameters at the corresponding position are searched and replaced according to the set process database to complete the autonomous matching generation of the welding path and process parameters.
4. A system for extracting weld features and automatically generating welding trajectories for special-shaped components, using the method for extracting weld features and automatically generating welding trajectories for special-shaped components according to any one of claims 1 to 3, characterized in that: include: Robots, robot control cabinets, positioners, line laser sensors, sensor controllers and industrial computers; The line laser sensor is fixed to the end of the robot in an eye-on-hand manner to collect point cloud data of the weld groove contour; The industrial computer completes the collection and transmission of point cloud data based on the sensor controller; After the data is transmitted to the industrial computer, it is processed by the algorithm to generate trajectory posture control points and transmitted to the robot control cabinet; The robot control cabinet is used to control the robot and the positioner to perform welding.
5. The system for extracting weld features and automatically generating welding trajectories for special-shaped components according to claim 4, characterized in that: The positioner can drive the workpiece to rotate along the x-axis, and the workpiece is fixed thereon with the axis of symmetry pointing vertically downward.
Citation Information
Patent Citations
Interaction-based welding seam curve extraction and automatic track generation method
CN113814528A
Welding robot teaching-free autonomous operation method based on data model and visual system
CN117921670A
Space right-angled broken line welding line fitting system based on line laser scanning
CN110315249A
Demonstration-free welding method and system based on laser vision sensor
CN117260102A