A design method for the spatial movement trajectory of a manipulator
Through the trajectory design method combining global and local optimization, the problems of inflexible and unreliable robot movement in the existing technology are solved, and high-precision and stable robot movement is achieved.
Patent Information
- Application Number
- CN202510596106.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-09
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-05-09
AI Technical Summary
Existing trajectory design schemes rely on offline calculations and cannot respond to changes in the environment or mechanical state in a timely manner, resulting in the robot's movement being inflexible and unreliable, and easily causing mechanical damage.
By collecting multimodal data to generate preliminary trajectories, global and local optimization is performed. The particle swarm optimization method and generalized unit mapping method are combined to optimize the path length, acceleration smoothness and joint angle. A visual interface and database are used for detection and storage.
It improves the smoothness and accuracy of the manipulator's movement, avoids mechanical damage, and increases the flexibility and reliability of trajectory planning, making it suitable for high-precision tasks.
Smart Images

Figure CN120269565B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of trajectory planning, in particular to a method for designing a space moving trajectory of a manipulator. Background Art
[0002] With the development of automation technology, robotic arms have been widely used in various industrial, medical and scientific research fields. Especially when performing precision tasks, how to accurately plan and control the spatial movement trajectory of the robotic arm has become an important technical challenge. In recent years, with the continuous advancement of robotics technology, especially the improvement of sensor technology and computing power, trajectory planning methods have continued to emerge, aiming to improve the accuracy and efficiency of the robotic arm in performing tasks.
[0003] However, most existing trajectory design schemes rely on offline calculations, making it impossible to respond to changes in the environment or mechanical state during execution in a timely manner, thereby limiting their flexibility and reliability in practical applications. In addition, due to insufficient consideration of the details of changes in posture angles and joint angles, the movement of the manipulator is easily not smooth, which may cause mechanical damage. Summary of the Invention
[0004] In view of the above existing problems, the present invention is proposed.
[0005] Therefore, the present invention provides a method for designing the spatial movement trajectory of a manipulator, which solves the problem that most existing trajectory design schemes rely on offline calculations, making it impossible to respond to changes in the environment or mechanical state during execution in a timely manner, thereby limiting their flexibility and reliability in practical applications. In addition, due to insufficient consideration of the details of the changes in posture angles and joint angles, the movement of the manipulator is easily not smooth, which may cause mechanical damage.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0007] In a first aspect, the present invention provides a method for designing a spatial movement trajectory of a manipulator, which comprises:
[0008] After collecting multimodal data, a preliminary trajectory is generated, and global optimization is performed based on the preliminary trajectory to obtain a global optimized trajectory;
[0009] Perform further local optimization operations based on the global optimization trajectory to obtain the final trajectory;
[0010] Perform detection based on the final trajectory and display it through a visual interface;
[0011] The detection results are stored in the database and then further encrypted.
[0012] As a preferred solution of the method for designing the spatial movement trajectory of the manipulator of the present invention, the generating of the preliminary trajectory after collecting multimodal data includes:
[0013] The IMU sensor collects the manipulator's speed, acceleration, and attitude angle data, and records the manipulator's starting position and target position;
[0014] The starting position and the target position are used as the fixed endpoints of the Bezier curve, and the normal distribution method is used to randomly generate z expected velocities and expected accelerations;
[0015] Use z randomly generated desired velocities and accelerations as boundary conditions;
[0016] The positions of control points P1 and P2 are calculated after calculating the velocity change of each control point based on the z expected velocities;
[0017] All velocity and acceleration data are discretized using the time step, and n discrete time point data are generated, and the velocity and acceleration values corresponding to each discrete time point are calculated;
[0018] Based on the velocity and acceleration values corresponding to each discrete time point, the cubic spline function S is constructed using the cubic spline interpolation method. v (t) and S a (t):
[0019] S v (t) = a0 + a1t + a2t 2 +a3t 3 ,
[0020] S a (t) = b0 + b1t + b2t 2 +b3t 3 ,
[0021] Where S v (t) represents the cubic spline function of velocity, a0 represents the constant term of velocity, a1 represents the coefficient of the linear term of velocity, a2 represents the coefficient of the quadratic term of velocity, a3 represents the coefficient of the cubic term of velocity, t represents the time parameter, S a (t) represents the cubic spline function of acceleration, b0 represents the constant term of acceleration, b1 represents the coefficient of the linear term of acceleration, b2 represents the coefficient of the quadratic term of acceleration, and b3 represents the coefficient of the cubic term of acceleration;
[0022] Set different attitude angle constraint ranges and adjust the control point positions through an iterative method. In each iteration, calculate the attitude angle of the current trajectory at each time point and compare it with the constraint range. If the constraint conditions are not met, adjust the position of the control point until the attitude angle meets the conditions.
[0023] Substitute the control point positions that meet the conditions and the recorded starting and target positions into the Bezier curve formula for calculation to obtain r preliminary trajectories.
[0024] As a preferred solution of the method for designing the spatial movement trajectory of the manipulator of the present invention, wherein: performing global optimization based on the preliminary trajectory to obtain the global optimized trajectory includes:
[0025] Based on r preliminary trajectories, the Euclidean distance is used to calculate the sum of the Euclidean distances between two adjacent points in each preliminary trajectory to obtain the path length:
[0026]
[0027] Where F1 represents the path length, n represents the total number of control points in the preliminary trajectory, i represents the index variable, and A i and A i+1 represents the position coordinates of the i-th and i+1-th control points in the preliminary trajectory, ‖A i -A i+1 ‖ represents the Euclidean distance between two adjacent points in the preliminary trajectory;
[0028] Based on r preliminary trajectories, the acceleration change degree of each preliminary trajectory is calculated to obtain the acceleration smoothness:
[0029]
[0030] Where F2 represents the acceleration smoothness, Δa i represents the acceleration change of the i-th control point in the preliminary trajectory, Δt represents the time interval between adjacent control points, Indicates the absolute value of the rate of change of acceleration;
[0031] Based on the velocity in each preliminary trajectory, calculate the time required for the task and get the completion time:
[0032]
[0033] Where F3 represents the completion time, v i represents the velocity of the i-th control point in the preliminary trajectory;
[0034] Take each preliminary trajectory as a particle, and the position of the control point in each preliminary trajectory as the position of each particle, and initialize the number, position and velocity of the particles;
[0035] By using the weighted sum method to combine path length, acceleration smoothness, and completion time, we obtain the global optimization objective function:
[0036] F4=δ1F1+δ2F2+δ3F3
[0037] Where F4 represents the global optimization objective function, δ1 represents the weight coefficient of path length, δ2 represents the weight coefficient of acceleration smoothness, and δ3 represents the weight coefficient of completion time;
[0038] The position and velocity of the particle are updated according to the current particle position, velocity and the best solution, and the objective function value F4 of each particle is calculated during the iteration process. When the decrease value of the objective function value no longer decreases significantly, the iteration is stopped and the global optimal trajectory is output.
[0039] As a preferred solution of the method for designing the spatial movement trajectory of the manipulator of the present invention, the further local optimization operation based on the global optimization trajectory to obtain the final trajectory includes:
[0040] Based on the global optimal trajectory, the time step is used for discretization to obtain m small trajectory segments;
[0041] The discrete time point t of each segment j Corresponding to each trajectory control point, the trajectory discrete point B(t j );
[0042] Based on m trajectory segments, calculate the discrete time point t in each segment j Acceleration at current position:
[0043]
[0044] Where, a(t j ) represents the discrete time point t j The acceleration at time v(t j ) represents the discrete time point t j The speed at time v(t j+1 ) represents the discrete time point t j+1 The speed at time t is , and Δt represents the time step;
[0045] According to the discrete time point t j The acceleration of the current position is used to further calculate the smoothness of the acceleration change:
[0046]
[0047] Where C1 represents the smoothness of acceleration change, e represents the total number of discrete points of the trajectory, j represents the index variable, and a(t j+1 ) represents the discrete time point t j+1 acceleration when
[0048] Based on the trajectory discrete points, calculate the angle change between adjacent trajectory discrete points:
[0049]
[0050] Where θ j represents the angle change of the jth discrete point trajectory, B(t j ) represents the discrete points of the trajectory, ‖B(t j )‖ represents B(t j )The norm of the vector, cos -1 represents the arccosine function;
[0051] The path smoothness is obtained by accumulating the obtained angle changes:
[0052]
[0053] Where C2 represents the path smoothness;
[0054] Based on the collected velocity, the integration method is used to integrate and obtain the joint angles at the current and previous moments;
[0055] Subtract the current joint angle from the joint angle at the previous moment to obtain the change in joint angle;
[0056] Based on the joint angle change, the joint angle change of each joint between two adjacent discrete points is calculated to obtain the joint angle limit value:
[0057]
[0058] Where C3 represents the joint angle limit value, represents the angle change of the jth discrete point, Indicates the maximum limit of angle change;
[0059] The range of the joint angle limit is:
[0060]
[0061] By combining the smoothness of acceleration change, path smoothness and joint angle limit value, we can get the local optimization objective function:
[0062]
[0063] Where C4 represents the local optimization objective function, The weighting coefficient that represents the smoothness of acceleration change, represents the weighting coefficient of the path smoothness, The weighting coefficient representing the joint angle limit value;
[0064] The generalized unit mapping method is used for iterative optimization. During the iteration process, the local optimization objective function value is calculated. When the descent value of the local optimization objective function no longer decreases significantly, the iteration is stopped and the final trajectory is output.
[0065] As a preferred solution of the method for designing the spatial movement trajectory of the manipulator of the present invention, the detection based on the final trajectory includes:
[0066] Using the sliding window technique, the mean of each time period in the final trajectory is calculated;
[0067] Set the detection threshold to ψ, and compare the mean of each time period with the threshold ψ. When the mean of each time period is greater than the threshold ψ, global and local optimization needs to be re-performed. When the mean of each time period is less than or equal to the threshold ψ, the final trajectory is used as the execution basis.
[0068] As a preferred solution of the method for designing the spatial movement trajectory of the manipulator of the present invention, wherein: the display through a visual interface refers to drawing a trajectory diagram using Matplotlib;
[0069] The trajectory diagram includes a position-time diagram, a velocity-time diagram, and an acceleration-time diagram.
[0070] As a preferred solution of the method for designing the spatial movement trajectory of the manipulator described in the present invention, the storage of the detection results through the database refers to storing the final trajectory used as the execution basis as a two-dimensional array, and making each row represent the trajectory state at a moment, using the Pandas library to store the data in CSV format, and saving all data by column.
[0071] As a preferred solution of the method for designing the spatial movement trajectory of the manipulator described in the present invention, the encryption operation refers to using a strong random number generation algorithm to generate a 256-bit key, and using the generated key to encrypt the trajectory data stored in the Pandas library.
[0072] In a second aspect, the present invention provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, any step of the method for designing the spatial movement trajectory of a manipulator as described in the first aspect of the present invention is implemented.
[0073] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, any step of the method for designing the spatial movement trajectory of a manipulator as described in the first aspect of the present invention is implemented.
[0074] The beneficial effects of the present invention are as follows: the present invention solves the deficiencies of traditional methods in terms of path smoothness, acceleration smoothness, and joint angle limitation by combining global optimization with local optimization of the trajectory. Global optimization, through the particle swarm optimization method, comprehensively considers the weights of path length, acceleration change, and task completion time, and can effectively improve the overall performance of the trajectory. Local optimization, on this basis, further refines the speed and acceleration changes at each time point to avoid mutations and controls the joint angle changes of the manipulator, making the entire movement process smoother and more precise. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0076] Figure 1 Flowchart of the method for designing the spatial movement trajectory of the manipulator in Example 1. DETAILED DESCRIPTION
[0077] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0078] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0079] Secondly, the term "one embodiment" or "embodiment" herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in various places throughout this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive of other embodiments.
[0080] Example 1, with reference to Figure 1 , which is the first embodiment of the present invention, provides a method for designing a manipulator spatial movement trajectory, comprising the following steps:
[0081] S1. After collecting multimodal data, generate a preliminary trajectory, and perform global optimization based on the preliminary trajectory to obtain a global optimized trajectory;
[0082] Specifically, generating a preliminary trajectory after collecting multimodal data includes:
[0083] The IMU sensor collects the manipulator's speed, acceleration, and attitude angle data, and records the manipulator's starting position and target position;
[0084] The starting position and the target position are used as the fixed endpoints of the Bezier curve, and the normal distribution method is used to randomly generate z expected velocities and expected accelerations;
[0085] Use z randomly generated desired velocities and accelerations as boundary conditions;
[0086] The positions of control points P1 and P2 are calculated after calculating the velocity change of each control point based on the z expected velocities;
[0087] All velocity and acceleration data are discretized using the time step, and n discrete time point data are generated, and the velocity and acceleration values corresponding to each discrete time point are calculated;
[0088] Based on the velocity and acceleration values corresponding to each discrete time point, the cubic spline function S is constructed using the cubic spline interpolation method. v (t) and S a (t):
[0089] S v (t) = a0 + a1t + a2t 2 +a3t 3 ,
[0090] S a (t) = b0 + b1t + b2t 2 +b3t 3 ,
[0091] Where S v (t) represents the cubic spline function of velocity, a0 represents the constant term of velocity, a1 represents the coefficient of the linear term of velocity, a2 represents the coefficient of the quadratic term of velocity, a3 represents the coefficient of the cubic term of velocity, t represents the time parameter, S a (t) represents the cubic spline function of acceleration, b0 represents the constant term of acceleration, b1 represents the coefficient of the linear term of acceleration, b2 represents the coefficient of the quadratic term of acceleration, and b3 represents the coefficient of the cubic term of acceleration;
[0092] a and b can be calculated through boundary conditions and interpolation process;
[0093] Different attitude angle constraint ranges are set according to task requirements, and the control point positions are adjusted through an iterative method. During each iteration, the attitude angle of the current trajectory at each time point is calculated and compared with the constraint range. If the constraint conditions are not met, the position of the control point is adjusted until the attitude angle meets the conditions.
[0094] Substitute the control point positions that meet the conditions and the recorded starting and target positions into the Bezier curve formula for calculation to obtain r preliminary trajectories.
[0095] The speed, acceleration and attitude angle data provided by the IMU sensor provide precise dynamic input for trajectory optimization, and the cubic spline interpolation method ensures a smooth transition of the trajectory and avoids drastic changes in acceleration and speed, thereby improving the execution stability and accuracy of the manipulator, making the present invention more suitable for high-precision tasks. Secondly, through the iterative optimization method of attitude angle constraints, execution failures caused by excessive changes in attitude angles are effectively avoided, and the use of Bezier curves makes trajectory planning more flexible, and the control points can be adjusted according to task requirements to generate a smooth and precise path.
[0096] Furthermore, a global optimization is performed based on the preliminary trajectory, and the global optimization trajectory includes:
[0097] Based on r preliminary trajectories, the Euclidean distance is used to calculate the sum of the Euclidean distances between two adjacent points in each preliminary trajectory to obtain the path length:
[0098]
[0099] Where F1 represents the path length, n represents the total number of control points in the preliminary trajectory, i represents the index variable, and A i and A i+1 represents the position coordinates of the i-th and i+1-th control points in the preliminary trajectory, ‖A i -A i+1 ‖ represents the Euclidean distance between two adjacent points in the preliminary trajectory;
[0100] Based on r preliminary trajectories, the acceleration change degree of each preliminary trajectory is calculated to obtain the acceleration smoothness:
[0101]
[0102] Where F2 represents the acceleration smoothness, Δa i represents the acceleration change of the i-th control point in the preliminary trajectory, Δt represents the time interval between adjacent control points, Indicates the absolute value of the rate of change of acceleration;
[0103] Based on the velocity in each preliminary trajectory, calculate the time required for the task and get the completion time:
[0104]
[0105] Where F3 represents the completion time, v i represents the velocity of the i-th control point in the preliminary trajectory;
[0106] Take each preliminary trajectory as a particle, and the position of the control point in each preliminary trajectory as the position of each particle, and initialize the number, position and velocity of the particles;
[0107] By using the weighted sum method to combine path length, acceleration smoothness, and completion time, we obtain the global optimization objective function:
[0108] F4=δ1F1+δ2F2+δ3F3
[0109] Where F4 represents the global optimization objective function, δ1 represents the weight coefficient of path length, δ2 represents the weight coefficient of acceleration smoothness, and δ3 represents the weight coefficient of completion time;
[0110] δ1, δ2, and δ3 can be set through engineering experience and expert knowledge;
[0111] The position and velocity of the particle are updated according to the current particle position, velocity and the best solution, and the objective function value F4 of each particle is calculated during the iteration process. When the decrease value of the objective function value no longer decreases significantly, the iteration is stopped and the global optimal trajectory is output.
[0112] By comprehensively considering the three optimization goals of path length, acceleration smoothness and completion time, the present invention can effectively optimize the motion trajectory of the manipulator. In terms of path length, the Euclidean distance is used to calculate the distance between adjacent control points to ensure that the manipulator reduces unnecessary movement when performing tasks. In the optimization of acceleration smoothness, the execution accuracy and equipment stability are improved by calculating and controlling the acceleration change. The optimization of completion time improves work efficiency by calculating the speed of each control point and minimizing the completion time of the task. In addition, the particle swarm optimization method can globally optimize the path, acceleration smoothness and completion time, and avoid local optimal problems. Secondly, particle swarm optimization The algorithm can effectively handle multi-objective optimization problems and ensure that trajectory planning achieves the best balance between multiple objectives. By fusing the optimization objectives through the weighted sum method, the weights can be flexibly adjusted according to the requirements of different tasks, thereby optimizing the trajectory in a targeted manner and improving the overall performance. Through the iterative optimization process, the present invention can adjust the position and speed of the particles in real time to ensure that the trajectory planning continuously approaches the global optimal solution. Moreover, by setting the stopping criteria, the optimization process can avoid unnecessary calculations while ensuring accuracy, saving time and resources, and making the obtained optimized trajectory not only meet the task requirements, but also meet the various constraints in the operation of the manipulator, ensuring its stable and efficient execution of tasks.
[0113] S2, further local optimization operations are performed based on the global optimization trajectory to obtain the final trajectory;
[0114] Specifically, further local optimization operations are performed based on the global optimization trajectory to obtain the final trajectory including:
[0115] Based on the global optimal trajectory, the time step is used for discretization to obtain m small trajectory segments;
[0116] The discrete time point t of each segment j Corresponding to each trajectory control point, the trajectory discrete point B(t j );
[0117] Based on m trajectory segments, calculate the discrete time point t in each segment j Acceleration at current position:
[0118]
[0119] Where, a(t j ) represents the discrete time point t j The acceleration at time v(t j ) represents the discrete time point t j The speed at time v(t j+1 ) represents the discrete time point t j+1 The speed at time t is , and Δt represents the time step;
[0120] According to the discrete time point t j The acceleration of the current position is used to further calculate the smoothness of the acceleration change:
[0121]
[0122] Where C1 represents the smoothness of acceleration change, e represents the total number of discrete points of the trajectory, j represents the index variable, and a(t j+1 ) represents the discrete time point t j+1 acceleration when
[0123] Based on the trajectory discrete points, calculate the angle change between adjacent trajectory discrete points:
[0124]
[0125] Where θ j represents the angle change of the jth discrete point trajectory, B(t j ) represents the discrete points of the trajectory, ‖B(t j )‖ represents B(t j )The norm of the vector, cos -1 represents the arccosine function;
[0126] The path smoothness is obtained by accumulating the obtained angle changes:
[0127]
[0128] Where C2 represents the path smoothness;
[0129] Based on the collected velocity, the integration method is used to integrate and obtain the joint angles at the current and previous moments;
[0130] Subtract the current joint angle from the joint angle at the previous moment to obtain the change in joint angle;
[0131] Based on the joint angle change, the joint angle change of each joint between two adjacent discrete points is calculated to obtain the joint angle limit value:
[0132]
[0133] Where C3 represents the joint angle limit value, represents the angle change of the jth discrete point, Indicates the maximum limit of angle change;
[0134] The range of joint angle limits is:
[0135]
[0136] By combining the smoothness of acceleration change, path smoothness and joint angle limit value, we can get the local optimization objective function:
[0137]
[0138] Where C4 represents the local optimization objective function, The weighting coefficient that represents the smoothness of acceleration change, represents the weighting coefficient of the path smoothness, The weighting coefficient representing the joint angle limit value;
[0139] Can be set through experimental data;
[0140] The generalized unit mapping method is used for iterative optimization. During the iteration process, the local optimization objective function value is calculated. When the descent value of the local optimization objective function no longer decreases significantly, the iteration is stopped and the final trajectory is output.
[0141] By combining global optimization and local optimization methods, the overall optimality of the trajectory is ensured and fine-tuning of details can be performed. The dual optimization framework of the present invention can comprehensively consider multiple objectives such as path length, acceleration smoothness, path smoothness and joint angle limit to ensure that the trajectory can achieve the optimal effect at each stage. By optimizing acceleration smoothness and path smoothness, the mutations in the trajectory caused by acceleration and deceleration can be effectively reduced, avoiding severe vibration or path discontinuity of the manipulator. The setting of joint angle change limit effectively avoids excessive rotation of the manipulator joints, thereby preventing structural damage to the manipulator or fatigue of the joints. The introduction of the generalized unit mapping method makes the trajectory optimization process more efficient and accurate. Under iterative optimization, the generalized unit mapping method can continuously adjust the position of the control point in each calculation, so that the trajectory can meet various constraints and tend to the optimal solution. This makes the present invention show higher adaptability and performance in practical applications, especially under complex tasks and high-precision requirements.
[0142] S3, detect based on the final trajectory and display it through a visual interface;
[0143] Specifically, detection based on the final trajectory includes:
[0144] Using the sliding window technique, the mean of each time period in the final trajectory is calculated;
[0145] Based on domain knowledge and relevant data, the detection threshold is set to ψ, and the mean of each time period is compared with the threshold ψ. When the mean of each time period is greater than the threshold ψ, global and local optimization needs to be re-performed. When the mean of each time period is less than or equal to the threshold ψ, the final trajectory is used as the execution basis.
[0146] The sliding window technology enables the trajectory to be dynamically monitored and adjusted during execution, timely capturing trajectory deviations and avoiding error accumulation. Moreover, by comparing the mean of each time period with the set threshold, global and local optimization can be triggered when the trajectory deviates from expectations, ensuring the accuracy and stability of the trajectory.
[0147] Furthermore, displaying through a visual interface refers to drawing a trajectory graph using Matplotlib;
[0148] The trajectory diagram includes position-time diagram, velocity-time diagram and acceleration-time diagram.
[0149] The position-time graph can show the optimized position at each moment, the speed-time graph can show the change of the velocity of the trajectory over time, and the acceleration-time graph can show the change of the acceleration of the trajectory over time.
[0150] Visual graphics can intuitively display the optimization progress of the trajectory, helping designers monitor and adjust trajectory parameters in real time to ensure the accuracy and stability of the robot when performing tasks. The visual interface also makes the debugging process easier, allowing designers to quickly identify problems and correct them, significantly improving optimization efficiency.
[0151] S4. The test results are stored in a database and then further encrypted;
[0152] Specifically, storing the detection results in a database means storing the final trajectory used as the execution basis as a two-dimensional array, with each row representing the trajectory status at a moment. The Pandas library is used to store the data in CSV format, and all data is saved by column.
[0153] By storing the robot trajectory data as a two-dimensional array and converting the data into CSV format using the Pandas library, efficient data storage and management are achieved. This invention ensures the persistence, time sequence, and ease of backtracking of trajectory data, facilitating real-time monitoring and adjustment of the trajectory. Furthermore, through standardized storage in CSV format, data can be easily analyzed, optimized, and shared across platforms, enhancing the compatibility and scalability of the system.
[0154] Furthermore, the encryption operation refers to using a strong random number generation algorithm to generate a 256-bit key, and using the generated key to encrypt the trajectory data stored in the Pandas library.
[0155] By combining a strong random number generation algorithm with a 256-bit key and AES encryption technology, the trajectory data stored in the Pandas library is encrypted, ensuring a high degree of data security during storage, transmission, and access. The strong random number generation algorithm ensures the unpredictability of the key, and the 256-bit key provides strong encryption strength, making the data highly resistant to attacks such as brute force cracking. The AES encryption algorithm ensures efficient and secure encryption, while also supporting fast decryption to meet real-time requirements.
[0156] This embodiment also provides a computer device suitable for the design method of the spatial movement trajectory of the manipulator, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute computer-executable instructions to implement the design method of the spatial movement trajectory of the manipulator proposed in the above embodiment.
[0157] The computer device may be a terminal, comprising a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device comprises a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or a button, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse.
[0158] This embodiment also provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for designing the spatial movement trajectory of the manipulator as proposed in the above embodiment; the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk.
[0159] In summary, the present invention solves the shortcomings of traditional methods in terms of path smoothness, acceleration smoothness, and joint angle limitation by combining global optimization with local optimization of the trajectory. Global optimization uses the particle swarm optimization method to comprehensively consider the weights of path length, acceleration change, and task completion time, which can effectively improve the overall performance of the trajectory. Local optimization, on this basis, further refines the speed and acceleration changes at each time point to avoid sudden changes and controls the joint angle changes of the manipulator, making the entire movement process smoother and more precise.
[0160] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A method for designing a spatial movement trajectory of a manipulator, characterized by: include, After collecting multimodal data, a preliminary trajectory is generated, and global optimization is performed based on the preliminary trajectory to obtain a global optimized trajectory; Perform further local optimization operations based on the global optimization trajectory to obtain the final trajectory; Perform detection based on the final trajectory and display it through a visual interface; The test results are stored in a database and then further encrypted; The IMU sensor collects the manipulator's speed, acceleration, and attitude angle data, and records the manipulator's starting position and target position; The starting and target positions are used as fixed endpoints of the Bezier curve and are randomly generated using the normal distribution method. A desired velocity and desired acceleration; Will randomly generate A desired velocity and a desired acceleration are used as boundary conditions; based on Calculate the speed change of each control point based on the expected speed and then calculate the position of the control point; All velocity and acceleration data are discretized using a time step and generated After collecting the data of discrete time points, calculate the speed and acceleration values corresponding to each discrete time point; Based on the velocity and acceleration values corresponding to each discrete time point, a cubic spline function is constructed using the cubic spline interpolation method. and , The cubic spline function representing the velocity, The cubic spline function representing acceleration; Set different attitude angle constraint ranges and adjust the control point positions through an iterative method. In each iteration, calculate the attitude angle of the current trajectory at each time point and compare it with the constraint range. If the constraint conditions are not met, adjust the position of the control point until the attitude angle meets the conditions. Substitute the control point position that meets the conditions and the recorded starting position and target position into the Bezier curve formula for calculation, and we get A preliminary trajectory; based on The Euclidean distance is used to calculate the sum of the Euclidean distances between two adjacent points in each preliminary trajectory to obtain the path length. based on preliminary trajectories, calculate the acceleration change degree of each preliminary trajectory, and obtain the acceleration smoothness; Based on the speed in each preliminary trajectory, the time required for the task is calculated to obtain the completion time; Take each preliminary trajectory as a particle, and the position of the control point in each preliminary trajectory as the position of each particle, and initialize the number, position and velocity of the particles; By using the weighted sum method, the path length, acceleration smoothness and completion time are combined to obtain the global optimization objective function; Update the particle's position and velocity based on the current particle's position, velocity, and the optimal solution, and calculate the objective function value of each particle during the iteration process. ,When the decrease value of the objective function value no longer decreases significantly, the iteration is stopped and the global optimal trajectory is output.
2. The method for designing a spatial movement trajectory of a manipulator according to claim 1, wherein: The further local optimization operation based on the global optimization trajectory to obtain the final trajectory includes: Based on the global optimal trajectory, the time step is used for discretization, and we get A small segment of the trajectory; The discrete time points of each segment Corresponding to each trajectory control point, the trajectory discrete points are obtained ; based on Small segments of the trajectory, calculate the discrete time points in each segment The acceleration of the current position; At discrete time points The acceleration of the current position is used to further calculate the smoothness of the acceleration change; Based on the trajectory discrete points, the angle change between adjacent trajectory discrete points is calculated; The path smoothness is obtained by accumulating the obtained angle changes; Based on the collected velocity, the integration method is used to integrate and obtain the joint angles at the current and previous moments; Subtract the current joint angle from the joint angle at the previous moment to obtain the change in joint angle; Based on the joint angle variation, the joint angle variation of each joint between two adjacent discrete points is calculated to obtain the joint angle limit value; The smoothness of acceleration change, path smoothness and joint angle limit are combined to obtain the local optimization objective function; The generalized unit mapping method is used for iterative optimization. During the iteration process, the local optimization objective function value is calculated. When the descent value of the local optimization objective function no longer decreases significantly, the iteration is stopped and the final trajectory is output.
3. The method for designing a manipulator spatial movement trajectory according to claim 2, wherein: The detection based on the final trajectory includes: Using the sliding window technique, the mean of each time period in the final trajectory is calculated; Set the detection threshold to , the mean of each time period and the threshold For comparison, when the mean of each time period is greater than the threshold When the average value of each time period is less than or equal to the threshold value, global and local optimization needs to be performed again. , the final trajectory will be used as the execution basis.
4. The method for designing a spatial movement trajectory of a manipulator according to claim 3, wherein: The display through the visual interface refers to drawing a trajectory diagram using Matplotlib; The trajectory diagram includes a position-time diagram, a velocity-time diagram, and an acceleration-time diagram.
5. The method for designing a spatial movement trajectory of a manipulator according to claim 4, wherein: Storing the detection results in a database means storing the final trajectory used as the execution basis as a two-dimensional array, making each row represent the trajectory state at a moment, using the Pandas library to store the data in CSV format, and saving all data by column.
6. The method for designing a manipulator spatial movement trajectory according to claim 5, wherein: The encryption operation refers to using a strong random number generation algorithm to generate a 256-bit key, and using the generated key to encrypt the trajectory data stored in the Pandas library.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for designing the spatial movement trajectory of the manipulator according to any one of claims 1 to 6 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for designing the spatial movement trajectory of the manipulator according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Mechanical arm space trajectory optimization method for optimal time under multiple constraint conditions
CN108656117A
Intelligent vehicle global optimal trajectory planning method and system based on dynamic planning
CN116185014A