Trajectory Compensation Method, Device, and Computer-Readable Storage Medium
The trajectory compensation method iteratively aligns the robot's actual motion with the planned path using position and acceleration data, addressing trajectory deviations and enhancing precision without complex models.
Patent Information
- Application Number
- CN202210638114.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-06
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2042-06-06
AI Technical Summary
When the robot moves, due to the flexibility of the reducer, the actual motion trajectory deviates from the pre-planned trajectory, resulting in the inability to adapt to high-precision applications.
By obtaining the planned motion trajectory of the robot as the target motion trajectory, the actual motion trajectory is determined using an acceleration sensor and Kalman filtering process or a laser tracker, the trajectory error is calculated, and the target motion trajectory iterates when the error exceeds the range until the error is within the preset range.
The actual motion trajectory of the robot is approached and planned motion trajectory is achieved, efficient trajectory compensation is strong, and it does not rely on precise mathematical models, has little calculations, and is easy to implement.
Smart Images

Figure CN115213897B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of robot technology, and particularly to a trajectory compensation method, device, and computer-readable storage medium. Background Art
[0002] Since robots can perform semi-autonomous or fully autonomous work, they have been widely used in the industrial field. Currently, when controlling the movement of a robot, the ideal state is that the robot can move along a pre-planned trajectory. However, due to various reasons such as the flexibility of the reducer, the actual movement trajectory of the robot usually deviates from the pre-planned trajectory. For example, the robot shakes during movement, which further causes the robot to be unable to adapt to some high-precision applications. Summary of the Invention
[0003] This application provides a trajectory compensation method, device, and computer-readable storage medium, which can simply and efficiently make the actual movement trajectory of the robot approach the planned movement trajectory.
[0004] In the first aspect of the embodiments of this application, a trajectory compensation method is provided. The method includes: obtaining the planned movement trajectory of the robot; taking the planned movement trajectory as the target movement trajectory; controlling the movement of the robot according to the target movement trajectory; determining the actual movement trajectory of the robot during the movement process; determining the trajectory error of the actual movement trajectory relative to the planned movement trajectory; judging whether the trajectory error is within a preset error range; if the trajectory error is not within the preset error range, then compensating the target movement trajectory according to the trajectory error to obtain a compensated movement trajectory; updating the target movement trajectory with the compensated movement trajectory, and returning to execute the step of controlling the movement of the robot according to the target movement trajectory until the trajectory error is within the preset error range.
[0005] Among them, the step of determining the actual movement trajectory of the robot during the movement process includes: obtaining the axis positions of each joint axis of the robot during the movement process and the end acceleration of the robot; determining the actual movement trajectory of the robot according to the axis positions and the end acceleration.
[0006] Among them, the step of determining the actual movement trajectory of the robot according to the axis positions and the end acceleration includes: taking the axis positions as the observed quantities and the end acceleration as the control quantities, and performing Kalman filtering processing to obtain the actual movement trajectory of the robot.
[0007] Among them, an acceleration sensor is installed at the end of the robot, and the method further includes: obtaining the end acceleration collected by the acceleration sensor during the movement of the robot.
[0008] Among them, the step of determining the actual motion trajectory of the robot during the motion process includes: during the motion of the robot, using a laser tracker to track the end of the robot, so as to obtain the actual motion trajectory of the robot.
[0009] Among them, before returning to execute the step of controlling the motion of the robot according to the target motion trajectory, it further includes: obtaining the historical number of times of executing the step of controlling the motion of the robot according to the target motion trajectory; if the historical number of times does not exceed the number threshold, then return to the step of controlling the motion of the robot according to the target motion trajectory.
[0010] Among them, the step of determining the trajectory error of the actual motion trajectory relative to the planned motion trajectory includes: respectively determining the point error between the interpolation points on the planned motion trajectory and the interpolation points on the actual motion trajectory within each interpolation period; determining the average value of the point errors to obtain the trajectory error of the planned motion trajectory relative to the planned motion trajectory.
[0011] Among them, the step of compensating the target motion trajectory according to the trajectory error includes: compensating the interpolation points corresponding to each interpolation period of the target motion trajectory according to the trajectory error.
[0012] A second aspect of the embodiments of the present application provides a trajectory compensation device, which includes a processor, a memory, and a communication circuit. The processor is respectively coupled to the memory and the communication circuit. Program data is stored in the memory, and the processor realizes the steps in any one of the above methods by executing the program data in the memory.
[0013] A third aspect of the embodiments of the present application provides a computer-readable storage medium, which stores a computer program that can be executed by a processor to realize the steps in the above method.
[0014] The beneficial effect is that the trajectory compensation method of the present application uses an iterative process to compensate the target motion trajectory of the robot, so that the actual motion trajectory of the robot can approximate the ideal motion trajectory (i.e., the planned motion trajectory). Moreover, the entire process does not require relying on an accurate mathematical model, only requires less prior knowledge and computational effort, has strong applicability, and is easy to implement. Description of the Drawings
[0015] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings. Among them:
[0016] Figure 1 is a schematic flowchart of an implementation manner of the trajectory compensation method of the present application;
[0017] Figure 2 is Figure 1 a schematic flowchart of step S104 in an application scenario in;
[0018] Figure 3 is Figure 1 a schematic flowchart of step S104 in another application scenario in;
[0019] Figure 4 is a schematic structural diagram of an implementation manner of the trajectory compensation device of the present application;
[0020] Figure 5 is a schematic structural diagram of an implementation manner of the computer-readable storage medium of the present application. Specific Embodiments
[0021] The following will clearly and completely describe the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, rather than all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.
[0022] Refer to Figure 1 , Figure 1 is a schematic flowchart of an implementation manner of the trajectory compensation method of the present application, and the method includes:
[0023] S101: Obtain the planned motion trajectory of the robot.
[0024] Among them, the planned motion trajectory is the motion trajectory of the robot in an ideal state, and the ultimate goal of the present application is to make the actual motion trajectory of the robot very close to the planned motion trajectory.
[0025] The process of step S101 may specifically include: after the operator confirms the starting teaching point, the ending teaching point, and several intermediate teaching points between the starting teaching point and the ending teaching point, perform speed planning to obtain the planned motion trajectory of the robot.
[0026] S102: Take the planned motion trajectory as the target motion trajectory.
[0027] S103: Control the movement of the robot according to the target movement trajectory.
[0028] Specifically, taking the target movement trajectory as the target, control the robot to move along the target movement trajectory. Due to reasons such as the flexibility of the reducer, there is usually a trajectory error between the actual movement trajectory of the robot and the target movement trajectory, that is to say, there is a deviation between the actual movement trajectory of the robot and the ideal movement trajectory.
[0029] S104: Determine the actual movement trajectory of the robot during the movement process.
[0030] After the movement of the robot ends, determine the trajectory during the actual movement process of the robot.
[0031] In an application scenario, refer to Figure 2 , step S104 includes:
[0032] S1041: Obtain the axis positions of each joint axis of the robot during the movement process and the end acceleration of the robot.
[0033] Among them, the end acceleration of the robot is specifically the acceleration at the end of the robot, for example, the acceleration of the tool center point (TCP point) of the robot.
[0034] Among them, several sampling moments can be determined during the movement process of the robot, and then at each sampling moment, determine the current axis position of each joint axis of the robot and the end acceleration of the robot. At this time, the obtained axis positions and end accelerations are all discrete values. In an application scenario, the determined sampling moments are the same as the subsequent interpolation moments.
[0035] Or, during the movement process of the robot, continuously obtain the axis positions of each joint axis of the robot and continuously obtain the end velocity of the robot. At this time, the obtained axis positions and end accelerations are all continuous values.
[0036] In this embodiment, in order to accurately obtain the end acceleration of the robot, an acceleration sensor is installed at the end of the robot, and the acceleration at the end of the robot is collected through the acceleration sensor.
[0037] S1042: Determine the actual movement trajectory of the robot according to the axis positions and the end acceleration.
[0038] Among them, by performing a fusion process on the obtained axis positions and end accelerations, the actual movement trajectory of the robot can be accurately determined.
[0039] In order to further improve the accuracy of determining the actual motion trajectory, the axis position is used as the observed quantity and the end acceleration is used as the control quantity for Kalman filtering, so as to obtain the actual motion trajectory of the robot.
[0040] Specifically, Kalman filtering is an algorithm that uses the linear system state equation to optimally estimate the system state through the system input and output observation data.
[0041] The process of performing Kalman filtering with the axis position as the observed quantity and the end acceleration as the control quantity can be generally understood as using the end acceleration to correct the trajectory determined according to the axis position, so as to accurately obtain the actual motion trajectory of the robot.
[0042] The process of performing Kalman filtering on the observed quantity and the control quantity belongs to the prior art and will not be elaborated here.
[0043] In another application scenario, as Figure 3 shown, step S104 includes:
[0044] S1043: During the movement of the robot, use a laser tracker to track the end of the robot, so as to obtain the actual motion trajectory of the robot.
[0045] Specifically, the laser tracker can directly measure the three-dimensional coordinates of spatial points. The laser tracker includes a laser tracking head and a reflector. During the movement of the robot, the reflector is installed at the end of the robot, and then the laser beam emitted by the laser tracking head is shot onto the reflector and returns to the laser tracking head. When the end of the robot moves, the laser tracking head adjusts the laser beam to align with the reflector at the end of the robot, and at the same time, the laser beam reflected by the reflector is received by the detection system on the laser tracking head, so as to obtain the spatial position of the end of the robot. In short, step S1043 is to install the reflector in the laser tracker at the end of the robot, and then determine the spatial pose of the end of the robot, so as to obtain the actual motion trajectory of the robot during the movement.
[0046] It can be understood that since the price of the laser tracker is usually higher than that of the acceleration sensor, compared with obtaining the actual motion trajectory of the robot using the laser tracker, determining the actual motion trajectory of the robot according to the axis position and the end acceleration can save equipment costs.
[0047] It should be noted that in other application scenarios, other methods can also be used to determine the actual motion trajectory of the robot. For example, step S104 can also only obtain the axis positions of each joint axis of the robot during the movement, and then use the inverse kinematics to determine the actual motion trajectory of the robot.
[0048] S105: Determine the trajectory error of the actual motion trajectory relative to the planned motion trajectory.
[0049] Specifically, the trajectory error of the actual motion trajectory relative to the planned motion trajectory characterizes the degree of deviation between the actual motion trajectory and the planned motion trajectory.
[0050] Among them, the point error between the interpolation points on the planned motion trajectory and the interpolation points on the actual motion trajectory can be determined respectively for each interpolation period, and then the average value of the point errors can be determined, so as to obtain the trajectory error of the actual motion trajectory relative to the planned motion trajectory.
[0051] Specifically, the entire motion process of the robot can be divided into multiple interpolation periods according to a preset cycle duration. For example, if the preset cycle is 1 millisecond, the points on the planned motion trajectory and the actual motion trajectory at 1 millisecond from the starting point are the interpolation points corresponding to the first interpolation period, denoted as the first interpolation point, and the points at 2 milliseconds from the starting point are the interpolation points corresponding to the second interpolation period, denoted as the second interpolation point, and so on. The interpolation points corresponding to each interpolation period of the planned motion trajectory and the actual motion trajectory can be determined.
[0052] Then, the point error between the first interpolation points on the planned motion trajectory and the actual motion trajectory, the point error between the second interpolation points, and so on are determined respectively. After obtaining the point errors between all interpolation points, the average value of the point errors is obtained to get the trajectory error of the actual motion trajectory relative to the planned motion trajectory.
[0053] Or in other embodiments, it can also be to sum all the point errors to obtain the trajectory error of the actual motion trajectory relative to the planned motion trajectory, or to determine the maximum point error among all the point errors, and then determine the maximum point error as the trajectory error of the actual motion trajectory relative to the planned motion trajectory, or to calculate the mean square deviation value of the point errors and use the mean square deviation value as the trajectory error of the actual motion trajectory relative to the planned motion trajectory.
[0054] S106: Determine whether the trajectory error is within a preset error range.
[0055] If the judgment result is that the trajectory error is not within the preset error range, then step S107 is executed; if the judgment result is that the trajectory error is within the preset error range, then step S109 is executed.
[0056] Specifically, if the trajectory error is within the preset error range, it means that the actual motion trajectory of the robot is already very close to the ideal motion trajectory of the robot, that is, the planned motion trajectory, so there is no need to compensate the trajectory of the robot, and the robot is directly controlled to move according to the latest target motion trajectory.
[0057] However, if the trajectory error is not within the preset error range, it indicates that the deviation between the actual motion trajectory of the robot and the ideal motion trajectory of the robot (i.e., the planned motion trajectory) is still large, and then the motion trajectory of the robot needs to be compensated.
[0058] S107: Compensate the target motion trajectory according to the trajectory error to obtain a compensated motion trajectory.
[0059] Among them, according to the trajectory error, the interpolation points corresponding to each interpolation period of the target motion trajectory can be compensated, so as to realize the compensation of the target trajectory and obtain a compensated motion trajectory. That is, compensate the first interpolation point, the second interpolation point,... respectively, and then determine the compensated motion trajectory according to the compensated interpolation points.
[0060] If P0 represents the position of the first interpolation point on the planned motion trajectory and PL represents the position of the first interpolation point on the actual motion trajectory, then the point error e of the first interpolation point on the actual motion trajectory relative to the first interpolation point on the planned motion trajectory is e = PL - P0. By analogy, the point errors corresponding to each interpolation point can be obtained, and then the average value e' of the point errors is determined. When compensating the target motion trajectory, if Q0 represents the position of the first interpolation point on the target motion trajectory, then calculate the result of Q0 - e', and by analogy, all interpolation points on the target motion trajectory can be compensated.
[0061] S108: Update the target motion trajectory with the compensated motion trajectory.
[0062] After executing step S108, return to execute step S103.
[0063] After obtaining the compensated motion trajectory, replace the target motion trajectory with the compensated motion trajectory, and then return to execute step S103, and control the robot to move according to the new target motion trajectory.
[0064] In some application scenarios, there may be some uncertain factors that cause the trajectory error between the actual motion trajectory and the planned motion trajectory to always be unable to be within the preset error range no matter how the trajectory compensation is performed. At this time, in order to avoid the entire process from looping infinitely, before returning to step S103, the historical number of times of executing step S103 (i.e., the number of times of executing step S103 before this) will also be obtained. If the historical number of times does not exceed the number threshold, return to execute step S103, but if the historical number of times has exceeded the number threshold, do not return to execute step S103, and at this time, an alarm prompt can be given.
[0065] Among them, the number threshold can be set according to the actual application scenario, such as 10 or 15, etc., and there is no limit here.
[0066] Of course, in other embodiments, before returning to execute step S103, it is also possible not to obtain the historical number of times of step S103, but directly return to execute step S103.
[0067] S109: End the trajectory compensation process, and subsequently control the movement of the robot according to the target movement trajectory.
[0068] After the trajectory compensation process ends, subsequently controlling the movement of the robot according to the target movement trajectory can make the actual movement trajectory of the robot approach the ideal movement trajectory of the robot (i.e., the planned movement trajectory).
[0069] It can be seen from the above that the trajectory compensation method of this embodiment uses an iterative process to compensate the target movement trajectory of the robot, making the actual movement trajectory of the robot approach the ideal movement trajectory (i.e., the planned movement trajectory), without relying on an accurate mathematical model, only requiring less prior knowledge and computational effort, having strong applicability and being easy to implement.
[0070] Refer to Figure 4 , Figure 4 FIG. is a schematic structural diagram of an embodiment of the trajectory compensation device of the present application. The trajectory compensation device 200 includes a processor 210, a memory 220, and a communication circuit 230. The processor 210 is respectively coupled to the memory 220 and the communication circuit 230. Program data is stored in the memory 220. The processor 210 implements the steps in the method of any of the above embodiments by executing the program data in the memory 220. For the detailed steps, reference can be made to the above embodiments and will not be elaborated here.
[0071] Among them, the trajectory compensation device 200 can be any device with algorithm processing capabilities such as a computer, a robot control cabinet, etc., which is not limited here.
[0072] Refer to Figure 5 , Figure 5 FIG. is a schematic structural diagram of an embodiment of the computer-readable storage medium of the present application. The computer-readable storage medium 300 stores a computer program 310, and the computer program 310 can be executed by a processor to implement the steps in any of the above methods.
[0073] Among them, the computer-readable storage medium 300 can specifically be a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk, or an optical disc, etc., which can store the computer program 310, or it can also be a server storing the computer program 310. The server can send the stored computer program 310 to other devices for running, or it can also run the stored computer program 310 by itself.
[0074] The above are only the embodiments of the present application, and do not limit the patent scope of the present application accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present application.
Claims
1. A trajectory compensation method, characterized in that, The method includes: Obtaining the planned motion trajectory of the robot; Taking the planned motion trajectory as the target motion trajectory; Controlling the motion of the robot according to the target motion trajectory; Determining the actual motion trajectory of the robot during the motion; Determining the trajectory error of the actual motion trajectory relative to the planned motion trajectory; Judging whether the trajectory error is within a preset error range; If the trajectory error is not within the preset error range, compensating the target motion trajectory according to the trajectory error to obtain a compensated motion trajectory; Updating the target motion trajectory with the compensated motion trajectory, and returning to execute the step of controlling the motion of the robot according to the target motion trajectory until the trajectory error is within the preset error range; Wherein, the step of determining the actual motion trajectory of the robot during the motion includes: Obtaining the axis positions of each joint axis of the robot during the motion and the end acceleration of the robot; Determining the actual motion trajectory of the robot according to the axis positions and the end acceleration; Wherein, the step of determining the actual motion trajectory of the robot according to the axis positions and the end acceleration includes: Taking the axis positions as observation quantities and the end acceleration as control quantities, and performing Kalman filtering processing to obtain the actual motion trajectory of the robot.
2. The method according to claim 1, characterized in that, An acceleration sensor is installed at the end of the robot, and the method further includes: During the motion of the robot, obtaining the end acceleration collected by the acceleration sensor.
3. The method according to claim 1, characterized in that, The step of determining the actual motion trajectory of the robot during the motion includes: During the motion of the robot, using a laser tracker to track the end of the robot to obtain the actual motion trajectory of the robot.
4. The method according to claim 1, characterized in that, Before returning to execute the step of controlling the motion of the robot according to the target motion trajectory, it further includes: Obtaining the historical number of times of executing the step of controlling the motion of the robot according to the target motion trajectory; If the historical number of times does not exceed the number threshold, returning to the step of controlling the motion of the robot according to the target motion trajectory.
5. The method according to claim 1, wherein The step of determining the trajectory error of the actual motion trajectory relative to the planned motion trajectory includes: Respectively determining the point errors between the interpolation points on the planned motion trajectory and the interpolation points on the actual motion trajectory within each interpolation period; Determining the average value of the point errors to obtain the trajectory error of the planned motion trajectory relative to the planned motion trajectory.
6. The method according to claim 5, wherein The step of compensating the target motion trajectory according to the trajectory error includes: Compensating the interpolation points corresponding to each interpolation period of the target motion trajectory according to the trajectory error.
7. A trajectory compensation device, characterized in that The trajectory compensation device includes a processor, a memory, and a communication circuit. The processor is respectively coupled to the memory and the communication circuit. Program data is stored in the memory, and the processor realizes the steps in the method according to any one of claims 1-6 by executing the program data in the memory.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and the computer program can be executed by a processor to implement the steps in the method according to any one of claims 1-6.
Citation Information
Patent Citations
Oil well bore track plotting device and method
CN105735969A
Industrial robot motion control method based on error compensation
CN110181509A