Trajectory Compensation Method, Computer Device, and Computer Readable Storage Medium

By calculating the trajectory angle and queue compensation value in laser cutting, the target compensation value is automatically determined, which solves the problem of difficulty and low efficiency in obtaining queue compensation value, and achieves high-precision and efficient laser cutting.

CN115781039BActive Publication Date: 2025-08-05HANS LASER TECH IND GRP CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111055987.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-09
Publication Date
2025-08-05
Estimated Expiration
2041-09-09

AI Technical Summary

Technical Problem

During the laser cutting process, the acquisition of queue compensation values in the prior art is difficult and time-consuming, resulting in low processing efficiency and overcompensation phenomenon, resulting in scrapping of cutting boards and large economic losses.

Method used

By obtaining the original trajectory queue and queue compensation values, calculating the trajectory angle, determining the target compensation value based on the included angle and queue compensation values, compensating the trajectory to be processed, and storing it in the target compensation queue, realizing automated and accurate trajectory compensation.

Benefits of technology

It improves the accuracy and efficiency of laser cutting, reduces the operation difficulty and time of operators, avoids overcompensation, and ensures the accuracy of cutting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115781039B_ABST
    Figure CN115781039B_ABST
Patent Text Reader

Abstract

The present invention discloses a trajectory compensation method, computer device, and readable storage medium. The method comprises obtaining an original trajectory queue and a queue compensation value corresponding to the original trajectory queue, wherein the original trajectory queue includes at least two to-be-processed trajectories; determining two adjacent to-be-processed trajectories in the original trajectory queue as a first processing trajectory and a second processing trajectory, respectively, based on the trajectory connection sequence; calculating the trajectory angle between the first processing trajectory and the second processing trajectory; obtaining target compensation values corresponding to the first processing trajectory and the second processing trajectory based on the trajectory angle and the queue compensation value; compensating the first processing trajectory and the second processing trajectory using the target compensation value to obtain the first compensated trajectory and the second compensated trajectory; sequentially storing the first compensated trajectory and the second compensated trajectory in a target compensation queue based on the trajectory connection sequence; and processing a workpiece based on the target compensation queue to obtain a target workpiece. This trajectory compensation method can improve cutting accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of laser cutting technology, and in particular to a trajectory compensation method, computer equipment, and computer-readable storage medium. Background Art

[0002] During the actual laser cutting process, the operator is required to pre-set a queue compensation value in the CNC system to modify the NC trajectory program to process the sheet material to be cut. This method of setting the queue compensation value for processing is affected by the laser equipment and cutting environment. The queue compensation value often requires the operator to adjust it multiple times before it is obtained. This is difficult and time-consuming to obtain, resulting in low processing efficiency. If the queue compensation value set by the operator is too large, the NC trajectory program will undergo complex deformation, resulting in over-compensation, which can easily cause the cut sheet material to be scrapped and result in significant economic losses. Summary of the Invention

[0003] An embodiment of the present invention provides a trajectory compensation method to solve the problems of low processing efficiency and over-compensation during laser cutting.

[0004] A trajectory compensation method, comprising:

[0005] Acquire an original trajectory queue and a queue compensation value corresponding to the original trajectory queue, wherein the original trajectory queue includes at least two trajectories to be processed;

[0006] According to the trajectory connection order, two adjacent to-be-processed trajectories in the original trajectory queue are respectively determined as a first processing trajectory and a second processing trajectory;

[0007] Calculating a trajectory angle between the first processing trajectory and the second processing trajectory;

[0008] Based on the trajectory angle and the queue compensation value, obtaining target compensation values corresponding to the first processing trajectory and the second processing trajectory;

[0009] Using the target compensation value, performing compensation processing on the first processing trajectory and the second processing trajectory to obtain a first compensated trajectory and a second compensated trajectory;

[0010] storing the first compensation trajectory and the second compensation trajectory in a target compensation queue in sequence according to the trajectory connection order;

[0011] Based on the target compensation queue, the workpiece to be processed is processed to obtain a target workpiece.

[0012] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned trajectory compensation method are implemented.

[0013] A computer-readable storage medium stores a computer program, which implements the steps of the above-mentioned trajectory compensation method when executed by a processor.

[0014] The above-mentioned trajectory compensation method, computer device and computer-readable storage medium, based on the trajectory connection sequence, respectively determine the two adjacent to-be-processed trajectories in the original trajectory queue as the first processing trajectory and the second processing trajectory, so as to ensure that the processing order of the to-be-processed trajectories corresponds to the order of the to-be-processed trajectories in the NC trajectory program, so as to ensure that the cut plate can be accurately processed in the future and avoid errors. The trajectory angle between the first processing trajectory and the second processing trajectory is calculated to realize the automated determination of the trajectory angle, and provide technical support for the subsequent determination of the target compensation values of the first processing trajectory and the second processing trajectory based on the trajectory angle. Based on the trajectory angle and the queue compensation value, the target compensation values corresponding to the first processing trajectory and the second processing trajectory are obtained to ensure that the first processing trajectory and the second processing trajectory are subsequently compensated using accurate target compensation values to avoid over-compensation. The target compensation value is used to compensate the first and second processing trajectories, obtaining first and second compensation trajectories. This ensures that any two adjacent first and second processing trajectories can be compensated using the precise target compensation value, thereby improving subsequent laser cutting accuracy and avoiding overcompensation of some pending trajectories after compensation due to an excessively large set queue compensation value. This also reduces operator difficulty and time, improving laser cutting efficiency. Based on the trajectory connection sequence, the first and second compensation trajectories are sequentially stored in a target compensation queue. Based on the target compensation queue, the workpiece to be processed is processed to obtain a target workpiece, thereby improving processing accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0016] Figure 1 is a flow chart of a trajectory compensation method according to an embodiment of the present invention;

[0017] Figure 2 1 is a compensation diagram in which the first processing track and the second processing track are connected clockwise in one embodiment of the present invention;

[0018] Figure 3 1 is a compensation diagram in which the first processing track and the second processing track are connected counterclockwise in one embodiment of the present invention;

[0019] Figure 4 is another compensation schematic diagram of a first processing track and a second processing track connected clockwise in one embodiment of the present invention;

[0020] Figure 5 is another compensation schematic diagram of a first processing track and a second processing track connected counterclockwise in one embodiment of the present invention;

[0021] Figure 6 is another flow chart of a trajectory compensation method according to one embodiment of the present invention;

[0022] Figure 7 is another flow chart of a trajectory compensation method according to one embodiment of the present invention;

[0023] Figure 8 is another flow chart of a trajectory compensation method according to one embodiment of the present invention;

[0024] Figure 9 is another flow chart of a trajectory compensation method according to one embodiment of the present invention;

[0025] Figure 10 is a schematic diagram of determining a compensation limit value in one embodiment of the present invention;

[0026] Figure 11 is another flow chart of a trajectory compensation method according to one embodiment of the present invention;

[0027] Figure 12 is another flow chart of a trajectory compensation method according to one embodiment of the present invention;

[0028] Figure 13 is another flow chart of a trajectory compensation method according to one embodiment of the present invention;

[0029] Figure 14 is another flow chart of a trajectory compensation method according to one embodiment of the present invention;

[0030] Figure 15 is another flow chart of a trajectory compensation method according to one embodiment of the present invention;

[0031] Figure 16 is another flow chart of a trajectory compensation method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0033] like Figure 1 As shown, this embodiment provides a trajectory compensation method, including the following steps:

[0034] S101: Acquire an original trajectory queue and a queue compensation value corresponding to the original trajectory queue, where the original trajectory queue includes at least two trajectories to be processed.

[0035] The original trajectory queue refers to a queue containing at least two trajectories to be processed.

[0036] The queue compensation value is preset by the operator and is used to compensate all pending trajectories in the original trajectory queue.

[0037] The trajectory to be processed is the trajectory compiled by the operator based on the cut plate.

[0038] In this embodiment, the compiler parses the NC trajectory program pre-compiled by the operator to obtain all pending trajectories and queue compensation values in the NC trajectory program; and stores the pending trajectories in the blank queue in sequence according to the trajectory connection order of the pending trajectories in the NC trajectory program, forming an original trajectory queue. The NC trajectory program is the abbreviation of the Numerical Control trajectory program, which means an automated control program. The trajectory connection order refers to the order of the pending trajectories in the NC trajectory program, which can be understood as the processing order of the pending trajectories in the actual laser cutting process.

[0039] S102: According to the trajectory connection sequence, two adjacent to-be-processed trajectories in the original trajectory queue are respectively determined as a first processing trajectory and a second processing trajectory.

[0040] As an example, each pending track carries a status flag, which is used to determine whether the pending track has been processed. The status flag includes a processed state and a pending state. The processed state means that the pending track has been processed; the pending state means that the pending track has not been processed.

[0041] Specifically, the compiler traverses the original trajectory queue and determines the first processing trajectory and the second processing trajectory according to the status identification of the trajectory to be processed and the trajectory connection order, so as to ensure that the processing order of the trajectory to be processed corresponds to the order of the trajectory to be processed in the NC trajectory program, so as to ensure that the cut plate can be processed accurately in the future and avoid errors.

[0042] Furthermore, according to the state identifier of the pending track and the track connection sequence, the first processing track and the second processing track are determined, including: judging whether there is a pending track with a processed state; if there is a pending track with a processed state, the pending track corresponding to the last processed state in the original track queue is determined as the first processing track; according to the track connection sequence, the next pending track corresponding to the processed state (i.e., the first pending track in the original track queue with a pending state) is determined as the second processing track, ensuring that the subsequent adjacent first compensation track and second compensation track have continuity, avoiding the situation where adjacent tracks are not connected and incorrect processing occurs. If the state identifier of the pending track does not have a processed state, then according to the track connection sequence, the first pending track at the head of the original track queue (the pending track corresponding to the pending state) is determined as the first processing track, and the second pending track (the pending track corresponding to the pending state) is determined as the second processing track. In this embodiment, the state identifier and the track connection sequence are used to obtain the first processing track and the second processing track from the original track queue to ensure that the compiler can automatically process the pending track, improve the degree of automation, and speed up processing efficiency. The first compensation trajectory is a trajectory obtained after compensation processing is performed on the first processing trajectory; the second compensation trajectory is a trajectory obtained after compensation processing is performed on the second processing trajectory.

[0043] S103: Calculate the included angle between the first processing trajectory and the second processing trajectory.

[0044] The trajectory angle refers to the angle formed by the first processing trajectory and the second processing trajectory.

[0045] In this embodiment, the first processing trajectory is processed to obtain a first processing parameter; the second processing trajectory is processed to obtain a second processing parameter; the first processing parameter and the second processing parameter are input into the angle calculation formula to automatically determine the trajectory angle, providing technical support for subsequently determining the target compensation values of the first and second processing trajectories based on the trajectory angle. The first processing parameter and the second processing parameter are parameters used to calculate the trajectory angle. The first processing parameter can be a first vector corresponding to the first processing trajectory; the second processing parameter can be a second vector corresponding to the second processing trajectory.

[0046] S104: Based on the trajectory angle and the queue compensation value, obtain target compensation values corresponding to the first processing trajectory and the second processing trajectory.

[0047] The target compensation value is a value used to perform compensation processing on the first processing trajectory and the second processing trajectory.

[0048] Generally, when the angle between the first processing trajectory and the trajectory corresponding to the second processing is less than π, if an excessively large queue compensation value is used to compensate the first processing trajectory and the second processing, the compensation trajectories may not intersect, resulting in over-compensation.

[0049] The process analysis of compensation in the case where both the first processing trajectory and the second processing trajectory are line segment trajectories is as follows: When the queue compensation value set by the operator does not exceed the limit compensation value, Figure 2 As shown, when the queue compensation value does not exceed the limit compensation value, the first processing trajectory ab and the second processing trajectory bc are connected clockwise, and the compensation result diagram of the left compensation instruction and the right compensation instruction.

[0050] Specifically, the compensation trajectory of the left compensation instruction is the clockwise connected line segment a1b1-arc b1b2-line segment b2c1; when the queue compensation value set by the operator does not exceed the limit compensation value, the clockwise trajectory compensation process is: the first processing trajectory ab uses the queue compensation value as the translation distance, and translates to the left in the direction of the normal vector to obtain the first compensation trajectory a1b1; the second processing trajectory bc uses the queue compensation value as the translation distance, and translates to the left in the direction of the normal vector to obtain the second compensation trajectory b2c1; then, with the connection point b of the first processing trajectory ab and the second processing trajectory b as the center of the circle and the queue compensation value as the radius, an arc b1b2 is drawn clockwise as the connecting trajectory of the first compensation trajectory a1b1 and the second compensation trajectory b2c1. Figure 2 The compensation trajectory of the right compensation instruction is the clockwise connecting line segment a2b2-line segment b2c2. The trajectory compensation process is as follows: the first processing trajectory ab uses the queue compensation value as the translation distance and translates to the right in the direction of the normal vector to obtain the first compensation trajectory a2b3; the second processing trajectory bc uses the queue compensation value as the translation distance and translates to the right in the direction of the normal vector to obtain the second compensation trajectory b3c2; then the intersection b3 of the first compensation trajectory a2b3 and the second compensation trajectory b3c2 is calculated, and the intersection b3 is used as the connection point of the first compensation trajectory a2b3 and the second compensation trajectory b3c2.

[0051] like Figure 3 As shown in the figure, when the queue compensation value does not exceed the limit compensation value, the compensation results of the left compensation instruction and the right compensation instruction are shown when the first processing trajectory ab and the second processing trajectory bc are connected counterclockwise. The limit compensation value is the maximum compensation value that ensures that the first processing trajectory and the second processing trajectory do not overcompensate.

[0052] Specifically, when the operator's set queue compensation value does not exceed the limit compensation value, the counterclockwise trajectory compensation process is as follows: the left compensation command compensation trajectory is the counterclockwise connection between line segment a2b2 and line segment b2c2. Specifically, the first processing trajectory ab is translated leftward in the direction of the normal vector using the queue compensation value as the translation distance, resulting in the first compensation trajectory a2b3. The second processing trajectory bc is translated leftward in the direction of the normal vector using the queue compensation value as the translation distance, resulting in the second compensation trajectory b3c2. Next, the intersection point b3 of the first compensation trajectory a2b3 and the second compensation trajectory b3c2 is calculated, and the intersection point b3 is used as the connection point between the first compensation trajectory a2b3 and the second compensation trajectory b3c2.

[0053] Figure 3 The right compensation command's compensation trajectory is a counterclockwise connection between line segment a1b1, arc b1b2, and line segment b2c1. Specifically, the first processed trajectory ab is translated leftward in the direction of the normal vector using the queue compensation value as the translation distance, resulting in the first compensation trajectory a1b1. The second processed trajectory bc is translated leftward in the direction of the normal vector using the queue compensation value as the translation distance, resulting in the second compensation trajectory b2c1. Next, with the connecting point b between the first and second processed trajectories ab and b as the center and the queue compensation value as the radius, an arc b1b2 is drawn counterclockwise, connecting the first and second compensation trajectories a1b1 and b2c1.

[0054] When the queue compensation value set by the operator exceeds the limit compensation value, such as Figure 4 As shown in FIG, the compensation result diagram of the left compensation instruction and the right compensation instruction when the first processing trajectory ab and the second processing trajectory bc are connected clockwise. Specifically, the compensation trajectory of the left compensation instruction is connected to the Figure 2 The compensation trajectory of the left compensation instruction is similar, consisting of a clockwise connecting line segment a1b1-arc b1b2-line segment b2c1. Figure 4 The right compensation instruction compensation trajectory is composed of the clockwise connecting line a2b3-arc b3b4-line segment b4c2, which is consistent with Figure 2 The right compensation command's compensation trajectory differs. This occurs because the first compensation trajectory a2b3, obtained by the first processed trajectory ab, and the second compensation trajectory b4c2, obtained by the second processed trajectory bc, do not intersect. To ensure continuity between adjacent compensation trajectories, an arc b3b4 is drawn counterclockwise, with center b as the circle and the alignment compensation value as the radius, between the first compensation trajectory a2b3 and the second compensation trajectory b4c2. This arc serves as the connecting trajectory for compensation segments a2b3 and b4c2. This phenomenon is called overcompensation.

[0055] like Figure 5 As shown, the compensation result diagram of the left compensation instruction and the right compensation instruction when the first processing trajectory ab and the second processing trajectory bc are connected counterclockwise.

[0056] Specifically, Figure 5 Right compensation command compensation trajectory and Figure 3 The right compensation instruction trajectory is similar, consisting of counterclockwise connecting line segment a1b1-arc b1b2-line segment b2c1. Figure 5 The left compensation command compensation trajectory and Figure 3 The left compensation command has a different compensation trajectory.

[0057] Among them, the left compensation instruction is an instruction to compensate the first processing trajectory and the second processing trajectory from the left side of the first processing trajectory and the second processing trajectory; the right compensation instruction is an instruction to compensate the first processing trajectory and the second processing trajectory to the right side of the first processing trajectory and the second processing trajectory.

[0058] Specifically, when the track angle is less than π, the target compensation value is calculated based on the track angle. When the track angle is not less than π, the queue compensation value is determined as the target compensation value.

[0059] In this embodiment, target compensation values of the first and second processing trajectories are determined according to the trajectory angle and the queue compensation value, so as to ensure that the first and second processing trajectories are subsequently compensated with accurate target compensation values to avoid over-compensation.

[0060] S105: Using the target compensation value, performing compensation processing on the first processing trajectory and the second processing trajectory to obtain a first compensated trajectory and a second compensated trajectory.

[0061] The first compensation trajectory is a trajectory obtained by compensating the first processing trajectory using the target compensation value, and the second compensation trajectory is a trajectory obtained by compensating the second processing trajectory using the target compensation value.

[0062] In this embodiment, by processing the trajectory angle and the queue compensation value, the target compensation value corresponding to the first processing trajectory and the second processing trajectory is obtained, and the target compensation value matching any two adjacent trajectories to be processed is automatically determined, ensuring that accurate target compensation values can be used to compensate any two adjacent first processing trajectories and second processing trajectories, so as to improve the subsequent laser cutting accuracy and avoid over-compensation of some trajectories to be processed after compensation processing due to the set queue compensation value being too large; and it can reduce the operation difficulty and operation time of the operator and improve the laser cutting efficiency.

[0063] S106: storing the first compensation trajectory and the second compensation trajectory in the target compensation queue in sequence according to the trajectory connection sequence.

[0064] The target compensation queue is a queue for storing compensated trajectories formed after the trajectories to be processed are compensated. It can be understood that the compensated trajectories in the target compensation queue correspond one-to-one to the trajectories to be processed in the original trajectory queue.

[0065] In this embodiment, the first compensation trajectory and the second compensation trajectory are sequentially stored in the target compensation queue according to the trajectory connection order; the original trajectory queue is checked to see whether there is a pending trajectory corresponding to the pending identifier. If there is a pending trajectory corresponding to the pending identifier in the original trajectory queue, steps S102-S106 are repeated until the status identifiers corresponding to all pending trajectories in the original trajectory queue are processed identifiers.

[0066] S107: Based on the target compensation queue, the workpiece to be processed is processed to obtain the target workpiece.

[0067] In this embodiment, after all the to-be-processed trajectories are processed, the workpiece is processed according to the compensation trajectories in the target compensation queue to obtain a target workpiece, thereby improving the processing accuracy.

[0068] The trajectory compensation method provided in this embodiment determines the two adjacent to-be-processed trajectories in the original trajectory queue as the first processing trajectory and the second processing trajectory, respectively, based on the trajectory connection sequence, to ensure that the processing order of the to-be-processed trajectories corresponds to the order of the to-be-processed trajectories in the NC trajectory program, so as to ensure that the cut plate can be accurately processed in the future and avoid errors. The trajectory angle between the first processing trajectory and the second processing trajectory is calculated to achieve automated determination of the trajectory angle, providing technical support for the subsequent determination of the target compensation values of the first processing trajectory and the second processing trajectory based on the trajectory angle. Based on the trajectory angle and the queue compensation value, the target compensation values corresponding to the first processing trajectory and the second processing trajectory are obtained to ensure that the first processing trajectory and the second processing trajectory are subsequently compensated using accurate target compensation values to avoid over-compensation. The target compensation value is used to compensate the first and second processing trajectories, obtaining the first and second compensation trajectories. This ensures that any two adjacent first and second processing trajectories can be compensated using the precise target compensation value, thereby improving subsequent laser cutting accuracy and avoiding overcompensation of some pending trajectories after compensation due to excessively large queue compensation values. This also reduces operator difficulty and time, improving laser cutting efficiency. Based on the trajectory connection sequence, the first and second compensation trajectories are sequentially stored in the target compensation queue. Based on the target compensation queue, the workpiece is processed to obtain the target workpiece, thereby improving processing accuracy.

[0069] As an example, Figure 6As shown, step S101, i.e. obtaining the original trajectory queue and the queue compensation value corresponding to the original trajectory queue, includes:

[0070] S201: Acquire the NC trajectory program and detect whether there is a spot compensation start instruction and a spot compensation cancel instruction in the NC trajectory program.

[0071] The spot compensation start instruction is an instruction to start compensating the trajectory to be processed. The spot compensation cancel instruction is an instruction to end compensating the trajectory to be processed. For example, the spot compensation start instruction can be begin; and the spot compensation cancel instruction can be end.

[0072] In this embodiment, the compiler traverses the NC trajectory program to automatically detect whether there is a spot compensation start instruction and a spot compensation cancel instruction in the NC trajectory program.

[0073] S202: If a spot compensation start instruction and a spot compensation cancel instruction exist in the NC trajectory program, at least two to-be-processed trajectories located between the spot compensation start instruction and the spot compensation cancel instruction are acquired.

[0074] S203: Acquire an original trajectory queue based on at least two to-be-processed trajectories.

[0075] S204: Obtain a queue compensation value from the NC trajectory program.

[0076] In this embodiment, when it is detected that there are spot compensation start instructions and spot compensation cancel instructions in the NC trajectory program, all pending trajectories between the spot compensation start instructions and the spot compensation cancel instructions are stored in a blank queue in sequence to form an original trajectory queue, so as to ensure that the order in which the pending trajectories are processed corresponds to the order in which the pending trajectories are processed in the NC trajectory program; and the queue compensation value corresponding to the original trajectory queue pre-compiled by the operator is obtained from the NC trajectory program, and the queue compensation value can be used subsequently to obtain the target compensation value that meets different pending trajectories to obtain the compensated trajectory, thereby ensuring that any adjacent compensated trajectories can be correctly connected to avoid over-compensation.

[0077] The trajectory compensation method provided in this embodiment obtains an NC trajectory program and detects whether there is a spot compensation start instruction and a spot compensation cancel instruction in the NC trajectory program; if the spot compensation start instruction and the spot compensation cancel instruction exist in the NC trajectory program, at least two to-be-processed trajectories located between the spot compensation start instruction and the spot compensation cancel instruction are obtained; based on the at least two to-be-processed trajectories, an original trajectory queue is obtained; and a queue compensation value is obtained from the NC trajectory program. The queue compensation value can then be used to obtain a target compensation value that satisfies different to-be-processed trajectories to obtain a compensated trajectory, thereby ensuring that any adjacent compensated trajectories can be correctly connected to avoid over-compensation.

[0078] As an example, Figure 7 As shown, step S103, i.e., calculating the included angle between the first processing trajectory and the second processing trajectory, includes:

[0079] S301: Obtain a first vector corresponding to a first processing trajectory, and obtain a second vector corresponding to a second processing trajectory.

[0080] S302: Multiply the first vector and the second vector to obtain a vector product.

[0081] Specifically, the first vector and the second vector are multiplied by a vector cross multiplication formula to obtain a vector product.

[0082] S303: Acquire trajectory directions corresponding to the first processing trajectory and the second processing trajectory based on the first vector and the second vector.

[0083] The trajectory direction indicates a direction formed by the vector direction of the first processing trajectory and the vector direction of the second processing trajectory.

[0084] Specifically, when the first vector corresponding to the first processing trajectory is The second vector corresponding to the second processing trajectory is Then the trajectory direction corresponding to the first processing trajectory and the second processing trajectory is the first direction, that is, the first direction is a pointing to b, and b pointing to c;

[0085] The first vector corresponding to the first processing trajectory is The second vector corresponding to the second processing trajectory is Then the trajectory direction corresponding to the first processing trajectory and the second processing trajectory is the second direction, that is, the second direction is b pointing to a, and b pointing to c.

[0086] S304: Calculate the first vector and the second vector according to the angle calculation formula to obtain the vector angle.

[0087] The angle calculation formula is a formula for calculating the vector angle. In this embodiment, the angle calculation formula is an arc cosine function, which speeds up the acquisition of the vector angle.

[0088] The vector angle is the angle calculated according to the angle calculation formula.

[0089] S305: Based on the trajectory direction, the vector product and the vector angle, obtain the trajectory angle corresponding to the first processing trajectory and the second processing trajectory.

[0090] In this embodiment, the angle calculation formula is the arccosine function. From the characteristics of the arccosine function, it can be known that the value range of the vector angle calculated by using the arccosine function is [0,π]. However, from actual applications, it can be known that the value range of the trajectory angle is [0,2π]. Therefore, in this embodiment, the trajectory direction, vector product and vector angle are used to jointly determine the trajectory angle corresponding to the first processing trajectory and the second processing trajectory to ensure the correctness of the trajectory angle and avoid the situation where the trajectory angle calculated by the arccosine function is incorrect when the first processing trajectory and the second processing trajectory rotate counterclockwise.

[0091] The trajectory compensation method provided in this embodiment obtains a first vector corresponding to the first processing trajectory and a second vector corresponding to the second processing trajectory; multiplies the first vector and the second vector to obtain a vector product; calculates the first vector and the second vector according to an angle calculation formula to obtain the vector angle, thereby accelerating the acquisition of the vector angle; and obtains the trajectory angle corresponding to the first processing trajectory and the second processing trajectory based on the trajectory direction, the vector product, and the vector angle, thereby ensuring the correctness of the trajectory angle and avoiding the situation where an incorrect trajectory angle is obtained by using the inverse cosine function when the first processing trajectory and the second processing trajectory rotate counterclockwise.

[0092] As an embodiment, the trajectory direction includes a first direction and a second direction; Figure 8 As shown, step S304, i.e., obtaining the trajectory angle corresponding to the first processing trajectory and the second processing trajectory based on the trajectory direction, the vector product and the vector angle, includes:

[0093] S401: When the trajectory direction is the first direction, determine whether the vector product is less than 0.

[0094] S402: If the vector product is less than 0, the difference between 2π and the vector angle is determined as the trajectory angle corresponding to the first processing trajectory and the second processing trajectory.

[0095] S403: If the vector product is not less than 0, the vector angle is determined as the trajectory angle corresponding to the first processing trajectory and the second processing trajectory.

[0096] Specifically, when the first vector corresponding to the first processing trajectory is The second vector corresponding to the first processed trajectory is Then the trajectory direction corresponding to the first processing trajectory and the second processing trajectory is the first direction, that is, the first direction is a pointing to b, and b pointing to c; according to the "right-hand rule to determine the direction", when the vector product is less than 0, it means that the rotation direction of the first vector and the second vector is clockwise, and the trajectory angle is greater than π. Therefore, the difference between 2π and the vector angle is determined as the trajectory angle corresponding to the first processing trajectory and the second processing trajectory; when the vector product is not less than 0, it means that the rotation direction of the first vector and the second vector is counterclockwise. At this time, the trajectory angle is not greater than π. Therefore, the vector angle is determined as the trajectory angle corresponding to the first processing trajectory and the second processing trajectory.

[0097] S404: When the trajectory direction is the second direction, determine whether the vector product is less than 0.

[0098] S405: If the vector product is less than 0, the vector angle is determined as the trajectory angle corresponding to the first processing trajectory and the second processing trajectory.

[0099] S406: If the vector product is not less than 0, the difference between 2π and the vector angle is determined as the trajectory angle corresponding to the first processing trajectory and the second processing trajectory.

[0100] Specifically, when the first vector corresponding to the first processing trajectory is The second vector corresponding to the second processing trajectory is Then the trajectory direction corresponding to the first processing trajectory and the second processing trajectory is the second direction, that is, the second direction is b pointing to a, and b pointing to c; according to the "right-hand rule to determine the direction", when the vector product is less than 0, it means that the rotation direction of the first vector and the second vector is counterclockwise, and the trajectory angle is not greater than π, so the initial angle is equal to the trajectory angle; when the vector product is not less than 0, it means that the rotation direction of the first vector and the second vector is clockwise, and the trajectory angle is greater than π, so the trajectory angle is the difference between 2π and the vector angle.

[0101] In the trajectory compensation method provided in this embodiment, when the vector product is less than 0, the difference between 2π and the vector angle is determined as the trajectory angle corresponding to the first and second processed trajectories. If the vector product is not less than 0, the vector angle is determined as the trajectory angle corresponding to the first and second processed trajectories. The vector product determines the trajectory angle corresponding to the first and second processed trajectories to ensure the accuracy of the trajectory angle, avoiding angle errors that may occur when calculating only using the inverse cosine function.

[0102] As an example, Figure 9 As shown, step S104, i.e., obtaining target compensation values corresponding to the first processing trajectory and the second processing trajectory based on the trajectory angle and the queue compensation value, includes:

[0103] S501: If the trajectory angle is less than π, obtain a first trajectory length corresponding to the first processed trajectory and a second trajectory length corresponding to the second processed trajectory.

[0104] The first track length is the length corresponding to the first processing track, and the second track length is the length corresponding to the second processing track.

[0105] S502: Obtaining a compensation limit value according to the first track length, the second track length, and the track angle.

[0106] The compensation limit value refers to the maximum queue compensation value adapted to the first trajectory length and the second processing trajectory.

[0107] Generally, when the angle between the first processing trajectory and the trajectory corresponding to the second processing is less than π, if an excessively large queue compensation value is used to compensate the first processing trajectory and the second processing, the compensation trajectories may not intersect, resulting in over-compensation.

[0108] In this embodiment, when the angle between the trajectories corresponding to the first processing trajectory and the second processing trajectory is less than π, in order to ensure that the first processing trajectory and the second processing trajectory can be accurately compensated normally, the compensation limit value is determined in advance based on the first trajectory length, the second trajectory length and the trajectory angle, that is, the maximum compensation value applicable to the first processing trajectory and the second processing trajectory is determined; and it is determined whether the queue compensation value exceeds the compensation limit value to ensure that the first processing trajectory and the second processing trajectory can be accurately compensated subsequently.

[0109] S503: Determine a target compensation value based on the compensation limit value and the queue compensation value.

[0110] In this embodiment, by comparing the compensation limit value and the queue compensation value, when the queue compensation value is not greater than the compensation limit value, the queue compensation value is determined as the target compensation value; when the queue compensation value is greater than the compensation limit value, the compensation limit value is determined as the target compensation value to ensure the accuracy of the target compensation value. Subsequently, the first processing trajectory and the second processing trajectory can be compensated based on the precise target compensation value to avoid over-compensation.

[0111] S504: If the trajectory angle is not less than π, the queue compensation value is determined as the target compensation value.

[0112] In this embodiment, when the trajectory angle is not less than π, over-compensation will not occur. Therefore, at this time, the queue compensation value is determined as the target compensation value to speed up the determination of the target compensation value and ensure that the first processing trajectory and the second processing trajectory are compensated according to the precise target compensation value to avoid over-compensation.

[0113] In the trajectory compensation method provided in this embodiment, when the trajectory angle is less than π, the first trajectory length corresponding to the first processing trajectory and the second trajectory length corresponding to the second processing trajectory are obtained. Based on the first trajectory length, the second trajectory length and the trajectory angle, the compensation limit value is obtained to ensure that the first processing trajectory and the second processing trajectory can be accurately compensated in the future. Based on the compensation limit value and the queue compensation value, the target compensation value is determined to ensure the accuracy of the target compensation value. The first processing trajectory and the second processing trajectory can be compensated in accordance with the precise target compensation value to avoid over-compensation. When the trajectory angle is not less than π, the queue compensation value is determined as the target compensation value to speed up the determination of the target compensation value, ensuring that the first processing trajectory and the second processing trajectory can be compensated in accordance with the precise target compensation value to avoid over-compensation.

[0114] As an example, Figure 11 As shown, step S502, i.e., obtaining a compensation limit value according to the first track length, the second track length, and the track angle, includes:

[0115] S601: Determine the smaller value of the first track length and the second track length as a compensation parameter.

[0116] The compensation parameter is a parameter used to calculate the compensation limit value.

[0117] S602: Calculate the trajectory angle and compensation parameters using the compensation limit formula to obtain a compensation limit value.

[0118] The compensation limit formula is a formula used to calculate the compensation limit value.

[0119] like Figure 4 and Figure 5 As shown, when the first processing trajectory ab and the second processing trajectory bc are translated to a1b1 and b2c1 respectively after the queue compensation value, according to the translation condition, it can be known that L ab =L a1b1 ,L bc =L b2c2 , L ab2 +L b2p1 =L b2p1 +L p1c1 =L bc ,L a1p1 +L b1p1 =L b1c +L p1b1 =L ab Therefore, when the queue compensation value does not exceed the compensation limit value, the first compensation trajectory and the second compensation trajectory have an intersection point p1. Figure 10 As shown, ∠1+∠2+∠3+∠4=α. According to the translation condition, Right now Therefore, ∠1=∠4; and RtΔb2bp1 and RtΔb1bp1 are congruent, so ∠2=∠3, ∠5=∠6; According to the translation condition, Then in RtΔb2bp1 and RtΔb1bp1, When the queue compensation value does not exceed the compensation limit, the intersection point p1 of the first compensation trajectory and the second compensation trajectory falls on point a1 or point c1; if the queue compensation value exceeds the compensation limit, p1 does not exist; therefore, the compensation limit formula is used. The compensation limit value is calculated, where transV is the compensation limit value. Figure 10 In the example, transV is edge b2b or edge b1b, L min The compensation parameters are used to ensure that the compensation limit value can meet the compensation requirements of the first processing trajectory and the second processing trajectory to avoid over-compensation.

[0120] The trajectory compensation method provided in this embodiment determines the smaller of the first and second trajectory lengths as the compensation parameter. A compensation limit formula is used to calculate the trajectory angle and the compensation parameter to obtain a compensation limit value. This ensures that the compensation limit value satisfies the compensation requirements for the first and second processed trajectories, preventing overcompensation.

[0121] As an example, Figure 12 As shown, step S503, i.e. determining a target compensation value based on the compensation limit value and the queue compensation value, includes:

[0122] S701: Determine whether the first processed trajectory and the second processed trajectory are arc-shaped trajectories.

[0123] S702: If either the first processing trajectory or the second processing trajectory is a circular arc trajectory, obtain a trajectory radius corresponding to the circular arc trajectory.

[0124] The trajectory radius refers to the radius corresponding to the arc trajectory.

[0125] S703: Determine the minimum value among the compensation limit value, the queue compensation value, and the trajectory radius as the target compensation value.

[0126] In this embodiment, when either the first processing trajectory or the second processing trajectory is an arc-shaped trajectory, in order to avoid over-compensation, when calculating the target compensation value, it is also necessary to determine the trajectory radius of the arc trajectory, that is, to determine the minimum value among the trajectory radius, the compensation limit value and the queue compensation value as the target compensation value.

[0127] Specifically, the target compensation value is obtained by multiplying the minimum value among the compensation limit value, the queue compensation value, and the trajectory radius by the limit ratio, where the limit ratio is a preset ratio, for example, 0.95.

[0128] Furthermore, the first and second processing trajectories also carry direction compensation instructions, which include left compensation instructions and right compensation instructions. The direction compensation instructions are used to indicate the direction in which the first and second processing trajectories should be compensated. The left compensation instruction instructs the first and second processing trajectories to be compensated from the left side of the first and second processing trajectories; the right compensation instruction instructs the first and second processing trajectories to be compensated to the right side of the first and second processing trajectories.

[0129] If the direction compensation instruction corresponding to the first processing trajectory and the second processing trajectory is a left compensation instruction, the target compensation value is the product of the limit ratio and the minimum value among the compensation limit value, the queue compensation value and the trajectory radius; for example, the limit ratio is setRatio, and the value of the setRatio can be adjusted according to actual conditions, for example, the value of the setRatio is 0.95, etc.; the compensation limit value is transV, the queue compensation value is tmpV, and the trajectory radius is R C ; The minimum value among the compensation limit value, queue compensation value and trajectory radius is min(tmpV,transV,R C ), at this time, the target compensation value is equal to the target compensation value = setRatio*min(tmpV, transV, R C ),

[0130] If the direction compensation instruction corresponding to the first processing trajectory and the second processing trajectory is a right compensation instruction, the target compensation value is the negative value of the product of the limit ratio and the minimum value among the compensation limit value, the queue compensation value and the trajectory radius; for example, the limit ratio is setRatio; the compensation limit value is transV, the queue compensation value is tmpV, and the trajectory radius is R C ; The minimum value among the compensation limit value, queue compensation value and trajectory radius is min(tmpV, transV, R C ), at this time, the target compensation value is equal to the target compensation value = -setRatio*min(tmpV,transV,R C ).

[0131] S704: If neither the first processing trajectory nor the second processing trajectory is an arc trajectory, a smaller value between the compensation limit value and the queue compensation value is determined as the target compensation value.

[0132] If the direction compensation instructions corresponding to the first processing trajectory and the second processing trajectory are left compensation instructions, then the target compensation value is the product of the limit ratio and the minimum value among the compensation limit value, the queue compensation value and the trajectory radius; exemplarily, the limit ratio is setRatio; the compensation limit value is transV, and the queue compensation value is tmpV; then the minimum value among the compensation limit value, the queue compensation value and the trajectory radius is min(tmpV, transV), at this time, the target compensation value is equal to the target compensation value = setRatio*min(tmpV, transV).

[0133] If the direction compensation instructions corresponding to the first processing trajectory and the second processing trajectory are right compensation instructions, then the target compensation value is the negative value of the product of the limit ratio and the minimum value among the compensation limit value, the queue compensation value and the trajectory radius; exemplarily, the limit ratio is setRatio; the compensation limit value is transV, and the queue compensation value is tmpV; then the minimum value among the compensation limit value, the queue compensation value and the trajectory radius is min(tmpV, transV), at this time, the target compensation value is equal to the target compensation value = -setRatio*min(tmpV, transV).

[0134] In the trajectory compensation method provided in this embodiment, if either the first or second processed trajectory is an arc-shaped trajectory, the trajectory radius corresponding to the arc-shaped trajectory is obtained; the minimum of the compensation limit value, the queue compensation value, and the trajectory radius is determined as the target compensation value; if neither the first or second processed trajectory is an arc-shaped trajectory, the smaller of the compensation limit value and the queue compensation value is determined as the target compensation value. Whether the first or second processed trajectory is an arc-shaped trajectory is considered separately, ensuring that the final target compensation value does not exceed the limit compensation value, thereby ensuring that the first and second compensated trajectories can be accurately connected and avoiding overcompensation.

[0135] As an example, Figure 13 As shown, step S106, that is, storing the first compensation trajectory and the second compensation trajectory in the target compensation queue in sequence according to the trajectory connection order, includes:

[0136] S801: Determine whether the first compensation trajectory is stored in the target compensation queue.

[0137] In this embodiment, when the compiler obtains the first compensation trajectory, it queries the target compensation queue to determine whether the target compensation queue stores the first compensation trajectory, providing technical support for subsequent determination of the second compensation trajectory.

[0138] Specifically, when the first compensation trajectory is not stored in the target compensation queue, it means that the first compensation trajectory is obtained by the first compensation process; when the first compensation trajectory is stored in the target compensation queue, it means that the first compensation trajectory is not obtained by the first compensation process.

[0139] In this embodiment, the pending trajectory carries a trajectory identifier, and the compensated trajectory carries a compensated trajectory identifier, with the trajectory identifier and the compensated trajectory identifier corresponding one-to-one. For example, when the original trajectory queue includes three pending trajectories, namely, pending trajectory 1, pending trajectory 2, and pending trajectory 3, during the first compensation process, pending trajectory 1 is determined as the first processing trajectory, and pending trajectory 2 is determined as the second processing trajectory. The first compensated trajectory obtained from the first processing trajectory has a compensated trajectory identifier of 1; the second compensated trajectory obtained from the second processing trajectory has a compensated trajectory identifier of 2, and the first compensated trajectory 1 and the second compensated trajectory 2 are stored in the target compensation queue. During the second compensation process, pending trajectory 2 is determined as the first processing trajectory, and pending trajectory 3 is determined as the second processing trajectory. The first compensated trajectory obtained from processing pending trajectory 2 has a compensated trajectory identifier of 2; the second compensated trajectory obtained from the second processing trajectory has a compensated trajectory identifier of 3, and the first compensated trajectory 2 and the second compensated trajectory 3 are stored in the target compensation queue.

[0140] S802: If the first compensation trajectory is stored in the target compensation queue, obtain a current compensation identifier.

[0141] The current compensation identifier is an identifier for indicating a connection mode between the first compensation track and the second compensation track.

[0142] Specifically, when the first compensation trajectory is stored in the target compensation queue, the current compensation identifier corresponding to the first compensation identifier and the second compensation identifier is obtained, so as to determine the connection mode of the first compensation trajectory and the second compensation trajectory according to the current compensation identifier.

[0143] S803: If the first compensation trajectory is not stored in the target compensation queue, the first compensation trajectory is stored in the target compensation queue, and a current compensation identifier is obtained.

[0144] Specifically, when the first compensation trajectory is not stored in the target compensation queue, the first compensation trajectory is stored in the target compensation queue, and the current compensation identifier corresponding to the first compensation identifier and the second compensation identifier is obtained, so as to determine the connection method of the first compensation trajectory and the second compensation trajectory according to the current compensation identifier.

[0145] S804: Determine the target processing logic corresponding to the second compensation trajectory according to the current compensation identifier, execute the target processing logic corresponding to the second compensation trajectory, and store the second compensation trajectory in the target compensation queue.

[0146] The target processing logic is a logic for determining a connection method between the first compensation queue and the second compensation queue.

[0147] In this embodiment, when the current compensation identifier is obtained, the target processing logic is executed to determine the connection method of the first compensation trajectory and the second compensation trajectory, and the second compensation trajectory is stored in the target compensation queue. In this embodiment, the target processing logic is determined by the current compensation identifier to accurately determine the connection method of the first compensation trajectory and the second compensation trajectory, providing technical support for subsequent laser cutting and improving the cutting accuracy of laser cutting.

[0148] In the trajectory compensation method provided in this embodiment, if the first compensation trajectory is stored in the target compensation queue, the current compensation identifier is obtained. If the first compensation trajectory is not stored in the target compensation queue, the first compensation trajectory is stored in the target compensation queue and the current compensation identifier is obtained. Based on the current compensation identifier, the target processing logic corresponding to the second compensation trajectory is determined, the target processing logic corresponding to the second compensation trajectory is executed, and the second compensation trajectory is stored in the target compensation queue, providing technical support for subsequent laser cutting and improving laser cutting accuracy.

[0149] In this embodiment, each to-be-processed trajectory carries a trajectory identifier, and each compensation trajectory corresponds to a compensation trajectory identifier;

[0150] As an embodiment, step S804, i.e., determining the target processing logic corresponding to the second compensation trajectory according to the current compensation identifier, executing the target processing logic corresponding to the second compensation trajectory, and storing the second compensation trajectory in the target compensation queue, includes:

[0151] According to the current compensation identifier, the target processing logic corresponding to the second compensation trajectory is determined, the target processing logic corresponding to the second compensation trajectory is executed, the target connection segment corresponding to the second compensation trajectory is obtained, and the target connection segment and the second compensation trajectory are stored in the target compensation queue.

[0152] The target connecting segment refers to a connecting segment used to connect the first compensation track and the second compensation track. The target connecting segment can be a line segment, an arc, or a point, etc., which is not limited here.

[0153] Since the laser cutting process is a continuous operation process, it is necessary to determine the target connection segment of the first compensation trajectory and the second compensation trajectory according to the target processing logic to ensure the continuity of the first compensation trajectory and the second compensation trajectory, to ensure continuous operation during laser cutting, to ensure cutting accuracy, and to avoid partial connection failure and cutting abnormalities.

[0154] As an example, Figure 14 As shown, the current compensation identifier includes a first compensation identifier and a second compensation identifier. According to the current compensation identifier, determining the target processing logic corresponding to the second compensation trajectory, executing the target processing logic corresponding to the second compensation trajectory, and obtaining the target connection segment corresponding to the second compensation trajectory include:

[0155] S901: If the current compensation identifier is the first compensation identifier, obtain the current end trajectory corresponding to the target compensation queue, and calculate the end point distance between the end point of the current end trajectory and the end point of the first compensation trajectory.

[0156] The first compensation mark is a mark indicating the connection mode of the first compensation track and the second compensation track.

[0157] The current end trajectory refers to the trajectory at the end of the target compensation queue, which can be understood as the last compensated trajectory in the target compensation queue. It should be noted that the current end trajectory and the first compensated trajectory are the trajectories obtained by compensating the same first processed trajectory. The end distance refers to the distance between the end point of the current end trajectory and the end point of the first compensated trajectory.

[0158] Specifically, when the original trajectory queue is acquired, the current compensation trajectory identifiers of the adjacent first and second processing trajectories in the original trajectory queue are pre-initialized to the first compensation identifier. If the included angle between the first and second processing trajectories is less than π, the first compensation identifiers corresponding to the first and second processing trajectories are modified to the second compensation identifier. After compensation processing is performed on the first and second processing trajectories, the first and second compensation trajectories are obtained. At this time, the current compensation identifiers of the first and second compensation trajectories correspond to the current compensation identifiers of the corresponding first and second processing trajectories. When the current compensation identifiers of the first and second compensation trajectories are the first compensation identifiers, the end point distance between the end point of the current end trajectory and the end point of the first compensation trajectory is calculated. Based on the end point distance, the target connecting segment between the first and second compensation trajectories is determined to ensure the continuity of the first and second compensation trajectories. The target connecting segment is the connecting segment used to connect the first and second compensation trajectories.

[0159] S902: Determine a target connecting segment between the first compensation trajectory and the second compensation trajectory according to the end point distance.

[0160] In this embodiment, after obtaining the first compensation trajectory and the second compensation trajectory, it is necessary to calculate the end point distance between the end point of the current end trajectory and the end point of the first compensation trajectory, so as to determine the target connection segment of the first compensation trajectory and the second compensation trajectory based on the end point distance, thereby achieving the target connection segment of the first compensation trajectory and the second compensation trajectory, so as to achieve accurate connection of the first compensation trajectory and the second compensation trajectory and avoid over-compensation.

[0161] S903: If the current compensation identifier is the second compensation identifier, obtain the current end trajectory corresponding to the target compensation queue, and obtain the trajectory intersection point corresponding to the current end trajectory and the second compensation trajectory.

[0162] The second compensation identifier is an identifier indicating that no target connecting segment needs to be added to the first compensation trajectory and the second compensation trajectory.

[0163] S904: Determine a target connection segment between the first compensation trajectory and the second compensation trajectory according to the trajectory intersection point.

[0164] Specifically, when the current compensation identifier of the first compensation trajectory and the second compensation trajectory is the second compensation identifier, the trajectory intersection point of the current end trajectory and the first compensation trajectory is calculated to determine the target connection segment between the first compensation trajectory and the second compensation trajectory based on the trajectory intersection point, thereby ensuring that the first compensation trajectory and the second compensation trajectory have continuity.

[0165] In this embodiment, the target connection segment and the second compensation trajectory are stored in the target compensation queue, and the target connection segment is ensured to be located after the current end trajectory, so that in subsequent laser cutting, the current end trajectory, the target connection segment and the second compensation trajectory can be connected in sequence to avoid over-compensation.

[0166] In the trajectory compensation method provided in this embodiment, if the current compensation identifier is the first compensation identifier, the current terminal trajectory corresponding to the target compensation queue is obtained, and the terminal distance between the terminal point of the current terminal trajectory and the terminal point of the first compensation trajectory is calculated. Based on the terminal distance, the target connection segment between the first compensation trajectory and the second compensation trajectory is determined to ensure the continuity of the first compensation trajectory and the second compensation trajectory. If the current compensation identifier is the second compensation identifier, the current terminal trajectory corresponding to the target compensation queue is obtained, and the trajectory intersection point corresponding to the current terminal trajectory and the second compensation trajectory is obtained. Based on the trajectory intersection point, the target connection segment between the first compensation trajectory and the second compensation trajectory is determined to ensure the continuity of the first compensation trajectory and the second compensation trajectory. The target connection segment and the second compensation trajectory are stored in the target compensation queue to avoid over-compensation.

[0167] As an example, Figure 15As shown, step S902, i.e., determining a target connection segment between the first compensation trajectory and the second compensation trajectory according to the end point distance, includes:

[0168] S1001: If the end point distance is greater than 0, a first compensation segment is added between the current end track and the second compensation track, and the first compensation segment is determined as the target connection segment.

[0169] S1002: If the end point distance is equal to 0, a compensation arc is added between the current end track and the second compensation track, and the compensation arc is determined as the target connection segment.

[0170] The first compensation line segment is a line segment connecting the first compensation track and the second compensation track, and the compensation arc is an arc connecting the first compensation track and the second compensation track.

[0171] In this embodiment, since the current end trajectory and the first compensation trajectory are obtained based on the same trajectory to be processed, when the end point distance between the end point of the current end trajectory and the end point of the first compensation trajectory is greater than 0, the end point of the second compensation trajectory and the end point of the current end trajectory do not coincide with each other. In this case, a first compensation line segment needs to be added between the current end trajectory and the second compensation trajectory to connect the current end trajectory and the second compensation trajectory to ensure that the current end trajectory and the second compensation trajectory have continuity. When the end point distance is equal to 0, the current end trajectory and the second compensation trajectory are connected. In this case, according to the normal processing method, a compensation arc is added between the current end trajectory and the second compensation trajectory, and the compensation arc is determined as the target connecting segment. In this case, a compensation arc is added between the current end trajectory and the second compensation trajectory to ensure that the current end trajectory and the second compensation trajectory have continuity.

[0172] In the trajectory compensation method provided in this embodiment, if the end point distance is greater than 0, a first compensation line segment is added between the current end point trajectory and the second compensation trajectory, and the first compensation line segment is determined as the target connecting segment. If the end point distance is equal to 0, a compensation arc is added between the current end point trajectory and the second compensation trajectory, and the compensation arc is determined as the target connecting segment to ensure continuity between the current end point trajectory and the second compensation trajectory.

[0173] As an example, Figure 16 As shown, step S904, i.e., determining a target connection segment between the first compensation trajectory and the second compensation trajectory according to the trajectory intersection, includes:

[0174] S1101: If the trajectory intersection point is on the second compensation trajectory, the trajectory intersection point is determined as the target connection segment.

[0175] S1102: If the trajectory intersection is not on the second compensation trajectory, add a second compensation line segment between the current end trajectory and the second compensation trajectory, and determine the second compensation line segment target connection segment as the target connection segment.

[0176] In this embodiment, the track intersection is the intersection formed by the current end rail and the second compensation track, in which case the track intersection is on the second compensation track; or, the intersection formed by the extension line of the current end rail and the second compensation track, in which case the track intersection is on the second compensation track; or, the intersection formed by the extension line of the current end rail and the second compensation track, in which case the track intersection is not on the second compensation track; or, the intersection formed by the extension line of the current end rail and the extension line of the second compensation track, in which case the track intersection is not on the second compensation track.

[0177] When the trajectory intersection is on the second compensation trajectory, the trajectory intersection is determined as the target connection segment; when the trajectory intersection is not on the second compensation trajectory, it means that the current end track and the second compensation trajectory cannot intersect, and it is necessary to add a second compensation line segment between the current end track and the second compensation trajectory, and determine the second compensation line segment as the target connection segment to ensure the continuity of the current end track and the second compensation trajectory.

[0178] In the trajectory compensation method provided in this embodiment, if the trajectory intersection point is on the second compensation trajectory, the trajectory intersection point is determined as the target connecting segment. If the trajectory intersection point is not on the second compensation trajectory, a second compensation line segment is added between the current terminal trajectory and the second compensation trajectory, and the second compensation line segment is determined as the target connecting segment to ensure continuity between the current terminal trajectory and the second compensation trajectory.

[0179] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0180] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the trajectory compensation method in the above embodiment are implemented, such as Figure 1 Steps S101-S107 shown, or Figures 6 to 16 To avoid repetition, the steps shown in the figure are not repeated here.

[0181] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the trajectory compensation method in the above embodiment are implemented, for example Figure 1 Steps S101-S107 shown, or Figures 6 to 16 To avoid repetition, the steps shown in the figure are not repeated here.

[0182] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0183] The embodiments described above 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 they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. 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 various embodiments of the present invention, and should all be included in the scope of protection of the present invention.

Claims

1. A trajectory compensation method, characterized in that: include: Acquire an original trajectory queue and a queue compensation value corresponding to the original trajectory queue, wherein the original trajectory queue includes at least two trajectories to be processed; According to the trajectory connection order, two adjacent to-be-processed trajectories in the original trajectory queue are respectively determined as a first processing trajectory and a second processing trajectory; Calculating a trajectory angle between the first processing trajectory and the second processing trajectory; Obtaining target compensation values corresponding to the first processing trajectory and the second processing trajectory based on the trajectory angle and the queue compensation value, including: if the trajectory angle is less than π, obtaining a first trajectory length corresponding to the first processing trajectory and a second trajectory length corresponding to the second processing trajectory; obtaining a compensation limit value based on the first trajectory length, the second trajectory length, and the trajectory angle; determining the smaller value of the first trajectory length and the second trajectory length as a compensation parameter; calculating the trajectory angle and the compensation parameter using a compensation limit formula to obtain a compensation limit value; determining whether the first processing trajectory and the second processing trajectory are circular arc trajectories; if either the first processing trajectory or the second processing trajectory is a circular arc trajectory, obtaining a trajectory radius corresponding to the circular arc trajectory; determining the minimum value of the compensation limit value, the queue compensation value, and the trajectory radius as the target compensation value; if neither the first processing trajectory nor the second processing trajectory is a circular arc trajectory, determining the smaller value of the compensation limit value and the queue compensation value as the target compensation value; and if the trajectory angle is not less than π, determining the queue compensation value as the target compensation value. performing compensation processing on the first processing trajectory and the second processing trajectory using the target compensation value to obtain a first compensated trajectory and a second compensated trajectory; storing the first compensation trajectory and the second compensation trajectory in a target compensation queue in sequence according to the trajectory connection order; Based on the target compensation queue, the workpiece to be processed is processed to obtain a target workpiece.

2. The trajectory compensation method according to claim 1, wherein: The obtaining of the original trajectory queue and the queue compensation value corresponding to the original trajectory queue includes: Obtaining an NC trajectory program and detecting whether a spot compensation start instruction and a spot compensation cancel instruction exist in the NC trajectory program; If a spot compensation start instruction and a spot compensation cancel instruction exist in the NC trajectory program, acquiring at least two to-be-processed trajectories located between the spot compensation start instruction and the spot compensation cancel instruction; Based on at least two of the to-be-processed trajectories, obtaining an original trajectory queue; A queue compensation value is obtained from the NC trajectory program.

3. The trajectory compensation method according to claim 1, wherein: The calculating the included angle between the first processing trajectory and the second processing trajectory includes: Obtaining a first vector corresponding to the first processing trajectory, and obtaining a second vector corresponding to the second processing trajectory; multiplying the first vector and the second vector to obtain a vector product; Acquire trajectory directions corresponding to the first processing trajectory and the second processing trajectory based on the first vector and the second vector; Calculate the first vector and the second vector according to the angle calculation formula to obtain the vector angle; Based on the trajectory direction, the vector product and the vector angle, a trajectory angle corresponding to the first processing trajectory and the second processing trajectory is obtained.

4. The trajectory compensation method according to claim 3, wherein: The trajectory direction includes a first direction and a second direction; and obtaining the trajectory angle corresponding to the first processing trajectory and the second processing trajectory based on the trajectory direction, the vector product, and the vector angle includes: When the trajectory direction is the first direction, determining whether the vector product is less than 0; If the vector product is less than 0, the difference between 2π and the vector angle is determined as the trajectory angle corresponding to the first processing trajectory and the second processing trajectory; If the vector product is not less than 0, determining the vector angle as the trajectory angle corresponding to the first processing trajectory and the second processing trajectory; When the trajectory direction is the second direction, determining whether the vector product is less than 0; If the vector product is less than 0, determining the vector angle as the trajectory angle corresponding to the first processing trajectory and the second processing trajectory; If the vector product is not less than 0, the difference between 2π and the vector angle is determined as the trajectory angle corresponding to the first processing trajectory and the second processing trajectory.

5. The trajectory compensation method according to claim 1, wherein: The step of sequentially storing the first compensation trajectory and the second compensation trajectory into a target compensation queue according to the trajectory connection order includes: determining whether the first compensation trajectory is stored in the target compensation queue; If the first compensation trajectory is stored in the target compensation queue, obtaining a current compensation identifier; If the first compensation trajectory is not stored in the target compensation queue, storing the first compensation trajectory in the target compensation queue and obtaining a current compensation identifier; According to the current compensation identifier, a target processing logic corresponding to the second compensation trajectory is determined, the target processing logic corresponding to the second compensation trajectory is executed, and the second compensation trajectory is stored in the target compensation queue.

6. The trajectory compensation method according to claim 5, wherein: The determining, according to the current compensation identifier, a target processing logic corresponding to the second compensation trajectory, executing the target processing logic corresponding to the second compensation trajectory, and storing the second compensation trajectory in the target compensation queue includes: Determine, according to the current compensation identifier, a target processing logic corresponding to the second compensation trajectory, execute the target processing logic corresponding to the second compensation trajectory, obtain a target connection segment corresponding to the second compensation trajectory, and store the target connection segment and the second compensation trajectory in the target compensation queue.

7. The trajectory compensation method according to claim 6, wherein: The current compensation identifier includes a first compensation identifier and a second compensation identifier; determining a target processing logic corresponding to the second compensation trajectory according to the current compensation identifier, executing the target processing logic corresponding to the second compensation trajectory, and obtaining a target connection segment corresponding to the second compensation trajectory includes: If the current compensation identifier is the first compensation identifier, obtaining the current end trajectory corresponding to the target compensation queue, and calculating the end point distance between the end point of the current end trajectory and the end point of the first compensation trajectory; determining a target connecting segment between the first compensation trajectory and the second compensation trajectory according to the endpoint distance; If the current compensation identifier is the second compensation identifier, obtaining the current end trajectory corresponding to the target compensation queue, and obtaining the trajectory intersection point corresponding to the current end trajectory and the second compensation trajectory; determining a target connection segment between the first compensation trajectory and the second compensation trajectory according to the trajectory intersection point; The target connecting segment and the second compensation trajectory are stored in the target compensation queue.

8. The trajectory compensation method according to claim 7, wherein: The determining, based on the endpoint distance, a target connection segment between the first compensation trajectory and the second compensation trajectory includes: If the end point distance is greater than 0, adding a first compensation line segment between the current end track and the second compensation track, and determining the first compensation line segment as the target connecting segment; If the end point distance is equal to 0, a compensation arc is added between the current end trajectory and the second compensation trajectory, and the compensation arc is determined as the target connecting segment.

9. The trajectory compensation method according to claim 7, wherein: The determining, based on the trajectory intersection, a target connection segment between the first compensation trajectory and the second compensation trajectory, includes: If the trajectory intersection point is on the second compensation trajectory, determining the trajectory intersection point as the target connection segment; If the trajectory intersection is not on the second compensation trajectory, a second compensation line segment is added between the current end trajectory and the second compensation trajectory, and the second compensation line segment is determined as the target connecting segment.

10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the trajectory compensation method according to any one of claims 1 to 9 are implemented.

11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the trajectory compensation method according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Method for obtaining hard break point in tool track and application of hard break point

    CN104656558A

  • Numerical controller having corner path generation function in consideration of post-interpolation acceleration / deceleration

    US20160041545A1