Weld joint path tracking method
By combining 3D structured light sensors and reinforcement learning networks, precise tracking of weld seam paths was achieved, solving the problems of weld seam position deviation and dynamic interference, and improving the reliability and accuracy of welding.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG QIANJIANG ROBOT CO LTD
- Filing Date
- 2025-12-13
- Publication Date
- 2026-04-21
AI Technical Summary
Existing welding technologies lack the ability to dynamically adjust when faced with weld position deviations and switching between multiple weld types. This results in the welding torch deviating from the weld center, uneven penetration, and an inability to respond in real time to dynamic disturbances during the welding process, affecting welding accuracy and efficiency.
Weld seam point cloud data is acquired using a 3D structured light sensor. Noise is removed by statistical filtering and least squares fitting while preserving geometric features. Weld gun displacement is corrected in real time by combining reinforcement learning network, and linkage between perception data and control commands is established to achieve accurate tracking of weld seam path.
It improves the reliability and accuracy of weld path tracking, can dynamically respond to interference during the welding process, adapt to complex working conditions, and improve welding quality and efficiency.
Smart Images

Figure CN121904099A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of welding technology and relates to a weld seam path tracking method. Background Technology
[0002] In the field of industrial welding automation, accurate identification and real-time tracking of weld paths are core aspects of ensuring welding quality. Traditional automated welding systems generally adopt a manual teaching path mode. This method lacks dynamic adjustment capabilities when faced with weld position shifts caused by workpiece thermal deformation and assembly errors, or when switching between multiple weld types such as V-type, U-type, and corner joints. This can easily lead to problems such as welding torch deviating from the weld center and uneven penetration, making it difficult to meet the dual requirements of high precision and high efficiency in modern welding.
[0003] Currently, mainstream weld seam recognition technologies include 2D image recognition, line laser scanning, and contact probe detection. These methods generally suffer from drawbacks such as susceptibility to environmental interference, unstable measurement accuracy, and inability to fully acquire the spatial geometric information of the weld seam. In recent years, with the rapid development of 3D structured light and point cloud sensing technologies, 3D weld seam recognition has become an industry trend. However, existing technologies largely rely on overall contour extraction or bounding box localization, making it difficult to accurately capture key feature points in the area where the weld seam and laser intersect. This results in poor uniqueness and repeatability of feature points in complex conditions such as asymmetric weld seams and curved transition sections, failing to provide a reliable positioning benchmark for subsequent path tracking.
[0004] At the level of weld seam path tracking, most systems still control the movement of the welding torch through path fitting and interpolation algorithms. They do not fully consider the dynamic interference during the welding process (such as workpiece vibration and airflow disturbance), nor do they establish a real-time linkage mechanism between sensing data and control commands. When the actual position of the weld seam shifts due to changes in working conditions, the system cannot correct the motion parameters in real time, resulting in the accumulation of tracking errors and seriously affecting the reliability of path tracking. Summary of the Invention
[0005] The purpose of this invention is to address the aforementioned problems in the existing technology by proposing a weld path tracking method. The technical problem to be solved is: how to improve the reliability of weld path tracking.
[0006] The objective of this invention can be achieved through the following technical solution: a weld path tracking method, comprising the following steps:
[0007] A. Acquire three-dimensional point cloud data of the weld area using a 3D structured light sensor;
[0008] B. Preprocess the acquired 3D point cloud data. The preprocessing includes using statistical filtering to remove outliers and fitting local polynomial surfaces using moving least squares to remove noise and retain geometric features.
[0009] C. Enhance the optimized 3D point cloud data with laser lines, set an intensity threshold, and retain high-brightness laser points.
[0010] D. By fitting the curve of the retained high-brightness laser points using the least squares polynomial method, the weld point cloud data of the cross section can be obtained.
[0011] Weld feature points are obtained from the weld point cloud data of the cross section using curvature and depth information; the weld center point is obtained from the weld feature points to construct a local spatial region;
[0012] E. Standardize the point cloud data within the local spatial region, and then feed the standardized point cloud data into the reinforcement learning network as input.
[0013] F. Predict the end effector direction of the welding robot arm in the next step using a reinforcement learning network; send the motion command to the robot controller, convert it into joint space control signals through the kinematic model, and execute the path following.
[0014] This weld path tracking method fully utilizes 3D structured light sensors to collect weld point cloud data, completely capturing the depth dimension features of the weld (such as bevel depth and sidewall inclination). This provides accurate data support for subsequent feature point extraction and curvature analysis, avoiding tracking deviations caused by missing two-dimensional data. Through least-squares polynomial fitting and fusion of weld depth information and curvature analysis, the method accurately locates the true geometric feature points where the laser and weld structure intersect, effectively ensuring the stability of feature point extraction in complex curved surfaces and asymmetric weld scenarios, thus avoiding interference data and feature distortion at the source. Simultaneously, by establishing real-time linkage between perception data and control commands through a reinforcement learning network, it abandons traditional fixed path fitting and interpolation modes. This allows for dynamic response to dynamic interferences during the welding process, such as workpiece vibration and airflow disturbances, and real-time correction of the welding torch end displacement and joint control signals, effectively avoiding the accumulation of tracking errors. This enhances adaptability to complex working conditions and achieves high-precision, low-latency path following, effectively improving the reliability of weld path tracking.
[0015] In the above weld path tracking method, the operation of removing outliers using statistical filtering in step B is as follows:
[0016] For each point p in the 3D point cloud data i Calculate the average distance from its k nearest neighbors. ;
[0017]
[0018] Where ||·|| represents Euclidean distance; It is a point The set of k nearest neighbors; This represents the j-th point in the set of k nearest neighbors of a given point;
[0019] Assume the average distance of all points { } follows a Gaussian distribution, calculate the mean. and standard deviation ;
[0020]
[0021]
[0022] Where N is the total number of points in the point cloud;
[0023] Set threshold Remove points that satisfy the following formula:
[0024] > + .
[0025] threshold The value is typically set to 5 to 20, with 10 being a common choice to better adapt to the local geometric features of the laser line itself and to more accurately identify discrete points.
[0026] In the above weld path tracking method, in step B, the operation of fitting a local polynomial surface using the moving least squares method to remove noise and preserve geometric features is as follows:
[0027] For each point in the 3D point cloud data In its neighborhood Intrinsically fit a local polynomial surface and minimize the weighted squared error:
[0028]
[0029] in, It is a local polynomial function; The coefficients to be determined; This represents the j-th point in the set of K nearest neighbors of a given point;
[0030]
[0031] in, Here, h is the weighting function, h is the neighborhood radius (smoothing parameter), and r is the number of neighborhood points. To the current fitted point Euclidean distance;
[0032] Normalize the weights:
[0033]
[0034] Point Projecting the coordinates onto the fitted surface yields the smoothed coordinates. :
[0035]
[0036] in, It is a least squares solution; It is a point Two-dimensional coordinates on a local coordinate system or projection plane; It is a function evaluation operation.
[0037] The coefficients to be determined in this step The solution is obtained using the weighted least squares method, and the calculation formula is: a = (M T AM) -1 M T AW. Here, M is the design matrix composed of the coordinates of neighboring points, A is the weight matrix calculated based on the distance between points, and W is the observation vector. This algorithm achieves accurate fitting of local geometric features by assigning higher weights to nearby points.
[0038] In the above weld path tracking method, the operation of retaining the high-brightness laser point in step C is as follows:
[0039] Extracting a candidate set of laser points from 3D point cloud data using an intensity threshold;
[0040]
[0041] in, This represents the reflection intensity value of each point in the point cloud. The intensity threshold is P; P represents the entire set of candidate laser points. This represents the set of interior points of the final fitted laser curve model, which consists of high-brightness laser points that need to be retained. By retaining these high-brightness laser points, this method can quickly remove background noise, allowing subsequent processing to focus only on effective data directly related to the weld, reducing subsequent processing costs and improving the stability of feature extraction.
[0042] In the above weld path tracking method, in step C, the laser curve model is obtained using the RANSAC algorithm, and the operation is as follows:
[0043] Random from The minimum point set is selected for initial model estimation;
[0044] Calculate the residuals of the remaining points to the initial model, and determine whether they belong to the interior points of the initial model. The residuals are calculated as the distance from the point to the model.
[0045] Points with residuals less than a set threshold are used as fitted inliers, and the number of inliers is calculated.
[0046] Repeat the above process N times, retaining the model with the most interior points as the final laser curve model. This step helps improve the accuracy of the retained high-brightness laser points, thus ensuring precise tracking of the subsequent weld seam.
[0047] In the above-described weld path tracking method, step D further includes segmenting the weld region of the cross-section's weld point cloud data using geometric feature analysis. The operation includes:
[0048] First, normal estimation is performed by calculating the covariance matrix. The surface normal is obtained by using the eigenvector corresponding to the smallest eigenvalue;
[0049]
[0050] in:
[0051] It is the neighborhood centroid; the eigenvectors of matrix C correspond to the principal directions of the local surface;
[0052] Perform eigenvalue decomposition on C:
[0053]
[0054] Where V represents the eigenvector matrix, a 3x3 orthogonal matrix, whose each column ( ) are eigenvectors of the covariance matrix C; Λ is the diagonal matrix of eigenvalues; The minimum eigenvalue, that is, the first column of data in V lies in the minimum eigenvector. Variance in direction; The intermediate feature value is the data in the intermediate feature vector. Variance in direction; The largest eigenvalue is the data in the largest eigenvector. Variance in direction;
[0055] Unify the direction of the normal. ;
[0056] Wherein, normal vector It is the smallest eigenvalue; This refers to the viewpoint position. The application of the weld area segmentation step can accurately locate the effective area of the weld, establishing a reliable foundation for accurately extracting weld feature points and optimizing the input data of the reinforcement learning network, thereby providing a reliable guarantee for the accurate tracking of the welding path.
[0057] In the above-described weld path tracking method, step D further includes fitting the weld centerline using a B-spline, the operation of which is as follows:
[0058] Extract the weld point cloud from the weld feature points based on the minimum depth change value and use it as the center point in the weld region;
[0059] Solve the system of equations :
[0060] Construct the basis function matrix N(N) (n+1)):
[0061]
[0062] Least squares solution:
[0063]
[0064] Where λ is the smoothing coefficient; D is the regularization matrix; and P represents the coordinate matrix of the control points to be determined. This represents the transpose of matrix N; N represents the coordinate matrix of the known original data points; N represents the basis function matrix. Indicates in the parameter At that point, the value of the 0th basis function of order p; They represent the parameters respectively. At that point, the value of the nth basis function of order p;
[0065] Generate fitted points:
[0066]
[0067] in, A vector-valued function representing parameter u; , This represents the value of the i-th p-th B-spline basis function at parameter u; Indicates curve parameters; Indicates the valid domain of the parameter;
[0068] Discrete weld scan points are transformed into continuous and smooth weld centerlines by generating fitting points.
[0069] Error assessment:
[0070]
[0071] in, This represents the k-th original data point; Indicates that u k Substituting the fitted B-spline curve formula C(u) into the calculated 3D coordinates; Root mean square error (RMSE) measures the average deviation between the fitted curve and the original data.
[0072] In the above-described weld path tracking method, step E, the operation of standardizing the point cloud data within the local spatial region, includes:
[0073] The formula for calculating the centroid of a point cloud is as follows:
[0074] Where N represents the number of points in the point cloud. Represent the coordinates of each point;
[0075] Perform a translation operation on each point in the point cloud, and obtain the new coordinates of each point after the translation. for:
[0076] =( )
[0077] Each point in the translated point cloud is scaled down, and the final coordinates after scaling are obtained. for:
[0078] ( )
[0079] in, Indicates the scaling factor; ; .
[0080] Standardizing point cloud data within a local spatial region can eliminate numerical differences between point clouds from different sources and at different scales, enabling the data to be uniformly mapped to a standardized range, thus providing a basic guarantee for accurately predicting the end-effector displacement direction of the welding robot.
[0081] In the above-described weld path tracing method, step F further includes:
[0082] The reward function is designed to calculate the reward value based on the angle between the actual motion direction and the main weld direction, the tracking error, and whether any deviation has occurred. The formula is:
[0083]
[0084] in, As a reward for tracking error, Rewards for orientation alignment; Punishment for shaking; To escape the punishment of being tracked; To complete the reward;
[0085] Through reward value Constructing the advantage function and use it as the objective function. The weights are updated in reverse to optimize the reinforcement learning network;
[0086] Advantage function for:
[0087]
[0088] in, As a value network, the state The predicted returns As a value network, the state The predicted returns Discount factor;
[0089] objective function for:
[0090]
[0091] in, The probability ratio; Indicates the direction of displacement of the robotic arm; This represents the current local point cloud features; The cropping threshold, Represents the clipping function; Operator for mathematical expectation;
[0092] By adjusting strategy parameters This increases the probability of the strategy taking advantageous actions and decreases the probability of taking disadvantageous actions.
[0093] In the steps, the reward value Designing a strategy for a continuous reward function is a prerequisite for achieving efficient and stable learning in complex, continuous weld seam tracking tasks. By driving the update of strategy network parameters through actual reward feedback, the welding path control acquires adaptive adjustment capabilities, enabling real-time response to trajectory disturbances caused by weld seam path shape, structural interference, or workpiece deformation, thereby improving the reliability and accuracy of welding path tracking.
[0094] In the above-described weld path tracing method, step F further includes:
[0095] The design of the reward function, the reward value The deviation between the current action and the actual weld path direction is calculated, and the specific formula is as follows:
[0096]
[0097] Through reward value Constructing the advantage function and use it as the objective function. The weights are updated in reverse to optimize the reinforcement learning network;
[0098] Advantage function for:
[0099]
[0100] in, As a value network, the state The predicted returns As a value network, the state The predicted returns Discount factor;
[0101] objective function for:
[0102]
[0103] in, For probability ratios, The cropping threshold, It is a commonly used function;
[0104] By adjusting strategy parameters This increases the probability of the strategy taking advantageous actions and decreases the probability of taking disadvantageous actions.
[0105] In the steps, the reward value A discrete reward strategy is designed to provide a precise optimization objective for the gradient update of the reinforcement learning network, thereby guiding the agent to quickly learn the correct strategy.
[0106] Compared with existing technologies, this weld path tracking method has the following advantages:
[0107] 1. This invention introduces a reinforcement learning network to construct an action decision model based on point cloud state input, and uses the policy gradient method (PPO) to achieve closed-loop learning from trajectory perception to action generation. By driving the policy network parameter update through actual reward feedback, the welding path control acquires adaptive adjustment capabilities, enabling real-time response to trajectory disturbances caused by weld path shape, structural interference, or workpiece deformation, thereby improving the reliability and accuracy of weld path tracking.
[0108] 2. The control process of this invention has three major capabilities: continuous acquisition, dynamic prediction, and closed-loop feedback. The overall system operation is highly stable with small path deviation. Compared with traditional schemes that rely on teaching and fixed interpolation, it has stronger self-learning ability, environmental adaptability, and control accuracy. It significantly improves the stability and intelligence level of welding tasks under complex working conditions and has good industrial application prospects and promotion value. Attached Figure Description
[0109] Figure 1 This is a schematic diagram of the control flow of the present invention. Detailed Implementation
[0110] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the present invention or its application or use. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0111] Example 1:
[0112] like Figure 1 As shown, when performing weld path tracking using this method, firstly, a 3D structured light sensor is used to acquire 3D point cloud data of the weld area; then, the acquired 3D point cloud data is preprocessed, including using statistical filtering to remove outliers and fitting a local polynomial surface using the moving least squares method to remove noise and retain geometric features; specifically, the statistical filtering method for removing outliers involves the following steps:
[0113] For each point p in the 3D point cloud data i Calculate the average distance from its k nearest neighbors. ;
[0114]
[0115] Where ||·|| represents Euclidean distance; It is a point The set of k nearest neighbors; This represents the j-th point in the set of k nearest neighbors of a given point; k is generally set to 20-50, and k=30 can be used.
[0116] Assume the average distance of all points { } follows a Gaussian distribution, calculate the mean. and standard deviation ;
[0117]
[0118]
[0119] Where N is the total number of points in the point cloud;
[0120] Set threshold Remove points that satisfy the following formula:
[0121] > + .
[0122] threshold The value is typically set to 5 to 20, with 10 being a common choice to better adapt to the local geometric features of the laser line itself and to more accurately identify discrete points.
[0123] The specific steps for fitting a local polynomial surface using the moving least squares method to remove noise and preserve geometric features are as follows:
[0124] For each point in the 3D point cloud data In its neighborhood Intrinsically fit a local polynomial surface and minimize the weighted squared error:
[0125]
[0126] in, It is a local polynomial function; The coefficients to be determined; This represents the j-th point in the set of K nearest neighbors of a given point; the coefficients to be determined in this step. The solution is obtained using the weighted least squares method, and the calculation formula is: a = (M T AM) -1 M T AW. Where M is the design matrix composed of the coordinates of neighboring points, A is the weight matrix calculated based on the distance between points, and W is the observation vector.
[0127]
[0128] in, Here, h is the weighting function, h is the neighborhood radius (smoothing parameter), and r is the number of neighborhood points. To the current fitted point Euclidean distance;
[0129] Normalize the weights:
[0130]
[0131] Point Projecting the coordinates onto the fitted surface yields the smoothed coordinates. :
[0132]
[0133] in, It is a least squares solution; It is point p i Two-dimensional coordinates on a local coordinate system or projection plane; This is a function evaluation operation. It involves setting the point... coordinates ( Substitute into the already fitted polynomial function In the middle. Because of the coefficient Since it is known, the function value (i.e., the height value) of that point can be calculated directly:
[0134] .
[0135] Subsequently, laser line region enhancement was performed on the optimized 3D point cloud data. By utilizing the intensity feature difference between the laser line points and the background points, threshold segmentation and clustering were used to separate the laser line from the background, thereby obtaining a cleaner and clearer laser line point cloud.
[0136] Set an intensity threshold I, which can range from 2000 to 8000; retain high-brightness laser points, specifically as follows:
[0137] Extracting a candidate set of laser points from 3D point cloud data using an intensity threshold I;
[0138]
[0139] in, This represents the reflection intensity value of each point in the point cloud. The intensity threshold is P; P represents the entire set of candidate laser points. This represents the set of interior points of the final fitted laser curve model, which consists of high-brightness laser points that need to be retained.
[0140] The laser curve model was obtained using the RANSAC algorithm, and the operation was as follows:
[0141] Random from The minimum point set is selected for initial model estimation;
[0142] Calculate the residual from the remaining points to the initial model, and determine whether they belong to the interior of the initial model. The residual is calculated as the distance from the point to the model; the formula is:
[0143]
[0144] Points with residuals less than a set threshold are used as fitted inliers, and the number of inliers is calculated. The threshold is generally set to 0.1 mm to 0.3 mm, and the initial value is generally set to 0.15 mm.
[0145] Repeat the above process N times, and retain the model with the most interior points as the final laser curve model.
[0146] Next, the weld seam point cloud data of the cross-section is segmented into weld seam regions using geometric feature analysis. The operations include:
[0147] First, normal estimation is performed by calculating the covariance matrix. The surface normal is obtained by using the eigenvector corresponding to the smallest eigenvalue;
[0148]
[0149] in:
[0150] It is the neighborhood centroid; the eigenvectors of matrix C correspond to the principal directions of the local surface;
[0151] Perform eigenvalue decomposition on C:
[0152]
[0153] Where V represents the eigenvector matrix, a 3x3 orthogonal matrix, whose each column ( ) are eigenvectors of the covariance matrix C; Λ is the diagonal matrix of eigenvalues; The minimum eigenvalue, that is, the first column of data in V lies in the minimum eigenvector. Variance in direction; The intermediate feature value is the data in the intermediate feature vector. Variance in direction; The largest eigenvalue is the data in the largest eigenvector. Variance in direction;
[0154] Unify the direction of the normal. ;
[0155] Wherein, normal vector It is the smallest eigenvalue; It refers to the viewpoint position.
[0156] Then, the high-brightness laser points after the weld area is segmented are fitted with curves using the least squares polynomial method to obtain the weld point cloud data of the cross section.
[0157] Weld feature points are obtained from the weld point cloud data of the cross-section using curvature and depth information. For the weld point cloud data of the cross-section, depth information refers to the Z-coordinate value of each point, which can be directly read from the 3D coordinates of the point. Curvature measures the degree of curvature of the point cloud curve at a certain point, and is calculated as follows: for each point p in the point cloud... i Within its neighborhood (taking m points before and after, e.g., m=5), a local quadratic curve or circle is fitted, and then the curvature of that point on this local geometry is calculated. Candidate points are located based on the minimum depth, and the curvature is used to verify the candidate points, ultimately obtaining the weld feature points.
[0158] Next, the weld center point is obtained from the weld feature points, and then the weld centerline is fitted using B-splines. The operation is as follows:
[0159] Extract the weld point cloud from the weld feature points based on the minimum depth change value and use it as the center point in the weld region;
[0160] Solve the system of equations :
[0161] Construct the basis function matrix N(N) (n+1)):
[0162]
[0163] Least squares solution:
[0164]
[0165] Where λ is the smoothing coefficient; D is the regularization matrix; and P represents the coordinate matrix of the control points to be determined. This represents the transpose of matrix N; N represents the coordinate matrix of the known original data points; N represents the basis function matrix. Indicates in the parameter At that point, the value of the 0th basis function of order p; They represent the parameters respectively. At that point, the value of the nth basis function of order p;
[0166] Generate fitted points:
[0167]
[0168] in, A vector-valued function representing parameter u; , This represents the value of the i-th p-th B-spline basis function at parameter u; Indicates curve parameters; Indicates the valid domain of the parameter;
[0169] By generating fitting points, discrete weld scanning points are transformed into continuous and smooth weld centerlines, i.e., the robotic arm's motion trajectory.
[0170] Error assessment:
[0171]
[0172] in, This represents the k-th original data point; Indicates that u k Substituting the fitted B-spline curve formula C(u) into the calculated 3D coordinates; This represents the root mean square error.
[0173] This is used to measure the average deviation between the fitted curve and the original data. The generated B-spline trajectory is sent to the robotic arm controller for execution. RMSE can be sent along with the trajectory data as a confidence index. For trajectory segments with high RMSE (low confidence), the robotic arm can be instructed to pass through at a lower speed and in a more cautious manner. For trajectory segments with low RMSE (high confidence), the robotic arm can complete the welding at full speed and efficiency. This achieves quality-based adaptive control, further improving the system's intelligence and robustness.
[0174] Next, a local spatial region is constructed, and the operation method is as follows:
[0175] Determine the center, the weld feature point P(x, y, z) of the current frame; define the shape and orientation of the region to delineate a local spatial range, such as a rectangle; determine the size of the region, the length in the X direction, the lower limit of which must be greater than the robot's movement speed per second, and extract all point clouds within this range as the local region.
[0176] Next, the point cloud data within the local spatial region is standardized. The operations include:
[0177] The formula for calculating the centroid of a point cloud is as follows:
[0178] Where N represents the number of points in the point cloud. Represent the coordinates of each point;
[0179] Perform a translation operation on each point in the point cloud, and obtain the new coordinates of each point after the translation. for:
[0180] =( )
[0181] Each point in the translated point cloud is scaled down, and the final coordinates after scaling are obtained. for:
[0182] ( )
[0183] in, Indicates the scaling factor; ; .
[0184] Standardizing point cloud data within a local spatial region can eliminate numerical differences between point clouds from different sources and at different scales, enabling the data to be uniformly mapped to a standardized range, thus providing a basic guarantee for accurately predicting the end-effector displacement direction of the welding robot.
[0185] The standardized point cloud data is then fed into the reinforcement learning network. The reinforcement learning network is a neural network with specific inputs, outputs, and internal structures. Its input is the standardized local spatial point cloud. The output is the action that the network needs to predict. In this embodiment, it is the displacement command of the robotic arm's end effector in three-dimensional space, i.e., a three-dimensional vector.
[0186] Then, the direction of the end effector displacement of the welding robot arm is predicted by the reinforcement learning network; the motion command is sent to the robot controller, which is converted into joint space control signals through the kinematic model and the execution path is followed.
[0187] This step also includes the design of a reward function. The reinforcement learning network uses environmental reward signals to guide parameter updates, achieving adaptive weld path tracking control. The operation is as follows:
[0188] The reward value is calculated based on the angle between the actual movement direction and the main weld direction, the tracking error, and whether any deviation has occurred. The formula is:
[0189]
[0190] in, As a reward for tracking error, Rewards for orientation alignment; Punishment for shaking; To escape the punishment of being tracked; To complete the reward;
[0191] Through reward value Constructing the advantage function and use it as the objective function. The weights are updated in reverse to optimize the reinforcement learning network;
[0192] Advantage function for:
[0193]
[0194] in, As a value network, the state The predicted returns As a value network, the state The predicted returns Discount factor;
[0195] The PPO (Policy-Based Probability-Based Gradient) algorithm calculates the probability ratio of new to old actions and constructs a conservative objective function by combining the advantage function with a pruning threshold to avoid excessive policy fluctuations. The value network improves the accuracy of long-term return estimation by minimizing the mean squared error between predicted and actual returns. Simultaneously, an entropy regularization term is introduced to encourage exploration and prevent premature policy convergence. The final total loss is a weighted sum of the policy loss, value loss, and entropy regularization term. Backpropagation of gradients updates the network parameters, thereby reducing the total loss.
[0196] The formula for the weighted sum is:
[0197]
[0198] Where theta is the parameter of the policy network and phi is the parameter of the value network; The weighting factor for value loss (e.g., 0.5 or 1.0). The weight coefficient for the entropy reward (e.g., 0.01). Parameter updates are achieved through gradient descent. Using the gradient descent algorithm, the gradient of the total loss function with respect to the policy network parameter theta and the value network parameter phi is calculated, and then both sets of parameters are updated simultaneously along the opposite direction of the gradient (i.e., the direction that reduces the loss).
[0199] PPO maximizes the following objective function, objective function for:
[0200]
[0201] in, The probability ratio; Indicates the direction of displacement of the robotic arm; This represents the current local point cloud features; The cropping threshold, Represents the clipping function; Operator for mathematical expectation;
[0202] By adjusting strategy parameters This allows the strategy to favor the dominant action (A). t The probability of >0 increases in the inferior action (A) and the probability of the inferior action (A) increases. t The probability of <0) decreases.
[0203] This weld path tracking method fully utilizes the precise modeling capabilities of 3D structured light vision systems for the spatial geometry of weld areas, achieving unique and repeatable extraction of weld feature points. Through least-squares polynomial fitting with RANSAC, the laser spatial curve is robustly extracted. Combined with weld cross-sectional depth and curvature analysis, the true geometric feature points where the laser and weld structure intersect are determined, ensuring the stability of feature points in complex curved surfaces and asymmetric weld environments.
[0204] In terms of control strategy, this method introduces a reinforcement learning network to construct an action decision model based on point cloud state input, and uses the policy gradient method (PPO) to achieve closed-loop learning from trajectory perception to action generation. By driving the update of policy network parameters through actual reward feedback, the welding path control possesses adaptive adjustment capabilities, enabling real-time response to dynamic factors such as weld path shape changes, structural interference, workpiece deformation, vibration, and airflow disturbances during the welding process. Through real-time linkage between perceived data and control commands, the welding torch end displacement parameters and joint control signals are corrected in real time, effectively suppressing the accumulation of tracking errors. This approach balances adaptability to complex working conditions with high-precision, low-latency path following performance, significantly improving the reliability and accuracy of weld path tracking.
[0205] Example 2:
[0206] The technical solution in this embodiment is basically the same as that in Embodiment 1, except that the reward value... The deviation between the current action and the actual weld path direction is calculated, and the specific formula is as follows:
[0207] .
[0208] The specific embodiments described herein are merely illustrative of the spirit of the invention. Those skilled in the art to which this invention pertains may make various modifications or additions to the described specific embodiments or use similar methods to substitute them, without departing from the spirit of the invention or exceeding the scope defined by the appended claims.
Claims
1. A weld seam path tracking method, characterized in that, The weld path tracing method includes the following steps: A. Acquire three-dimensional point cloud data of the weld area using a 3D structured light sensor; B. Preprocess the acquired 3D point cloud data. The preprocessing includes using statistical filtering to remove outliers and fitting local polynomial surfaces using moving least squares to remove noise and retain geometric features. C. Enhance the optimized 3D point cloud data with laser lines, set an intensity threshold, and retain high-brightness laser points. D. By fitting the curve of the retained high-brightness laser points using the least squares polynomial method, the weld point cloud data of the cross section can be obtained. Weld feature points are obtained from the weld point cloud data of the cross section using curvature and depth information; the weld center point is obtained from the weld feature points to construct a local spatial region; E. Standardize the point cloud data within the local spatial region, and then feed the standardized point cloud data into the reinforcement learning network as input. F. Predict the end effector direction of the welding robot arm in the next step using a reinforcement learning network; send the motion command to the robot controller, convert it into joint space control signals through the kinematic model, and execute the path following.
2. The weld path tracking method according to claim 1, characterized in that, In step B, the operation of removing outliers using statistical filtering is as follows: For each point in the 3D point cloud data Calculate the average distance from its k nearest neighbors. ; Where ||·|| represents Euclidean distance; It is a point The set of k nearest neighbors; This represents the j-th point in the set of k nearest neighbors of a given point; Assume the average distance of all points { } follows a Gaussian distribution, calculate the mean. and standard deviation ; Where N is the total number of points in the point cloud; Set threshold Remove points that satisfy the following formula: > + 。 3. The weld path tracking method according to claim 1 or 2, characterized in that, In step B, the operation of fitting the local polynomial surface using the moving least squares method to remove noise and preserve geometric features is as follows: For each point in the 3D point cloud data In its neighborhood Intrinsically fit a local polynomial surface and minimize the weighted squared error: in, It is a local polynomial function; The coefficients to be determined; This represents the j-th point in the set of K nearest neighbors of a given point; in, Here, h is the weighting function, h is the neighborhood radius (smoothing parameter), and r is the number of neighborhood points. To the current fitted point Euclidean distance; Normalize the weights: Point Projecting the coordinates onto the fitted surface yields the smoothed coordinates. : in, It is a least squares solution; It is a point Two-dimensional coordinates on a local coordinate system or projection plane; It is a function evaluation operation.
4. The weld path tracking method according to claim 1 or 2, characterized in that, In step C, the operation of retaining the high-brightness laser point is as follows: Extracting a candidate set of laser points from 3D point cloud data using an intensity threshold; in, This represents the reflection intensity value of each point in the point cloud. The intensity threshold is P; P represents the entire set of candidate laser points. This represents the set of interior points of the final fitted laser curve model.
5. The weld path tracking method according to claim 4, characterized in that, In step C, the laser curve model is obtained using the RANSAC algorithm, and the operation is as follows: Random from The minimum point set is selected for initial model estimation; Calculate the residuals of the remaining points to the initial model, and determine whether they belong to the interior points of the initial model. The residuals are calculated as the distance from the point to the model. Points with residuals less than a set threshold are used as fitted inliers, and the number of inliers is calculated. Repeat the above process N times, and retain the model with the most interior points as the final laser curve model.
6. The weld path tracking method according to claim 1 or 2, characterized in that, Step D further includes segmenting the weld region of the weld point cloud data of the cross section using geometric feature analysis. The operation includes: First, normal estimation is performed by calculating the covariance matrix. The surface normal is obtained by using the eigenvector corresponding to the smallest eigenvalue; in: It is the neighborhood centroid; the eigenvectors of matrix C correspond to the principal directions of the local surface; Perform eigenvalue decomposition on C: Where V represents the eigenvector matrix, a 3x3 orthogonal matrix, whose each column ( ) are eigenvectors of the covariance matrix C; Λ is the diagonal matrix of eigenvalues; The minimum eigenvalue, that is, the first column of data in V lies in the minimum eigenvector. Variance in direction; The intermediate feature value is the data in the intermediate feature vector. Variance in direction; The largest eigenvalue is the data in the largest eigenvector. Variance in direction; Unify the direction of the normal. ; Wherein, normal vector It is the smallest eigenvalue; It refers to the viewpoint position.
7. The weld path tracking method according to claim 1 or 2, characterized in that, Step D further includes fitting the weld centerline using a B-spline, the operation of which is as follows: Extract the weld point cloud from the weld feature points based on the minimum depth change value and use it as the center point in the weld region; Solve the system of equations : Construct the basis function matrix N(N) (n+1)): Least squares solution: Where λ is the smoothing coefficient; D is the regularization matrix; and P represents the coordinate matrix of the control points to be determined. This represents the transpose of matrix N; N represents the coordinate matrix of the known original data points; N represents the basis function matrix. Indicates in the parameter At that point, the value of the 0th basis function of order p; They represent the parameters respectively. At that point, the value of the nth basis function of order p; Generate fitted points: in, A vector-valued function representing parameter u; , This represents the value of the i-th p-th B-spline basis function at parameter u; Indicates curve parameters; Indicates the valid domain of the parameter; Discrete weld scan points are transformed into continuous and smooth weld centerlines by generating fitting points. Error assessment: in, This represents the k-th original data point; Indicates will Substituting the fitted B-spline curve formula C(u) into the calculated 3D coordinates; This represents the root mean square error.
8. The weld path tracking method according to claim 1 or 2, characterized in that, The operations for standardizing point cloud data within a local spatial region include: The formula for calculating the centroid of a point cloud is as follows: Where N represents the number of points in the point cloud. Represent the coordinates of each point; Perform a translation operation on each point in the point cloud, and obtain the new coordinates of each point after the translation. for: =( ) Each point in the translated point cloud is scaled down, and the final coordinates after scaling are obtained. for: ( ) in, Indicates the scaling factor; ; .
9. The weld path tracking method according to claim 1 or 2, characterized in that, In step F, the weld path tracking method further includes: The reward function is designed to calculate the reward value based on the angle between the actual motion direction and the main weld direction, the tracking error, and whether any deviation has occurred. The formula is: in, As a reward for tracking error, Rewards for orientation alignment; Punishment for shaking; To escape the punishment of being tracked; To complete the reward; Through reward value Constructing the advantage function and use it as the objective function. The weights are updated in reverse to optimize the reinforcement learning network; Advantage function for: in, As a value network, the state The predicted returns As a value network, the state The predicted returns Discount factor; objective function for: in, The probability ratio; Indicates the direction of displacement of the robotic arm; This represents the current local point cloud features; The cropping threshold, Represents the clipping function; Operator for mathematical expectation; By adjusting strategy parameters This increases the probability of the strategy taking advantageous actions and decreases the probability of taking disadvantageous actions.
10. The weld path tracking method according to claim 1 or 2, characterized in that, In step F, the weld path tracking method further includes: The design of the reward function, the reward value The deviation between the current action and the actual weld path direction is calculated, and the specific formula is as follows: Through reward value Constructing the advantage function and use it as the objective function. The weights are updated in reverse to optimize the reinforcement learning network; Advantage function for: in, As a value network, the state The predicted returns As a value network, the state The predicted returns Discount factor; objective function for: in, For probability ratios, The cropping threshold, It is a commonly used function; By adjusting strategy parameters This increases the probability of the strategy taking advantageous actions and decreases the probability of taking disadvantageous actions.