A robot processing speed optimization method and electronic equipment
By eliminating trajectory points, identifying breakpoints, optimizing compression and overall fitting of robot processing trajectories, the problem of insufficient processing speed of micro straight line segments in the prior art is solved, and the processing speed and efficiency are improved without reducing accuracy.
Patent Information
- Application Number
- CN202411846056.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-12-16
AI Technical Summary
When there are a large number of tiny straight line segments in the processing robot processing, it is difficult to achieve the set desired speed without affecting the trajectory accuracy, resulting in the processing speed being not fast enough.
By obtaining the track points and line segment information in the processing trajectory, trajectory point elimination, breakpoint identification, compression optimization and overall fitting are performed to optimize the processing trajectory so that it reaches the set desired speed without changing the accuracy.
It improves the processing speed of the robot, reduces the processing time, reduces the vibration caused by sudden speed changes, extends the service life of the mechanical equipment, and improves the processing accuracy.
Smart Images

Figure CN119292184B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of robot trajectory processing, and specifically relates to a robot processing speed optimization method and electronic equipment. Background Art
[0002] In current robot processing, the trajectory of the processing object is generated by different CAMs. For the CAMs commonly used in the market, such as UG, PowerMill, Sprut, etc., the trajectories generated when processing parts with large curvature are composed of a large number of tiny straight lines less than 1 mm (in order to maintain the maximum consistency with the part contour).
[0003] For program segments with a large number of tiny straight line segments, most robot systems currently use arc transition, speed look-ahead, acceleration and deceleration control trajectory smoothing and other methods, all of which aim to increase processing speed.
[0004] However, the above method has certain problems. For example, there is an accuracy error in the arc transition, and it is not suitable for occasions with too high accuracy requirements. Speed preview is currently a commonly used method for processing tiny straight line segments. By previewing N (numerical) segments, the speed of each small line segment’s starting point, end point, and inflection point is calculated in advance. From an algorithmic perspective, the more preview segments there are, the more stable the speed planning is (it can reach the set expected speed). However, if there are too many preview segments, the controller calculation time will be too long, and if there are too few preview segments, the set expected speed cannot be reached. Summary of the invention
[0005] In order to solve the problems existing in the background technology, the present invention proposes a robot processing speed optimization method and processing method, which is for the robot cutting, welding or spraying process There are a large number of tiny line segments in the processing optimization, the result can improve the robot processing speed, which can be used for cutting, welding or spraying.
[0006] In view of the above-mentioned problems, the present invention provides a method capable of processing a large number of tiny straight line segments and making them reach a set expected speed within a set error range without affecting the trajectory accuracy, so as to solve the problems of the prior art.
[0007] The technical solution adopted by the present invention is:
[0008] 1. A method for optimizing robot processing speed:
[0009] S1, obtaining a processing trajectory consisting of processing line segments and trajectory points, and inputting it into a data processing device to calculate the length, angle and height of the processing line segment;
[0010] The data processing device is usually a computer, a PLC, a single chip microcomputer, etc.
[0011] S2, performing traversal processing on two adjacent processing line segments formed by three adjacent trajectory points in combination with preset parameters, and performing trajectory point elimination operations accordingly;
[0012] S3, performing breakpoint identification processing on the processing trajectory after the trajectory point elimination and deletion operation;
[0013] S4, performing compression optimization processing on the processing trajectory after the breakpoint identification;
[0014] S5. Perform overall fitting processing on the compression-optimized processing trajectory.
[0015] The specific implementation of the processing described in the present invention is that the robot controls the processing point to move sequentially along each trajectory point on the processing trajectory, and then accelerates and decelerates between every two trajectory points at a fixed preset acceleration.
[0016] The processing trajectory is composed of a plurality of trajectory points connected in sequence by processing line segments through connecting lines, both ends of each processing line segment are trajectory points, and the length l of each processing line segment and the angle a and height h of the triangle formed between each current processing line segment and the next processing line segment are calculated, wherein the angle a is the turning angle between the corresponding vector of the current processing line segment and the corresponding vector of the next processing line segment, and the height h is the height of the triangle formed by taking the current processing line segment and the next processing line segment as the two sides of the triangle respectively.
[0017] In step S2, the length, angle and height of the processed line segment are compared with the minimum line segment length L pre-set by the user (the line segment length L can be calculated in advance through the known speed and acceleration parameters of the system), the triangle height H and the angle A between the line segments, and then a comparison is made to determine whether to perform an elimination operation.
[0018] The step S2 specifically includes: comparing the result calculated in step 1 with the minimum line segment length L set by the user (the line segment length L can be calculated by the known speed and acceleration parameters of the system), the triangle height H, and the angle A between the line segments.
[0019] First, compare the length l of the current processed line segment with the preset minimum line segment length L:
[0020] And the angle a and height h of the triangle formed between each current processing line segment and its next processing line segment.
[0021] If L>1, the current processing line segment is considered to be a tiny line segment (less than the minimum line segment length L set by the user), and the next step of processing is performed; otherwise, the current processing line segment is considered not to be a tiny line segment, and the next step of processing is not performed, the current processing line segment is skipped, and the processing judgment of the next processing line segment is performed;
[0022] Then, compare the angle a of the triangle corresponding to the current machining line segment with the preset corner A between line segments, and compare the height h of the triangle corresponding to the current machining line segment with the preset triangle height H:
[0023] If a > A, it is necessary to further compare the height (error) of the triangle, and if H < h, do not perform any operations on the trajectory points of the current machining line segment and the next machining line segment to maintain the integrity of the original trajectory between the current machining line segment and the next machining line segment; otherwise, perform an elimination operation on the trajectory points between the current machining line segment and the next machining line segment, that is, eliminate the trajectory points at the end of the current machining line segment / the trajectory points at the beginning of the next machining line segment.
[0024] In the step S3, specifically, in combination with the motion speed continuity, rotation vector, motion type, etc. of the trajectory segment, pre-machining simulation is performed through preset machining parameters in the data processing device to judge the average machining speed of each machining line segment in the machining trajectory after the trajectory point deletion and elimination operation:
[0025] If the average machining speed of the machining line segment during pre-machining is less than the proportional threshold C of the preset machining speed, and the proportional threshold C is usually set to 95%, then the trajectory points between the current machining line segment and the previous machining line segment are used as breakpoints and marked; otherwise, no processing is performed, that is, the trajectory points between the current machining line segment and the previous machining line segment are not used as breakpoints.
[0026] The step S4 mainly first calculates the corner of the line segment unit and the rotation vector ROTV of the trajectory points in the line segment unit for the machining trajectory after breakpoint recognition, then makes a judgment by combining the corner and the rotation vector ROTV, and calculates the arc radius R formed by the line segment unit for compression into a space circle or smooth compression processing.
[0027] The step S4 is specifically as follows:
[0028] S41. Take the whole of two adjacent machining line segments formed by every three adjacent trajectory points as a line segment unit. First, calculate the lengths d1 and d2 of the two machining line segments, and calculate the corner α between the two machining line segments by the following formula:
[0029] P0P1 * P1P2 = |P0P1| * |P1P2| * cos(α)
[0030] Among them, P0P1 represents the connection vector from the trajectory point P0 to the trajectory point P1, P1P2 represents the connection vector from the trajectory point P1 to the trajectory point P2, the * symbol is the vector dot product, |P0P1| represents the length d1 from the trajectory point P0 to the trajectory point P1, and |P1P2| represents the length d2 from the trajectory point P1 to the trajectory point P2;
[0031] S42. For each trajectory point in the line segment unit, the rotation vector ROTV of each trajectory point is calculated according to the vector cross product according to the following formula:
[0032] ROTV=θ*N
[0033] Wherein, N is the rotation axis, θ is the rotation angle between the line vector P0P1 from the trajectory point P0 to the trajectory point P1 and the line vector P1P2 from the trajectory point P0 to the trajectory point P2;
[0034] The above rotation axis and rotation angle are calculated according to the following formulas:
[0035] N=V1×V2
[0036] θ=arccos((V1*V2) / (|V1|*|V2|))
[0037] Where: V1 is the line vector P0P1 from trajectory point P0 to trajectory point P1, V2 is the line vector P1P2 from trajectory point P0 to trajectory point P2, the × symbol represents vector cross product, the * symbol represents vector dot product, |V1| represents the modulus of vector V1, and |V2| represents the modulus of vector V2;
[0038] S43, then the rotation vector ROTV of the three trajectory points in the integrated line segment unit is judged according to the following conditions:
[0039] α>A
[0040] ROTV0*ROTV1>0
[0041] ROTV1*ROTV2>0
[0042] Wherein, A represents the preset angle threshold;
[0043] If the above conditions are all met at the same time, the three trajectory points P0, P1 and P2 in the line segment unit can form a circle, and step S44 is performed;
[0044] If the above conditions are not met at the same time, a trajectory smoothing operation is performed and step S45 is performed;
[0045] Through the above, we can judge whether the three points P0, P1 and P2 have the conditions to form a circle. Usually, if the angle α is extremely small (usually tends to 0), or the lengths of d1 and d2 are also extremely small (usually tend to 0), then it is judged that the three points P0, P1 and P2 cannot form a space circle.
[0046] S44. Calculate the radius R of the arc formed by the line segment units according to the following formula:
[0047] R=||P0P1||*||P1P2||*||P2P0|| / (2*||N||)
[0048] Among them, ||P i P j || is the Euclidean distance between two trajectory points, i and j represent the sequence numbers of the trajectory points, and ||N|| is the modulus of the normal vector of the triangle formed by the three points, which is used to calculate the area of the triangle;
[0049] The two processing line segments in the line segment unit are changed from straight line segments to arc line segments with a radius of R, so that they are compressed into a space circle, that is, a convex arc is made between the two trajectory points with the radius R obtained above;
[0050] The rotation vector of the trajectory point is given by the right-hand screw rule.
[0051] S45, adding the adjacent track points before the track point P0 and the adjacent track points after the track point P2 to the line segment unit, and further judging according to the following conditions in combination with the line segment lengths between the adjacent track points among the five track points:
[0052] ROTV0* ROTV1≤0
[0053] ROTV1* ROTV2≤0
[0054] (L1+ L2) <MIN(L0,L3)
[0055] Wherein, L1 represents the length of the track segment between track point P0 and track point P1, L2 represents the length of the track segment between track point P0 and track point P2, L0 represents the length of the track segment between track point P0 and its adjacent track point before it, L3 represents the length of the track segment between track point P2 and its adjacent track point after P2, and MIN() represents the function of taking the minimum value of L0 and L3;
[0056] If all three of the above conditions are met at the same time, smooth compression will be performed;
[0057] If the above three conditions are not met at the same time, no smoothing compression processing is performed, and no processing is performed.
[0058] The smooth compression process is specifically as follows:
[0059] First, establish a line between the first trajectory point P0 in the line segment unit and its previous adjacent trajectory point as the first line, and a line between the third trajectory point P2 in the line segment unit and its subsequent adjacent trajectory point as the second line, and take the intersection point between the first line and the second line as the intersection point;
[0060] Then, the midpoint of the line between the intersection point and the second track point P2 in the line segment unit is taken as the smoothing point, and the second track point P2 in the line segment unit is replaced by the smoothing point, thereby achieving smooth compression processing.
[0061] The step S5 specifically uses a cubic spline curve to perform overall fitting processing on the compression-optimized processing trajectory.
[0062] 2. An electronic device comprising:
[0063] A memory, the memory being used to store a processing program;
[0064] A processor, wherein the processor implements the above-mentioned processing speed optimization method when executing the processing program.
[0065] The present invention processes tiny straight line segments in the processing trajectory, reads the trajectory code to be processed through the robot controller, determines whether the processing trajectory segment is a tiny line segment, and compresses continuous tiny line segments so that they reach the set processing speed without changing the accuracy, thereby improving the processing efficiency, effectively improving the vibration of the robot caused by the sudden change of speed, extending the service life of the machine and improving the processing accuracy.
[0066] The beneficial effects of the present invention are:
[0067] The present invention proposes a solution to the problem that a large number of small line segments exist in the robot cutting process, resulting in the inability to reach the set speed. The characteristic trajectories that meet the continuous small line segments are deleted, circle compressed, trajectory smoothed and spline fitted in sequence, so that the robot cutting speed can reach the set expected speed, reducing the cutting time and reducing the robot cutting vibration. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 Processing flow chart for the entire trajectory;
[0069] Figure 2 It is a triangular graph formed by three consecutive trajectory points;
[0070] Figure 3 Delete the schematic diagram for the trajectory point;
[0071] Figure 4 This is the trajectory diagram after deleting some trajectory points;
[0072] Figure 5 Rotate vector diagram for trajectory points;
[0073] Figure 6 The trajectory is compressed into a circular graph;
[0074] Figure 7 is the trajectory smoothing graph;
[0075] Figure 8 This is a comparison chart of arc transition and spline fitting;
[0076] Fig. 9 This is a speed comparison chart before and after trajectory processing. DETAILED DESCRIPTION
[0077] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0078] Embodiments of the present invention are as follows:
[0079] This embodiment provides a method for deleting and compressing robot processing trajectory points to improve the efficiency of the robot in processing tasks such as cutting, welding, and spraying.
[0080] In order to achieve the purpose of the invention, the present invention proposes a compression processing method for tiny line segments, which realizes the optimization of robot cutting processing speed. The process is as follows Figure 1 As shown, the specific implementation steps of the method are as follows:
[0081] S1. Obtain a processing trajectory consisting of processing line segments and trajectory points, and input it into a data processing device to calculate the length, angle and height of the processing line segments.
[0082] The specific processing trajectory is composed of multiple trajectory points connected in sequence through processing line segments through connecting lines. Both ends of each processing line segment are trajectory points, and the length l of each processing line segment and the angle a and height h of the triangle formed between each current processing line segment and the next processing line segment are calculated. The angle a is the angle between the corresponding vector of the current processing line segment and the corresponding vector of the next processing line segment, and the height h is the height of the triangle formed by taking the current processing line segment and the next processing line segment as the two sides of the triangle respectively.
[0083] The control system pre-reads the trajectory processing file program segment, such as Figure 2 As shown, for the current line segment P0P1, the length l of the tiny line segment P0P1, the angle a between the two adjacent line segments between the tiny line segment P0P1 and the tiny line segment P1P2, and the height h of the triangle formed by the two adjacent line segments as the waist are calculated.
[0084] S2. Perform traversal processing on two adjacent processing line segments formed by three adjacent trajectory points in combination with preset parameters, and perform trajectory point deletion operation accordingly.
[0085] The above is based on the length, angle and height of the processed line segment and the minimum line segment length L set in advance by the user (the line segment length L can be calculated in advance through the known speed and acceleration parameters of the system), the triangle height H and the angle A between the line segments, and then determines whether to perform the elimination operation.
[0086] Specifically, compare the result calculated in step 1 with the minimum line segment length L set by the user (for the line segment length L, it can be calculated through the known speed and acceleration parameters of the system), the triangle height H, and the corner A between line segments:
[0087] First, compare the length l of the currently processed line segment with the preset minimum line segment length L:
[0088] If L > l, then at this time, the currently processed line segment is considered a tiny line segment (less than the minimum line segment length L set by the user), and then proceed to the next step; otherwise, it is considered that the currently processed line segment is not a tiny line segment, do not proceed to the next step, skip the currently processed line segment and perform the processing and judgment of the next processed line segment;
[0089] Then, compare the angle a of the triangle corresponding to the currently processed line segment with the preset corner A between line segments, and compare the height h of the triangle corresponding to the currently processed line segment with the preset triangle height H:
[0090] If a > A, it is necessary to further compare the height (error) of the triangle, and if H < h, do not perform any operations on the trajectory points of the currently processed line segment and the next processed line segment to maintain the integrity of the original trajectory between the currently processed line segment and the next processed line segment; otherwise, perform an elimination operation on the trajectory points between the currently processed line segment and the next processed line segment, that is, perform an elimination operation on the trajectory points at the end of the currently processed line segment / the trajectory points at the beginning of the next processed line segment.
[0091] As Figure 3 shown, the three points P0, P1, and P2 form two consecutive small blocks, and the elimination operation is to delete the P1 point and retain the P0 and P2 points.
[0092] S3. Perform breakpoint recognition processing on the machining trajectory after the trajectory point elimination operation.
[0093] Specifically, in combination with the motion speed continuity, rotation vector, motion type, etc. of the trajectory segment, perform pre - machining simulation with preset machining parameters through the data processing device to judge the average machining speed of each machining line segment in the machining trajectory after the trajectory point deletion operation:
[0094] If the average machining speed of the machining line segment during pre - machining is less than the ratio threshold C of the preset machining speed, and the ratio threshold C is usually set to 95%, then the trajectory points between the currently processed line segment and the previous processed line segment are used as breakpoints and marked; otherwise, no processing is performed, that is, the trajectory points between the currently processed line segment and the previous processed line segment are not used as breakpoints.
[0095] For the trajectory 1 after the trajectory point elimination operation (the trajectory point elimination operation eliminates redundant points within the precision error range, which can increase the length of the small line segment) in step S2 as Figure 4 At this time, it is also necessary to determine whether there is a "breakpoint" between the continuous tracks 1.
[0096] The breakpoint is judged based on the continuity of the motion speed of the trajectory segment, the rotation vector, the motion type, etc. For example, if the speed of processing segment 1 ... processing segment 10 is 1000 mm / min, and the speed of processing segment 11 is less than 1000 mm / min*95%, then processing segment 1 ... processing segment 10 is considered to be a continuous segment, and there is a breakpoint between processing segment 10 and processing segment 11.
[0097] The trajectory after the breakpoint check is represented as trajectory 2, and at this time, trajectory 2 contains a large number of straight line segments.
[0098] S4, performing compression optimization processing on the processing trajectory after the breakpoint identification;
[0099] S41. In a specific implementation, the trajectory segment 2 after the breakpoint detection is a continuous line segment, such as Figure 5 As shown, the curvature calculation is performed on the entirety of two adjacent processing line segments formed by every three adjacent trajectory points as a line segment unit.
[0100] First, the arc part is excluded according to the trajectory file, and the lengths of the two continuous processing line segments formed by the three trajectory points, d1 and d2, are calculated by checking the three continuous trajectory points P0, P1, and P2 of the straight line trajectory.
[0101] Taking the whole of two adjacent processing line segments formed by three adjacent trajectory points as a line segment unit, the lengths d1 and d2 of the two processing line segments are first calculated, and the turning angle α between the two processing line segments is calculated by the following formula:
[0102] P0P1* P1P2= |P0P1|* |P1P2|* cos(α)
[0103] Among them, P0P1 represents the line vector from trajectory point P0 to trajectory point P1, P1P2 represents the line vector from trajectory point P1 to trajectory point P2, |P0P1| represents the length d1 from trajectory point P0 to trajectory point P1, and |P1P2| represents the length d2 from trajectory point P1 to trajectory point P2.
[0104] If the calculated rotation angle α is extremely small, usually tends to 0, or the lengths of d1 and d2 are also extremely small (usually tend to 0), then it is determined that the three points P0, P1 and P2 cannot form a circle.
[0105] S42: After calculation, the rotation vectors of the continuous trajectory points need to be further checked to determine whether they can form a space circle. If at least three continuous rotation vectors have almost equal lengths and directions, then Figure 5The tiny trajectory segments in the space will be compressed into a space circle.
[0106] For each trajectory point in the line segment unit, the rotation vector ROTV of each trajectory point is calculated according to the vector cross product according to the following formula:
[0107] ROTV=θ*N
[0108] Where N is the rotation axis and θ is the rotation angle;
[0109] The above rotation axis and rotation angle are calculated according to the following formulas:
[0110] N=V1×V2
[0111] Wherein, V1 is the line vector P0P1 from trajectory point P0 to trajectory point P1, V2 is the line vector P1P2 from trajectory point P0 to trajectory point P2, and the × symbol represents vector cross product;
[0112] θ=arccos((V1*V2) / (|V1|*|V2|))
[0113] Among them, the * symbol is the vector dot product, |V1| represents the modulus length of vector V1, and |V2| represents the modulus length of vector V2;
[0114] S43, then the rotation vector ROTV of the three trajectory points in the integrated line segment unit is judged according to the following conditions:
[0115] α>A
[0116] ROTV0* ROTV1>0
[0117] ROTV1* ROTV2>0
[0118] If the above conditions are all met at the same time, the three trajectory points P0, P1 and P2 in the line segment unit can form a circle, and step S44 is performed;
[0119] If the above conditions are not met at the same time, a trajectory smoothing operation is performed and step S45 is performed;
[0120] Through the above, we can judge whether the three points P0, P1 and P2 have the conditions to form a circle. Usually, if the angle α is extremely small (usually tends to 0), or the lengths of d1 and d2 are also extremely small (usually tend to 0), then it is judged that the three points P0, P1 and P2 cannot form a space circle.
[0121] S44. Calculate the radius R of the arc formed by the line segment units according to the following formula:
[0122] R=||P0P1||*||P1P2||*||P2P0|| / (2*||N||)
[0123] Among them, ||P i P j || is the Euclidean distance between two trajectory points, i and j represent the sequence numbers of the trajectory points, and ||N|| is the modulus of the normal vector of the triangle formed by the three points, which is used to calculate the area of the triangle;
[0124] The two processing line segments in the line segment unit are changed from straight line segments to arc line segments with a radius of R, so that they are compressed into a space circle, that is, a convex arc is made between the two trajectory points with the radius R obtained above;
[0125] The rotation vector of the trajectory point is given by the right-hand screw rule.
[0126] The trajectory that satisfies the above rules is Figure 6 As shown, the trajectory after the spatial circle is fitted to the continuous small line segments can eliminate the corners between small blocks while ensuring accuracy and achieve the expected set speed.
[0127] The specific processing is that the robot controls the processing point to move along each trajectory point in sequence on the processing trajectory, and then accelerates and decelerates between every two trajectory points at a fixed preset acceleration.
[0128] The cutting process of this embodiment is performed according to the relationship between the speed v, the path length x and the acceleration a, which is expressed as follows:
[0129] 2*a*x=v*v
[0130] It can be seen that according to the set acceleration and expected speed, the smaller the path length x is, the smaller the actual speed is. By processing the small line segment through the above steps, the path length x becomes longer while ensuring the accuracy, and the speed will be improved.
[0131] Therefore, although the length of the above-mentioned compression into a spatial circle increases, the trajectory after fitting the continuous small line segments can eliminate the corners between small blocks while ensuring accuracy, can achieve the expected set speed, and will achieve a faster arrival time when moving along the processing trajectory.
[0132] S45. For tiny line segments that cannot be compressed into a space circle after the above calculation, a spline compression / trajectory smoothing method will be used to perform fitting operations on the small line segments.
[0133] like Figure 7As shown, for trajectory point P1 (yellow dot), the rotation vectors ROTV0, ROTV1 and ROTV2 of its two adjacent points before and after - trajectory point P0 and trajectory point P2 are calculated respectively, the trajectory length of vector P0P1 from trajectory point P0 to trajectory point P1 is L1, the trajectory length of vector P0P2 from trajectory point P0 to trajectory point P2 is L2, the length of trajectory segment 0 from the adjacent trajectory point before trajectory point P0 to trajectory point P0 is L0, and the length of trajectory segment 3 from trajectory point P2 to the adjacent trajectory point after trajectory point P2 is L3.
[0134] If the rotation vector and length satisfy the following formulas respectively, it indicates that there is a kink point in the trajectory (that is, the trajectory point P1 is a kink point, yellow dot):
[0135] ROTV0* ROTV1≤0
[0136] ROTV1* ROTV2≤0
[0137] (L1+ L2) <MIN(L0,L3)
[0138] Among them, L1 represents the length of the trajectory segment from trajectory point P0 to trajectory point P1, L2 represents the length of the trajectory segment of vector P0P2 from trajectory point P0 to trajectory point P2, L0 represents the length of the trajectory segment from the adjacent trajectory point before trajectory point P0 to trajectory point P0, and L3 represents the length of the trajectory segment from trajectory point P2 to the adjacent trajectory point after trajectory point P2.
[0139] Therefore, the average of the red point at the intersection between the trajectory segment 0 and the trajectory segment 3 and the yellow point at the middle trajectory point P1 is calculated to obtain a smooth point (green point p), and the kink point at the middle trajectory point P1 is replaced by the smooth point.
[0140] The smoothed trajectory is further subjected to spline compression processing.
[0141] S5. Perform overall fitting processing on the compression-optimized processing trajectory.
[0142] like Figure 8 As shown, the usual processing method for the smoothed line segments is to use the corner transition method in the control system. For small line segments, this method has excessive errors and reduced speed, so spline fitting is performed on the smoothed small line segments.
[0143] Here, a cubic spline curve is used to fit the original trajectory. The spline curve will almost completely regenerate the original curve, and the angle change can also be integrated into the spline. It has the advantages of high accuracy, ability to achieve target speed and reduce cutting time.
[0144] Finally, the optimized processing trajectory is used to control the robot to process the robotic arm.
[0145] like Fig. 9 As shown, the upper figure shows the cutting speed of unprocessed continuous tiny line segments, and the lower figure uses the cutting speed of the present invention. It can be seen from the two figures that the method of the present invention has a significant effect on improving the speed.
[0146] In practice, the processing of the present invention can also be transformed into a spraying process, which becomes a spraying track.
[0147] It can be seen from the above that in the application of spraying robots, the method of the present invention can significantly reduce the number of trajectory points, optimize the spraying path, and thus improve the spraying speed and uniformity. For welding applications, the present invention can optimize the welding path, reduce the welding time and improve the quality of the weld. Through the above embodiments, the present invention improves the processing speed and reduces the processing time without reducing the processing accuracy. At the same time, since the trajectory optimization process reduces the vibration caused by the speed mutation, the service life of the mechanical equipment is extended, and the processing efficiency and quality are improved.
Claims
1. A robot processing speed optimization method, characterized in that: The steps to implement the method are as follows: S1, obtaining a processing trajectory consisting of processing line segments and trajectory points, and inputting it into a data processing device to calculate the length, angle and height of the processing line segment; S2, performing traversal processing on two adjacent processing line segments formed by three adjacent trajectory points in combination with preset parameters, and performing trajectory point elimination operations accordingly; S3, performing breakpoint identification processing on the processing trajectory after the trajectory point elimination operation; S4, performing compression optimization processing on the processing trajectory after the breakpoint identification; The step S4 mainly involves first calculating the corner and rotation vector ROTV of the line segment unit for the processing trajectory after the breakpoint is identified, then making a judgment based on the corner and rotation vector ROTV, and calculating the arc radius R formed by the line segment unit to compress it into a space circle or perform smooth compression processing; The step S4 is specifically as follows: S41, taking the whole of two adjacent processing line segments formed by three adjacent trajectory points as a line segment unit, firstly calculating the lengths d1 and d2 of the two processing line segments, and calculating the turning angle α between the two processing line segments by the following formula: P0P1* P1P2= |P0P1|* |P1P2|*cos(α) Wherein, P0P1 represents the line vector from trajectory point P0 to trajectory point P1, P1P2 represents the line vector from trajectory point P1 to trajectory point P2, the * symbol is the vector dot product, |P0P1| represents the length d1 from trajectory point P0 to trajectory point P1, |P1P2| represents the length d2 from trajectory point P1 to trajectory point P2; S42. For each trajectory point in the line segment unit, the rotation vector ROTV of each trajectory point is calculated according to the following formula: ROTV=θ*N Wherein, N is the rotation axis, θ is the rotation angle between the line vector P0P1 from the trajectory point P0 to the trajectory point P1 and the line vector P1P2 from the trajectory point P0 to the trajectory point P2; The above rotation axis and rotation angle are calculated according to the following formulas: N=V1×V2 θ=arccos((V1*V2) / (|V1|*|V2|)) Where: V1 is the line vector P0P1 from trajectory point P0 to trajectory point P1, V2 is the line vector P1P2 from trajectory point P0 to trajectory point P2, the × symbol represents vector cross product, the * symbol represents vector dot product, |V1| represents the modulus of vector V1, and |V2| represents the modulus of vector V2; S43, then the rotation vector ROTV of the three trajectory points in the integrated line segment unit is judged according to the following conditions: α>A ROTV0*ROTV1>0 ROTV1*ROTV2>0 Wherein, A represents the preset angle threshold; If the above conditions are all met at the same time, the three trajectory points P0, P1 and P2 in the line segment unit can form a circle, and step S44 is performed; If the above conditions are not met at the same time, a trajectory smoothing operation is performed and step S45 is performed; S44. Calculate the radius R of the arc formed by the line segment units according to the following formula: R=||P0P1||*||P1P2||*||P2P0|| / (2*||N||) Among them, ||P i P j || is the Euclidean distance between two trajectory points, i and j represent the sequence numbers of the trajectory points, and ||N|| is the modulus of the normal vector of the triangle formed by the three points, which is used to calculate the area of the triangle; The two processed line segments in the line segment unit are changed from straight line segments to arc line segments with a radius of R so that they are compressed into a space circle; S45, adding the adjacent track points before the track point P0 and the adjacent track points after the track point P2 to the line segment unit, and further judging according to the following conditions in combination with the line segment lengths between the adjacent track points among the five track points: ROTV0* ROTV1≤0 ROTV1* ROTV2≤0 (L1+ L2) <MIN(L0,L3) Wherein, L1 represents the length of the track segment between track point P0 and track point P1, L2 represents the length of the track segment between track point P0 and track point P2, L0 represents the length of the track segment between track point P0 and its adjacent track point before it, L3 represents the length of the track segment between track point P2 and its adjacent track point after P2, and MIN() represents the function of taking the minimum value of L0 and L3; If all three of the above conditions are met at the same time, smooth compression will be performed; If the above three conditions are not met at the same time, no smoothing compression will be performed; S5. Perform fitting processing on the processing trajectory after compression optimization.
2. The method for optimizing robot processing speed according to claim 1, characterized in that: The processing trajectory is composed of a plurality of trajectory points connected in sequence by processing line segments through connecting lines, both ends of each processing line segment are trajectory points, and the length l of each processing line segment and the angle a and height h of the triangle formed between each current processing line segment and the next processing line segment are calculated, wherein the angle a is the turning angle between the corresponding vector of the current processing line segment and the corresponding vector of the next processing line segment, and the height h is the height of the triangle formed by taking the current processing line segment and the next processing line segment as the two sides of the triangle respectively.
3. The method for optimizing robot processing speed according to claim 1, characterized in that: In step S2, the length, angle and height of the processed line segment are compared with the preset minimum line segment length L, triangle height H and angle A between line segments to determine whether to perform an elimination operation.
4. The method for optimizing robot processing speed according to claim 1, characterized in that: The step S2 is specifically as follows: First, compare the length l of the current processed line segment with the preset minimum line segment length L: If L > l, the current processed line segment is considered to be a tiny line segment, and the next processing step is performed; otherwise, the current processed line segment is considered not to be a tiny line segment, and the processing judgment of the next processed line segment is performed; Then, the angle a of the triangle corresponding to the current processed line segment is compared with the preset angle A between line segments, and the height h of the triangle corresponding to the current processed line segment is compared with the preset triangle height H: If a>A and H < h, no operation is performed on the trajectory points of the current processing line segment and the next processing line segment to maintain the integrity of the original trajectory between the current processing line segment and the next processing line segment; otherwise, the trajectory points between the current processing line segment and the next processing line segment are eliminated, that is, the trajectory points at the end of the current processing line segment are eliminated.
5. The method for optimizing robot processing speed according to claim 1, characterized in that: In step S3, the average processing speed of each processing line segment during pre-processing is determined by pre-processing with preset processing parameters in a data processing device in combination with the motion speed continuity, rotation vector, motion type, etc. of the trajectory segment: If the average processing speed of the processing line segment during pre-processing is less than the preset processing speed ratio threshold C, the trajectory point between the current processing line segment and the previous processing line segment is used as a breakpoint and marked; otherwise, no processing is performed.
6. The method for optimizing robot processing speed according to claim 1, characterized in that: The smooth compression process is specifically as follows: First, establish a line between the first trajectory point P0 in the line segment unit and its previous adjacent trajectory point as the first line, and a line between the third trajectory point P2 in the line segment unit and its subsequent adjacent trajectory point as the second line, and take the intersection point between the first line and the second line as the intersection point; Then, the midpoint of the line between the intersection point and the second track point P2 in the line segment unit is taken as the smoothing point, and the second track point P2 in the line segment unit is replaced by the smoothing point, thereby achieving smooth compression processing.
7. The method for optimizing robot processing speed according to claim 1, characterized in that: The step S5 specifically uses a cubic spline curve to perform overall fitting processing on the compression-optimized processing trajectory.
8. An electronic device, characterized in that: include: A memory, the memory being used to store a processing program; A processor, wherein when executing the processing program, the processor implements the processing speed optimization method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Machining method based on Bezier curve corner smooth transition algorithm
CN111061213A
Track fairing method for tiny line segments, medium and machine tool numerical control equipment
CN114488941A