Robot motion trajectory optimization method and device, computer device and storage medium

By iteratively smoothing the teaching points of the industrial robot and optimizing the spline path, the fluctuation problem caused by teaching error was solved, and the stability of robot operation and workpiece processing quality were improved.

CN116061180BActive Publication Date: 2026-04-14SHANGHAI FLEXIV ROBOTICS TECH CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI FLEXIV ROBOTICS TECH CO LTD
Filing Date
2023-02-06
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

During the teaching process of industrial robots, errors in the teaching point position cause large fluctuations in the spline path, affecting the robot's running speed and the surface treatment quality of the workpiece.

Method used

By discretizing the initial spline path, an energy cost function and a bias function are constructed. Based on the objective function, iterative smoothing is performed to optimize the sampling point sequence to reduce jitter and distance differences, thereby generating a smooth spline path.

Benefits of technology

The optimized spline path reduces fluctuations during robot operation, improves running speed and stability, and enhances the surface treatment quality of the workpiece.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116061180B_ABST
    Figure CN116061180B_ABST
Patent Text Reader

Abstract

The application relates to a robot motion trajectory optimization method and device, computer equipment and a storage medium. The method comprises the following steps: creating an initial spline path according to determined waypoints; discretely sampling the initial spline path to obtain a sampling point sequence, which is used as a current sampling point sequence; performing iterative smoothing processing on the current sampling point sequence based on the jitter degree of the current sampling point sequence and the distance difference between the current sampling point sequence and the waypoints on the initial spline path; and taking the iterative smoothing processing result as a new current sampling point sequence. The method can make the fluctuation of the optimized position spline path and attitude spline path smaller, improve the speed and stability of the robot during operation, and optimize the position spline path and attitude spline path, so that the angular velocity of the robot during operation can be improved and the angular acceleration jitter can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of industrial robot teaching point optimization technology, and in particular to a robot motion trajectory optimization method, device, computer equipment and storage medium. Background Technology

[0002] In industrial robot applications, spline paths can be used for free-form surface grinding, polishing, and machining. Given a workpiece to be processed, the user needs to teach a series of waypoints on the workpiece surface along the trajectory path, including the location waypoints (P0, P1, ..., P...). N ) and the corresponding attitude waypoints (Q0, Q1, ..., Q N The robot controller then generates a smooth trajectory that passes through the points taught by the user in sequence.

[0003] In practical applications, to improve the fit between the grinding tool at the end effector of an industrial robot and the curved surface of the workpiece, it is usually necessary to teach a large number of densely packed points. To better describe the spline path, the distance between the teaching points is typically 2–5 mm. During the teaching process, the user needs to manually control the robot's grinding tool to approach the object surface until it is in contact with it. The teach pendant then records the coordinates of the grinding tool's center at this point.

[0004] like Figure 1 As shown, because users judge whether the tool's center point is in contact with the surface by visual inspection, there will be some error during the contact process. That is, the actual contact point may have deviated from the actual tool center position, and the recorded tool center position will be off-center from the object's surface. Furthermore, the robot's kinematic calibration error will also affect the accuracy of the recorded tool center coordinates. These two errors result in the recorded tool center coordinates of the actual grinding tool being as follows: Figure 2 As shown, the actual spline path formed is as follows: Figure 2 As shown by the dashed line, the teaching error causes significant fluctuations in the spline path. During actual execution, the robot's acceleration fluctuates frequently, reducing the robot's running speed and stability, and consequently affecting the quality of workpiece surface grinding, polishing, or processing. Summary of the Invention

[0005] Therefore, it is necessary to provide a robot motion trajectory optimization method, device, computer equipment, and storage medium that can optimize the point quality on the spline path so that the final sample path meets the smoothness requirement, thereby improving the robot's running stability and the workpiece surface treatment quality.

[0006] On the one hand, this application provides a method for optimizing robot motion trajectories, the method comprising:

[0007] Create an initial spline path based on the identified waypoints;

[0008] Discretize the initial spline path to obtain a sequence of sampling points, which is then used as the current sequence of sampling points.

[0009] Based on the jitter level of the current sampling point sequence and the distance difference between the current sampling point sequence and the waypoints on the initial spline path, the current sampling point sequence is iteratively smoothed, and the result of the iterative smoothing is used as the new current sampling point sequence.

[0010] In one embodiment, based on the jitter level of the current sampling point sequence and the distance difference between the current sampling point sequence and waypoints on the initial spline path, an iterative smoothing process is performed on the current sampling point sequence, including:

[0011] Based on the jitter level of the current sampling point sequence, an energy cost function is constructed;

[0012] Based on the distance difference between the current sampling point sequence and the waypoints on the initial spline path, a deviation function is constructed;

[0013] Based on the energy cost function, the deviation function, and the given function weights, a target function is obtained. The function weights reflect the respective participation of jitter and distance difference in constructing the target function. The target function characterizes the smoothing process as minimizing the weighted sum of the energy cost function and the deviation function under the influence of the function weights.

[0014] The current sampling point sequence is iteratively smoothed based on the objective function to obtain the final iteratively smoothed sampling point sequence.

[0015] In one embodiment, the energy cost function includes path parameters; based on the jitter level of the current sampling point sequence, the energy cost function is constructed, including:

[0016] Based on the second derivative of each sampling point in the current sampling point sequence with respect to the path parameters, determine the angular acceleration vector of each sampling point in the current sampling point sequence;

[0017] The sum of the squares of the magnitudes of the angular acceleration vectors at all sampling points in the current sampling point sequence is used as the energy cost function.

[0018] In one embodiment, a bias function is constructed based on the distance difference between the current sampling point sequence and the waypoints on the initial spline path, including:

[0019] The sum of the squares of the distance deviations between each sampling point in the current sampling point sequence and the waypoints at the corresponding positions of the initial spline path is used as the deviation function.

[0020] In one embodiment, iterative smoothing of the current sample point sequence based on an objective function includes:

[0021] Determine the gradient of the initial spline path at each sampling point in the current sampling point sequence;

[0022] The corresponding sampling points are smoothed according to the gradient of each sampling point, and the smoothing result is used as the current sampling point sequence. The cumulative number of smoothing operations is also updated.

[0023] If the cumulative number of smoothing operations has not reached the preset number of iterations, return to the step of determining the gradient of the initial spline path at each sampling point in the current sampling point sequence and continue execution until the cumulative number of smoothing operations reaches the preset number of iterations.

[0024] In one embodiment, the method further includes: receiving an adjustment instruction to adjust a given function weight and a preset number of iterations; adjusting the given function weight and the preset number of iterations according to the adjustment instruction; returning a step of iteratively smoothing the current sampling point sequence based on the jitter level of the current sampling point sequence and the distance difference between the current sampling point sequence and the waypoints on the initial spline path; and continuing to execute to obtain the final iteratively smoothed sampling point sequence.

[0025] In one embodiment, if the current sampling point sequence is the sampling point sequence at the current position, then the energy cost function is:

[0026]

[0027] The deviation function is:

[0028] The objective function is: minF(P) * )=D(P * )+αE(P * );

[0029] Where E(P) represents the energy cost function; C″ i (u j D(P) is the angular acceleration vector of the i-th sampling point; * ) represents the deviation function; P i This is the i-th sampling point on the initial spline path; F(P) represents the i-th location path point in the current sampling point sequence. * ) represents the objective function; α is the given function weight; k represents the number of sampling points.

[0030] In one embodiment, the method further includes: displaying an initial spline path and a spline path recreated based on the current sampling point sequence.

[0031] On the other hand, this application also provides a robot motion trajectory optimization device. The device includes:

[0032] The spline creation module is used to create an initial spline path based on the determined waypoints;

[0033] The sampling module is used to discretize the initial spline path to obtain a sequence of sampling points, which is then used as the current sequence of sampling points.

[0034] The iterative smoothing module is used to perform iterative smoothing on the current sampling point sequence based on the jitter level of the current sampling point sequence and the distance difference between the current sampling point sequence and the waypoints on the initial spline path, and use the iterative smoothing result as the new current sampling point sequence.

[0035] On the other hand, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the above-described robot motion trajectory optimization method.

[0036] On the other hand, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the above-described robot motion trajectory optimization method.

[0037] On the other hand, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the above-described robot motion trajectory optimization method.

[0038] The aforementioned robot motion trajectory optimization method, device, computer equipment, and storage medium, based on the jitter level of the current sampling point sequence and the distance difference between the current sampling point sequence and the waypoints on the initial spline path, perform iterative smoothing processing on the current sampling point sequence, so that the optimized position spline path and attitude spline path have smaller fluctuations, improving the speed and stability of the robot during operation; at the same time, optimizing the position spline path and attitude spline path can increase the angular velocity of the robot during operation and reduce angular acceleration jitter. Attached Figure Description

[0039] Figure 1 This is a schematic diagram of the spline path and teaching points of an industrial robot in one embodiment;

[0040] Figure 2 This is a schematic diagram illustrating the impact of teaching errors on spline paths in one embodiment;

[0041] Figure 3 A diagram illustrating the application environment of robot motion trajectory optimization methods;

[0042] Figure 4 This is a flowchart illustrating a robot motion trajectory optimization method in one embodiment;

[0043] Figure 5 This is a flowchart illustrating the process of constructing the objective function in one embodiment;

[0044] Figure 6 This is a flowchart illustrating the iterative smoothing process of the current sampling point sequence based on an objective function in another embodiment.

[0045] Figure 7 This is a schematic diagram of the initial spline path before iterative smoothing in one embodiment;

[0046] Figure 8 This is a schematic diagram of the initial spline path after iterative smoothing in one embodiment;

[0047] Figure 9 This is a schematic diagram of the initial spline path of the pose before iterative smoothing processing in one embodiment;

[0048] Figure 10 This is a schematic diagram of the initial spline path of the attitude after iterative smoothing in one embodiment;

[0049] Figure 11 This is a structural block diagram of a robot motion trajectory optimization device in one embodiment;

[0050] Figure 12 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0051] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0052] The robot motion trajectory optimization method provided in this application embodiment can be applied to, for example... Figure 3 The application environment shown is illustrated. Terminal 102 is connected to server 104 for communication. Terminal 102 and server 104 can be connected directly or indirectly via wired or wireless communication, which is not limited herein. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or located in the cloud or on other servers.

[0053] Terminal 102 creates an initial spline path based on the determined waypoints; it discretizes the initial spline path to obtain a sequence of sampling points, which is then used as the current sampling point sequence; based on the jitter of the current sampling point sequence and the distance difference between the current sampling point sequence and the waypoints on the initial spline path, it performs iterative smoothing on the current sampling point sequence, and uses the result of the iterative smoothing as the new current sampling point sequence.

[0054] The terminal 102 may be, but is not limited to, one or more of various desktop computers, laptops, smartphones, tablets, IoT devices, or portable wearable devices. IoT devices may be one or more of smart TVs or smart in-vehicle devices. Portable wearable devices may be one or more of smartwatches, smart bracelets, or head-mounted devices.

[0055] Among them, server 104 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0056] In some embodiments, such as Figure 4 As shown, a method for optimizing robot motion trajectories is provided. This method can be applied to a terminal or executed collaboratively by a terminal and a server. The following explanation uses the application of this method to a computer device as an example; the computer device can be a terminal or a server. The method includes the following steps:

[0057] Step 402: Create an initial spline path based on the determined waypoints.

[0058] The determined waypoints include position waypoints and / or attitude waypoints, and the initial spline paths include initial position spline paths and / or initial attitude spline paths. If the determined waypoints include both position and attitude waypoints, an initial position spline path is created based on the position waypoints, and an initial attitude spline path is created based on the attitude waypoints. If the determined waypoints include only position waypoints, an initial position spline path is created based on the position waypoints. If the determined waypoints include only attitude waypoints, an initial attitude spline path is created based on the attitude waypoints.

[0059] In this embodiment, a segmented C2 continuous cubic Bézier curve is established to fit the determined position waypoint or the determined attitude waypoint. Here, C2 continuity refers to the continuity of the second derivative of the initial spline path; a cubic Bézier curve is defined in a plane or three-dimensional space using four control points.

[0060] In some embodiments, taking the initial spline path of the location as an example, using These represent the four control points of the k-th cubic Bézier curve. Location path point P. i It can be described using three-dimensional coordinates. The expression for the k-th cubic Bézier curve is:

[0061]

[0062] Among them B i,3 (u) is a cubic Bernstein polynomial:

[0063]

[0064] Among them, C k (u) represents the k-th cubic Bézier curve; u is the probability; i represents the i-th control point. The control points are solved using the following system of linear equations:

[0065]

[0066] The control points are (S0, S1, ..., S). N ), where (S0,S1,…,S N () represents multiple control points on the k-th cubic Bézier curve. When N is 4, 4 control points can be obtained. The control points at the beginning and end of the k-th Bézier curve are configured as follows:

[0067]

[0068]

[0069] The intermediate control point is configured as follows:

[0070]

[0071]

[0072] In this embodiment, a cubic Bézier curve is defined in a plane or three-dimensional space based on the configured four control points.

[0073] In some embodiments, taking the initial spline path of the attitude as an example, based on the attitude path points (O0, O1, ..., O...), N Construct a cubic Bézier curve. Attitude path point O. i Described by quaternions: O i =(O i,w O i,x O i,y O i,z ), O i,x O i,y and O i,zO represents a vector (i.e., the axis of rotation). i,w The rotation angle is represented by the normalized Bézier curve expression for the k-th segment:

[0074]

[0075] in, Let represent the four control points of the k-th cubic Bézier curve. Solve for the control points using the following system of linear equations:

[0076]

[0077] The control points are (S0, S1, ..., S). N ), where (S0,S1,…,S N () represents multiple control points on the k-th cubic Bézier curve. When N is 4, 4 control points can be obtained. The control points at the beginning and end of the k-th Bézier curve are configured as follows:

[0078]

[0079]

[0080] The intermediate control point is configured as follows:

[0081]

[0082]

[0083] And normalize it:

[0084]

[0085]

[0086] In this embodiment, a cubic Bézier curve is defined in a plane or three-dimensional space based on the configured four control points.

[0087] Optionally, the user manually controls the end effector of the robot tool to contact the workpiece surface along a series of midpoints on the teach pendant. The computer records the position and orientation of the end effector at each contact point, and the waypoints are denoted as (P0, P1, ..., P...). N The attitude waypoints are denoted as (O0, O1, ..., O). NThe computer equipment establishes a segmented C2 continuous cubic Bézier curve based on the actual measured and determined position waypoints to obtain the initial position spline path, and then approximates the initial position spline path to the determined position waypoints through 4 control points on the cubic Bézier curves; the computer equipment establishes a segmented C2 continuous cubic Bézier curve based on the actual measured and determined attitude waypoints to obtain the initial attitude spline path, and then approximates the initial attitude spline path to the determined attitude waypoints through 4 control points on the cubic Bézier curves.

[0088] Step 404: Discretize the initial spline path to obtain a sequence of sampling points, which is then used as the current sequence of sampling points.

[0089] The sampling point sequence includes a position sampling point sequence and / or an attitude sampling point sequence. If M position waypoints are uniformly sampled according to the path parameters on the initial position spline path, and these M waypoints are arranged in the sampling order, a position sampling point sequence is obtained and used as the current position sampling point sequence. Similarly, if M attitude waypoints are uniformly sampled according to the path parameters on the initial attitude spline path, and these M attitude waypoints are arranged in the sampling order, an attitude sampling point sequence is obtained and used as the current attitude sampling point sequence. In this embodiment, the path parameters are the parameters placed in the spline path.

[0090] Step 406: Based on the jitter level of the current sampling point sequence and the distance difference between the current sampling point sequence and the waypoints on the initial spline path, perform iterative smoothing on the current sampling point sequence, and use the result of the iterative smoothing as the new current sampling point sequence.

[0091] The jitter of the current sampling point sequence can be characterized by the energy cost function; the distance difference between the current sampling point sequence and the waypoints on the initial spline path can be characterized by the deviation function.

[0092] The iterative smoothing process for the current sampling point sequence specifically refers to: first, calculating the gradient of each sampling point in the current sampling point sequence; then, based on the coordinates of the current sampling point and the gradient of the current sampling point, determining the coordinates of the current sampling point for the next iterative smoothing process, thus completing one iterative smoothing process.

[0093] It is important to note that the iterative smoothing result of the current position sampling point is the updated coordinates of the current position sampling point sequence; the iterative smoothing result of the current position sampling point is the updated quaternion of the current attitude sampling point sequence. This embodiment performs iterative smoothing on the current position sampling point and the current attitude sampling point respectively, thereby improving the angular velocity of the robot during operation and reducing angular acceleration jitter.

[0094] If the current sampling point sequence is the current position sampling point sequence, then iterative smoothing is performed on the current position sampling point sequence based on the jitter level of the current position sampling point sequence and the distance difference between the current position sampling point sequence and the position waypoints on the initial position spline path. If the current sampling point sequence is the current attitude sampling point sequence, then iterative smoothing is performed on the current attitude sampling point sequence based on the jitter level of the current attitude sampling point sequence and the distance difference between the current attitude sampling point sequence and the attitude waypoints on the initial attitude spline path.

[0095] Optionally, the computer device calculates the gradient of each sampling point in the current sampling point sequence, determines the coordinates of the current sampling point in the next iteration of smoothing based on the coordinates of the current sampling point and the gradient of the current sampling point, and completes one iteration of smoothing process; the smoothing result is used as the current sampling point sequence, multiple iterations of smoothing process are performed, and the spline path is recreated based on the current sampling point sequence.

[0096] In the above-mentioned robot motion trajectory optimization method, based on the jitter level of the current sampling point sequence and the distance difference between the current sampling point sequence and the waypoints on the initial spline path, the current sampling point sequence is iteratively smoothed to make the optimized position spline path and attitude spline path fluctuate less, thereby improving the speed and stability of the robot during operation; at the same time, optimizing the position spline path and attitude spline path can increase the angular velocity of the robot during operation and reduce angular acceleration jitter.

[0097] In some embodiments, such as Figure 5 As shown, based on the jitter level of the current sampling point sequence and the distance difference between the current sampling point sequence and the waypoints on the initial spline path, the current sampling point sequence is iteratively smoothed, specifically including the following steps:

[0098] Step 502: Construct an energy cost function based on the jitter level of the current sampling point sequence.

[0099] The energy cost function includes path parameters.

[0100] Optionally, the computer device determines the angular acceleration vector of each sampling point in the sampling point sequence based on the second derivative of each sampling point with respect to the path parameters; and uses the sum of the squares of the magnitudes of the angular acceleration vectors at all sampling points in the sampling point sequence as the energy cost function.

[0101] Step 504: Construct a deviation function based on the distance difference between the current sampling point sequence and the waypoints on the initial spline path.

[0102] Optionally, the computer device uses the sum of squares of the distance deviations between each sampling point in the sampling point sequence and the waypoints at the corresponding positions of the initial spline path as the deviation function.

[0103] Step 506: Based on the energy cost function, the deviation function, and the given function weights, obtain the objective function, where the function weights are used to reflect the degree of participation of jitter and distance difference in constructing the objective function; where the objective function is used to characterize the goal of smoothing as minimizing the weighted sum of the energy cost function and the deviation function under the influence of the function weights.

[0104] The function weights can reflect the proportion of jitter and distance differences in the construction of the objective function. The objective function is an optimization goal set to simultaneously balance "reducing jitter" and "reducing the distance between the optimized point and the initial point." It is used to constrain the optimization of the initial spline path, aiming to make the optimized spline path fluctuate less and improve the speed and stability of the robot during operation.

[0105] Alternatively, the computer device may use the product of the energy cost function and the function weights, and the minimum sum of the deviation function, as the objective function.

[0106] Step 508: Perform iterative smoothing on the current sampling point sequence based on the objective function to obtain the final iteratively smoothed sampling point sequence.

[0107] Optionally, the computer device performs iterative smoothing on the current sampling point sequence with the optimization objective of balancing "reducing the degree of jitter" and "reducing the distance between the optimized point and the initial point" to obtain the final iteratively smoothed sampling point sequence.

[0108] In some embodiments, taking the current sampling point sequence as an example, the sum of the squares of the magnitudes of the angular acceleration vectors at all sampling points in the sampling point sequence is used as the energy cost function, and the constructed energy cost function is:

[0109]

[0110] Where E(P) represents the energy cost function corresponding to the location spline path; C″ i (u j ) represents the angular acceleration vector of the i-th sampling point; k represents the number of sampling points.

[0111] The constructed deviation function is: Wherein, D(P) * ) represents the deviation function; P i This is the i-th sampling point on the initial spline path; is the i-th location path point in the current sampling point sequence; k represents the number of sampling points.

[0112] The established objective function is: minF(P) *)=D(P * )+αE(P * ); where F(P) * The ') represents the objective function; α is the pre-input function weight parameter. The initial default value of the function weight parameter α is generally 0.5.

[0113] In some embodiments, taking the current sampling point sequence as the current attitude sampling point sequence as an example, the sum of the squares of the magnitudes of the angular acceleration vectors at all sampling points in the sampling point sequence is used as the energy cost function, and the constructed energy cost function is:

[0114]

[0115] Where E(O) represents the energy cost function corresponding to the attitude spline path; α i,j Let be the angular acceleration vector of the i-th attitude sampling point. conj[·] is the quaternion conjugate operator.

[0116] The constructed deviation function is: Among them, D(O) * ) represents the deviation function; O i This refers to the i-th attitude sampling point on the initial spline path; Let be the i-th attitude sampling point on the initial spline path; k represents the number of sampling points.

[0117] The established objective function is: minG(O * )=D(O * )+βE(O * ), where β is a pre-input function weight parameter. The initial default value of β in the smoothing parameter is generally 0.5.

[0118] In the above embodiments, the sum of the squares of the magnitudes of the angular acceleration vectors at all sampling points in the sampling point sequence is used as the minimization objective, so that the optimized path fluctuations are smaller, the deviation between the smoothed position waypoints or attitude waypoints and the initially determined waypoints is reduced, and the speed and stability of the robot during operation are improved.

[0119] In one embodiment, such as Figure 6 As shown, based on the objective function, the current sampling point sequence is iteratively smoothed, specifically including the following steps:

[0120] Step 602: Determine the gradient of the initial spline path at each sampling point in the current sampling point sequence.

[0121] In this embodiment, the gradient descent method is used to update the gradient of each sampling point.

[0122] Step 604: Smooth the corresponding sampling points according to the gradient of each sampling point, use the smoothing result as the current sampling point sequence, and update the cumulative number of smoothing operations.

[0123] Specifically, the process of smoothing the corresponding sampling point based on the gradient of each sampling point is as follows: based on the coordinates of the current sampling point and the gradient of the current sampling point, the coordinates of the current sampling point are determined for the next iteration of smoothing, thus completing one iteration of smoothing.

[0124] In some embodiments, taking the current sampling point sequence as an example, the current position sampling point sequence is used, and the smoothing parameters are determined in advance, namely the function weight α and the preset number of iterations N. p Updated using gradient descent for:

[0125]

[0126] in, The objective function is F(P) * )exist The gradient at point λ1 is the step size parameter, which can usually be taken as 1e. -3 ~1e -6 P n+1 As the coordinates of the current sampling point in the next iteration of smoothing, that is, P n+1 Substitute back the energy cost function E(P) and the deviation function D(P) * Recalculate and redefine the objective function in N iterations. p The location path point smoothing process is then completed.

[0127] In some embodiments, taking the current sampling point sequence as an example, the current pose sampling point sequence is used, and the smoothing parameters are determined in advance, namely the function weight β and the preset number of iterations N. o Updated using gradient descent for:

[0128]

[0129] in, For G(O) * In O * The gradient at the i-th waypoint. for:

[0130]

[0131] exp(.) is the quaternion exponentiation operator; λ2 is the step size parameter, which is usually taken as 1e. -3 ~1e -6 On+1 As the coordinates of the current sampling point in the next iteration of smoothing, that is, O n+1 Substitute back the energy cost function E(O) and the deviation function D(O) * Recalculate and redefine the objective function in N iterations. o The attitude path point smoothing process is then completed.

[0132] Step 606: If the cumulative number of smoothing processes has not reached the preset number of iterations, return to the step of determining the gradient of the recreated spline path at each sampling point in the current sampling point sequence and continue execution until the cumulative number of smoothing processes reaches the preset number of iterations.

[0133] In some embodiments, the robot trajectory optimization method further includes: a computer device displaying an initial spline path and a spline path recreated based on the current sequence of sampling points.

[0134] like Figure 7 As shown, this is the initial spline path before iterative smoothing; Figure 8 The image shows the position spline path after iterative smoothing; compare... Figure 7 and Figure 8 It can be seen that the smoothness of the position spline path is significantly improved after iterative smoothing, allowing users to... Figure 8 The smoothing effect shown determines whether the function weight α and the preset number of iterations N need to be adjusted. p .

[0135] like Figure 9 As shown, this is the initial spline path of the pose before iterative smoothing; Figure 10 The image shows the attitude spline path after iterative smoothing; in comparison... Figure 9 and Figure 10 It can be seen that the smoothness of the attitude spline path is significantly improved after iterative smoothing. Users can then... Figure 10 The smoothing effect shown determines whether the function weight β and the preset number of iterations N need to be adjusted. o .

[0136] In some embodiments, if the smoothing effect of the current sampling point sequence does not meet the requirements after iterative smoothing, the computer device receives an adjustment instruction to adjust the given function weights and the preset number of iterations. The computer device adjusts the given function weights and the preset number of iterations according to the adjustment instruction, and returns the step of iteratively smoothing the current sampling point sequence based on the jitter of the current sampling point sequence and the distance difference between the current sampling point sequence and the waypoints on the initial spline path. The computer device continues to execute the steps to obtain the sampling point sequence after the final iterative smoothing.

[0137] It should be noted that: smoothness requirements can be represented by the smoothness of spline paths, adjustment instructions can be set manually or generated by another terminal, and the adjustment strategies for function weights and preset iteration counts can be set according to actual needs, which will not be elaborated here.

[0138] The optimization method described above can not only be used for smoothing position path points in Euclidean space, but also utilizes quaternion logarithms and exponential operations to smooth attitude path points, thereby improving the angular velocity of the robot during operation and reducing angular acceleration jitter. In addition, when the position spline path and / or attitude spline path do not meet the smoothing requirements, adjusting the function weights and preset iteration counts can control the deviation between the smoothed position or attitude path points and the initially determined path points, thus balancing the deviation and smoothness between the smoothed position or attitude path points and the initially determined path points.

[0139] In a specific example, a robot motion trajectory optimization method includes the following steps:

[0140] Step 1: Create an initial spline path based on the determined waypoints.

[0141] Step 2: Discretize the initial spline path to obtain a sequence of sampling points, which is then used as the current sequence of sampling points.

[0142] Step 3: Based on the second derivative of each sampling point in the current sampling point sequence with respect to the path parameters, determine the angular acceleration vector of each sampling point in the current sampling point sequence;

[0143] Step 4: Use the sum of the squares of the magnitudes of the angular acceleration vectors at all sampling points in the current sampling point sequence as the energy cost function.

[0144] Step 5: Take the sum of the squares of the distance deviations between each sampling point in the current sampling point sequence and the waypoints at the corresponding positions of the initial spline path as the deviation function.

[0145] Step 6: Based on the energy cost function, the deviation function, and the given function weights, obtain the objective function, where the function weights reflect the degree of participation of jitter and distance difference in constructing the objective function; where the objective function characterizes the goal of the smoothing process as minimizing the weighted sum of the energy cost function and the deviation function under the influence of the function weights.

[0146] Step 7: Determine the gradient of the initial spline path at each sampling point in the current sampling point sequence;

[0147] Step 8: Smooth the corresponding sampling points according to the gradient of each sampling point, use the smoothing result as the current sampling point sequence, and update the cumulative number of smoothing operations.

[0148] Step 9: If the cumulative number of smoothing processes has not reached the preset number of iterations, return to the step of determining the gradient of the initial spline path at each sampling point in the current sampling point sequence and continue to execute until the cumulative number of smoothing processes reaches the preset number of iterations, and obtain the sampling point sequence after the final iterative smoothing process.

[0149] Step 10: If the spline path corresponding to the sampling point sequence after the final iterative smoothing does not meet the smoothing requirements, then receive the adjustment instruction to adjust the given function weight and the preset number of iterations. Adjust the given function weight and the preset number of iterations according to the adjustment instruction, return to step 3, and continue to execute to obtain the sampling point sequence after the final iterative smoothing.

[0150] In the above embodiments, the quality of position and posture teaching points can be optimized simultaneously, resulting in a smoother final pose path, thereby improving the stability of robot operation and thus enhancing the surface treatment quality of the workpiece.

[0151] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0152] Based on the same inventive concept, this application also provides a robot motion trajectory optimization device for implementing the robot motion trajectory optimization method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more robot motion trajectory optimization device embodiments provided below can be found in the limitations of the robot motion trajectory optimization method described above, and will not be repeated here.

[0153] In some embodiments, such as Figure 11 As shown, a robot motion trajectory optimization device is provided, including: a spline creation module 100, a sampling module 200, and an iterative smoothing processing module 300, wherein:

[0154] The spline creation module 100 is used to create an initial spline path based on the determined waypoints.

[0155] The sampling module 200 is used to discretize the initial spline path to obtain a sequence of sampling points, which is then used as the current sequence of sampling points.

[0156] The iterative smoothing module 300 is used to perform iterative smoothing on the current sampling point sequence based on the jitter level of the current sampling point sequence and the distance difference between the current sampling point sequence and the waypoints on the initial spline path, and use the iterative smoothing result as the new current sampling point sequence.

[0157] In some embodiments, the iterative smoothing module 300 is further configured to: construct an energy cost function based on the jitter level of the current sampling point sequence;

[0158] Based on the distance difference between the current sampling point sequence and the waypoints on the initial spline path, a deviation function is constructed;

[0159] Based on the energy cost function, the deviation function, and the given function weights, a target function is obtained. The function weights reflect the respective participation of jitter and distance difference in constructing the target function. The target function characterizes the smoothing process as minimizing the weighted sum of the energy cost function and the deviation function under the influence of the function weights.

[0160] The current sampling point sequence is iteratively smoothed based on the objective function to obtain the final iteratively smoothed sampling point sequence.

[0161] In some embodiments, the iterative smoothing module 300 is further configured to: determine the angular acceleration vector of each sampling point in the current sampling point sequence based on the second derivative of each sampling point in the current sampling point sequence with respect to the path parameters;

[0162] The sum of the squares of the magnitudes of the angular acceleration vectors at all sampling points in the current sampling point sequence is used as the energy cost function.

[0163] In some embodiments, the iterative smoothing module 300 is further configured to: use the sum of squares of the distance deviations between each sampling point in the current sampling point sequence and the waypoints at the corresponding positions of the initial spline path as the deviation function.

[0164] In some embodiments, the iterative smoothing module 300 is further configured to: determine the gradient of the initial spline path at each sampling point in the current sampling point sequence;

[0165] The corresponding sampling points are smoothed according to the gradient of each sampling point, and the smoothing result is used as the current sampling point sequence. The cumulative number of smoothing operations is also updated.

[0166] If the cumulative number of smoothing operations has not reached the preset number of iterations, return to the step of determining the gradient of the initial spline path at each sampling point in the current sampling point sequence and continue execution until the cumulative number of smoothing operations reaches the preset number of iterations.

[0167] In some embodiments, the iterative smoothing module 300 is further configured to: receive an adjustment instruction to adjust a given function weight and a preset number of iterations, adjust the given function weight and the preset number of iterations according to the adjustment instruction, and return a step of iteratively smoothing the current sampling point sequence based on the jitter level of the current sampling point sequence and the distance difference between the current sampling point sequence and the waypoints on the initial spline path, and continue to execute to obtain the final iteratively smoothed sampling point sequence.

[0168] In some embodiments, if the current sampling point sequence is the sampling point sequence at the current location, then the energy cost function is:

[0169]

[0170] The deviation function is:

[0171] The objective function is: minF(P) * )=D(P * )+αE(P * );

[0172] Where E(P) represents the energy cost function; C″ i (u j D(P) is the angular acceleration vector of the i-th sampling point; * ) represents the deviation function; P i This is the i-th sampling point on the initial spline path; F(P) represents the i-th location path point in the current sampling point sequence. * ) represents the objective function; α is the given function weight; k represents the number of sampling points.

[0173] In some embodiments, the apparatus further includes a display module 400, which displays the initial spline path and the spline path recreated based on the current sampling point sequence.

[0174] Each module in the aforementioned robot motion trajectory optimization device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0175] In some embodiments, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 12 As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a method for optimizing robot motion trajectories. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0176] Those skilled in the art will understand that Figure 12 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0177] In some embodiments, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0178] In some embodiments, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0179] In some embodiments, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0180] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0181] (If the plan involves push advertising, add a description stating that users can refuse the pushed ads or can easily reject push advertising information, etc.)

[0182] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0183] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0184] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for optimizing robot motion trajectory, characterized in that, The method includes: Based on the determined location waypoints and / or attitude waypoints, an initial spline path is created; wherein, creating the initial spline path includes: establishing a segmented C2 continuous Bézier curve; when the waypoints include attitude waypoints, the attitude waypoints are described by quaternions, a normalized Bézier curve is constructed, and the control points are normalized. The initial spline path is discretized to obtain a sequence of sampling points, which is then used as the current sequence of sampling points. Based on the jitter level of the current sampling point sequence and the distance difference between the current sampling point sequence and the waypoints on the initial spline path, the current sampling point sequence is iteratively smoothed, and the result of the iterative smoothing is used as the new current sampling point sequence. Specifically, based on the jitter level of the current sampling point sequence, an energy cost function is constructed, including: the energy cost function includes path parameters; based on the second derivative of each sampling point in the current sampling point sequence with respect to the path parameters, the angular acceleration vector of each sampling point in the current sampling point sequence is determined; and the sum of the squares of the magnitudes of the angular acceleration vectors at all sampling points in the current sampling point sequence is used as the energy cost function. Specifically, based on the distance difference between the current sampling point sequence and the waypoints on the initial spline path, a deviation function is constructed, including: using the sum of the squares of the distance deviations between each sampling point in the current sampling point sequence and the waypoints at the corresponding positions on the initial spline path as the deviation function; The iterative smoothing process is performed using an objective function constructed based on the energy cost function and the deviation function, and employs the gradient descent method. When performing iterative smoothing on the sequence of location sampling points, the update formula is: ; in, For the objective function exist gradient at, This is the step size parameter; When performing iterative smoothing on the attitude sampling point sequence, the attitude sampling points are described by quaternions, and the update formula is: ; Where exp(.) is the quaternion exponentiation operator. , This is the step size parameter.

2. The method according to claim 1, characterized in that, The iterative smoothing process for the current sampling point sequence based on the jitter level of the current sampling point sequence and the distance difference between the current sampling point sequence and the waypoints on the initial spline path includes: Based on the jitter level of the current sampling point sequence, an energy cost function is constructed; Based on the distance difference between the current sampling point sequence and the waypoints on the initial spline path, a deviation function is constructed; Based on the energy cost function, the deviation function, and the given function weights, a target function is obtained, wherein the function weights reflect the respective participation of the jitter level and the distance difference in constructing the target function; and the target function characterizes the smoothing process as minimizing the weighted sum of the energy cost function and the deviation function under the influence of the function weights; and Based on the objective function, the current sampling point sequence is iteratively smoothed to obtain the final iteratively smoothed sampling point sequence.

3. The method according to claim 2, characterized in that, The iterative smoothing process of the current sampling point sequence based on the objective function includes: Determine the gradient of the initial spline path at each sampling point in the current sampling point sequence; The corresponding sampling points are smoothed according to the gradient of each sampling point, and the smoothing result is used as the current sampling point sequence. The cumulative number of smoothing operations is also updated. If the cumulative number of smoothing processes has not reached the preset number of iterations, then return to the step of determining the gradient of the initial spline path at each sampling point in the current sampling point sequence and continue execution until the cumulative number of smoothing processes reaches the preset number of iterations.

4. The method according to claim 3, characterized in that, The method further includes: receiving an adjustment instruction to adjust the given function weights and the preset number of iterations; adjusting the given function weights and the preset number of iterations according to the adjustment instruction; returning the step of iteratively smoothing the current sampling point sequence based on the jitter level of the current sampling point sequence and the distance difference between the current sampling point sequence and the waypoints on the initial spline path; and continuing to execute to obtain the final iteratively smoothed sampling point sequence.

5. The method according to claim 2, characterized in that, If the current sampling point sequence is the sampling point sequence at the current position, then the energy cost function is: ; The deviation function is: ; The objective function is: ; in, Let be the angular acceleration vector of the i-th sampling point; Represents the deviation function; This is the i-th sampling point on the initial spline path; This refers to the i-th location path point in the current sampling point sequence; Represent the objective function; For the given function weights; Indicates the number of sampling points.

6. The method according to claim 1, characterized in that, The method further includes: displaying the initial spline path and the spline path recreated based on the current sampling point sequence.

7. A robot motion trajectory optimization device, characterized in that, The device includes: The spline creation module is used to create an initial spline path based on the determined location waypoints and / or attitude waypoints; wherein, creating the initial spline path includes: establishing a segmented C2 continuous Bézier curve; when the waypoints include attitude waypoints, the attitude waypoints are described by quaternions, constructing a normalized Bézier curve, and normalizing the control points. The sampling module is used to discretize the initial spline path to obtain a sequence of sampling points, which is then used as the current sequence of sampling points. An iterative smoothing module is used to perform iterative smoothing on the current sampling point sequence based on the jitter level of the current sampling point sequence and the distance difference between the current sampling point sequence and waypoints on the initial spline path, and use the iterative smoothing result as a new current sampling point sequence; wherein, based on the jitter level of the current sampling point sequence, an energy cost function is constructed, including: the energy cost function includes path parameters, and based on the second derivative of each sampling point in the current sampling point sequence with respect to the path parameters, the angular acceleration vector of each sampling point in the current sampling point sequence is determined; the sum of the squares of the magnitudes of the angular acceleration vectors at all sampling points in the current sampling point sequence is used as the energy cost function; Specifically, based on the distance difference between the current sampling point sequence and the waypoints on the initial spline path, a deviation function is constructed, including: using the sum of the squares of the distance deviations between each sampling point in the current sampling point sequence and the waypoints at the corresponding positions on the initial spline path as the deviation function; The iterative smoothing process is performed using an objective function constructed based on the energy cost function and the deviation function, and employs the gradient descent method. When performing iterative smoothing on the sequence of location sampling points, the update formula is: ; in, For the objective function exist gradient at, This is the step size parameter; When performing iterative smoothing on the attitude sampling point sequence, the attitude sampling points are described by quaternions, and the update formula is: ; Where exp(.) is the quaternion exponentiation operator. , This is the step size parameter.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Robot driving method and apparatus

    CN107678405A

  • Vehicle trajectory planning method and system, electronic equipment and computer readable storage medium

    CN112631304A

  • Path planning method and device, storage medium and electronic equipment

    CN113759887A