Welding manipulator path planning method based on rapid expansion random forest

By rapidly expanding the random forest algorithm to optimize the path planning of the welding robot, the problems of low path planning efficiency and uneven path in the existing technology are solved, and efficient collision avoidance capabilities are achieved in complex environments.

CN120620178APending Publication Date: 2025-09-12JIANGSU UNIV OF SCI & TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510717212.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

The path planning algorithm of the welding robot in the existing technology is inefficient and the path is not smooth, making it difficult to effectively avoid collisions in complex environments.

Method used

A path planning method based on rapidly expanding random forest is adopted. By establishing a dynamic model of the welding robot, combining Bayesian updating and Markov chain random sampling, optimizing tree expansion and resource allocation, performing local sampling and collision detection, and generating a collision-free path.

Benefits of technology

It improves the efficiency and smoothness of path planning, enables more accurate path selection in complex environments, reduces redundant parts, and improves the flexibility and adaptability of the manipulator.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120620178A_ABST
    Figure CN120620178A_ABST
Patent Text Reader

Abstract

The invention discloses a welding manipulator path planning method based on a fast expansion random forest. The method comprises the steps that a welding manipulator kinetic model is designed; an RRF * algorithm tree selection problem is formalized into an MAB problem, a more desirable tree in tree extension is actively selected, and resources are effectively allocated to the most desirable tree; designing a Bayesian updating process, wherein Bayesian updating is gradually improved through an observation result; local sampling is carried out, the local connectivity of the space is utilized through Markov chain random sampling, and the random sampling is updated through a Bayesian suggestion distribution sequence; collision detection is carried out, if a new node falls in a safe feasible region, the new node is added into the random tree, node sampling continues to be carried out, and otherwise, the node is removed and sampling is carried out again; and performing path extraction. According to the welding manipulator path planning optimization algorithm provided by the invention, the planned path can be smoother, and the algorithm efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of path planning, relates to welding robot path planning technology, and specifically relates to a welding robot path planning method based on rapidly expanding random forests. Background Art

[0002] As a core component of automation systems, robotic arms are increasingly being used in manufacturing, assembly lines, and precision operations. In recent years, the research and application of six-degree-of-freedom robotic arms (6-DOF RobotArm) have made significant progress, becoming a crucial tool in intelligent production, medical robotics, automated warehousing, and other fields.

[0003] Six-degree-of-freedom manipulators can mimic the precision manipulation of human arms and are widely used in industrial automation, medical surgery, unmanned assembly, 3D printing, welding, and handling. Their core technologies include motion control, trajectory planning, and dynamic analysis. Path planning, as a crucial step, is directly related to the efficiency and safety of manipulator operations. Path planning requires calculating an optimal path from a starting point to a destination within a given workspace based on specific optimization criteria, while avoiding obstacles and collisions, and taking into account the range of joint motion and the manipulator's operational capabilities. Therefore, path planning is a crucial aspect of a manipulator's intelligence, determining its adaptability and flexibility in complex environments.

[0004] Welding manipulators are widely used in industrial welding and can improve welding efficiency. Currently, it is necessary to combine industrial sites and implement path planning for welding manipulators in complex working environments to avoid collisions, which has important theoretical significance and practical application value. Summary of the Invention

[0005] Purpose of the invention: In order to overcome the deficiencies in the prior art, a welding robot path planning method based on an improved Rapidly-exploring Random Tree Forest (RRF*) algorithm is provided, which can make the planned path smoother and improve the efficiency of the algorithm.

[0006] Technical solution: To achieve the above objectives, the present invention provides a welding robot path planning method based on rapidly expanding random forests, comprising the following steps:

[0007] S1: Establish the dynamic model of the welding robot;

[0008] S2: Formalize the RRF* algorithm tree selection problem as the MAB problem, actively select more promising trees in tree expansion, and effectively allocate resources to the most promising trees;

[0009] S3: Design a Bayesian update process that is gradually improved through observations;

[0010] S4: Perform local sampling, exploit the local connectivity of the space through Markov chain random sampling, and update the random sampling order through Bayesian suggestion distribution;

[0011] S5: Perform collision detection. If the new node falls within the safe feasible region, add the new node to the random tree and continue node sampling. Otherwise, remove the node and resample.

[0012] S6: Perform path extraction to obtain the final path.

[0013] Furthermore, in step S1, the manipulator motion function needs to be obtained by the DH parameter method, and the specific process is as follows:

[0014] A1: Define the coordinate system. The Denavit-Hartenberg (DH) parameter method is used to describe the relative motion relationship between the joints of the manipulator, so that the relative position and posture of each joint to the previous joint can be described by a simple forward and inverse transformation matrix. The DH parameter method simplifies the kinematic modeling of the manipulator by defining the relationship between each two adjacent coordinate systems. The relationship between each two adjacent coordinate systems is determined by four parameters. Among them, θ i is the joint angle, i.e. around Z i The angle of axis rotation; d i is the connecting rod offset, i.e. along Z i Axis translation; a i is the connecting rod length, i.e. i The translation of the axis; α i is the connecting rod torsion angle, i.e. i The rotation angle of the axis.

[0015] A2: Solve the forward kinematics of the manipulator. Forward kinematics is the process of calculating the position and posture of the end effector in space from the joint angles or displacements of the manipulator.

[0016] Through the DH parameter method, the transformation matrix of each joint is calculated step by step, and finally the transformation matrix from the base coordinate system to the end effector is obtained;

[0017] A3: Solve the inverse kinematics of the manipulator. Inverse kinematics is to solve the angles or displacements of each joint of the manipulator given the position and posture of the end effector.

[0018] Since the inverse kinematics of the six-degree-of-freedom welding robot is nonlinear, the numerical method of the Newton-Raphson method is used to obtain the inverse kinematics solution of the welding robot, and the target position of the end effector is approached by continuously adjusting the joint angles.

[0019] Furthermore, the specific process of step A2 is as follows:

[0020] B1: Define the DH parameter table for each joint, define the coordinate system for each joint through the DH parameter table, and record the rotation angle θ of the joint i , offset d i , connecting rod length a i , torsion angle α i .

[0021] B2: Construct the transformation matrix of each joint and calculate the relative transformation matrix T for each pair of adjacent joints i and i+1 according to the DH parameters. i i+1 .

[0022]

[0023] Among them, θ i is the joint angle, d i is the connecting rod offset, a i is the connecting rod length, α i is the connecting rod torsion angle.

[0024] B3: Calculate the total transformation matrix of the end effector: By multiplying the transformation matrix of each joint, the total transformation matrix from the base coordinate system to the end effector is obtained

[0025]

[0026] Where n is the total number of joints of the welding robot.

[0027] B4: Extract the position and posture of the end effector by calculating Extract the position and attitude of the end effector. The last column of the transformation matrix gives the position (x, y, z) of the end effector, while the first 3x3 part of the matrix gives the rotation matrix of the end effector, which is used to describe the attitude of the end effector.

[0028]

[0029] in, is a 3x3 rotation matrix describing the posture of the end effector; is a 3x1 displacement vector describing the position of the end effector.

[0030] Furthermore, the specific process of step A3 is as follows:

[0031] C1: Define the objective function, which describes the difference between the current position of the end effector and the target position, and can be expressed as a position error vector;

[0032] f(θ)=P(θ)-Ptarget (4)

[0033] Among them, P(θ) is the actual position of the end effector calculated from the current joint angle, P target is the given target position. For the attitude part, the target is the error of the rotation matrix, and the final objective function f(θ) contains the position and attitude errors;

[0034]

[0035] Among them, R(θ) is the rotation matrix of the end effector, R target is the target rotation matrix;

[0036] C2: Calculate the Jacobian matrix. The Jacobian matrix J(θ) describes the linear relationship between the change in joint angle and the change in end effector position.

[0037]

[0038] C3: Newton-Raphson method iteratively updates the joint angles and updates the solution estimate by the current solution value;

[0039] The update formula is:

[0040] θ new =θ old -J(θ old ) -1 ·f(θ old ) (7)

[0041] Among them, θ old is the current joint angle guess, J(θ old ) -1 is the inverse of the Jacobian matrix, f(θ old ) is the current error vector;

[0042] C4: Determine the termination condition, set the error threshold, and stop the iteration when the error of the end effector position ||f(θ)|| is less than the preset threshold.

[0043] ||f(θ)||<ò (8)

[0044] Among them, ∈ is the error tolerance.

[0045] Furthermore, in step S2, the RRF* algorithm tree selection problem is formalized as the MAB problem. The MAB problem is a classic decision problem that describes the problem of weighing multiple choices under limited resource conditions. This strategy actively selects trees that are more promising in tree expansion and effectively allocates resources to the most promising trees to speed up planning operations. In the MAB problem, each arm has an unknown reward distribution. The goal is to maximize the cumulative reward obtained through exploration and utilization. The core of the MAB problem is exploration and utilization: exploration is used to try different arms and collect data to understand the reward expectations of each arm; the utilization stage selects the arm with the highest expected reward based on the current information to obtain the maximum benefit.

[0046] The present invention adopts the upper confidence bound (UCB) to optimize the decision-making solution tree selection problem by reasonably balancing the exploration of unknown arms and the use of known arms, and finds a balance between exploring new options and selecting the currently known best options. The core idea of ​​the UCB algorithm is to assign a confidence upper bound value to each choice, which consists of two parts: the average reward value and the confidence interval. The average reward value is the average reward of the choice calculated based on the currently collected data, and the confidence interval is an adjustment value based on the uncertainty of the choice. Finally, each choice is scored to select the output with the highest score. After each output, the user feedback is observed and the parameters of the candidate arm are updated. Each scoring method is:

[0047]

[0048] in, is the average reward of the i-th choice, reflecting the benefit effect of i. The latter is the upper bound of the confidence interval, reflecting the uncertainty of the i-th choice. T is the total number of choices, n i The number of times the i-th option is selected.

[0049] The present invention fixes the starting point and the end point of the two trees, and creates two trees from the starting point and the end point respectively during initialization. Introducing additional random trees, creating multiple random trees, and expanding them as independent trees. Each random tree T i Both are located in free space C free The complexity of a certain location depends on the surrounding environment. Therefore, the expansion rate of each tree is different. In order to allocate more resources in the area with a wide view and make rational use of the environment, it is set in the MAB problem to bias the exploration from the starting point x ini and the target point x goal The growing tree has a high expansion rate; when space is limited, the RRF* algorithm can create intermediate random trees to interconnect them.

[0050]

[0051] Among them, the tree T i The average reward, C is the exploration coefficient, t is the total number of expansions of all trees, n i is a random tree T i The number of times selected, α is the distance weight coefficient, d i is a random tree T i The distance to the target point or starting point, β environmental factor weight coefficient, used to adjust the impact of environmental complexity on the UCB value, S i is a random tree T i The Complexity Score of your current location.

[0052] Furthermore, in step S3, the local sampling process is modeled as a Markov process. The state θ of the local planner t As time changes and depends on its previous state, the local sampling process in this invention can be regarded as a Bayesian update process. Bayesian update is gradually improved by observation results. When a sampling is successful, the successful direction will become the basis for updating the proposal distribution, thereby affecting the direction of subsequent sampling. The failed direction reduces the sampling probability, making the local planner more inclined to explore new, potentially effective directions. When the local sampler moves from the current state θ t When expanding the local tree, it distributes Q from the proposals t Sampling direction x t,i , and then try to expand in that direction. If the expansion is successful, the state of the planner will be updated to θ t+1 , and proceed to the next sampling; otherwise the local planner remains in the current state Q t , and sample again from the updated proposal distribution as follows:

[0053] Proposal distribution Q of the local sampler t (x|x t-1 ,X i ) will be adjusted according to the Bayesian update after each sampling. The specific update method is:

[0054]

[0055] Among them, x t-1 For the direction of the last successful expansion, X i is the set of all currently known directions, α i is the normalization constant;

[0056] During the update, a kernel function is used to weight the previous failure directions. The kernel function k(x,x′) uses the factor β to control the influence of the historical failure direction on the current sampling distribution. The specific form of the kernel function is:

[0057]

[0058] Among them, λ is the length scale that controls the dependence on the previous direction, and β is the scaling factor used to adjust the influence weight of the previous failed direction.

[0059] To ensure that the sampling process is not restricted to a specific direction, in addition to basic Bayesian updates and kernel function weighting, a periodic update mechanism is added to effectively guide the local planner to sample more flexibly in space. This mechanism uses exponential decay to gradually reduce the influence of past sampling results on the current proposal distribution over time.

[0060] The specific update method is:

[0061]

[0062] Among them, σ is the scaling factor, which controls the speed of attenuation; p is the period, which controls the repeatability of sampling and the influence of periodic updates.

[0063] Furthermore, in step S4, to make the robot sampling more adaptable to maps of varying complexity, inaccessible areas with narrow passages, dense obstacles, or complex structures are collectively referred to as restricted areas. Because randomly generated points may be blocked by obstacles, finding a collision-free path is difficult, resulting in a lower global sampling success rate in restricted areas. To improve the RRF* algorithm's sampling success rate in restricted areas, adaptive local sampling is triggered when RRF* detects a difficult-to-traverse restricted area.

[0064] The RRF* algorithm performs random walks through Bayesian sampling and Markov Chain Monte Carlo (MCMC). Through Bayesian updating, combined with historical sampling data and current environmental information, the RRF* algorithm constructs a sampling distribution that adapts to the restricted area to predict effective sampling points. The local sampling state is

[0065]

[0066] Among them, k is the kernel function that integrates the failure information of x', λ i is the normalization factor, and δ is the previous successful direction. This distribution tends to generate sampling points close to the boundary of the current connected region or the center of the restricted space to increase the possibility of passing through the narrow area.

[0067] MCMC sampling uses Markov Chain Monte Carlo methods to generate a series of sampling points that depend on the current point. The random step size is designed to take into account the local connectivity of the space, ensuring that the new sampling point is as connected as possible to the existing path. First, starting from the current node xt, a candidate point xt+1 is generated according to the Bayesian proposal distribution. Second, the candidate point is checked for collision-free connection to xt. Finally, if the connectivity check passes, xt+1 is accepted as the new sampling point; otherwise, candidate generation continues.

[0068] Furthermore, in step S4, the area with few or no obstacles is defined as an open space. In the open area, the extension of the path is not easily blocked by obstacles, and the path can be generated faster. When RRF* detects a relatively empty area, the rapid expansion strategy is enabled to speed up the overall path planning. In the open space, RRF* uses a global random sampling strategy similar to the rapid exploration random tree RRT*, which is not limited to the local area. RRF* uses a multi-tree structure, in which different trees can be expanded simultaneously in the open space to make full use of the space and reduce planning time. In the open area, the algorithm will give priority to those trees with faster growth rates in order to quickly generate collision-free path segments.

[0069] Furthermore, in order to improve node utilization in step S5, the collision probability detection method is selected instead of the straight line intersection method. The specific process of collision detection is as follows:

[0070] D1: Discrete the random tree edge into multiple points and calculate the cumulative collision probability of the discrete points; the collision probability estimation function is:

[0071] Among them, n1 is the number of points selected on the edge, M(p i ) is point p i The collision probability of

[0072]

[0073] Where n2 is the number of obstacles, m j (p i ) is any obstacle pair p i the impact of;

[0074]

[0075] Where d is the distance from the obstacle to point p i The Euclidean distance of

[0076]

[0077] Among them, k CPA is the actual collision probability of the edge, kp is the collision coefficient;

[0078] D2: Design a probability collision threshold and compare the accumulated value of the discrete point collision probability with it.

[0079] Furthermore, the path extraction in step S6 starts from the starting node x ini To the target node x goal Generate a collision-free path. Based on the known growth information of all random trees, the algorithm randomly generates multiple trees at the beginning and stores them in a list. If adding an intermediate random tree makes the path better, the path will be taken from the starting point through the intermediate random tree to the final destination. Path extraction requires validating the path segments, i.e., determining whether there is a collision between the straight path between two nodes.

[0080] The main steps of path extraction are as follows:

[0081] E1: Checks whether a path segment is valid. Uses a collision function to detect collisions between two nodes. It takes as input the coordinates of the start and destination nodes and returns a Boolean value indicating whether the path segment is valid. If the path segment is collision-free, it can be used directly for connection. It uses Euclidean distance calculation to connect two nodes (x1, y1) and (x2, y2). The midpoint of the path can be obtained by linear interpolation.

[0082] (x,y)=(x1+t(x2-x1),y1+t(y2-y1))(19)

[0083] Among them, t∈[0,1], t is discretely valued by setting the step size, generating points on the path segment and detecting collisions.

[0084] E2: Determine whether the starting tree can be directly connected to the target tree. The path connection function checks whether the starting and ending points can form a good path without passing through other random trees. If so, the path from the end point to the starting point is extracted to form the final path.

[0085]

[0086] E3: If the starting point and the end point cannot be directly connected, then the random tree path is added to connect the segments. First, the target tree is connected to the nearest random tree to form a partial path. Then, other random trees are added and the collision is determined during the connection process. Finally, the path is connected to the starting tree to form the last segment. The nearest intermediate random tree node is selected, the distance between the target tree and each intermediate tree node is calculated, and the nearest node x is selected. nearest

[0087]

[0088] Path connection is to gradually build a path by segment connection. If there is no collision on the path, it will be added to the path sequence.

[0089] Assume that from x goal Connect to x nearest , then connect to other intermediate trees, and finally connect to the starting tree, and calculate the connection through the following segment-by-segment path distance formula;

[0090]

[0091] E4: path reversal;

[0092] To ensure the path sequence from the starting node x ini To the target node x goal ,After the path is constructed, the reverse operation is performed to return to the final path, which can be completed by the following formula;

[0093] path=[x n ,x n-1 ,...,x1](23)

[0094] The present invention transforms the tree selection problem into a multi-armed bandit problem (Multi-ArmedBandit, MAB) through a multi-tree structure algorithm, and accelerates path planning through reasonable resource allocation. Data is collected by exploring different options, and the optimal strategy is selected based on the existing information. The upper confidence bound strategy is adopted to optimize the exploration and utilization process, thereby improving the efficiency of path planning. Adaptive optimization is performed on the local connectivity problem in the restricted area, and the Markov chain Monte Carlo method is introduced and updated through the Bayesian distribution. The RRF* algorithm combines the multi-tree method with the Bayesian local sampling strategy. In open areas, the algorithm dynamically selects the tree expansion method according to the characteristics of the environment, and adopts a strategy similar to RRT* for rapid expansion. During the path extraction process, it ensures that the path from the starting point to the target point is collision-free, significantly improving the performance of path planning.

[0095] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0096] 1. This invention uses a multi-tree structure that is interconnected to form the final path. This allows the algorithm to explore different areas more efficiently, allowing for more accurate path selection when a feasible path is found. It also effectively reduces redundant paths, thereby reducing the algorithm's search space and shortening convergence time.

[0097] 2. The present invention introduces a Bayesian local sampling method, which can be dynamically adjusted according to the complexity of the environment. For complex maps and maps with narrow obstacles, the manipulator can intelligently adjust the step size by evaluating the fitness of the current solution to adapt to different types of maps.

[0098] 3. The present invention combines the Markov chain random sampling strategy to dynamically adjust the expansion direction of the tree. By weighing the pros and cons of the nearest points, the relatively better sampling nodes are selected, thereby improving the operation efficiency of the algorithm. The manipulator can flexibly adjust the sampling direction. BRIEF DESCRIPTION OF THE DRAWINGS

[0099] Figure 1 It is the topological diagram of the RRF* algorithm in the present invention;

[0100] Figure 2 It is the composition diagram of the RRF* algorithm;

[0101] Figure 3 is a random node sampling graph;

[0102] Figure 4 is a flow chart of the method of the present invention;

[0103] Figure 5 This is the structural diagram of the welding robot;

[0104] Figure 6 is the obstacle map;

[0105] Figure 7 This is a comparison chart of path results under narrow maps;

[0106] Figure 8 This is a comparison chart of path results under complex maps. DETAILED DESCRIPTION

[0107] The present invention is further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention. After reading the present invention, modifications of various equivalent forms of the present invention made by those skilled in the art all fall within the scope defined by the claims attached to this application.

[0108] Example 1:

[0109] This embodiment provides a welding robot path planning method based on rapid expansion random forest, the topology diagram is as follows Figure 1 As shown, the gray irregular shape is an obstacle, the white area is the feasible region, and the green and red circles are the root nodes of the starting tree and the target tree in the RRF* algorithm, that is, the starting point x of the path. ini and the target point x goal , the orange circle is the root node x of the middle random tree ran , RRF* algorithm components such as Figure 2 As shown. Figure 4 , the path planning method includes the following steps:

[0110] S1: Design the dynamic model of the manipulator, refer to Figure 5 , the specific steps are as follows:

[0111] A1: Define the coordinate system. The Denavit-Hartenberg (DH) parameter method is used to describe the relative motion relationship between the joints of the manipulator, so that the relative position and posture of each joint to the previous joint can be described by a simple forward and inverse transformation matrix.

[0112] A2: Solve the forward kinematics of the manipulator. Use the DH parameter method to gradually calculate the transformation matrix of each joint, and finally obtain the transformation matrix from the base coordinate system to the end effector. The specific process is as follows:

[0113] B1: Define the DH parameter table for each joint, define the coordinate system for each joint through the DH parameter table, and record the rotation angle θ of the joint i , offset d i , connecting rod length a i , torsion angle α i .

[0114] B2: Construct the transformation matrix of each joint and calculate the relative transformation matrix T for each pair of adjacent joints i and i+1 according to the DH parameters. i i+1 .

[0115]

[0116] Among them, θ i is the joint angle, d i is the connecting rod offset, a i is the connecting rod length, α i is the connecting rod torsion angle.

[0117] B3: Calculate the total transformation matrix of the end effector: By multiplying the transformation matrix of each joint, the total transformation matrix from the base coordinate system to the end effector is obtained

[0118]

[0119] Where n is the total number of joints of the robot.

[0120] B4: Extract the position and posture of the end effector by calculating Extract the position and attitude of the end effector. The last column of the transformation matrix gives the position (x, y, z) of the end effector, while the first 3x3 part of the matrix gives the rotation matrix of the end effector, which is used to describe the attitude of the end effector.

[0121]

[0122] in, is a 3x3 rotation matrix describing the posture of the end effector; is a 3x1 displacement vector describing the position of the end effector.

[0123] A3: Solve the inverse kinematics of the manipulator. This paper uses the numerical method of the Newton-Raphson method to obtain the inverse kinematics solution of the welding manipulator. By continuously adjusting the joint angles, the target position of the end effector is approached. The specific process is as follows:

[0124] C1: Define the objective function, which describes the difference between the current position of the end effector and the target position, and can be expressed as a position error vector.

[0125] f(θ)=P(θ)-P target (4)

[0126] Among them, P(θ) is the actual position of the end effector calculated from the current joint angle, P target is the given target location.

[0127] For the attitude part, the target is the error of the rotation matrix, and the final objective function f(θ) contains the position and attitude errors.

[0128]

[0129] Among them, R(θ) is the rotation matrix of the end effector, R target is the target rotation matrix.

[0130] C2: Calculate the Jacobian matrix. The Jacobian matrix J(θ) describes the linear relationship between the change in joint angle and the change in end effector position.

[0131]

[0132] C3: The Newton-Raphson method iteratively updates the joint angles and updates the solution estimate using the current solution value. The update formula is:

[0133] θ new =θ old -J(θ old ) -1 ·f(θ old ) (7)

[0134] Among them, θ old is the current joint angle guess, J(θ old ) -1 is the inverse of the Jacobian matrix, f(θ old ) is the current error vector.

[0135] C4: Determine the termination condition, set the error threshold, and stop the iteration when the error of the end effector position ||f(θ)|| is less than the preset threshold.

[0136] ||f(θ)||<ò (8)

[0137] Among them, ∈ is the error tolerance.

[0138] S2: The RRF* algorithm tree selection problem is formalized as a MAB problem. Using UCB, the tree selection problem is solved by properly balancing exploration of unknown arms and leveraging known arms to optimize decision making. This balance is achieved by exploring new options and selecting the best currently known option. Finally, each choice is scored to select the highest-scoring output. After each output, user feedback is observed and the parameters of the candidate arms are updated. Each scoring method is:

[0139]

[0140] in, is the average reward of the i-th choice, reflecting the benefit effect of i. The latter is the upper bound of the confidence interval, reflecting the uncertainty of the i-th choice. T is the total number of choices, n i The number of times the i-th option is selected.

[0141] In order to allocate more resources and make rational use of the environment in the area with a wide field of view, it is set to explore the starting point x in the MAB problem. ini and the target point x goal The growing tree has a high expansion rate; when space is limited, the RRF* algorithm can create intermediate random trees to interconnect them.

[0142]

[0143] Among them, the tree T i The average reward, C is the exploration coefficient, t is the total number of expansions of all trees, n i is a random tree T i The number of times selected, α is the distance weight coefficient, d i is a random tree T i The distance to the target point or starting point, β environmental factor weight coefficient, used to adjust the impact of environmental complexity on the UCB value, S i is a random tree T i The Complexity Score of your current location.

[0144] S3: Design the Bayesian update process, which is gradually improved by observation results. The local sampling process is modeled as a Markov process. The state θ of the local planner t The proposal distribution Q of the local sampler changes over time and depends on its previous state t (x|x t-1 ,X i) will be adjusted according to the Bayesian update after each sampling. The specific update method is:

[0145]

[0146] Among them, x t-1 For the direction of the last successful expansion, X i is the set of all currently known directions, α i is the normalization constant.

[0147] During the update, a kernel function is used to weight the previous failure directions. The kernel function k(x,x′) uses the factor β to control the influence of the historical failure direction on the current sampling distribution. The specific form of the kernel function is:

[0148]

[0149] Among them, λ is the length scale that controls the dependence on the previous direction, and β is the scaling factor used to adjust the influence weight of the previous failed direction.

[0150] To ensure that the sampling process is not restricted to a specific direction, in addition to basic Bayesian updates and kernel function weighting, a periodic update mechanism is added to effectively guide the local planner to sample more flexibly in space. This mechanism uses exponential decay to gradually reduce the influence of past sampling results on the current proposal distribution over time.

[0151] The specific update method is:

[0152]

[0153] Among them, σ is the scaling factor, which controls the speed of attenuation; p is the period, which controls the repeatability of sampling and the influence of periodic updates.

[0154] S4: Perform local sampling, exploiting the local connectivity of the space through Markov chain random sampling, which is sequentially updated through a Bayesian proposal distribution.

[0155] The RRF* algorithm performs random walks through Bayesian sampling and Markov Chain Monte Carlo (MCMC). By combining historical sampling data and current environmental information with Bayesian updates, the RRF* algorithm constructs a sampling distribution that adapts to the restricted area, such as Figure 3 As shown, the effective sampling points are predicted and the local sampling state is:

[0156]

[0157] Among them, k is the kernel function that integrates the failure information of x', λ iis the normalization factor, and δ is the previous successful direction. This distribution tends to generate sampling points close to the boundary of the current connected region or the center of the restricted space to increase the possibility of passing through the narrow area.

[0158] In open areas, path expansion is less likely to be blocked by obstacles, allowing for faster path generation. When RRF* detects a relatively empty area, it activates a rapid expansion strategy to accelerate overall path planning. In open spaces, RRF* uses a global random sampling strategy similar to RRT*, not limited to local areas. RRF* utilizes a multi-tree structure, where different trees can be expanded simultaneously in open spaces to fully utilize the space and reduce planning time. In open areas, the algorithm prioritizes trees with faster growth rates to quickly generate collision-free path segments.

[0159] S5: Perform collision detection. If the new node falls within the safe feasible region, add the new node to the random tree and continue node sampling. Otherwise, remove the node and resample. The specific process of collision detection is as follows:

[0160] D1: Discretize the random tree edge into multiple points and calculate the cumulative collision probability of the discrete points. The collision probability estimation function is:

[0161]

[0162] Among them, n1 is the number of points selected on the edge, M(p i ) is point p i The collision probability of

[0163]

[0164] Where n2 is the number of obstacles, m j (p i ) is any obstacle pair p i the impact of;

[0165]

[0166] Where d is the distance from the obstacle to point p i The Euclidean distance of

[0167]

[0168] Among them, k CPA is the actual collision probability of the edge, k p is the collision coefficient;

[0169] D2: Design a probability collision threshold and compare the accumulated value of the discrete point collision probability with it.

[0170] S6: Perform path extraction, path extraction starts from the starting node xini To the target node x goal Generate a collision-free path. Based on the known growth information of all random trees, the algorithm randomly generates multiple trees at the beginning and stores them in a list. If adding an intermediate random tree makes the path better, the path will be taken from the starting point through the intermediate random tree to the final destination. Path extraction requires validating the path segments, i.e., determining whether there is a collision between the straight path between two nodes.

[0171] The main steps of path extraction are as follows:

[0172] E1: Checks whether a path segment is valid. Use the collision function to detect collisions between two nodes. It takes as input the coordinates of the start and destination nodes and returns a Boolean value indicating whether the path segment is valid. If the path segment is collision-free, it can be used directly for connection. Connecting the two nodes (x1, y1) and (x2, y2) uses Euclidean distance calculations. The midpoint of the path can be found using linear interpolation.

[0173] (x,y)=(x1+t(x2-x1),y1+t(y2-y1))(19)

[0174] Among them, t∈[0,1], t is discretely valued by setting the step size, generating points on the path segment and detecting collisions.

[0175] E2: Determine whether the starting tree can be directly connected to the target tree. The path connection function checks whether the starting and ending points can form a good path without passing through other random trees. If so, the path from the end point to the starting point is extracted to form the final path.

[0176]

[0177] E3: If the starting point and the end point cannot be directly connected, then the random tree path is added to connect the segments. First, the target tree is connected to the nearest random tree to form a partial path. Then, other random trees are added and the collision is determined during the connection process. Finally, the path is connected to the starting tree to form the last segment. The nearest intermediate random tree node is selected, the distance between the target tree and each intermediate tree node is calculated, and the nearest node x is selected. nearest

[0178]

[0179] Path connection is a segmented connection method that gradually builds the path. If the path has no collision, it is added to the path sequence.

[0180] Assume that from x goal Connect to x nearest , then connect to other intermediate trees, and finally connect to the starting tree, and calculate the connection through the following segment-by-segment path distance formula;

[0181]

[0182] E4: Path reversal. To ensure the path sequence from the starting node x ini To the target node x goal ,After the path is constructed, the reverse operation is performed to return to the final path, which can be completed by the following formula.

[0183] path=[x n ,x n-1 ,...,x1](23)

[0184] Example 2:

[0185] In this embodiment, the effectiveness and effect of the method of the present invention are verified by the following experiments, which are as follows:

[0186] The computer used in the experiment is Intel(R) Core i5-12500H CPU@2.5GHz, 16G memory; the operating system is Windows 11, the programming language is Python 3.9, and the programming environment is Visual Studio 2021. The initial DH parameters required for the experiment are shown in Table 1. Figure 6 The two maps shown are Figure 6 The left image (a) shows a narrow obstacle map, while the right image (b) shows a complex map with more obstacles. Both maps are 100m × 100m in size. The gray area represents obstacles, and the white area represents the manipulator's feasible region. The manipulator's initial position is set to [6m, 10m], and the target point is set to [90m, 90m].

[0187] Table 1

[0188]

[0189]

[0190] In this embodiment, 50 simulation experiments were conducted on the RRT* and the algorithm of the present invention in two maps, using path length, algorithm search time, and path curvature as performance evaluation indicators of the algorithm.

[0191] Table 2

[0192]

[0193] Table 2 compares the search time and path length averaged over 50 experiments for RRT* and the proposed algorithm on two maps. This data comparison shows that path lengths were reduced by 25.7% and 31.25% on narrow and complex maps, respectively. The RRF* algorithm, by improving its local sampling strategy and using different sampling strategies for confined and open areas to accelerate convergence, increased search speed by 34.21% and 17.14%, respectively. This demonstrates that the proposed algorithm achieves high path quality and search efficiency on both maps.

[0194] Figure 7 This is a path comparison diagram of this embodiment in a narrow and long obstacle map, Figure 7 It can be seen that the RRT* algorithm has obvious randomness, and the growth path of the random tree has no clear directionality. During the expansion process of the tree, the entire area needs to be covered to find a feasible path. Therefore, the RRT* algorithm in these complex environments often results in tortuous and long paths, low path quality, and low algorithm efficiency. In contrast, the RRF* algorithm proposed in the present invention performs path planning by introducing three random trees. Each tree grows independently from the starting point or target point, and then forms the final path through the connection between the tree nodes. This method can more effectively utilize the interaction between multiple trees, quickly find and connect feasible paths in different areas, and improve the algorithm search efficiency.

[0195] Figure 8 This is a path comparison diagram in the complex map of this embodiment, Figure 8 It can be seen that by comparing the RRT* algorithm and the RRF* algorithm, the difference in path length can be clearly observed. The RRT* algorithm has a high degree of randomness in the search process. Although it can find a path from the starting point to the target, since the growth of the tree has no clear directionality, it often needs to traverse a larger area during the expansion process. This random expansion results in a larger curvature of the path, a longer path length, and may include unnecessary detours, resulting in lower path quality. In contrast, the RRF* algorithm proposed in the present invention adopts a multi-tree structure expansion and forms the final path through mutual connection. This enables the algorithm to explore different areas more efficiently, avoids the random influence of a single tree, and thus can more accurately select a path when finding a feasible path, and effectively reduce the redundant part of the path. Therefore, the path planned by the RRF* algorithm in a complex environment is shorter than that of the RRT* algorithm, and the path is more direct and more optimized, avoiding unnecessary twists and long paths.

Claims

1. A welding robot path planning method based on rapidly expanding random forest, characterized in that: The steps include: S1: Establish the dynamic model of the welding robot; S2: Formalize the RRF* algorithm tree selection problem as the MAB problem, actively select more promising trees in tree expansion, and effectively allocate resources to the most promising trees; S3: Design a Bayesian update process that is gradually improved through observations; S4: Perform local sampling, exploit the local connectivity of the space through Markov chain random sampling, and update the random sampling order through Bayesian suggestion distribution; S5: Perform collision detection. If the new node falls within the safe feasible region, add the new node to the random tree and continue node sampling. Otherwise, remove the node and resample. S6: Perform path extraction to obtain the final path.

2. A welding robot path planning method based on rapidly expanding random forest according to claim 1, characterized in that: In step S1, obtaining the manipulator motion function by the DH parameter method includes: A1: Define the coordinate system. The DH parameter method is used to describe the relative motion relationship between the joints of the manipulator, so that the relative position and posture of each joint with the previous joint can be described by a simple forward and inverse transformation matrix. The DH parameter method simplifies the kinematic modeling of the manipulator by defining the relationship between each two adjacent coordinate systems. The relationship between each two adjacent coordinate systems is determined by four parameters, among which θ i is the joint angle, i.e. around Z i The angle of axis rotation; d i is the connecting rod offset, i.e. along Z i Axis translation; a i is the connecting rod length, i.e. i The translation of the axis; α i is the connecting rod torsion angle, i.e. i The rotation angle of the axis; A2: Solve the forward kinematics of the manipulator; Through the DH parameter method, the transformation matrix of each joint is calculated step by step, and finally the transformation matrix from the base coordinate system to the end effector is obtained; A3: Solve the inverse kinematics of the manipulator; Since the inverse kinematics of the six-degree-of-freedom welding robot is nonlinear, the numerical method of the Newton-Raphson method is used to obtain the inverse kinematics solution of the welding robot, and the target position of the end effector is approached by continuously adjusting the joint angles.

3. A welding robot path planning method based on rapidly expanding random forest according to claim 2, characterized in that: The step A2 specifically includes: B1: Define the DH parameter table for each joint, define the coordinate system for each joint through the DH parameter table, and record the rotation angle θ of the joint i , offset d i , connecting rod length a i , torsion angle α i ; B2: Construct the transformation matrix of each joint and calculate the relative transformation matrix T for each pair of adjacent joints i and i+1 according to the DH parameters. i i+1 : Among them, θ i is the joint angle, d i is the connecting rod offset, a i is the connecting rod length, α i is the connecting rod torsion angle; B3: Calculate the total transformation matrix of the end effector: By multiplying the transformation matrix of each joint, the total transformation matrix from the base coordinate system to the end effector is obtained Where n is the total number of joints of the welding robot. B4: Extract the position and posture of the end effector by calculating Extract the position and attitude of the end effector; the last column of the transformation matrix gives the position (x, y, z) of the end effector, while the first 3x3 part of the matrix gives the rotation matrix of the end effector, which is used to describe the attitude of the end effector; in, is a 3x3 rotation matrix describing the posture of the end effector; is a 3x1 displacement vector describing the position of the end effector.

4. A welding robot path planning method based on rapidly expanding random forest according to claim 2, characterized in that: The step A3 specifically includes: C1: Define the objective function, which describes the difference between the current position of the end effector and the target position, expressed as a position error vector: f(θ)=P(θ)-P target (4) Among them, P(θ) is the actual position of the end effector calculated from the current joint angle, P target is the given target position; for the attitude part, the target is the error of the rotation matrix, and the final objective function f(θ) contains the position and attitude errors; Among them, R(θ) is the rotation matrix of the end effector, R target is the target rotation matrix; C2: Calculate the Jacobian matrix. The Jacobian matrix J(θ) describes the linear relationship between the change in joint angle and the change in end effector position. C3: Iteratively update the joint angles using the Newton-Raphson method, updating the solution estimate using the current solution value. The update formula is: Among them, θ old is the current joint angle guess, J(θ old ) -1 is the inverse of the Jacobian matrix, f(θ old ) is the current error vector; C4: Determine the termination condition, set the error threshold, and stop the iteration when the error of the end effector position ||f(θ)|| is less than the preset threshold; ||f(θ)||<ò (8) Where ∈ is the error tolerance.

5. The welding robot path planning method based on rapidly expanding random forest according to claim 1, characterized in that: In step S2, the RRF* algorithm tree selection problem is formalized as a MAB problem. UCB is used to solve the tree selection problem by balancing the exploration of unknown arms and the use of known arms to optimize the decision. A balance is found between exploring new options and selecting the best currently known option. Finally, each option is scored to select the output with the highest score. After each output, user feedback is observed and the parameters of the candidate arms are updated. Each scoring method is: in, is the average reward of the i-th choice, reflecting the benefit effect of i. The latter is the upper bound of the confidence interval, reflecting the uncertainty of the i-th choice. T is the total number of choices, n i The number of times the i-th option is selected; Set the MAB problem to explore the starting point x ini and the target point x goal The growing tree has a high expansion rate; when space is limited, the RRF* algorithm creates intermediate random trees to interconnect them; Among them, the tree T i The average reward, C is the exploration coefficient, t is the total number of expansions of all trees, n i is a random tree T i The number of times selected, α is the distance weight coefficient, d i is a random tree T i The distance to the target point or starting point, β environmental factor weight coefficient, used to adjust the impact of environmental complexity on the UCB value, S i is a random tree T i The "Complexity Score" of the current location.

6. The welding robot path planning method based on rapidly expanding random forest according to claim 1, characterized in that: In step S3, the Bayesian update is gradually improved by the observation results, and the local sampling process is modeled as a Markov process; the state θ of the local planner t The proposal distribution Q of the local sampler changes over time and depends on its previous state t (x|x t-1 ,X i ) will be adjusted according to the Bayesian update after each sampling. The specific update method is: Among them, x t-1 For the direction of the last successful expansion, X i is the set of all currently known directions, α i is the normalization constant; During the update, a kernel function is used to weight the previous failure directions. The kernel function k(x,x′) uses the factor β to control the influence of the historical failure direction on the current sampling distribution. The specific form of the kernel function is Among them, λ is the length scale that controls the dependence on the previous direction, and β is the scaling factor used to adjust the influence weight of the previous failed direction.

7. A welding robot path planning method based on rapidly expanding random forest according to claim 6, characterized in that: The Bayesian update in step S3 includes a periodic update mechanism. The specific update method is: Among them, σ is the scaling factor, which controls the speed of attenuation; p is the period, which controls the repeatability of sampling and the influence of periodic updates.

8. A welding robot path planning method based on rapidly expanding random forest according to claim 7, characterized in that: In step S4, the RRF* algorithm performs random walks through Bayesian sampling and Markov chain Monte Carlo. By Bayesian updating, combining historical sampling data and current environmental information, the RRF* algorithm constructs a sampling distribution that adapts to the restricted area, thereby predicting effective sampling points. The local sampling state is Among them, k is the kernel function that integrates the failure information of x', λ i is the normalization factor, and δ is the previous successful direction.

9. A welding robot path planning method based on rapidly expanding random forest according to claim 8, characterized in that: The specific process of collision detection in step S5 is as follows: D1: Discrete the random tree edge into multiple points and calculate the cumulative collision probability of the discrete points; the collision probability estimation function is: Among them, n1 is the number of points selected on the edge, M(p i ) is point p i The collision probability of Where n2 is the number of obstacles, m j (p i ) is any obstacle pair p i the impact of; Where d is the distance from the obstacle to point p i The Euclidean distance of Among them, k CPA is the actual collision probability of the edge, k p is the collision coefficient; D2: Design a probability collision threshold and compare the accumulated value of the discrete point collision probability with it.

10. A welding robot path planning method based on rapidly expanding random forest according to claim 9, characterized in that: The process of path extraction in step S6 includes: E1: Checks whether a path segment is valid. Uses a collision function to detect collisions between two nodes. It takes as input the coordinates of the start and destination nodes and returns a Boolean value indicating whether the path segment is valid. If there is no collision, the segment is used directly for connection. It uses Euclidean distance calculation to connect the two nodes (x1, y1) and (x2, y2). The midpoint of the path is obtained by linear interpolation. (x,y)=(x1+t(x2-x1),y1+t(y2-y1))(19) Among them, t∈[0,1], t is discretely valued by setting the step size, generating points on the path segment and detecting collisions; E2: Determine whether the starting tree can be directly connected to the target tree; The path connection function detects whether the starting point and the end point can form a better path without passing through other random trees; if so, the path from the end point to the starting point is extracted to form the final path; E3: If the starting point and the end point cannot be directly connected, a random tree path is added to connect the segments. First, connect the target tree and the nearest random tree to form a partial path. Then, add other random trees and check whether there is any collision during the connection process. Finally, connect to the starting tree to form the last partial path. Select the nearest intermediate random tree node, calculate the distance between the target tree and each intermediate tree node, select the nearest node x nearest Path connection is to gradually build a path by segment connection. If there is no collision on the path, it will be added to the path sequence. Assume that from x goal Connect to x nearest , then connect to other intermediate trees, and finally connect to the starting tree, and calculate the connection through the following segment-by-segment path distance formula; E4: path reversal; To ensure the path sequence from the starting node x ini To the target node x goal After the path is constructed, the reverse operation is performed to return the final path, which is completed by the following formula: path=[x n ,x n-1 ,...,x1] (23)。