A robot motor dynamic speed regulation rule and its online solution method and system
By establishing a buffer area in the robot system and adjusting the interpolation data in real time, the problem of cumbersome operations when changing the trajectory speed is solved, real-time dynamic speed regulation of complex trajectories is achieved, efficiency and stability are improved, and the calculation process is simplified.
Patent Information
- Application Number
- CN202111599588.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-24
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2041-12-24
AI Technical Summary
During the movement of the robot, when changing the trajectory speed, it is necessary to re-modify the speed setting value of each trajectory, which makes the operation cumbersome and error-prone, affecting work efficiency and the quality of robot operations.
By establishing a cache area to store trajectory interpolation data, the adjustment magnification is obtained in real time and its changes are judged, the interpolation data is corrected, and the interpolation target value is calculated and updated to achieve real-time adjustment of complex trajectory speeds and simplify the dynamic speed adjustment process.
It achieves a smooth and continuous speed change curve, avoids mechanical impact, reduces the amount of calculation and code complexity, improves operating efficiency, simplifies algorithm development, and meets the real-time needs of robots.
Smart Images

Figure CN116009485B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of robot technology, and in particular to a robot motor dynamic speed regulation rule and an online solution method thereof. Background Art
[0002] The smoothness and speed of a robot's motion are important indicators of its motion control capabilities. In existing robot control, when a teaching trajectory needs to be executed at different speeds, the running speed of the trajectory is generally changed by modifying the set speed of the teaching trajectory. For complex operations with many process trajectories, every time the trajectory speed is changed, the operator needs to re-modify the speed setting value of each trajectory, which is very cumbersome and prone to errors, greatly affecting work efficiency and robot operation quality.
[0003] The Chinese invention patent with patent application number 201210224099 discloses a method for real-time adjustment of feed speed. This method needs to re-detect the acceleration and deceleration state of the current point each time the speed is adjusted, and re-plan the subsequent speed curve according to different formulas. The logic is complex and the amount of calculation is large. This patent is mainly aimed at the feed speed adjustment in the field of CNC machine tool processing. In the field of robot control, its motion trajectory usually adopts S-type speed planning or higher-order speed planning methods. If re-planning is adopted, the solution process is complicated and the amount of calculation is large, and it is impossible to efficiently perform dynamic speed adjustment of the robot motor. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a robot motor dynamic speed regulation rule and an online solution method thereof, so as to solve the problem that each time the trajectory speed is changed, the operator needs to re-modify the speed setting value of each trajectory, resulting in a cumbersome process.
[0005] The present invention solves the above technical problems through the following technical means:
[0006] A robot motor dynamic speed regulation rule and an online solution method thereof, comprising the following steps:
[0007] S10, establishing a buffer area to store trajectory interpolation data dn, where n is a natural number;
[0008] S20, obtaining the current adjustment rate in real time;
[0009] S30, determining whether the adjustment rate rate has changed, if so, correcting the cached trajectory interpolation data and determining whether the motor is at a commutation node, if so, executing step S40, if not, executing step S50;
[0010] S40, in the current interpolation cycle, set the interpolation target value Jtarget=d0 and send it to the motor, and re-execute step S20; if the current interpolation cycle is the first interpolation cycle after commutation, proceed to step S50;
[0011] S50, at this time the motor is not commutating, and the current interpolation target value Jtarget is calculated;
[0012] S60, determine whether the interpolation target value Jtarget is within the interval [d0, d1]. If so, obtain new interpolation data d2 from the cache header and update it and send it to the motor end. If not, directly send the interpolation target value Jtarget to the motor end and return to step S10 until all trajectory interpolation data dn are corrected.
[0013] By obtaining the current adjustment rate rate in real time and judging whether it has changed, in the current interpolation cycle, the interpolation target value Jtarget is set to d0 and sent to the motor. If the current interpolation cycle is in the first interpolation cycle after commutation, the current interpolation target value Jtarget is calculated, and it is judged whether the interpolation target value Jtarget is in the interval [d0, d1]. If it is in the interval, the new interpolation data d2 is obtained from the cache head and updated and sent to the motor end. By analogy, all the stored trajectory interpolation data dn are corrected, thereby achieving real-time adjustment of the complex trajectory speed.
[0014] As a further solution of the present invention: Step S1 comprises:
[0015] S11, obtaining the head trajectory interpolation data d0 cached each time, initializing the interpolation target value Jtarget=d0, and obtaining the next trajectory interpolation data d1 for storage;
[0016] S12, determine whether the trajectory interpolation data d1 is obtained, if obtained, execute step S20, if not obtained, directly set the interpolation target value Jtarget = d0 and send it to the motor, and wait for the data production thread to continue to produce new trajectory interpolation data before terminating.
[0017] As a further solution of the present invention: each time the trajectory interpolation data is consumed, each bit of data in the buffer area moves forward by one bit.
[0018] As a further solution of the present invention: the buffer area size is 20.
[0019] As a further solution of the present invention: during normal operation, the cached head trajectory interpolation data d0 is obtained each time, the interpolation target value Jtarget=d0 is initialized, and the next trajectory interpolation data d1 is obtained.
[0020] As a further solution of the present invention: the value range of the adjustment ratio rate is 0%≤rate≤100%.
[0021] As a further solution of the present invention: the modification comprises the following steps:
[0022] S31, saving the difference deltaJ_last between the two trajectory interpolation data d1 and d0 calculated in the previous interpolation cycle, and calculating the difference deltaJ of the current interpolation cycle using formula (1);
[0023] deltaJ=d1-d0 (1)
[0024] S32, determine whether deltaJ*deltaJ_last<0, where deltaJ_last is the difference obtained in the last cycle. If yes, it indicates that the motor starts to commutate, and step S40 is executed; otherwise, step S50 is executed.
[0025] As a further solution of the present invention: the calculation formula for calculating the current interpolation target value Jtarget is as follows: Jtarget=Jtarget+deltaJ*rate(2).
[0026] As a further solution of the present invention: updating and sending to the motor end includes:
[0027] And update d0=d1, d1=d2, and send the interpolation target value Jtarget at this time to the motor end.
[0028] A robot motor dynamic speed regulation rule and an online solution system thereof, comprising:
[0029] A storage module is used to establish a buffer area to store trajectory interpolation data dn, where n is a natural number;
[0030] The acquisition module is used to obtain the current adjustment rate in real time;
[0031] The first judgment module is used to judge whether the adjustment rate rate has changed. If it has changed, the cached trajectory interpolation data is corrected and whether the motor is at a commutation node. If so, it enters the assignment module, if not, it enters the calculation module;
[0032] The assignment module is used to set the interpolation target value Jtarget = d0 in the current interpolation cycle and send it to the motor, and return to the acquisition module; if the current interpolation cycle is the first interpolation cycle after commutation, it enters the calculation module;
[0033] A calculation module, used to calculate the current interpolation target value Jtarget;
[0034] The second judgment module is used to judge whether the interpolation target value Jtarget is within the interval [d0, d1]. If it is within the interval, the new interpolation data d2 is obtained from the cache header and updated and sent to the motor end. If not, the interpolation target value Jtarget is directly sent to the motor end and returned to the storage module until all the trajectory interpolation data dn are corrected.
[0035] The advantages of the present invention are:
[0036] 1. The present invention can obtain the current adjustment rate rate in real time and determine whether it has changed. In the current interpolation cycle, the interpolation target value Jtarget is set to be d0 and sent to the motor. If the current interpolation cycle is in the first interpolation cycle after commutation, the current interpolation target value Jtarget is calculated, and it is determined whether the interpolation target value Jtarget is within the interval [d0, d1]. If it is within the interval, the new interpolation data d2 is obtained from the cache header and updated and sent to the motor end. By analogy, the stored storage trajectory interpolation data dn is completely corrected, thereby realizing real-time adjustment of the complex trajectory speed.
[0037] 2. In the present invention, the interpolation data cache is first obtained through the data production thread, and then the speed ratio is detected in real time by the consumption thread, so as to correct the interpolation data in the cache and achieve the purpose of real-time speed regulation.
[0038] 3. The dynamic speed regulation online solution method provided by the patent of the present invention can obtain a smooth and continuous speed change curve. While avoiding mechanical shock during the speed regulation process, it solves the problems of large code volume and stability during re-planning. The logic is simple and the calculation amount is small, which can greatly reduce the workload of subsequent algorithm development and meet the robot's strong real-time requirements.
[0039] 4. When the present invention is used, during the entire operation process of the robot, the robot on-site operator only needs to issue a speed control command through a handheld teaching pendant, and can very conveniently control the robot to operate at different speeds, thereby effectively improving the robot's operating efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A flow chart of the robot motor dynamic speed regulation rules and online solution method provided in Example 1 of the present invention.
[0041] Figure 2 This is a schematic diagram of the structure of the robot motor dynamic speed regulation rule and its online solution system provided in Example 2 of the present invention.
[0042] Figure 3 A flow chart of online solution of dynamic speed regulation in the robot motor dynamic speed regulation rule and online solution method provided in Example 1 of the present invention.
[0043] Figure 4 This is a schematic diagram comparing the displacement before 100% speed regulation and after 20% speed regulation provided in Example 1 of the present invention.
[0044] Figure 5 It is a schematic diagram comparing the displacement before 100% speed regulation and the displacement after real-time speed regulation provided in Example 1 of the present invention. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described in combination with the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] Example 1
[0047] See also Figure 1 and Figure 3 , Figure 1 A schematic flow chart of a robot motor dynamic speed regulation rule and an online solution method thereof provided in Embodiment 1 of the present invention, Figure 3 The flow chart of online solution of dynamic speed regulation in the dynamic speed regulation rule and online solution method of the robot motor provided in Example 1 of the present invention is small in calculation amount, easy to implement in engineering and can effectively improve the working efficiency of the robot, including data production thread and consumption real-time thread, wherein the data production thread interpolates the trajectory according to the speed multiplier of 100% to produce interpolation data and cache it, the consumption thread acquires the interpolation data in real time, and performs speed regulation on the current interpolation data according to the rate adjustment signal, and the following generator mainly includes the following steps:
[0048] S10, establishing a buffer area to store trajectory interpolation data dn, where n is a natural number;
[0049] The trajectory is a pre-planned trajectory.
[0050] S11, obtaining the head trajectory interpolation data d0 cached each time, initializing the interpolation target value Jtarget=d0, and obtaining the next trajectory interpolation data d1 for storage;
[0051] S12, determine whether the trajectory interpolation data d1 is obtained, if obtained, execute step S20, if not obtained, directly set the interpolation target value Jtarget = d0 and send it to the motor, and wait for the data production thread to continue to produce new trajectory interpolation data before terminating.
[0052] Specifically, in this step, the size of the buffer area is 20. During normal operation, the cached head trajectory interpolation data d0 is obtained each time, the interpolation target value Jtarget=d0 is initialized, and the next trajectory interpolation data d1 is obtained. If the trajectory interpolation data d1 is not obtained, the interpolation target value Jtarget=d0 is directly set and sent to the motor. At this time, the consumption of the real-time thread is completed, and the data production thread is waiting to continue to produce new trajectory interpolation data, and the whole process ends; if the trajectory interpolation data d1 can be obtained, step 20 is performed.
[0053] It should be emphasized that in this step, each time the trajectory interpolation data is consumed, each bit of data in the buffer area moves forward by one bit;
[0054] S20, obtaining the current adjustment rate rate in real time, with a value range of 0%≤rate≤100%;
[0055] S30, determining whether the adjustment rate rate has changed, if so, correcting the cached trajectory interpolation data and determining whether the motor is at a commutation node, if so, executing step S40, if not, executing step S50;
[0056] The modification comprises the following steps:
[0057] S31, saving the difference deltaJ_last between the two trajectory interpolation data d1 and d0 calculated in the previous interpolation cycle, and calculating the difference deltaJ of the current interpolation cycle using formula (1);
[0058] deltaJ=d1-d0 (1)
[0059] S32, determine whether deltaJ*deltaJ_last<0, where deltaJ_last is the difference obtained in the last cycle. If yes, it indicates that the motor starts to commutate, and step S40 is executed; otherwise, step S50 is executed;
[0060] S40, in the current interpolation cycle, set the interpolation target value Jtarget=d0 and send it to the motor, and re-execute step S20; if the current interpolation cycle is the first interpolation cycle after commutation, proceed to step S50.
[0061] S50, at this time the motor is not commutating, calculate the current interpolation target value Jtarget:
[0062] The calculation formula for calculating the current interpolation target value Jtarget is as follows:
[0063] Jtarget=Jtarget+deltaJ*rate (2)
[0064] S60, determine whether the interpolation target value Jtarget is within the interval [d0, d1]. If so, obtain new interpolation data d2 from the cache header and update it and send it to the motor end. If not, directly send the interpolation target value Jtarget to the motor end and return to step S10 until all trajectory interpolation data dn are corrected.
[0065] Specifically, in this step, d0=d1, d1=d2, ... are updated, and the interpolation target value Jtarget at this time is sent to the motor end; if it is not within the interval, no operation is performed, and the interpolation target value Jtarget at this time is directly sent to the motor end. After completion, jump to step S10.
[0066] See also Figure 4 and Figure 5 , Figure 4 This is a schematic diagram comparing the displacement before 100% speed regulation and after 20% speed regulation provided in Example 1 of the present invention. Figure 5 It is a schematic diagram comparing the displacement before 100% speed regulation and the displacement after real-time speed regulation provided in Example 1 of the present invention.
[0067] During the whole process, the data production thread performs planning interpolation according to the speed multiplier of 100%, and the consumption thread only needs to detect the speed multiplier in real time without adjusting any planning parameters. The speed multiplier is applied to the interpolation data and corrected according to the speed adjustment method of the present invention, such as Figure 4 , the speed curve before regulation is obtained by interpolation according to the 100% speed planning. When the movement starts, the robot receives a 20% speed regulation command and runs at this rate until it stops; Figure 5 The curve before speed regulation is obtained by interpolation according to the 100% speed planning. At the beginning of the robot operation, it receives a 20% speed regulation command. After reaching the target speed and running for a period of time, it detects and obtains a 55% speed regulation command. After running for a period of time, it receives an 85% speed regulation command again until the robot stops running.
[0068] Example 2
[0069] See also Figure 2 , Figure 2 A schematic diagram of the structure of a robot motor dynamic speed regulation rule and an online solution system provided in Embodiment 2 of the present invention, the system comprising:
[0070] The storage module 701 is used to establish a buffer area to store trajectory interpolation data dn, where n is a natural number; and is also used to:
[0071] Obtain the head trajectory interpolation data d0 cached each time, initialize the interpolation target value Jtarget=d0, and obtain the next trajectory interpolation data d1 for storage;
[0072] Determine whether the trajectory interpolation data d1 is obtained. If so, execute step S20. If not, directly set the interpolation target value Jtarget=d0 and send it to the motor, and wait for the data production thread to continue to produce new trajectory interpolation data before terminating.
[0073] Specifically, in this step, the size of the buffer area is 20. During normal operation, the cached head trajectory interpolation data d0 is obtained each time, the interpolation target value Jtarget=d0 is initialized, and the next trajectory interpolation data d1 is obtained. If the trajectory interpolation data d1 is not obtained, the interpolation target value Jtarget=d0 is directly set and sent to the motor. At this time, the consumption of the real-time thread is completed, and the data production thread is waiting to continue to produce new trajectory interpolation data, and the whole process ends; if the trajectory interpolation data d1 can be obtained, the execution acquisition module 702 is performed.
[0074] It should be emphasized that in this step, each time the trajectory interpolation data is consumed, each bit of data in the buffer area moves forward by one bit;
[0075] The acquisition module 702 is used to obtain the current adjustment rate rate in real time, with a value range of 0%≤rate≤100%;
[0076] The first judgment module 703 is used to judge whether the adjustment rate rate has changed. If it has changed, the cached trajectory interpolation data is corrected and whether the motor is at a commutation node. If so, it enters the assignment module, if not, it enters the calculation module; it is also used to:
[0077] Determine whether the adjustment rate rate has changed. If so, correct the cached trajectory interpolation data and determine whether the motor is at a commutation node. If so, execute step S40; if not, execute step S50;
[0078] The modification comprises the following steps:
[0079] S31, saving the difference deltaJ_last between the two trajectory interpolation data d1 and d0 calculated in the previous interpolation cycle, and calculating the difference deltaJ of the current interpolation cycle using formula (1);
[0080] deltaJ=d1-d0 (1)
[0081] S32, determine whether deltaJ*deltaJ_last<0, where deltaJ_last is the difference obtained in the last cycle. If yes, it indicates that the motor starts to commutate, and the assignment module 704 is executed. Otherwise, the calculation module 705 is executed;
[0082] The assignment module 704 is used to set the interpolation target value Jtarget=d0 in the current interpolation cycle and send it to the motor, and return to the acquisition module; if the current interpolation cycle is the first interpolation cycle after commutation, enter the calculation module 705;
[0083] A calculation module 705, used for calculating the current interpolation target value Jtarget;
[0084] The calculation formula for calculating the current interpolation target value Jtarget is as follows:
[0085] Jtarget=Jtarget+deltaJ*rate (2)
[0086] The second judgment module 706 is used to judge whether the interpolation target value Jtarget is within the interval [d0, d1]. If it is within the interval, the new interpolation data d2 is obtained from the cache header and updated and sent to the motor end. If not, the interpolation target value Jtarget is directly sent to the motor end and returned to the storage module until the trajectory interpolation data dn is completely corrected.
[0087] Specifically, in this module, d0=d1, d1=d2, ... are updated, and the interpolation target value Jtarget at this time is sent to the motor end; if it is not within the interval, no operation is performed, and the interpolation target value Jtarget at this time is directly sent to the motor end. After completion, jump to the storage module 701.
[0088] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A robot motor dynamic speed regulation rule and its online solution method, characterized in that: include: S10, establishing a buffer area to store trajectory interpolation data dn, where n is a natural number; S20, obtaining the current adjustment rate in real time; S30, determine whether the adjustment rate rate has changed, if it has changed, correct the cached trajectory interpolation data and determine whether the motor is at a commutation node, if so, execute step S40, if not, execute step S50, the correction includes the following steps: S31, saving the difference deltaJ_last between the two trajectory interpolation data d1 and d0 calculated in the previous interpolation cycle, and using formula (1) to calculate the difference deltaJ in the current interpolation cycle; deltaJ=d1-d0(1) S32, determining whether deltaJ*deltaJ_last<0, wherein deltaJ_last is the difference obtained in the last cycle, if yes, it indicates that the motor starts to commutate, and step S40 is executed, otherwise, step S50 is executed; S40, in the current interpolation cycle, set the interpolation target value Jtarget=d0 and send it to the motor, and re-execute step S20; if the current interpolation cycle is the first interpolation cycle after commutation, proceed to step S50; S50, at this time, the motor is not commutating, and the current interpolation target value Jtarget is calculated. The calculation formula for calculating the current interpolation target value Jtarget is as follows: Jtarget=Jtarget + deltaJ*rate(2); S60, determine whether the interpolation target value Jtarget is within the interval [d0, d1]. If so, obtain new interpolation data d2 from the cache header and update it and send it to the motor end. If not, directly send the interpolation target value Jtarget to the motor end and return to step S10 until all trajectory interpolation data dn are corrected.
2. The robot motor dynamic speed regulation rule and online solution method thereof according to claim 1 is characterized in that: The step S10 comprises: S11, obtaining the head trajectory interpolation data d0 cached each time, initializing the interpolation target value Jtarget=d0, and obtaining the next trajectory interpolation data d1 for storage; S12, determine whether the trajectory interpolation data d1 is obtained, if obtained, execute step S20, if not obtained, directly set the interpolation target value Jtarget=d0 and send it to the motor, and wait for the data production thread to continue to produce new trajectory interpolation data before terminating.
3. The robot motor dynamic speed regulation rule and online solution method thereof according to claim 2 is characterized in that: Each time the trajectory interpolation data is consumed, each bit of data in the buffer moves forward by one bit.
4. The robot motor dynamic speed regulation rule and online solution method thereof according to claim 2 is characterized in that: The buffer size is 20.
5. The robot motor dynamic speed regulation rule and online solution method thereof according to claim 4 is characterized in that: Each time the cached head trajectory interpolation data d0 is obtained, the interpolation target value Jtarget=d0 is initialized, and the next trajectory interpolation data d1 is obtained.
6. The robot motor dynamic speed regulation rule and online solution method thereof according to claim 4 is characterized in that: The value range of the adjustment rate rate is 0%≤rate≤100%.
7. The robot motor dynamic speed regulation rule and online solution method thereof according to claim 4 is characterized in that: Updates sent to the motor include: And update d0=d1, d1=d2, and send the interpolation target value Jtarget at this time to the motor end.
8. A system based on the robot motor dynamic speed regulation rule and its online solution method according to any one of claims 1 to 7, characterized in that: include: A storage module, used for establishing a buffer area to store trajectory interpolation data dn, where n is a natural number; The acquisition module is used to obtain the current adjustment rate in real time; The first judgment module is used to judge whether the adjustment rate rate has changed. If it has changed, the cached trajectory interpolation data is corrected and whether the motor is at a commutation node. If so, it enters the assignment module. If not, it enters the calculation module. The correction includes the following steps: S31, saving the difference deltaJ_last between the two trajectory interpolation data d1 and d0 calculated in the previous interpolation cycle, and using formula (1) to calculate the difference deltaJ in the current interpolation cycle; deltaJ=d1-d0(1) S32, judging whether deltaJ*deltaJ_last<0, wherein deltaJ_last is the difference obtained in the last cycle, if yes, it indicates that the motor starts to commutate, and the assignment module is executed, otherwise, the calculation module is executed; The assignment module is used to set the interpolation target value Jtarget=d0 in the current interpolation cycle and send it to the motor, and return to the acquisition module; if the current interpolation cycle is the first interpolation cycle after commutation, it enters the calculation module; The calculation module is used to calculate the current interpolation target value Jtarget. The calculation formula for calculating the current interpolation target value Jtarget is as follows: Jtarget=Jtarget + deltaJ*rate(2); The second judgment module is used to judge whether the interpolation target value Jtarget is within the interval [d0, d1]. If it is within the interval, the new interpolation data d2 is obtained from the cache header and updated and sent to the motor end. If not, the interpolation target value Jtarget is directly sent to the motor end and returned to the storage module until all the trajectory interpolation data dn are corrected.
9. The system according to claim 8, characterized in that Storage modules are used for: Get the head trajectory interpolation data d0 cached each time, initialize the interpolation target value Jtarget=d0, and get the next trajectory interpolation data d1 for storage; Determine whether the trajectory interpolation data d1 is obtained. If obtained, execute the acquisition module. If not, directly set the interpolation target value Jtarget=d0 and send it to the motor, and wait for the data production thread to continue to produce new trajectory interpolation data before terminating.
10. The system according to claim 9, characterized in that Each time the trajectory interpolation data is consumed, each bit of data in the buffer moves forward by one bit.
