Robot spline interpolation node selection method based on single-step energy loss
By calculating the energy loss and curvature information of single-steps, adjusting the step length, the problem of uncertain number of interpolated node points is solved, efficient interpolation node selection is achieved, and the efficiency of robot motion planning and teaching programs is improved.
Patent Information
- Application Number
- CN202510242052.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-03-03
AI Technical Summary
In the prior art, the interpolation node selection method cannot reflect the local bending of the curve, and the number of interpolation node points cannot be determined in advance, and continuous trial and error is required to achieve the accuracy requirements.
By calculating the single-step energy loss, adjusting the step length using curvature information, determining the position and number of interpolation nodes, and using the robot spline interpolation node selection method based on the single-step energy loss, the distribution of interpolation nodes is determined one by one.
Quickly determine the minimum node position and number required for the interpolation trajectory, improve the fitting accuracy of the interpolation curve, and is suitable for robot motion planning and teaching program generation.
Smart Images

Figure CN120363175A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of robots, and particularly to a method for selecting interpolation nodes of a robot spline based on single-step energy loss. Background Art
[0002] The essence of a robot's generated motion is obtained by performing motion interpolation on multiple taught points, and these taught points are interpolation nodes in the interpolation algorithm. For a straight line, MOVL is used to interpolate between two points to generate a straight-line motion; for a circular arc, MOVC is used to perform motion interpolation on three points to generate a circular-arc motion. For MOVS, the situation is more complex. The number and distribution of interpolation nodes depend on the accuracy requirements, but the more specific method for selecting interpolation nodes has always been very vague. Common methods for selecting interpolation nodes include equidistant node method, Chebyshev nodes, Gauss-Legendre nodes, etc. However, these methods usually do not highlight the specific characteristics of the curve when selecting interpolation nodes. For curves of the same length, only by changing the number of interpolation nodes can the error between the interpolation curve and the original curve be controlled. This method has two drawbacks: it cannot reflect the local bending situation of the specific curve; the required number of interpolation nodes cannot be known in advance and needs to be continuously tried and error-prone to obtain the appropriate number of interpolation nodes. Summary of the Invention
[0003] In order to overcome the above-mentioned drawbacks and deficiencies of the prior art, the purpose of the present invention is to provide a method for selecting interpolation nodes of a robot spline based on single-step energy loss.
[0004] The purpose of the present invention is achieved by the following technical solutions:
[0005] A method for selecting interpolation nodes of a robot spline based on single-step energy loss, comprising:
[0006] Input the trajectory to be tracked by the robot end effector;
[0007] Discretize the trajectory to be tracked to obtain ordered discrete points, and record the position information and curvature information corresponding to the discrete points;
[0008] Set the starting and ending points of the trajectory to be tracked as the first interpolation node s0 and the last interpolation node s n , and add an interpolation node s1 and s n at the positions of the discrete points that are Δ apart from s0 and s n-1 , and in the interval between s1 and s n-1 , by adjusting the step size to make the single-step energy value equal to the set energy value, the position where the set energy value is located is used as an interpolation node, and all interpolation nodes in the interval are obtained.
[0009] Further, the calculation formula for the single-step energy value is:
[0010]
[0011] Among them, R and curv are respectively the radius of curvature and the curvature of the curve, k, c, and b are all constants, step and i are parameters of the given trajectory, i is the i-th discrete point, step is the step size, and the curve length between the i-th discrete point and the (i + step)-th discrete point is step.
[0012] Furthermore, the k, c, and b are constants obtained by fitting the distribution law of the standard circle interpolation nodes.
[0013] Furthermore, calculate the curvature of the discrete points on the curve, specifically:
[0014]
[0015] In the formula, r(t) refers to the given trajectory, r′(t) and r″(t) are respectively the first derivative and the second derivative of the trajectory, and ‖‖ represents the modulus of the vector.
[0016] Furthermore, within the interval of s1 and s n-1 make the single-step energy value equal to the set energy value by adjusting the step size, and the position where the set energy value is located is used as an interpolation node, specifically:
[0017] First, assume that the curvature of the curve remains constant, and calculate the step size based on the curvature at the current position as an estimated value of the actual step size;
[0018] Adjust the size of the estimated value so that the single-step energy value calculated by the integral within the step size is equal to the set energy value, and the position at this time is used as an interpolation node.
[0019] Furthermore, the relationship between the step size and the curvature is:
[0020]
[0021] Furthermore, when s n-2 and s n-1 the single-step energy value between them is less than the set energy value, then there is no need to set an interpolation node.
[0022] An electronic device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the method for selecting interpolation nodes of the robotic spline.
[0023] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0024] 1. The present invention can quickly determine the positions and quantities of the minimum number of nodes required to track a trajectory using spline interpolation, which is used to assist in the generation of motion planning methods and robot teaching programs based on hierarchical search trees.
[0025] 2. The present invention gives the relationship between the maximum energy per step and the error. The value of the maximum energy per step can be adjusted according to the tracking accuracy requirements of the curve in the process. Specifically, the relationship between these three parameters b, c, and k and the set error upper limit err is obtained by fitting a standard circle. Before fitting, the error upper limit err is determined, and then, under different curvatures, while ensuring that the maximum error does not exceed err, the corresponding changes in the node growth step length are controlled, and the b, c, and k parameters of the expression are fitted. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 is a flowchart of the present invention;
[0027] Figure 2 is a method for processing the natural boundary of spline interpolation according to the present invention;
[0028] Figure 3 is a schematic diagram of the principle for selecting the next interpolation node according to the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0029] The following will further elaborate on the present invention in detail in conjunction with embodiments, but the implementation manners of the present invention are not limited thereto.
[0030] The present invention provides a method for selecting interpolation nodes for spline interpolation of a robot with single-step energy loss. By setting a fixed energy value, starting from the first interpolation node, the energy consumed during "walking" is cumulatively calculated along the curve. When the consumed energy reaches the fixed energy value limit, it stops, and the current position is used as a new interpolation node. Subsequently, it continues to start from this point, and the above steps are continuously repeated until the last interpolation node is reached, and finally, the selection of the interpolation nodes for the entire curve is completed.
[0031] The degree of curve bending is an important factor that mainly affects the distribution of interpolation nodes in spline interpolation. Generally speaking, on the premise of ensuring a certain curve length and that the maximum error between the interpolated curve and the original curve does not exceed a fixed value, the more curved the curve, the denser the distribution of interpolation nodes; conversely, the straighter the curve, the sparser the distribution of interpolation nodes. When the curve completely degenerates into a straight line, only the two ends are needed as interpolation nodes to complete the interpolation that meets the requirements. The present invention uses the curvature change to describe the degree of curve bending. The curvature conforms to the relevance and distribution conditions of interpolation nodes. The greater the curvature, the denser the node distribution. Also, because the curvature distribution of a curve is often not constant, in order to make the change in curvature distribution have a guiding effect on the distribution of interpolation nodes, the present invention does not calculate the node distribution as a whole like methods such as equidistant nodes and Lagrange nodes, but determines the distribution of interpolation nodes one by one in the way of variable single-step length. For a free curve with variable curvature, an integral expression is constructed, which can calculate the energy consumed during the process of starting from any point and reaching the next point after traveling an arbitrary length. The present invention determines that a fixed maximum energy value is set for this process. When the consumed energy reaches this maximum energy value, it means that the single-step length of this section of the curve reaches the maximum value.
[0032] As Figure 1 shown, the specific technical solution includes the following steps:
[0033] S1. For welding, the welding torch is required to move along the weld seam. Therefore, the trajectory contour of the weld seam can be directly picked up from the joint line of the workpiece model;
[0034] S2. The weld seams of various shapes picked up are discretized at a certain resolution to obtain a series of uniform discrete points, and the position coordinates of the discrete points, as well as the first derivative and second derivative of the curve at the corresponding positions, etc. are recorded;
[0035] S3. Calculate the curvature of the discrete points on the curve according to the first derivative and the second derivative;
[0036]
[0037] In the formula, r(t) refers to the given trajectory, r′(t) and r″(t) are the first derivative and the second derivative of the trajectory respectively, and ‖‖ represents the modulus of the vector.
[0038] S4. According to the welding requirements, determine the starting point of the welding section as the first interpolation node s0, and the target point as the last interpolation node s n ;
[0039] S5. Since the MOVS instructions of the main robot manufacturers perform interpolation with natural boundaries as boundary conditions, the interpolation nodes at both ends can only provide position constraints for the interpolation curve. Affected by the boundaries, the step size calculated from the curvature cannot control the errors in the first and last interpolation intervals. Therefore, at the discrete point positions Δ away from the endpoints s0 and s n add an interpolation node s1 and s n-1 respectively, where Δ is a relatively small value. During the spline interpolation process, these two points approximately replace the nodes at both ends to provide constraints on the first and second derivatives for the spline interpolation of the entire curve.
[0040] As Figure 2 illustrated, it is not enough to only rely on the curvature to select interpolation nodes to complete the spline interpolation of natural boundaries. By adding an additional interpolation node Δ away from the endpoints on both sides respectively, the spline interpolation of natural boundaries can be approximately transformed into the spline interpolation of clamped boundaries, and the curve fitting accuracy of the interpolation is higher.
[0041] As Figure 3 shown, S6. In the interval starting from s1 and ending at s n-1 , adjust the step size so that the energy value per step is approximately equal to the maximum energy value, and calculate the intermediate interpolation nodes one by one.
[0042] In this embodiment, in step S2, the curve is discretized, and the position information, first derivative, and second derivative of the discrete points are obtained.
[0043] In this embodiment, the specific steps for calculating the current step size and forward selecting interpolation nodes in step S6 are as follows:
[0044] S61. First, assume that the curvature of the curve remains constant, and calculate the step size based on the curvature at the current position as an estimated value of the actual step size. When the curvature of the curve remains constant, the relationship between the step size and the curvature is:
[0045]
[0046] where the constants ENERGY, b, c, and k are all related to the maximum error between the interpolation curve and the original curve, and are parameters obtained by fitting from the statistical data of spline interpolation experiments with a circle as the reference. In this example, take ENERGY = 11.3134; b = 11.3134; c = 67.7262; k = 0.0152.
[0047] These constants were obtained by fitting during the spline interpolation experiment with equally spaced nodes on a standard circle. A circle was used because its curvature is constant. Therefore, even when interpolating nodes according to the curvature, the nodes are equally spaced. By limiting the maximum error to err0 and then using the circle to try different equal-spacing step sizes, the variation law between the step size and the curvature was fitted. In this example, err0 = 15 was used.
[0048] The given circular trajectory was used to obtain the variation relationship between the curvature and the node step size within the limited maximum error range and fit a formula. Then this formula was applied to other given free curves with more randomly varying curvatures.
[0049] The reason for using a circle is that the curvature of a circle is constant and the distribution of its interpolation nodes is known to be equally spaced, which is more convenient for studying the curvature and the node step size without additional interference.
[0050] The radius of the circle is controlled by the curvature. Since fitting requires uniform data to fit the relationship between the curvature and the step size, the radius of the circle was set to increase with the curvature at the same interval.
[0051] S62. Adjust the size of the step based on the estimated step size. When the single-step energy value calculated by the integral within the step is finally equal to the limited energy value, that is the current true step size:
[0052]
[0053] energy == ENERGY.
[0054] This embodiment also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the method for selecting robot spline interpolation nodes described above.
[0055] The present invention can quickly determine the positions and quantities of the fewest nodes required to use spline interpolation to track a trajectory, which is used to assist in the generation of motion planning methods and robot teaching programs based on hierarchical search trees. The present invention gives the relationship between the maximum energy per step and the error, and the value of the maximum energy per step can be adjusted according to the process requirements for the tracking accuracy of the curve.
[0056] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited by the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications made without departing from the spirit and principle of the present invention shall be equivalent replacement methods and are all included in the protection scope of the present invention.
Claims
1. A method for selecting nodes of robotic spline interpolation based on single-step energy loss, characterized in that, Including: The trajectory to be tracked by the end effector of the robot; Discretize the trajectory to be tracked to obtain ordered discrete points, and record the position information and curvature information corresponding to the discrete points; Set the starting endpoint and the ending endpoint of the trajectory to be tracked as the first interpolation node s0 and the last interpolation node s, respectively. n , at the discrete point positions that are Δ away from s0 and s n , add an interpolation node s1 and s respectively. n-1 , within the interval of s1 and s n-1 , by adjusting the step size to make the single-step energy value equal to the set energy value, the position where the set energy value is located is used as an interpolation node, and all interpolation nodes within the interval are obtained.
2. The method for selecting robot spline interpolation nodes according to claim 1, characterized in that The calculation formula for the single-step energy value is: Wherein, R and curv are respectively the curvature radius and curvature of the curve, k, c, and b are all constants, step and i are parameters of the given trajectory, i is the i-th discrete point, step is the step size, and the curve length between the i-th discrete point and the (i + step)-th discrete point is step.
3. The method for selecting robot spline interpolation nodes according to claim 2, characterized in that, The k, c, and b are constants obtained by fitting the distribution law of the standard circular interpolation nodes.
4. The method for selecting robot spline interpolation nodes according to claim 1, wherein Calculate the curvature of the discrete points in the curve, specifically: In the formula, r(t) refers to the given trajectory, r′(t) and r″(t) are respectively the first derivative and the second derivative of the trajectory, and ‖‖ represents the modulus of the vector.
5. The method for selecting robot spline interpolation nodes according to any one of claims 1-4, characterized in that Within the interval of s1 and s n-1 , by adjusting the step size, the single-step energy value is made equal to the set energy value, and the position of the set energy value is used as an interpolation node. Specifically: First, assume that the curvature of the curve is constant, and calculate the step size as an estimated value of the actual step size according to the curvature at the current position; Adjust the size of the estimated value so that the single-step energy value calculated by the integral within the step size is equal to the set energy value, and the position at this time is used as an interpolation node.
6. The method for selecting robot spline interpolation nodes according to claim 5, wherein The relationship between the step size and the curvature is: Wherein, ENERGY, b, c, and k are constants.
7. The method for selecting robot spline interpolation nodes according to claim 1, characterized in that When s n-2 and s n-1 the single-step energy value between them is less than the set energy value, there is no need to set interpolation nodes.
8. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method for selecting robot spline interpolation nodes according to any one of claims 1-7.
Citation Information
Patent Citations
Error-controllable four-axis industrial robot B-spline transition type smooth trajectory generating method
CN109664303A
Robot trajectory planning method, device and system for realizing C2 continuity
CN113103240A
Positioner path planning method for realizing automatic arrangement of workpieces based on hierarchical search tree
CN113618276A
Path planning method and device for smooth regression of given trajectory of mobile robot
CN114115299A
A Trajectory Planning Method For Six Degree-of-Freedom Robots Taking Into Account of End Effector Motion Error
US20190184560A1
Cited By
Method, device and equipment for automatically planning operation path of agricultural machine
CN121274999A