Welding obstacle avoidance path planning method and system based on artificial intelligence
By employing an AI-based welding obstacle avoidance path planning method, which utilizes a dynamic convex hull generation algorithm and a quality deviation functional, the problem of balancing efficiency and quality in traditional welding methods is solved, achieving efficient and safe welding path planning.
Patent Information
- Application Number
- CN202511350275.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-22
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-09-22
AI Technical Summary
Traditional welding methods struggle to simultaneously ensure both efficiency and quality in path planning under complex working conditions, and collision detection suffers from lag or missed detection, leading to low welding efficiency or poor welding quality.
An AI-based welding obstacle avoidance path planning method is adopted. By constructing a collision probability density distribution through a dynamic convex hull generation algorithm and penetration depth detection, and combining it with a quality deviation functional for dynamic compensation, an optimized set of welding torch motion parameters is generated, enabling quantitative assessment of potential collision risks and welding quality control.
It improves welding efficiency and quality, reduces the probability of collisions between the welding torch and obstacles, and enhances the safety of equipment operation and the overall automation level of welding operations.
Smart Images

Figure CN120839338A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a welding obstacle avoidance path planning method and system based on artificial intelligence. Background Technology
[0002] In modern manufacturing, welding, as a key joining process, is widely used in automobile manufacturing, shipbuilding, aerospace, and heavy machinery. With the improvement of industrial automation, welding robots are gradually replacing manual operations due to their efficient and stable operating characteristics, but path planning under complex working conditions still faces challenges.
[0003] In welding complex structures, weld quality is closely related to the welding torch pose and the smoothness of its motion trajectory. Traditional methods often employ a single decision logic of "obstacle avoidance first" or "quality first." When faced with scenarios where dense obstacles and high-precision weld requirements coexist, these methods are prone to excessively long path redundancy leading to inefficiency, or excessive local pose deviations causing defects such as weld misalignment and undercut. Furthermore, some traditional collision detection methods are based on static geometric boundary calculations, making it difficult to quantify dynamic collision risks during motion. This can lead to "false obstacle avoidance" or "missed detection" phenomena when multi-jointed robots are in motion. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a welding obstacle avoidance path planning method and system based on artificial intelligence, which improves welding efficiency and quality targets and enhances the automation level of the overall welding operation.
[0005] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows: Firstly, an artificial intelligence-based welding obstacle avoidance path planning method, the method comprising: Step 1: Collect a discrete spatial sample set of the welding area and generate a work space partitioning model based on bounded polyhedron decomposition; Step 2: Input the workspace partitioning model into the deep reinforcement learning decision-maker, and combine the welding start and end pose tensors and weld parameterization curves to obtain the joint space motion element sequence. Step 3: Use the convex hull generation algorithm to generate a dynamic convex hull from the keyframe pose set of the motion primitive sequence; perform penetration depth detection on the dynamic convex hull and the discrete space sampling set to generate a collision probability density distribution; perform quality assessment on the collision probability density distribution, and integrate the welding gun attitude constraint and kinematic error propagation chain to generate a welding quality deviation functional. Step 4: Analyze the high-deviation nodes in the welding quality deviation functional, perform local tangent plane projection on the associated spatial sampling subset, and obtain the pose compensation parameters. Step 5: Input the pose compensation parameters and joint space motion primitive sequence into the inverse kinematics module, and generate the optimized welding torch motion parameter set through geodesic construction and parameterized spline interpolation.
[0006] Furthermore, a discrete spatial sampling set of the welding area is collected, and a work space partitioning model is generated based on bounded polyhedral decomposition, including: Step 11: Construct an initial bounded polyhedron bounding box based on the spatial coordinate extreme points of the discrete space sampling set; divide the initial bounded polyhedron bounding box into equal parts along the three axes of the Cartesian coordinate system to generate a set of sub-polyhedron elements; Step 12: Perform spatial position matching detection on the set of sub-polyhedral elements. If there are obstacle sampling points in the element, mark it as an obstacle element. If the element contains only passable sampling points, mark it as a free space element. Step 13: Perform adjacency analysis on the free space elements to generate a set of adjacent element pairs; based on the set of adjacent element pairs, detect the consistency of the normal vector direction of the shared contact surface, and mark the element pairs with the included angle of the normal vectors less than a preset threshold as coplanar element groups; Step 14: Calculate the coplanar unit group and iteratively perform the geometric merging operation until there are no new units to be merged, generating a continuous bounded polyhedral region set; merge the continuous bounded polyhedral region set with the obstacle unit set to generate the work space subdivision model.
[0007] Furthermore, the workspace partitioning model is input into a deep reinforcement learning decision-maker, and combined with the welding start and end pose tensors and weld parameterization curves, to obtain a sequence of joint space motion primitives, including: Step 21: Based on the set of polyhedral elements of the passable area of the work space partitioning model, extract the geometric center coordinates and spatial adjacency relationships of each element to generate a spatial position relationship description set; discretize the parameterized curve of the weld into a set of equidistant sampling points, and based on the spatial position relationship description set, map each sampling point to the geometric center point of the nearest neighbor element to generate a weld reference position sequence. Step 22: Using the spatial coordinates corresponding to the welding start and end pose tensors as endpoints, the weld reference position sequence is used as a motion trajectory constraint. Based on the spatial position relationship description set, a trajectory tracking path search is performed to generate an initial obstacle avoidance path position sequence. Step 23: Input the weld reference position sequence and the initial obstacle avoidance path position sequence into the deep reinforcement learning policy network, and update the policy gradient through the path length optimization objective, collision avoidance constraint and attitude smoothness constraint to obtain the optimized path position sequence. Step 24: Convert each spatial coordinate in the optimized path position sequence into a joint angle vector using the robot inverse kinematics model, and generate a joint spatial motion primitive sequence according to the motion time sequence.
[0008] Furthermore, step 3 includes: Step 31: Extract the keyframe pose set from the joint space motion primitive sequence, construct the motion convex hull corresponding to each keyframe based on the robot link motion envelope parameters; arrange the motion convex hulls according to the motion sequence to generate a dynamic convex hull sequence covering the robot motion trajectory. Step 32: Based on the dynamic convex hull sequence, perform spatial interference detection with the discrete spatial sampling set, calculate the minimum penetration depth value of each spatial sampling point relative to the surface of each convex hull, and generate a set of penetration depth values; Step 33: Establish a mapping relationship between continuous position points and penetration depth values in the entire working space. Calculate the probability weight of each spatial position point affected by the penetration depth value using the Gaussian distribution law. Aggregate the probability weights of all penetration depth values at continuous spatial position points to generate a collision probability density distribution field. Input the collision probability density distribution field into the welding quality evaluator, and fuse the welding gun attitude constraint function with the robot kinematic error propagation model to generate a welding quality deviation functional.
[0009] Furthermore, the high-deviation nodes in the welding quality deviation functional are analyzed, and local tangent plane projection is performed on the associated spatial sampling subset to obtain pose compensation parameters, including: Step 41: Based on the welding quality deviation functional, identify spatial location points where the deviation value exceeds a preset threshold and generate a high deviation node set; based on the high deviation node set, extract the corresponding obstacle sampling point subset in the discrete spatial sampling set to obtain the associated spatial sampling subset. Step 42: Based on the associated spatial sampling subset, for each obstacle sampling point, extract the set of spatial sampling points within the preset radius neighborhood to generate a local neighborhood point set; based on the local neighborhood point set, calculate the obstacle surface normal vector; Step 43: Based on the surface normal vector and the coordinates of the sampling points, construct a local tangent plane that passes through the sampling points and has the normal vector as its axis. Then, along the direction of the local tangent plane's normal vector, orthogonally project the original obstacle sampling points onto the tangent plane to generate the coordinates of the projected points. Aggregate all the coordinates of the projected points to generate a set of projected point coordinates. Step 44: Based on the pose difference between the set of projection point coordinates and the original sampling point coordinates, synthesize the spatial position compensation vector and the welding gun posture rotation parameter to obtain the pose compensation parameter.
[0010] Furthermore, the pose compensation parameters and the sequence of joint space motion primitives are input into the inverse kinematics module. Through geodesic construction and parametric spline interpolation, an optimized set of welding torch motion parameters is generated, including: Step 51: Based on the pose compensation parameters and the joint space motion primitive sequence, the position compensation vector and attitude rotation parameters are superimposed at the key frame pose to generate the compensated and corrected joint motion path; based on the compensated and corrected joint motion path, the shortest continuous motion trajectory connecting adjacent key frame poses is constructed in the robot joint space. Step 52: Extract the keyframe pose sequence from the shortest continuous motion trajectory as the interpolation control point set; determine the spline curve segmentation connection parameters and geometric continuity conditions based on the spatial distribution relationship of the control point set; generate a continuous smooth trajectory based on the control point set and geometric continuity conditions. Step 53: Sample joint angle time series data at equal time intervals along a continuous smooth trajectory; calculate the welding torch end spatial pose using a forward kinematics model based on the joint angle at each time node in the time series data; integrate the welding torch end spatial pose to generate an optimized welding torch motion parameter set.
[0011] Furthermore, joint angle time-series data are obtained by sampling along a continuous smooth trajectory at equal time intervals; based on the joint angles at each time node in the time-series data, the spatial pose of the welding torch end effector is calculated using a forward kinematics model; the spatial pose of the welding torch end effector is integrated to generate an optimized set of welding torch motion parameters, including: Step 61: Based on the continuous smooth trajectory, perform discrete sampling along the trajectory path with a fixed time step to generate a discrete time series of joint angles; based on each time node in the discrete time series, obtain the corresponding combination of joint angles. Step 62: Based on the joint angle combination and the robot link geometry parameters, calculate the pose transformation relationship between adjacent links; starting from the robot base coordinate system, iteratively synthesize the coordinate systems of each link according to the pose transformation relationship along the kinematic chain to obtain the spatial position coordinates of the welding gun end in the base coordinate system; based on the synthesis result of the end link coordinate system, extract the rotation relationship relative to the base coordinate system to obtain the welding gun attitude rotation parameters. Step 63: Aggregate the spatial position coordinates and attitude matrices of all time nodes, and construct the welding torch motion pose sequence in chronological order; fuse the welding torch motion pose sequence with the welding process parameters to generate an optimized welding torch motion parameter set.
[0012] Secondly, an artificial intelligence-based welding obstacle avoidance path planning system includes: The acquisition module is used to acquire discrete spatial sampling sets of the welding area and generate a work space partitioning model based on bounded polyhedron decomposition. The decision module is used to input the workspace partitioning model into the deep reinforcement learning decision engine, and combine the welding start and end pose tensor and the weld parameterization curve to obtain the joint space motion primitive sequence. The computation module is used to generate a dynamic convex hull from the keyframe pose set of the motion primitive sequence using a convex hull generation algorithm; to perform penetration depth detection on the dynamic convex hull and the discrete space sampling set to generate a collision probability density distribution; to perform quality evaluation on the collision probability density distribution and to integrate the welding torch attitude constraint and kinematic error propagation chain to generate a welding quality deviation functional. The analysis module is used to analyze the high-deviation nodes in the welding quality deviation functional, perform local tangent plane projection on the associated spatial sampling subset, and obtain pose compensation parameters. The output module is used to input the pose compensation parameters and the sequence of joint space motion primitives into the inverse kinematics module, and generate an optimized set of welding torch motion parameters through geodesic construction and parametric spline interpolation.
[0013] Thirdly, a computing device, comprising: One or more processors; A storage device for storing one or more programs that, when executed by one or more processors, cause the one or more processors to implement the method.
[0014] Fourthly, a computer-readable storage medium storing a program that, when executed by a processor, implements the method.
[0015] The above solution of the present invention includes at least the following beneficial effects: By constructing a collision probability density distribution through a dynamic convex hull generation algorithm and penetration depth detection, a quantitative assessment of potential collision risks during motion is achieved. High-risk areas are identified in advance and targeted optimizations are performed, solving the problem of delayed or missed collision detection in traditional obstacle avoidance methods. This reduces the probability of collisions between the welding torch and obstacles or workpieces, and improves the safety of equipment operation.
[0016] By using the quantitative evaluation and dynamic compensation mechanism of the quality deviation functional, collision avoidance and welding quality control are simultaneously achieved during the obstacle avoidance path planning process. This avoids the contradiction of "prioritizing obstacle avoidance at the expense of quality" or "ensuring quality while ignoring obstacle avoidance." Under complex working conditions, it balances welding efficiency and quality objectives, thereby improving the overall automation level and production efficiency of welding operations. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of a welding obstacle avoidance path planning method based on artificial intelligence, provided by an embodiment of the present invention.
[0018] Figure 2 This is a schematic diagram of a welding obstacle avoidance path planning system based on artificial intelligence, provided by an embodiment of the present invention. Detailed Implementation
[0019] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0020] like Figure 1 As shown, an embodiment of the present invention proposes a welding obstacle avoidance path planning method based on artificial intelligence, the method comprising the following steps: Step 1: Collect a discrete spatial sample set of the welding area and generate a work space partitioning model based on bounded polyhedron decomposition; Step 2: Input the workspace partitioning model into the deep reinforcement learning decision-maker, and combine the welding start and end pose tensors and weld parameterization curves to obtain the joint space motion element sequence. Step 3: Use the convex hull generation algorithm to generate a dynamic convex hull from the keyframe pose set of the motion primitive sequence; perform penetration depth detection on the dynamic convex hull and the discrete space sampling set to generate a collision probability density distribution; perform quality assessment on the collision probability density distribution, and integrate the welding gun attitude constraint and kinematic error propagation chain to generate a welding quality deviation functional. Step 4: Analyze the high-deviation nodes in the welding quality deviation functional, perform local tangent plane projection on the associated spatial sampling subset, and obtain the pose compensation parameters. Step 5: Input the pose compensation parameters and joint space motion primitive sequence into the inverse kinematics module, and generate the optimized welding torch motion parameter set through geodesic construction and parameterized spline interpolation.
[0021] In this embodiment of the invention, a collision probability density distribution is constructed by using a dynamic convex hull generation algorithm and penetration depth detection to achieve a quantitative assessment of potential collision risks during movement, identify high-risk areas in advance and perform targeted optimization, solve the problem of delayed or missed collision detection in traditional obstacle avoidance methods, reduce the probability of collisions between the welding torch and obstacles or workpieces, and improve the safety of equipment operation.
[0022] By using the quantitative evaluation and dynamic compensation mechanism of the quality deviation functional, collision avoidance and welding quality control are simultaneously achieved during the obstacle avoidance path planning process. This avoids the contradiction of "prioritizing obstacle avoidance at the expense of quality" or "ensuring quality while ignoring obstacle avoidance." Under complex working conditions, it balances welding efficiency and quality objectives, thereby improving the overall automation level and production efficiency of welding operations.
[0023] In a preferred embodiment of the present invention, step 1, acquiring a discrete spatial sampling set of the welding area, and generating a work space partitioning model based on bounded polyhedral decomposition, includes: Step 11: Construct an initial bounded polyhedron bounding box based on the spatial coordinate extreme points of the discrete space sampling set; divide the initial bounded polyhedron bounding box into equal parts along the three axes of the Cartesian coordinate system to generate a set of sub-polyhedron elements; Step 12: Perform spatial position matching detection on the set of sub-polyhedral elements. If there are obstacle sampling points in the element, mark it as an obstacle element. If the element contains only passable sampling points, mark it as a free space element. Step 13: Perform adjacency analysis on the free space elements to generate a set of adjacent element pairs; based on the set of adjacent element pairs, detect the consistency of the normal vector direction of the shared contact surface, and mark the element pairs with the included angle of the normal vectors less than a preset threshold as coplanar element groups; Step 14: Calculate the coplanar unit group and iteratively perform the geometric merging operation until there are no new units to be merged, generating a continuous bounded polyhedral region set; merge the continuous bounded polyhedral region set with the obstacle unit set to generate the work space subdivision model.
[0024] In step 11 above, the collected discrete sampling points of the welding area (including obstacle points and passable points) are processed to extract the extreme values in the spatial coordinates; specifically, the minimum value (x_min) and maximum value (x_max) in the x-axis direction, the minimum value (y_min) and maximum value (y_max) in the y-axis direction, and the minimum value (z_min) and maximum value (z_max) in the z-axis direction are found.
[0025] Using these extracted extreme points as vertices, an axis-aligned cuboid bounding box is constructed. The bounding box is set to [x_min, x_max] × [y_min, y_max] × [z_min, z_max] to ensure that all sampling points are contained within this bounding box.
[0026] Equidistant meshing generates sub-units: The meshing quantities n_x, n_y, and n_z are set along the x, y, and z axes respectively, with values ranging from 5 to 50. Specific values can be adjusted according to the size and precision requirements of the welding area; for example, for a 1m... 3For the region, n_x = n_y = n_z = 10 can be set; then the partitioning interval for each axis is calculated, Δx = (x_max - x_min) / n_x, Δy = (y_max - y_min) / n_y, Δz = (z_max - z_min) / n_z; the bounding box is partitioned into n_x × n_y × n_z small cuboid sub-units according to these intervals, and the spatial range of each sub-unit is [x_min + i•Δx, x_min + (i + 1)•Δx] × [y_min + j•Δy, y_min + (j + 1)•Δy] × [z_min + k•Δz, z_min + (k + 1)•Δz] (where i = 0, 1, ..., n_x-1; j = 0, 1, ..., n_y-1; k = 0, 1, ..., n_z-1).
[0027] In step 12 above, all sub-units are traversed. For each sub-unit, it is checked whether the points in the discrete sampling set fall within the spatial range of the sub-unit, that is, whether the x, y, and z coordinates of the points are within the x, y, and z intervals corresponding to the sub-unit.
[0028] If a sub-unit contains at least one sampling point with the preset label "obstacle", then the sub-unit is marked as an "obstacle unit"; if all sampling points in a sub-unit are preset labels "passable" and there are no obstacle points, then it is marked as a "free space unit".
[0029] In step 13 above, all free space units are traversed to determine whether there is a shared contact surface between units; that is, two units are adjacent in a certain coordinate axis direction and share a complete rectangular surface. For example, the x_max of unit A is equal to the x_min of unit B, and the y and z ranges completely overlap. Through such judgment, a set of adjacent unit pairs is formed.
[0030] For the shared contact surface of adjacent element pairs, calculate the normal vector, where the normal vector of the contact surface adjacent in the x direction is the ±x axis direction, the normal vector of the contact surface adjacent in the y direction is the ±y axis direction, and the normal vector of the contact surface adjacent in the z direction is the ±z axis direction; calculate the angle between the normal vectors of the shared surface of the two elements, and if the angle is less than a preset threshold (the value range is 5-15°, usually set to 10°), then mark the element pair as "coplanar element group".
[0031] Step 14 above performs an iterative merging operation on the coplanar unit group, merging adjacent units with continuous and consistent normal vectors into a larger polyhedron, such as combining coplanar units continuous along the x-axis into a cuboid extending to the x-range; repeating this process until there are no new units to be merged, generating a set of continuous bounded polyhedral regions, which is a continuous region of free space.
[0032] By integrating the set of continuous bounded polyhedral regions (free space) with the set of obstacle units (obstacle regions), the spatial extent of each region is clearly marked, thus forming a complete operational space partitioning model.
[0033] Model building and implementation process: Model construction: A three-dimensional discrete sampling set of the welding area, which includes coordinate information and type labels (obstacle or passable); these sampling sets are collected by devices such as LiDAR and vision sensors. The sampling density needs to cover the key parts of the area, with 50-5000 sampling points per cubic meter. The specific number is adjusted according to the sensor accuracy (±5mm~±20mm).
[0034] Core module design: Boundary box generation module: Its main function is to calculate the range of the boundary box based on the extreme points of the sampling points; Subdivision module: Generates sub-elements according to preset intervals; Element marking module: Determines the type of element through coordinate matching; Adjacency and coplanarity analysis module: Responsible for identifying adjacent elements and calculating the angle between normal vectors; Merging module: Iteratively merges coplanar elements to generate a continuous region.
[0035] Implementation process: Tool selection: Python language is used, NumPy library is used for coordinate calculation, and Open3D / PyVista library is used for 3D geometric operations and visualization to implement related algorithms; Workflow implementation: First, the sampling point data is read, then the extreme values are extracted to construct the bounding box, then the sub-cells are generated, then the cell type is marked, then adjacent cells are searched, the angle between normal vectors is calculated and coplanar groups are marked, then the continuous regions are generated by iterative merging, and finally the obstacle cells are fused to output the final working space subdivision model.
[0036] In this embodiment of the invention, by using discrete sampling and equidistant partitioning, the obstacles and free space in the welding area can be accurately divided, providing a reliable geometric basis for robot path planning. The coplanar element merging operation reduces the number of redundant elements, lowering the computational complexity of subsequent path planning while maintaining partitioning accuracy. Clearly distinguishing between obstacle areas and free space effectively prevents collisions between the robot and workpieces, fixtures, etc., during welding, improving operational safety and stability.
[0037] In a preferred embodiment of the present invention, step 2 involves inputting the workspace partitioning model into a deep reinforcement learning decision processor, and combining the welding start and end pose tensors and weld parameterization curves to obtain a joint space motion primitive sequence, including: Step 21: Based on the set of polyhedral elements of the passable area of the work space partitioning model, extract the geometric center coordinates and spatial adjacency relationships of each element to generate a spatial position relationship description set; discretize the parameterized curve of the weld into a set of equidistant sampling points, and based on the spatial position relationship description set, map each sampling point to the geometric center point of the nearest neighbor element to generate a weld reference position sequence. Step 22: Using the spatial coordinates corresponding to the welding start and end pose tensors as endpoints, the weld reference position sequence is used as a motion trajectory constraint. Based on the spatial position relationship description set, a trajectory tracking path search is performed to generate an initial obstacle avoidance path position sequence. Step 23: Input the weld reference position sequence and the initial obstacle avoidance path position sequence into the deep reinforcement learning policy network, and update the policy gradient through the path length optimization objective, collision avoidance constraint and attitude smoothness constraint to obtain the optimized path position sequence. Step 24: Convert each spatial coordinate in the optimized path position sequence into a joint angle vector using the robot inverse kinematics model, and generate a joint spatial motion primitive sequence according to the motion time sequence.
[0038] In step 21 above, a set of free space cells is selected from the workspace partitioning model, and the geometric center coordinates of each cell are calculated (i.e., the midpoint of the cell's x, y, z interval, such as coordinates [(x_min+x_max) / 2,(y_min+y_max) / 2,(z_min+z_max) / 2]); and the adjacency relationships between cells are extracted (using the set of adjacent cell pairs generated in step 13), and integrated into a spatial positional relationship description set (including cell center coordinates and adjacent cell indices).
[0039] The parameterized curve of the weld (such as a straight line, circular arc or Bezier curve) is discretized into a set of sampling points at equal intervals. The sampling interval ranges from 0.5 to 5 mm (adjusted according to the weld accuracy requirements, 1 mm for high-precision welding). The number of sampling points generated is usually 50-200.
[0040] For each discrete sampling point, the nearest free space unit geometric center is searched using the spatial position relationship description set (using Euclidean distance to select the unit center with the smallest distance), and the sampling point sequence is converted into a weld reference position sequence (composed of unit center coordinates).
[0041] In step 22 above, the spatial coordinates (starting point) corresponding to the welding start pose tensor and the spatial coordinates (end point) corresponding to the ending pose tensor are used as path endpoints, and the weld reference position sequence is used as a necessary constraint point (which must be passed in sequence or adjacent to each other).
[0042] Based on a spatial location relationship description set, a trajectory tracking search algorithm (such as the improved A) is adopted. The algorithm starts from the starting point and moves gradually towards the ending point along adjacent cells, avoiding obstacle cells in the process. At each step, it prioritizes approaching the next constraint point in the weld reference position sequence to generate an initial obstacle avoidance path position sequence (composed of cell center coordinates in the order of movement).
[0043] The specific calculation process of the trajectory tracking search algorithm: Start and end point settings: Set the spatial coordinates corresponding to the welding start pose tensor as the search start point S, and set the spatial coordinates corresponding to the end pose tensor as the target end point T. Record the cell indexes of the two points (based on the cell division of the work space partitioning model).
[0044] Constraint point sequence sorting: Sort the weld reference position sequence according to the welding time sequence to form a constraint point list P = [P1, P2, ..., P...]. n (n is the number of sampling points, 50-200), and each constraint point corresponds to the geometric center coordinates of the free space element.
[0045] Set the heuristic function weight ω (range 0.3-0.7, balancing path length and constraint tracking accuracy), step size threshold L (range 5-20mm, controlling the cell movement distance in each search), and constraint proximity threshold D (range 2-10mm, determining whether it is close to the constraint point).
[0046] Each search node contains the current cell index, cumulative path length, index of satisfied constraint points (recording the sequence number of the constraint points that have been passed), and parent node pointer (used for backtracking the path).
[0047] Adjacent cell selection: Starting from the cell where the current node is located, based on the list of adjacent cells in the spatial position relationship description set, select all free space cells (excluding obstacle cells) as candidate expansion cells; the candidate cells must satisfy the condition that the center distance from the current cell is ≤ step size threshold L.
[0048] Cost function calculation: For each candidate cell, calculate the comprehensive cost F = G + ω•H, where: G is the cumulative path length from the starting point to the current candidate cell (the sum of cell center distances along the already searched paths); H is the heuristic cost, which consists of two parts: the straight-line distance from the candidate cell to the endpoint T, and the distance from the candidate cell to the next unsatisfied constraint point P. k The straight-line distance (each weighted 50%).
[0049] Constraint point satisfaction determination: If the center of the candidate element is close to the next unsatisfied constraint point P k If the Euclidean distance is less than or equal to the constraint proximity threshold D, then mark the constraint point as satisfied and update the index of satisfied constraint points (increase the k value by 1).
[0050] Obstacle avoidance: When expanding candidate units, the unit type is checked through the spatial position relationship description set. If the unit is marked as an "obstacle unit", it is directly eliminated. If the candidate unit and the obstacle unit share the contact surface, the safe distance is calculated (≥2mm). If it is less than 2mm, the unit is discarded.
[0051] Priority queue management: A priority queue (arranged in ascending order of comprehensive cost F) is used to store nodes to be expanded. Each time, the node with the smallest F value is selected as the current node for expansion.
[0052] Endpoint determination: When the extended node reaches the cell where the endpoint T is located, and the distance between the node and T is less than or equal to the constraint proximity threshold D, the search stops.
[0053] Path backtracking: Tracing back from the endpoint node to the starting point along the parent node pointer, extracting the center coordinates of all passed units, and arranging them in chronological order to generate the initial obstacle avoidance path position sequence.
[0054] Model building and implementation process: Node Management Module: Responsible for node creation, status updates, and priority sorting. It uses a dictionary to store node information (cell index, cumulative cost, constraint progress, etc.) and implements a priority queue function through a heap structure. Cost Evaluation Module: Includes a built-in cost function calculator to calculate the G value (cumulative distance) and H value (heuristic distance) of candidate cells in real time, supporting dynamic adjustment of weight ω. Constraint Tracking Module: Compares the positional relationship between the current node and the constraint point list in real time, determines whether the constraint point is satisfied through distance calculation, and updates the constraint progress counter. Obstacle Avoidance Verification Module: Connects to the obstacle cell data of the workspace partitioning model, quickly queries the obstacle attributes of candidate cells through cell index, and achieves real-time obstacle avoidance filtering. Weight ω Adjustment: 0.6-0.7 for high-precision welding scenarios (such as precision instrument welds) to prioritize constraint tracking accuracy; 0.3-0.5 for welding large-size workpieces to prioritize shortening the path length.
[0055] Threshold dynamic adaptation: The step threshold L is adjusted according to the weld curvature, with 15-20mm for straight welds and 5-10mm for curved welds (curvature radius < 50mm); the constraint proximity threshold D is set according to the welding accuracy requirements, with 2-5mm for laser welding and 5-10mm for arc welding.
[0056] Data Structure: An adjacency list is used to store the adjacency relationships between units, and a hash table is used to map unit indices and coordinates to improve query efficiency; Implementation Tools: A priority queue is implemented based on the heapq library in Python, and the NumPy library is used to calculate spatial distances. The Open3D library is used to visualize the path search process; Different welding scene models (including complex obstacles) are imported into the Gazebo simulation environment, and the path length, constraint satisfaction rate (≥95%) and search time (controlled within 1-5 seconds) are recorded by adjusting parameters.
[0057] Step 23 above, deep reinforcement learning path optimization: convert the weld reference position sequence (as the target trajectory) and the initial obstacle avoidance path position sequence (as the initial solution) into the network input format, including position coordinate normalization (mapping to the [-1, 1] interval) and temporal encoding (adding time step index).
[0058] Policy network training: Data is input into a deep reinforcement learning policy network. The core indicators of the reward function are path length minimization (optimization objective), collision-free operation (constraint condition: path points must fall within free space cells), and pose smoothness (the rate of change of joint angles between adjacent points is less than a threshold, ranging from 5° to 15° / step). Iterative updates are performed using a policy gradient algorithm (such as PPO). In each iteration, the agent generates candidate optimization paths based on the current path, calculates the reward value, and adjusts the network parameters. The learning rate ranges from 0.001 to 0.01, and the number of iterations is 1000-5000.
[0059] After training, the policy network optimizes the initial path and outputs a sequence of optimized path positions that satisfy the constraints (spatial coordinates are arranged in the order of motion).
[0060] In step 24 above, each spatial coordinate (x, y, z, attitude angle) in the optimized path position sequence is input into the robot's inverse kinematics model to solve for the corresponding joint angle vector (e.g., a 6-axis robot outputs 6 joint angles, the value range is determined according to the robot model, usually -180° to 180° or -90° to 90°); if there are multiple solutions, the solution with the middle joint motion range is selected first to avoid extreme positions.
[0061] The joint angle vectors are arranged sequentially according to the path time sequence. Each vector corresponds to a motion primitive (containing the target value of the joint angle and the motion time, with a time step of 0.01-0.1s, which is adjusted according to the motion speed requirements), generating a joint space motion primitive sequence.
[0062] Model building and implementation process: Static inputs: Free space cell information (center coordinates, adjacency relationships) of the workspace partitioning model, and robot DH parameters (used for inverse kinematics calculation).
[0063] Dynamic input: Welding start and end pose tensors (start / end coordinates and attitude), weld parameterized curves (mathematical expressions or discrete point sets).
[0064] Core module design: Spatial Relationship Processing Module: Extracts the unit center and adjacency relationship to realize the mapping from sampling points to units.
[0065] Path search module: Performs initial obstacle avoidance path search based on adjacency relationships.
[0066] The deep reinforcement learning module includes a policy network (input is path state, output is position adjustment) and a value network (evaluates the quality of the path). The network structure uses 3-5 fully connected layers (64-256 neurons per layer) or LSTM temporal network.
[0067] Inverse kinematics module: Based on numerical solutions, it realizes the conversion from spatial coordinates to joint angles.
[0068] Training process: Collect 1000-5000 sets of welding scene data (including different weld shapes and obstacle distributions), and generate initial paths and corresponding optimal path labels (manual annotation or simulation generation).
[0069] Network training: Initialize the policy network parameters (random weights).
[0070] Each training iteration samples a batch of samples from the dataset, inputs them into the network to generate optimized paths, and calculates reward values (the shorter the path length, the fewer the collisions, and the smoother the pose, the higher the reward).
[0071] The network parameters are updated using policy gradients, and the model performance is verified every 100 iterations. If the path optimization effect does not improve the performance, the learning rate is reduced or the process is stopped early.
[0072] Adjust hyperparameters such as the number of network layers, number of neurons, and learning rate, and select the optimal model through cross-validation.
[0073] The system employs Python, uses NumPy for coordinate calculations, builds a reinforcement learning network using PyTorch / TensorFlow, implements inverse kinematics transformation and robot control interface using ROS (Robot Operating System), and performs virtual environment simulation verification using Gazebo.
[0074] In this embodiment of the invention, deep reinforcement learning can minimize path length and ensure smooth posture while satisfying obstacle avoidance constraints, thereby reducing robot motion energy consumption and vibration. Through multi-scenario training, the model can adapt to different weld seam shapes (straight lines, curves) and obstacle distributions without manual reprogramming. The obstacle avoidance mechanism and inverse kinematics transformation based on the workspace partitioning model ensure that the generated joint motion primitives are collision-free and within the robot's motion range. Compared to traditional path planning algorithms, the reinforcement learning optimization process can be completed in seconds, meeting the real-time requirements of welding operations.
[0075] In a preferred embodiment of the present invention, step 3 involves generating a dynamic convex hull by applying a convex hull generation algorithm to the keyframe pose set of the motion primitive sequence; performing penetration depth detection on the dynamic convex hull and the discrete spatial sampling set to generate a collision probability density distribution; and performing quality assessment on the collision probability density distribution, and fusing welding torch attitude constraints and kinematic error propagation chains to generate a welding quality deviation functional, including: Step 31: Extract the keyframe pose set from the joint space motion primitive sequence, construct the motion convex hull corresponding to each keyframe based on the robot link motion envelope parameters; arrange the motion convex hulls according to the motion sequence to generate a dynamic convex hull sequence covering the robot motion trajectory. Step 32: Based on the dynamic convex hull sequence, perform spatial interference detection with the discrete spatial sampling set, calculate the minimum penetration depth value of each spatial sampling point relative to the surface of each convex hull, and generate a set of penetration depth values; Step 33: Establish a mapping relationship between continuous position points and penetration depth values in the entire working space. Calculate the probability weight of each spatial position point affected by the penetration depth value using the Gaussian distribution law. Aggregate the probability weights of all penetration depth values at continuous spatial position points to generate a collision probability density distribution field. Input the collision probability density distribution field into the welding quality evaluator, and fuse the welding gun attitude constraint function with the robot kinematic error propagation model to generate a welding quality deviation functional.
[0076] In step 31 above, keyframes are extracted from the joint space motion primitive sequence at fixed intervals. The interval ranges from 10 to 30 motion primitives (adjusted according to the trajectory complexity; 10 to 15 for complex curve trajectories and 20 to 30 for straight trajectories), forming a keyframe pose set (including the poses of each joint angle and the end effector).
[0077] Based on the motion envelope parameters of each link in the robot (such as link length, diameter, and joint range of motion, parameters from the robot manual, with length ranging from 50-500 mm and diameter from 10-50 mm), the link position in each keyframe is geometrically modeled. A convex hull generation algorithm (such as Graham scan method) is used to construct the minimum convex polyhedron (convex hull) covering the link's motion range. Each convex hull contains 8-20 vertices (depending on the link shape complexity).
[0078] The convex hulls corresponding to each key frame are arranged sequentially according to the motion time sequence. The convex hull shape changes between adjacent key frames are supplemented by linear interpolation to generate a dynamic convex hull sequence that continuously covers the robot's motion trajectory (the frame rate is consistent with the key frame interval, usually 10-50Hz).
[0079] In step 32 above, the dynamic convex hull sequence and discrete spatial sampling set are traversed, and each sampling point is checked one by one to see if it has spatial interference with the convex hull (i.e., whether the point is located inside the convex hull). The detection method is to judge the positional relationship between the point and each face of the convex hull. If the point is inside the convex hull, it is determined to be interference.
[0080] For sampling points where interference occurs, calculate the shortest distance (vertical distance) from the point to each surface of the convex hull, and take the minimum value as the penetration depth value of the point; if the point does not interfere, the penetration depth value is recorded as 0; the penetration depth value ranges from 0 to 50 mm (above 50 mm is considered a serious collision risk), and a set of penetration depth values is generated.
[0081] In step 33 above, within the entire working space, the penetration depth values of discrete sampling points are mapped to continuous location points through spatial interpolation (such as Kriging interpolation) to establish the correspondence between location and penetration depth; based on the Gaussian distribution law, a probability weight is assigned to each penetration depth value: the greater the penetration depth, the higher the weight (the standard deviation ranges from 1 to 5 mm to control the weight decay rate).
[0082] The probability weights of all sampling points are aggregated to form a smooth collision probability density distribution field in continuous space (the higher the value, the greater the collision risk at that location). The resolution of the distribution field is consistent with the subdivision accuracy of the working space (0.5-5mm / grid).
[0083] The distributed field is input into the welding quality evaluator, integrating two core constraints: Welding torch posture constraint function: limits welding torch angle deviation (e.g., angle with weld normal ≤ 5°) and nozzle height deviation (≤ 3mm). Kinematic error propagation model: The end effector error accumulation is calculated based on the robot joint angle error (0.1°-0.5°) and link length error (0.1-0.5mm); the welding quality deviation functional is generated by weighted fusion of collision probability, attitude deviation and error accumulation (the lower the value, the better the quality).
[0084] Model building and implementation process: Input keyframe pose and link parameters, generate convex hulls for each frame using a convex hull algorithm, and support dynamic morphological updates according to trajectory time sequence; Penetration depth detection module: uses a spatial point-convex hull interference judgment algorithm to batch calculate the penetration depth of sampling points and output a set of depth values; Probability distribution modeling module: implements Gaussian weight allocation and spatial interpolation to generate a continuous collision probability density field, and supports dynamic resolution adjustment; Quality assessment module: has a built-in welding torch attitude constraint rule library (with customizable thresholds) and error propagation parameter table (based on robot calibration data), and integrates multiple factors to calculate the quality deviation functional.
[0085] For high-precision trajectories (such as curved welds), use 10-15 primitives, and for low-precision trajectories, use 20-30 primitives to balance computational load and accuracy. The link modeling error should be ≤1mm to ensure that the convex hull covers more than 99% of the actual motion range. For complex obstacle scenes, use 1-2mm (weight concentration), and for open scenes, use 3-5mm (weight smoothing). The joint angle error should be set according to the robot's factory calibration value (0.1°-0.3°), and the link error should be updated through periodic calibration (0.1-0.3mm).
[0086] Rasterization preprocessing: The workspace is divided into uniform grids, with the grid side length consistent with the workspace division accuracy, ranging from 0.5-5mm (0.5-2mm for precision welding scenarios, and 3-5mm for heavy-duty welding). The center coordinates of each grid are used as continuous position points to be interpolated, denoted as grid points (x, y, y). i y i , z i ). Boundary extension: To avoid edge grid interpolation deviation, extend 5-10 grids outside the working space boundary (extension distance 2.5-50mm) to ensure that all effective areas are covered.
[0087] Neighborhood search range: For each grid point, a spherical neighborhood is defined with that point as the center, with a radius of 50-200mm (50-100mm in areas with dense obstacles to reduce interference from irrelevant samples; 150-200mm in open areas to increase sample representativeness). Select discrete sampling points with known penetration depth values within the neighborhood, with the number controlled between 10 and 20 (no less than 5 to ensure interpolation stability); prioritize retaining the sample closest to the grid point, and if the distance is the same, retain the point with greater penetration depth (highlighting the impact of the risk area). Distance weight calculation: Basic weights are assigned based on the straight-line distance between sample points and grid points; the closer the distance, the higher the weight. Specific rules: Sample points with a distance ≤ 50mm: weighting 30%-40%; sample points with a distance ≤ 100mm and a distance between 50mm and 100mm: weighting 20%-30%; sample points with a distance ≤ 200mm and a distance between 100mm and 200mm: weighting 10%-20%; the sum of all sample weights is normalized to 1 to ensure effective weighted calculation. Weighted fusion calculation: the penetration depth value of the grid point = Σ (the penetration depth of the sample point × the corresponding weight), and the calculation result is retained to two decimal places (accuracy ±0.01mm). Smoothing verification: The difference in penetration depth values of adjacent grids (grids sharing edges or faces) is checked. If the difference is greater than 0.5 mm, the edge sample weights are readjusted until the difference is less than or equal to 0.5 mm to ensure the continuity of field distribution. Detailed process of distance calculation (penetration depth): Decompose the surface of each dynamic convex hull into triangular or quadrilateral patches (each patch is defined by 3-4 vertices), and record the normal vector direction of each patch (outward is the positive direction); for each discrete sampling point, calculate its signed distance to all patches of the convex hull (along the normal vector direction, a positive value indicates that the point is inside the convex hull, and a negative value indicates that it is outside); if the signed distance of all patches is ≥0, it is determined to be an interference point; if there is at least one patch with a distance <0, it is a non-interference point.
[0088] Precise calculation of penetration depth: For interference points, only the areas with positive signed distances (internal areas) are retained, and the perpendicular distances from the points to these areas are calculated (negative distances are discarded to avoid interference from external areas); the minimum value among the effective perpendicular distances is selected as the penetration depth value. If a point is located exactly on a certain area (distance = 0), the penetration depth is recorded as 0; the calculation accuracy is controlled within ±0.1mm, and even tiny penetrations with distances <0.1mm are recorded (to avoid missing potential risks). Outlier handling: If the penetration depth is greater than 50mm, record it as 50mm (it exceeds the safe range of robot movement and is considered a serious risk); the penetration depth of non-interference points is fixed as 0.
[0089] Detailed process of calculating weights using the Gaussian distribution function: Using the penetration depth value d of the sample point as the center (mean) of the Gaussian distribution, the maximum weight (weight at the center) is set to 1.0 (the larger the penetration depth, the center weight remains unchanged but the distribution range is adjusted); for complex scenarios (such as areas with multiple fixtures intersecting): the standard deviation σ = 1-2mm, the weight is concentrated in the range of [d-σ, d+σ] (accounting for about 68%), and rapidly decays to 0 (the decay boundary is d±3σ); for open scenarios (such as large flat welding areas): the standard deviation σ = 3-5mm, the weight is distributed smoothly in the range of [d-2σ, d+2σ] (accounting for about 95%), and the decay boundary is extended to d±3σ to avoid excessive amplification of local risks. Grid weight superposition: For each grid point, collect the Gaussian weights of all sample points in its neighborhood, and perform secondary weighting according to the distance between the sample point and the grid point (sample weights ≤50mm ×1.0, 50-100mm ×0.8, 100-200mm ×0.5) to enhance the influence weight of nearby samples. The sum of the superimposed weights is divided by the number of sample points in the neighborhood to obtain the collision probability density value of the grid point. The value range is strictly controlled within 0-1 (0 represents no collision risk, and 1 represents extremely high risk). A 3×3×3 grid window is used for mean filtering. The probability value of each grid is updated to the average value of all grids in the window to ensure that the probability difference between adjacent grids is ≤0.1 and to eliminate local jump noise.
[0090] Implementation tools and processes: Geometric calculations: Open3D is used to generate convex hulls, and NumPy is used to perform spatial interpolation and distance calculations.
[0091] Probabilistic modeling: The Gaussian distribution function of the SciPy library is used to calculate the weights, and the probability density field is visualized using Matplotlib; Implementation process: Read the motion primitive sequence → extract keyframes → generate dynamic convex hull → calculate penetration depth → construct the probability field → fuse constraints to generate bias functionals. The entire process is performed offline on the PC (takes 5-30 minutes, depending on the complexity of the scene).
[0092] In this embodiment of the invention, a dynamic convex hull covers the entire motion domain of the robot. By combining penetration depth and probability distribution, continuous quantification of collision risk is achieved, improving the accuracy of risk identification. By integrating collision probability, posture constraints, and kinematic errors, the limitations of traditional single indicators are overcome, comprehensively reflecting the factors affecting welding quality.
[0093] In a preferred embodiment of the present invention, step 4 involves analyzing the high-deviation nodes in the welding quality deviation functional, performing local tangent plane projection on the associated spatial sampling subset, and obtaining pose compensation parameters, including: Step 41: Based on the welding quality deviation functional, identify spatial location points where the deviation value exceeds a preset threshold and generate a high deviation node set; based on the high deviation node set, extract the corresponding obstacle sampling point subset in the discrete spatial sampling set to obtain the associated spatial sampling subset. Step 42: Based on the associated spatial sampling subset, for each obstacle sampling point, extract the set of spatial sampling points within the preset radius neighborhood to generate a local neighborhood point set; based on the local neighborhood point set, calculate the obstacle surface normal vector; Step 43: Based on the surface normal vector and the coordinates of the sampling points, construct a local tangent plane that passes through the sampling points and has the normal vector as its axis. Then, along the direction of the local tangent plane's normal vector, orthogonally project the original obstacle sampling points onto the tangent plane to generate the coordinates of the projected points. Aggregate all the coordinates of the projected points to generate a set of projected point coordinates. Step 44: Based on the pose difference between the set of projection point coordinates and the original sampling point coordinates, synthesize the spatial position compensation vector and the welding gun posture rotation parameter to obtain the pose compensation parameter.
[0094] In step 41 above, the welding quality deviation value of each sampling point in the discrete space is calculated (based on a preset deviation functional, reflecting the difference between the actual welding effect and the ideal state); a deviation threshold is set (the value range is usually 0.1mm to 1mm, which is adjusted according to the welding accuracy requirements, such as taking a smaller value for precision welding), and sampling points with deviation values exceeding the threshold are marked as high deviation nodes, forming a set of high deviation nodes.
[0095] Obstacle sampling points corresponding to high-deviation nodes are selected from the discrete spatial sampling set to form an associated spatial sampling subset (focusing on the key areas that need compensation).
[0096] In step 42 above, for each obstacle sampling point in the associated spatial sampling subset, spatial sampling points around the point are selected with a preset radius (ranging from 5mm to 50mm, which needs to be determined according to the sampling point density to ensure that the neighborhood contains 5 to 20 effective sampling points to guarantee fitting accuracy) to generate a local neighborhood point set; plane fitting is performed on the local neighborhood point set (by extracting geometric features to eliminate the influence of noise points), and the normal vector of the fitted plane is calculated as the normal vector of the obstacle surface at the sampling point (the normal vector needs to be normalized and the direction should point outward of the obstacle to ensure consistency).
[0097] In step 43 above, the surface normal vector obtained in step 42 is used as the axis to construct a local tangent plane through the current obstacle sampling point (the tangent plane is perpendicular to the normal vector, reflecting the local geometric trend of the obstacle surface at that point); along the normal vector direction of the local tangent plane, the original obstacle sampling point is orthogonally projected onto the tangent plane to obtain the coordinates of the projection point (the projection process ensures that the direction is strictly along the normal vector to eliminate oblique projection error).
[0098] Summarize the projected coordinates of all sampling points to form a set of projected point coordinates.
[0099] In step 44 above, the positional difference between the coordinates of the projected point and the coordinates of the original sampling point is calculated. This difference vector is the spatial position compensation vector (along the normal vector direction, directly reflecting the linear displacement that needs to be adjusted).
[0100] Analyze the angle difference between the surface normal vector at the original sampling point and the normal vector of the tangent plane where the projection point is located (if there is an attitude deviation), and combine the adaptation requirements of the welding gun attitude and the obstacle surface to convert the angle difference into the welding gun attitude rotation parameter (the rotation angle is usually within the range of ±5° to ±15° to avoid excessive rotation affecting welding stability); integrate the spatial position compensation vector and the welding gun attitude rotation parameter to obtain the final pose compensation parameter.
[0101] In this embodiment of the invention, by focusing on high-deviation nodes and associated regions, global indiscriminate compensation is avoided, thereby improving compensation efficiency and accuracy. Based on local tangent plane projection and normal vector analysis, pose compensation is made to conform to the local geometric features of the obstacle surface, reducing welding deviations caused by surface irregularities.
[0102] In a preferred embodiment of the present invention, step 5 involves inputting the pose compensation parameters and the joint space motion primitive sequence into the inverse kinematics module, and generating an optimized set of welding torch motion parameters through geodesic construction and parametric spline interpolation, including: Step 51: Based on the pose compensation parameters and the joint space motion primitive sequence, the position compensation vector and attitude rotation parameters are superimposed at the key frame pose to generate the compensated and corrected joint motion path; based on the compensated and corrected joint motion path, the shortest continuous motion trajectory connecting adjacent key frame poses is constructed in the robot joint space. Step 52: Extract the keyframe pose sequence from the shortest continuous motion trajectory as the interpolation control point set; determine the spline curve segmentation connection parameters and geometric continuity conditions based on the spatial distribution relationship of the control point set; generate a continuous smooth trajectory based on the control point set and geometric continuity conditions. Step 53: Sample joint angle time series data at equal time intervals along a continuous smooth trajectory; calculate the welding torch end spatial pose using a forward kinematics model based on the joint angle at each time node in the time series data; integrate the welding torch end spatial pose to generate an optimized welding torch motion parameter set.
[0103] In step 51 above, the inverse kinematics module is constructed: based on the robot's structural parameters (such as the link length, joint type, and installation error of a 6-axis welding robot), a mapping relationship model between the joint space and the end effector space is established; the model must include constraints such as joint angle limits (rotary joint range ±160°~±180°, translational joint stroke 0~500mm) and kinematic parameter error ranges (link length error ≤±0.1mm, joint offset error ≤±0.05°). Model training and calibration: Data was collected through robot calibration experiments: 20-50 feature points were selected in the workspace, and the deviations between the measured joint angles and the theoretical end-effector poses were recorded. The least squares method was used to correct model parameters (such as joint zero-point offset and link length compensation) to control the model pose prediction error within ±0.2mm (position) and ±0.1° (attitude). The compensated and corrected keyframe poses (including position compensation vectors and attitude rotation parameters) were input, and the joint angles of adjacent keyframes were solved in the inverse kinematics module by constraining joint angular velocity (≤30° / s) and angular acceleration (≤50° / s²). 2 Generate the shortest continuous trajectory in the joint space, ensuring that the trajectory is within the joint limits and has no singular points (singular point avoidance error ≥ 5°).
[0104] The specific process of correcting model parameters using the least squares method: Select 20 to 50 feature points evenly within the robot's workspace (covering short, medium, and long-range work areas, avoiding concentration near singular points). Each feature point is precisely calibrated using a teach pendant or positioned using a laser tracker (positioning accuracy ≤ ±0.05 mm).
[0105] For each feature point, record the measured values of the robot joint angles (acquired through the joint encoder, with an accuracy of ±0.001°) and the theoretical pose of the end effector (including X / Y / Z coordinates and attitude angles, calculated from the robot's factory model).
[0106] Error term construction: Position error is the difference between measured coordinates and theoretical coordinates (ΔX, ΔY, ΔZ, in mm), and attitude error is the difference between measured attitude angles and theoretical attitude angles (Δα, Δβ, Δγ, in °); Error weights are set: the position error weight is 1.0, and the attitude error weight is 0.1 to 0.5 (adjusted according to the attitude accuracy requirements of the welding scenario, with higher weights for precision welding), to avoid a single error term dominating the correction result.
[0107] Parameter correction iteration: The initial parameters are the robot's factory DH parameters (link length, joint offset, etc.). Set the range of parameters to be corrected: link length correction ≤ ±0.1mm, joint offset correction ≤ ±0.05°, joint torsion angle correction ≤ ±0.1° (to prevent over-correction from deviating from the actual characteristics of the mechanical structure).
[0108] The iterative least squares method is adopted: in each iteration, the parameter correction amount is back-calculated through the error term, and the theoretical pose is recalculated by substituting it into the model until the overall error meets the convergence condition that the root mean square error of position is ≤ ±0.2mm and the root mean square error of attitude is ≤ ±0.1°. The number of iterations is controlled between 10 and 30 (to avoid iteration divergence).
[0109] Verification of correction results: Select 5 to 10 verification points that were not involved in training (distributed on the edge of the workspace and on typical welding paths) to verify the pose prediction accuracy of the corrected model. The error of the verification points should be ≤ ±0.05mm (position) and ±0.02° (attitude) of the training points.
[0110] If the verification error exceeds the standard, the number of feature points needs to be increased (adding 2 to 5 points in areas with large errors) or the error weights need to be adjusted, and the iterative correction needs to be performed again until the accuracy requirements are met.
[0111] Write the final corrected parameters (such as link length L1=150.02mm, joint offset θ2=0.03°, etc.) into the robot control system, overwriting the original factory parameters, and record the error comparison data before and after the correction (archived for future reference and used for subsequent maintenance and calibration). Step 52 above, spline interpolation model construction: A cubic B-spline model is used, with the basis function order set to 3. Node vectors are evenly distributed according to the control point distribution (interval between adjacent nodes is 0.1–1 m, adjusted according to path density). The model must meet the following geometric continuity conditions: positional continuity (C0) requires the coordinate difference between adjacent segment endpoints to be ≤0.05 mm; velocity continuity (C1) requires the angle between endpoint velocity vectors to be ≤0.5°; for precise scenes, acceleration continuity (C2) is required, with an acceleration change rate ≤100° / s². 3 . Model parameter optimization training: Typical welding path samples (straight lines, arcs, broken lines, etc.) were selected. By adjusting the weights of spline control points (weights range from 0.5 to 1.5) and the node spacing, the deviation between the interpolated trajectory and the theoretical path was made ≤0.1mm. Simulation tests were used to verify the smoothness of the trajectory (maximum speed fluctuation ≤5%). Smooth trajectory generation implementation: Input control point set (keyframe pose sequence), automatically calculate segmented connection parameters based on pre-trained spline model to generate continuous trajectory; perform local optimization on trajectory: if the curvature of a certain segment exceeds the threshold (curvature radius ≤ 50mm), add intermediate control points (control point density increased by 20% to 50%) to ensure smooth trajectory transition. Step 53 above, constructing the forward kinematics model: establish the model based on the DH parameter method, and clarify the parameters such as the length (50~300mm), torsion angle (0°~90°), and joint offset (0~50mm) of each link. The model output is the three-dimensional coordinates (X / Y / Z range ±1000mm) and attitude angle (Euler angle range ±180°) of the welding torch end. Model accuracy calibration training: Control the robot to move according to a preset combination of joint angles (each group of angles is 5° to 10° apart), use a laser tracker to measure the actual pose of the end effector, compare the model output value with the measured value, and iteratively correct the DH parameters (correction amount ≤ ±0.02mm / ±0.01°) to make the pose calculation error ≤ ±0.15mm (position) and ±0.1° (attitude). Motion parameter set generation: The smooth trajectory is sampled at equal time intervals (0.02 to 0.05 seconds, with the smaller value taken when the welding speed is ≥0.5m / min) to obtain joint angle time series data; the joint angle at each time node is input into the forward kinematics model to solve the welding torch end pose, and integrated to form a motion parameter set containing timestamps (accuracy ±1ms), position coordinates, and attitude angles. The parameter set needs to be verified by trajectory playback (playback error ≤0.2mm).
[0112] In this embodiment of the invention, spline interpolation and continuity constraints are used to avoid abrupt changes in joint motion, reduce robot vibration and impact, lower mechanical losses, and improve motion stability. Pose compensation parameters are effectively integrated into the motion trajectory, ensuring that deviation corrections in critical areas are executed through actual motion, directly improving the accuracy of welding pose.
[0113] like Figure 2 As shown, embodiments of the present invention also provide an artificial intelligence-based welding obstacle avoidance path planning system, comprising: The acquisition module is used to acquire discrete spatial sampling sets of the welding area and generate a work space partitioning model based on bounded polyhedron decomposition. The decision module is used to input the workspace partitioning model into the deep reinforcement learning decision engine, and combine the welding start and end pose tensor and the weld parameterization curve to obtain the joint space motion primitive sequence. The computation module is used to generate a dynamic convex hull from the keyframe pose set of the motion primitive sequence using a convex hull generation algorithm; to perform penetration depth detection on the dynamic convex hull and the discrete space sampling set to generate a collision probability density distribution; to perform quality evaluation on the collision probability density distribution and to integrate the welding torch attitude constraint and kinematic error propagation chain to generate a welding quality deviation functional. The analysis module is used to analyze the high-deviation nodes in the welding quality deviation functional, perform local tangent plane projection on the associated spatial sampling subset, and obtain pose compensation parameters. The output module is used to input the pose compensation parameters and the sequence of joint space motion primitives into the inverse kinematics module, and generate an optimized set of welding torch motion parameters through geodesic construction and parametric spline interpolation.
[0114] It should be noted that this system is a system corresponding to the above method. All implementation methods in the above method embodiments are applicable to this embodiment and can achieve the same technical effect.
[0115] Embodiments of the present invention also provide a computing device, including: a processor and a memory storing a computer program, wherein the computer program, when executed by the processor, performs the method described above. All implementations in the above method embodiments are applicable to this embodiment and can achieve the same technical effects.
[0116] Embodiments of the present invention also provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method described above. All implementations in the above method embodiments are applicable to this embodiment and can achieve the same technical effects.
[0117] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A welding obstacle avoidance path planning method based on artificial intelligence, characterized in that, The method includes: Step 1: Collect a discrete spatial sample set of the welding area and generate a work space partitioning model based on bounded polyhedron decomposition; Step 2: Input the workspace partitioning model into the deep reinforcement learning decision-maker, and combine the welding start and end pose tensors and weld parameterization curves to obtain the joint space motion primitive sequence. Step 3: Use the convex hull generation algorithm to generate a dynamic convex hull from the keyframe pose set of the motion primitive sequence; perform penetration depth detection on the dynamic convex hull and the discrete space sampling set to generate a collision probability density distribution; perform quality assessment on the collision probability density distribution, and integrate the welding gun attitude constraint and kinematic error propagation chain to generate a welding quality deviation functional. Step 4: Analyze the high-deviation nodes in the welding quality deviation functional, perform local tangent plane projection on the associated spatial sampling subset, and obtain the pose compensation parameters. Step 5: Input the pose compensation parameters and joint space motion primitive sequence into the inverse kinematics module, and generate the optimized welding torch motion parameter set through geodesic construction and parameterized spline interpolation.
2. The welding obstacle avoidance path planning method based on artificial intelligence according to claim 1, characterized in that, Collect a discrete spatial sample set of the welding area, and generate a work space partitioning model based on bounded polyhedral decomposition, including: Step 11: Construct an initial bounded polyhedron bounding box based on the spatial coordinate extreme points of the discrete space sampling set; divide the initial bounded polyhedron bounding box into equal parts along the three axes of the Cartesian coordinate system to generate a set of sub-polyhedron elements; Step 12: Perform spatial position matching detection on the set of sub-polyhedral elements. If there are obstacle sampling points in the element, mark it as an obstacle element. If the element contains only passable sampling points, mark it as a free space element. Step 13: Perform adjacency analysis on the free space elements to generate a set of adjacent element pairs; based on the set of adjacent element pairs, detect the consistency of the normal vector direction of the shared contact surface, and mark the element pairs with the included angle of the normal vectors less than a preset threshold as coplanar element groups; Step 14: Calculate the coplanar unit group and iteratively perform the geometric merging operation until there are no new units to be merged, generating a continuous bounded polyhedral region set; merge the continuous bounded polyhedral region set with the obstacle unit set to generate the work space subdivision model.
3. The welding obstacle avoidance path planning method based on artificial intelligence according to claim 2, characterized in that, The workspace partitioning model is input into a deep reinforcement learning decision-maker, and combined with the welding start and end pose tensors and weld parameterization curves, to obtain a sequence of joint space motion primitives, including: Step 21: Based on the set of polyhedral elements of the passable area of the work space partitioning model, extract the geometric center coordinates and spatial adjacency relationships of each element to generate a spatial position relationship description set; discretize the parameterized curve of the weld into a set of equidistant sampling points, and based on the spatial position relationship description set, map each sampling point to the geometric center point of the nearest neighbor element to generate a weld reference position sequence. Step 22: Using the spatial coordinates corresponding to the welding start and end pose tensors as endpoints, the weld reference position sequence is used as a motion trajectory constraint. Based on the spatial position relationship description set, a trajectory tracking path search is performed to generate an initial obstacle avoidance path position sequence. Step 23: Input the weld reference position sequence and the initial obstacle avoidance path position sequence into the deep reinforcement learning policy network, and update the policy gradient through the path length optimization objective, collision avoidance constraint and attitude smoothness constraint to obtain the optimized path position sequence. Step 24: Convert each spatial coordinate in the optimized path position sequence into a joint angle vector using the robot inverse kinematics model, and generate a joint spatial motion primitive sequence according to the motion time sequence.
4. The welding obstacle avoidance path planning method based on artificial intelligence according to claim 3, characterized in that, Step 3 includes: Step 31: Extract the keyframe pose set from the joint space motion primitive sequence, construct the motion convex hull corresponding to each keyframe based on the robot link motion envelope parameters; arrange the motion convex hulls according to the motion sequence to generate a dynamic convex hull sequence covering the robot motion trajectory. Step 32: Based on the dynamic convex hull sequence, perform spatial interference detection with the discrete spatial sampling set, calculate the minimum penetration depth value of each spatial sampling point relative to the surface of each convex hull, and generate a set of penetration depth values; Step 33: Establish a mapping relationship between continuous position points and penetration depth values in the entire working space. Calculate the probability weight of each spatial position point affected by the penetration depth value using the Gaussian distribution law. Aggregate the probability weights of all penetration depth values at continuous spatial position points to generate a collision probability density distribution field. Input the collision probability density distribution field into the welding quality evaluator, and fuse the welding gun attitude constraint function with the robot kinematic error propagation model to generate a welding quality deviation functional.
5. The welding obstacle avoidance path planning method based on artificial intelligence according to claim 4, characterized in that, The high-deviation nodes in the welding quality deviation functional are analyzed, and local tangent plane projection is performed on the associated spatial sampling subset to obtain pose compensation parameters, including: Step 41: Based on the welding quality deviation functional, identify spatial location points where the deviation value exceeds a preset threshold and generate a high deviation node set; based on the high deviation node set, extract the corresponding obstacle sampling point subset in the discrete spatial sampling set to obtain the associated spatial sampling subset. Step 42: Based on the associated spatial sampling subset, for each obstacle sampling point, extract the set of spatial sampling points within the preset radius neighborhood to generate a local neighborhood point set; based on the local neighborhood point set, calculate the obstacle surface normal vector; Step 43: Based on the surface normal vector and the coordinates of the sampling points, construct a local tangent plane that passes through the sampling points and has the normal vector as its axis. Then, along the direction of the local tangent plane's normal vector, orthogonally project the original obstacle sampling points onto the tangent plane to generate the coordinates of the projected points. Aggregate all the coordinates of the projected points to generate a set of projected point coordinates. Step 44: Based on the pose difference between the set of projection point coordinates and the original sampling point coordinates, synthesize the spatial position compensation vector and the welding gun posture rotation parameter to obtain the pose compensation parameter.
6. The welding obstacle avoidance path planning method based on artificial intelligence according to claim 5, characterized in that, The pose compensation parameters and the sequence of joint space motion primitives are input into the inverse kinematics module. Through geodesic construction and parametric spline interpolation, an optimized set of welding torch motion parameters is generated, including: Step 51: Based on the pose compensation parameters and the joint space motion primitive sequence, the position compensation vector and attitude rotation parameters are superimposed at the key frame pose to generate the compensated and corrected joint motion path; based on the compensated and corrected joint motion path, the shortest continuous motion trajectory connecting adjacent key frame poses is constructed in the robot joint space. Step 52: Extract the keyframe pose sequence from the shortest continuous motion trajectory as the interpolation control point set; determine the spline curve segmentation connection parameters and geometric continuity conditions based on the spatial distribution relationship of the control point set; generate a continuous smooth trajectory based on the control point set and geometric continuity conditions. Step 53: Sample joint angle time series data at equal time intervals along a continuous smooth trajectory; calculate the welding torch end spatial pose using a forward kinematics model based on the joint angle at each time node in the time series data; integrate the welding torch end spatial pose to generate an optimized welding torch motion parameter set.
7. The welding obstacle avoidance path planning method based on artificial intelligence according to claim 6, characterized in that, Joint angle time-series data are obtained by sampling along a continuous smooth trajectory at equal time intervals; the welding torch end-effector spatial pose is calculated using a forward kinematics model based on the joint angle at each time node in the time-series data; the welding torch end-effector spatial pose is integrated to generate an optimized welding torch motion parameter set, including: Step 61: Based on the continuous smooth trajectory, perform discrete sampling along the trajectory path with a fixed time step to generate a discrete time series of joint angles; based on each time node in the discrete time series, obtain the corresponding combination of joint angles. Step 62: Based on the joint angle combination and the robot link geometry parameters, calculate the pose transformation relationship between adjacent links; starting from the robot base coordinate system, iteratively synthesize the coordinate systems of each link according to the pose transformation relationship along the kinematic chain to obtain the spatial position coordinates of the welding gun end in the base coordinate system; based on the synthesis result of the end link coordinate system, extract the rotation relationship relative to the base coordinate system to obtain the welding gun attitude rotation parameters. Step 63: Aggregate the spatial position coordinates and attitude matrices of all time nodes, and construct the welding torch motion pose sequence in chronological order; fuse the welding torch motion pose sequence with the welding process parameters to generate an optimized welding torch motion parameter set.
8. An artificial intelligence-based welding obstacle avoidance path planning system, wherein the system implements the method as described in any one of claims 1 to 7, characterized in that, include: The acquisition module is used to acquire discrete spatial sampling sets of the welding area and generate a work space partitioning model based on bounded polyhedron decomposition. The decision module is used to input the workspace partitioning model into the deep reinforcement learning decision engine, and combine the welding start and end pose tensor and the weld parameterization curve to obtain the joint space motion primitive sequence. The calculation module is used to generate a dynamic convex hull from the keyframe pose set of the motion primitive sequence using a convex hull generation algorithm; The dynamic convex hull and discrete spatial sampling set are subjected to penetration depth detection to generate a collision probability density distribution; the collision probability density distribution is subjected to quality assessment, and welding gun attitude constraints and kinematic error transmission chain are fused to generate a welding quality deviation functional. The analysis module is used to analyze the high-deviation nodes in the welding quality deviation functional, perform local tangent plane projection on the associated spatial sampling subset, and obtain pose compensation parameters. The output module is used to input the pose compensation parameters and the sequence of joint space motion primitives into the inverse kinematics module, and generate an optimized set of welding torch motion parameters through geodesic construction and parametric spline interpolation.
9. A computing device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program that, when executed by a processor, implements the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Skip distance correction WSN three-dimensional space target positioning method based on coplanarity
CN104968046A
Live line work mechanical arm autonomous obstacle avoidance path planning method based on movement primitive libraries
CN107214701A
Collision-free trajectory planning method for joint space of industrial robot
CN114407019A
Ray tracing-based collision detection method in non-structured environment obstacle dense scene
CN118484001A
Welding seam path planning method and system based on robot kinematics and medium
CN119610103A
Cited By
Track plate drilling parameter intelligent optimization method and system based on deep learning
CN121541575A
Method and system for stabilizing wire arcs of IC chip and memory chip of wire bonding machine
CN121624587A
Real-time mobile robot welding system control method
CN121733530A
Distributed aerial target navigation tracking and positioning method
CN122130058A
A Distributed Navigation, Tracking and Positioning Method for Airborne Targets
CN122130058B