A method and device for eliminating rounding errors in S-shaped acceleration and deceleration speed planning
Through the segmented analysis of the S-shaped acceleration and deceleration speed curve and real-time interpolation strategy, the circular error problem caused by the S-shaped acceleration and deceleration speed planning in the computer CNC system is solved, and the stability and accuracy of workpiece processing is achieved, ensuring acceleration and the constraints of acceleration run within the range.
Patent Information
- Application Number
- CN202311744776.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-18
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2043-12-18
AI Technical Summary
In computer CNC systems, the circular error caused by S-shaped acceleration and deceleration speed planning affects the processing accuracy and motion stability. The existing compensation methods cannot effectively prevent acceleration and acceleration from exceeding the constraint value or extending the interpolation time.
Through segmented analysis of S-shaped acceleration and deceleration speed curves and real-time interpolation speed planning strategies, appropriate interpolation strategies are selected according to different situations, including upward rounding or no endpoint transfer processing to eliminate rounding errors and ensure acceleration and acceleration are within the constraint range.
Effectively eliminate round-circular errors, improve the stability, accuracy and stability of workpiece processing, avoid the cross-border phenomenon of acceleration and acceleration, and flexibly adjust the speed planning under different circumstances, improving the adaptability and working performance of the machine.
Smart Images

Figure CN117724399B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer numerical control technology, and in particular to a method and device for eliminating rounding errors in S-shaped acceleration and deceleration speed planning. Background Art
[0002] In computer numerical control systems, one of the important factors that affect the smoothness, accuracy and stability of the workpiece processing process is the planning of interpolation speed. Therefore, appropriate speed planning under the premise of satisfying the kinematic and dynamic constraints of the machine tool has become an important research topic. For the speed curve, acceleration curve and jerk curve, the existing acceleration and deceleration algorithms include T-shaped acceleration and deceleration, S-shaped acceleration and deceleration, exponential acceleration and deceleration, polynomial acceleration and deceleration, etc. Among them, S-shaped acceleration and deceleration is widely used in current multi-axis motion systems because of its relative simplicity and good performance of smooth speed and acceleration curves.
[0003] In addition, in computer numerical control systems, in order to improve processing efficiency and quality, speed foresight has become an indispensable process in speed planning. Speed foresight is mainly to ensure that the last segment can be decelerated smoothly to 0, and at the same time calculate the maximum turning speed or terminal speed of each segment. However, it is difficult to ensure that the actual interpolation of each segment is an integer multiple of the interpolation period, so rounding errors in the calculation process are inevitable. However, the existence of rounding errors may affect the processing accuracy and the stability of the movement.
[0004] The existing compensation method for rounding error is usually to round up or down the time. Rounding down the time will cause the acceleration and jerk to exceed the constraint value. Although rounding up can meet various constraints, the interpolation time becomes longer, resulting in the final terminal speed being lower than the allowable terminal speed calculated by the forward look. Summary of the invention
[0005] The first object of the present invention is to provide a method for eliminating rounding errors by S-shaped acceleration and deceleration speed planning, which has the characteristics of improving the smoothness, accuracy and stability of workpiece processing.
[0006] The above-mentioned object of the present invention is achieved through the following technical solutions:
[0007] A method for eliminating rounding errors in S-shaped acceleration and deceleration speed planning, comprising:
[0008] According to the machining path of the workpiece, a path to be interpolated is obtained, wherein the path to be interpolated includes different trajectory segments;
[0009] According to the path to be interpolated and the maximum feed rate, the starting speed of the starting point of the trajectory segment and the terminal speed of the end point of the trajectory segment are determined, and the acceleration time and acceleration, deceleration time and deceleration, and uniform speed time are calculated using an S-shaped curve acceleration and deceleration algorithm, and an S-shaped acceleration and deceleration speed curve is drawn according to the acceleration time and acceleration, deceleration time and deceleration, and uniform speed time, that is, the VT diagram of the initial planning;
[0010] The S-shaped acceleration / deceleration speed curve is divided into three zones according to the trend of speed change, including an acceleration zone ACC, a uniform speed zone CF, and a deceleration zone DEC, and is divided into seven segments according to the time sequence, the acceleration zone includes an acceleration segment ViAi with increasing acceleration, an acceleration segment ViAc with constant acceleration, and an acceleration segment ViAd with decreasing acceleration, the uniform speed zone includes a uniform speed segment Vc, and the deceleration zone includes a deceleration segment VdDi with increasing deceleration, a deceleration segment VdDc with constant deceleration, and a deceleration segment VdDd with decreasing deceleration;
[0011] The speed sample points on the S-shaped acceleration / deceleration speed curve are obtained and marked as initial planning values. According to the acceleration / deceleration speed conditions of the zone corresponding to the initial planning value, the S-shaped acceleration / deceleration speed curve is divided into four conditions, including a condition of only the ACC zone, a condition of only the DEC zone, a condition of only the ACC and DEC zones, and a condition of the CF zone. According to different conditions, the corresponding real-time interpolation speed planning strategy is selected to eliminate the rounding error.
[0012] In a preferred example, the present invention can be further configured as follows: selecting a corresponding real-time interpolation speed planning strategy according to different situations to eliminate rounding errors, including:
[0013] When the S-shaped acceleration / deceleration speed curve has only the ACC zone, the displacement S of the ACC zone is calculated. Acc , the length of the current trajectory segment L, according to the displacement S of the ACC area Acc and the length L of the current trajectory segment, calculate the displacement residual ε round =LS Acc , obtain the time coefficient T related to the interpolation cycle, and make the following judgments to select the corresponding real-time interpolation speed planning strategy to eliminate the rounding error;
[0014] When ε round <V s When T, first try to round up an interpolation cycle as the starting speed V s , calculate the maximum acceleration A' after rounding error compensation, the maximum jerk J' after rounding error compensation, and the terminal velocity V' after rounding error compensation e ;
[0015] If V′ e >V s, then round up to an interpolation cycle as the starting speed V s Otherwise, the transfer process is performed without passing the end point of the current trajectory segment, with the initial planned end speed V e Transitioning to the next segment of the trajectory, the initial planned terminal velocity V e is the initially planned speed on the VT map of the initial plan;
[0016] When V s T<ε round <ΔS′ Acc_1 When the ViAi segment is added with an interpolation cycle, for the ACC area where the ViAc segment does not exist, the maximum acceleration A′ after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal velocity V′ after rounding error compensation are calculated. e ;
[0017] For the ACC area with ViAc segments, the maximum acceleration A′ after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal velocity V′ after rounding error compensation are calculated. e ;
[0018] When ΔS′ Acc_1 <ε round <ΔS′ Acc_2 When the ViAc segment is , an interpolation cycle is added to the ViAc segment. For the ACC area where the ViAc segment does not exist when drawing the S-shaped acceleration and deceleration speed curve, an interpolation cycle is added as the ViAc segment, and the maximum acceleration A′ after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V′e after rounding error compensation are calculated;
[0019] For the ACC area with ViAc segments, the maximum acceleration A′ after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal velocity V′ after rounding error compensation are calculated. e ;
[0020] When ΔS′ Acc_2 <ε round <ΔS′ Acc_3 When the ViAd segment is added with an interpolation cycle, for the ACC area where the ViAc segment does not exist, the maximum acceleration A′ after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal velocity V′ after rounding error compensation are calculated. e ;
[0021] For the ACC area with ViAc segments, the maximum acceleration A′ after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal velocity V′ after rounding error compensation are calculated. e ;
[0022] When ΔS′ Acc_3 <ε round When the initial planned terminal speed V e Add an interpolation cycle to calculate the maximum acceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation. e .
[0023] In a preferred example, the present invention can be further configured as follows: selecting a corresponding real-time interpolation speed planning strategy according to different situations to eliminate rounding errors, and further comprising:
[0024] When the S-shaped acceleration / deceleration speed curve has only the DEC zone, the displacement S of the DEC zone is calculated. Dec , the length of the current trajectory segment L, according to the displacement S of the DEC area Dec and the length L of the current trajectory segment, calculate the displacement residual ε round =LS Dec , and make the following judgments to select the corresponding real-time interpolation speed planning strategy to eliminate the rounding error: When ΔS′ Dec_1 <ε round <V s When T, add an interpolation cycle as the starting speed V s , calculate the maximum acceleration A' after rounding error compensation, the maximum jerk J' after rounding error compensation, and the terminal velocity V' after rounding error compensation e :
[0025] When ΔS′ Dec_2 <ε round ≤ΔS′ Dec_1 When an interpolation cycle is added to the VdDi segment, for the DEC area where there is no VdDc segment, the maximum deceleration A′ after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V′ after rounding error compensation are calculated. e ;
[0026] For the DEC area with VdDc segments, the maximum deceleration A′ after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V′e after rounding error compensation are calculated;
[0027] When ΔS′ Dec_3 <ε round ≤ΔS′ Dec_2When the VdDc segment is 0, an interpolation cycle is added to the VdDc segment. For the DEC area where the VdDc segment does not exist when drawing the S-shaped acceleration and deceleration speed curve, an interpolation cycle is added as the VdDc segment, and the maximum deceleration A′ after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V′e after rounding error compensation are calculated;
[0028] For the DEC area with VdDc segments, the maximum deceleration A′ after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V′e after rounding error compensation are calculated;
[0029] When V e T<ε round ≤ΔS′ Dec_3 When an interpolation cycle is added to the VdDd segment, for the DEC area where the VdDc segment does not exist, the maximum deceleration A′ after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V′ after rounding error compensation are calculated. e ;
[0030] For the existence of VdD c The DEC area of the segment is used to calculate the maximum deceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation. e ;
[0031] When ΔS′ Dec_3 ≤ε round ≤V e At T, the terminal speed V e Add an interpolation cycle, calculate the maximum deceleration A′ after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V′e after rounding error compensation;
[0032] When ε round <ΔS′ Dec_3 , the transfer process is performed without passing the end point of the current trajectory segment, with the initial planned end speed V e Transition to the next track.
[0033] In a preferred example, the present invention can be further configured as follows: selecting a corresponding real-time interpolation speed planning strategy according to different situations to eliminate rounding errors, and further comprising:
[0034] When the S-shaped acceleration / deceleration speed curve has only ACC and DEC zones, an interpolation cycle is added as the CF zone to calculate the displacement S of the ACC zone. Acc , displacement S of DEC area Dec , displacement S of CF zone Vc, calculate the length L of the current trajectory segment, according to the displacement S of the ACC area Acc , displacement S of DEC area Dec , displacement S of CF zone Vc and the length L of the current trajectory segment, calculate the displacement residual ε round =LS Acc -S Dec -S Vc , and make the following judgments to select the corresponding real-time interpolation speed planning strategy to eliminate the rounding error:
[0035] When ε round <V s T&&ε round <V e T, the transfer process is performed without passing the end point of the current trajectory segment, with the initial planned end speed V e Transition to the next section of the trajectory;
[0036] When V s T<ε round <V e When T, the interpolation strategy with only the ACC area is selected;
[0037] When V e T<ε round When , the interpolation strategy with only DEC area is selected.
[0038] In a preferred example, the present invention can be further configured as follows: selecting a corresponding real-time interpolation speed planning strategy according to different situations to eliminate rounding errors, and further comprising:
[0039] When the S-shaped acceleration / deceleration speed curve has a CF zone, the initial planned starting speed V is obtained. s , the initial planned terminal speed V e , the maximum speed V of the initial plan m , make the following judgment and select the corresponding real-time interpolation speed planning strategy to eliminate the rounding error:
[0040] When there is no ACC and DEC area, that is, V s =V e =V m , then the transfer process is performed without passing the end point of the current trajectory segment, with the initial planned end speed V e Transition to the next section of the trajectory;
[0041] When the ACC and CF regions exist, that is, V s <V e &&V e =V m , then select the interpolation strategy with only ACC area;
[0042] When there are CF and DEC regions, that is, V s >V e &&V s =V m , then select the interpolation strategy with only DEC area;
[0043] When ACC, CF and DEC regions exist, that is, V s <V m &&V e <V m , if V s ≤V e , then the interpolation strategy with only ACC area is selected, otherwise the interpolation strategy with only DEC area is selected.
[0044] In a preferred example, the present invention can be further configured as follows: the switching process is performed without passing the end point of the current trajectory segment, with the initial planned end speed V e Transition to the next section of the trajectory, including:
[0045] Suppose the end point is point B, the previous trajectory segment is AB, and the next trajectory segment is BC. There is a point p on the trajectory segment AB, and a point q on the trajectory segment BC. Suppose the initial planning starting speed of the trajectory segment AB is V s , the initial planned terminal speed is V e , let |pB| be the displacement residual in the trajectory segment AB, and |pB| satisfies |pB|<V e T s &&|pB|<V s T;
[0046] Calculate the position coordinates of the point q according to the distance |Bq| between the point B and the point q, the distance |pB| between the point p and the point B, the distance |pq| between the point p and the point q, and the angle ∠ABC between the previous trajectory segment AB and the next trajectory segment BC;
[0047] According to the position coordinates of the point q, the next interpolation cycle is interpolated to the next trajectory segment BC, located at the point q, so as to achieve the terminal velocity V initially planned. e Transition to the next trajectory segment BC.
[0048] In a preferred example, the present invention can be further configured as follows: calculating the position coordinates of the point q according to the distance |Bq| between the point B and the point q, the distance |pB| between the point p and the point B, the distance |pq| between the point p and the point q, and the angle ∠ABC between the previous trajectory segment AB and the next trajectory segment BC, including:
[0049] Solve the trigonometric cosine formula (1);
[0050] |Bq| 2 +|pB| 2 -2|Bq|·|pB|cos∠ABC=|pq|2 (1)
[0051] Let the |pq| satisfy |pq|=V e T, solve equation (2):
[0052]
[0053] Get the position coordinates of the point q.
[0054] In a preferred example, the present invention can be further configured as follows: Acc_1 is the displacement increment that keeps the initial planned terminal speed unchanged when adding an interpolation cycle in the ViAi segment; the ΔS′ Acc_2 is the displacement increment that keeps the initial planned terminal velocity unchanged when adding an interpolation cycle in the ViAc segment; the ΔS′ Acc_3 It is the displacement increment that keeps the initial planned terminal velocity unchanged by adding one interpolation cycle in the ViAd segment.
[0055] In a preferred example, the present invention can be further configured as follows: Dec_1 is the displacement increment that keeps the initial planned terminal speed unchanged when adding an interpolation cycle in the VdDi segment; the ΔS′ Dec_2 is the displacement increment that keeps the initial planned terminal speed unchanged when adding an interpolation cycle in the VdDc segment; the ΔS′ Dec_3 The displacement increment is the displacement increment that keeps the terminal speed unchanged when adding an interpolation cycle in the VdDd segment; the ΔS Dec_3 is the displacement increment of the VdDd segment before rounding error compensation.
[0056] The second object of the present invention is to provide a device for eliminating rounding errors by S-shaped acceleration and deceleration speed planning, which has the characteristics of improving the smoothness, accuracy and stability of workpiece processing.
[0057] The second object of the present invention is achieved by the following technical solutions:
[0058] A device for eliminating rounding errors in S-shaped acceleration and deceleration speed planning, comprising:
[0059] An acquisition module is used to acquire a path to be interpolated according to a processing path of a workpiece, wherein the path to be interpolated includes different trajectory segments; a drawing module is used to determine a starting speed of a starting point of the trajectory segment and a terminal speed of an end point of the trajectory segment according to the path to be interpolated and a maximum feed speed, and to calculate acceleration time and acceleration, deceleration time and deceleration, and uniform speed time using an S-shaped curve acceleration and deceleration algorithm, and to draw an S-shaped acceleration and deceleration speed curve according to the acceleration time and acceleration, deceleration time and deceleration, and uniform speed time, i.e., an initially planned VT diagram;
[0060] A division module, for the S-shaped acceleration and deceleration speed curve, is divided into three areas according to the trend of speed change, including an acceleration area ACC, a uniform speed area CF, and a deceleration area DEC, and is divided into seven segments according to the time sequence, the acceleration area includes an acceleration segment ViAi with increasing acceleration, an acceleration segment ViAc with constant acceleration, and an acceleration segment ViAd with decreasing acceleration, the uniform speed area includes a uniform speed segment Vc, and the deceleration area includes a deceleration segment VdDi with increasing deceleration, a deceleration segment VdDc with constant deceleration, and a deceleration segment VdDd with decreasing deceleration;
[0061] A selection module is used to obtain speed sample points on the S-shaped acceleration / deceleration speed curve, mark them as initial planning values, and divide the S-shaped acceleration / deceleration speed curve into four situations according to the acceleration / deceleration speed situation of the zone corresponding to the initial planning value, including a situation with only the ACC zone, a situation with only the DEC zone, a situation with only the ACC and DEC zones, and a situation with the CF zone. According to different situations, a corresponding real-time interpolation speed planning strategy is selected to eliminate rounding errors.
[0062] In summary, the present invention includes at least one of the following beneficial technical effects:
[0063] 1. By adopting this technical solution, the S-shaped acceleration and deceleration speed curve is modified to compensate for the rounding error. When the rounding-up method cannot ensure that the acceleration and jerk comply with the constraints, the method of not passing the end point is used to transfer to the next trajectory. As for the speed rounding error time, it is rounded up to the nearest integer, which can reduce the amount of acceleration and jerk that exceeds the limit. Combined with the displacement error rounding up, the acceleration and jerk can be perfectly limited within the constraint range. The error compensation method of the present invention can achieve the optimal solution in terms of speed and accuracy;
[0064] 2. Since the displacement rounding error or residual amount is too small, the next interpolation cycle will directly jump to the next track. The resulting geometric error is acceptable compared to the error caused by machine vibration caused by interpolation to the end point. Therefore, the transfer processing method without passing the end point can ensure the stability, accuracy and stability of the workpiece during the processing;
[0065] 3. This technical solution uses the mathematical idea of classification discussion to classify the real-time interpolation speed planning strategy for eliminating rounding errors, and can take into account the changes in different working environments and task requirements to select the corresponding speed planning strategy. This can make the workpiece processing machine more adaptable, able to flexibly adjust the speed planning in different situations, and improve work performance and coping ability. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 It is a flowchart of steps S1-S4 in a method for eliminating rounding errors in S-shaped acceleration and deceleration speed planning according to one embodiment of the present invention;
[0067] Figure 2 This is a typical 7-segment S-shaped acceleration and deceleration motion curve diagram;
[0068] Figure 3 yes Figure 1 Specific flow diagram of step S4;
[0069] Figure 4 yes Figure 3 Specific flow diagram of step S40;
[0070] Figure 5 This is a schematic diagram of the transfer processing without passing the end point;
[0071] Figure 6 yes Figure 3 Specific flow diagram of step S41;
[0072] Figure 7 yes Figure 3 Specific flow diagram of step S42;
[0073] Figure 8 yes Figure 3 Specific flow chart of step S43 in FIG. DETAILED DESCRIPTION
[0074] The following will be combined with the attached embodiment of the present invention Figure 1-7 , the technical solutions in the embodiments of the present invention are clearly and completely described. Obviously, the described embodiments are part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0075] The present invention is further described in detail below in conjunction with the accompanying drawings.
[0076] See also Figure 1 , which is an embodiment of a method for eliminating rounding errors in S-shaped acceleration and deceleration speed planning provided in an embodiment of the present application, including steps S1-S4.
[0077] S1. According to the processing path of the workpiece, a path to be interpolated is obtained, where the path to be interpolated includes different trajectory segments;
[0078] First, the machining path of the workpiece is determined according to the geometric shape and machining requirements of the workpiece. The machining path may be a straight line, arc or other shape.
[0079] Secondly, the path to be interpolated is calculated based on the processing path. Specifically, the path to be interpolated can be calculated by the following steps:
[0080] 1) Divide the processing path into several trajectory segments, each of which is a continuous curve segment consisting of a series of points.
[0081] 2) Connect each trajectory segment to obtain the path to be interpolated.
[0082] S2. According to the path to be interpolated and the maximum feed rate, determine the starting speed of the starting point of the trajectory segment and the terminal speed of the end point of the trajectory segment, use the S-shaped curve acceleration and deceleration algorithm to calculate the acceleration time and acceleration, deceleration time and deceleration, and uniform speed time, and draw an S-shaped acceleration and deceleration speed curve according to the acceleration time and acceleration, deceleration time and deceleration, and uniform speed time, that is, the initial planned VT diagram;
[0083] First, according to the interpolation path and the maximum feed rate, determine the starting speed of the starting point of the trajectory segment and the end speed of the end point of the trajectory segment. These speeds will be used to calculate the S-curve acceleration and deceleration algorithm.
[0084] Secondly, calculate the acceleration time and acceleration, deceleration time and deceleration, and uniform speed time: use the S-curve acceleration and deceleration algorithm to calculate the acceleration time, deceleration time and uniform speed time of the trajectory segment, as well as the corresponding acceleration and deceleration.
[0085] Finally, based on the calculated acceleration time, deceleration time, and uniform speed time, as well as the corresponding acceleration and deceleration, an S-shaped acceleration and deceleration speed curve (i.e. the VT diagram of the initial plan) is drawn. On this curve, you can clearly see the process of speed changing over time, including the acceleration stage, uniform speed stage, and deceleration stage.
[0086] S3, S-shaped acceleration and deceleration speed curve, divided into 3 zones according to the trend of speed change, including acceleration zone ACC, uniform speed zone CF, deceleration zone DEC, and divided into 7 segments according to time sequence, the acceleration zone includes acceleration segment ViAi with increasing acceleration, acceleration segment ViAc with constant acceleration, acceleration segment ViAd with decreasing acceleration, the uniform speed zone includes uniform speed segment Vc, the deceleration zone includes deceleration segment VdDi with increasing deceleration, deceleration segment VdDc with constant deceleration, and deceleration segment VdDd with decreasing deceleration;
[0087] See also Figure 2 , which is a typical 7-segment S-shaped acceleration and deceleration motion curve. It can be clearly seen that it can be divided into 3 areas according to the trend of speed change: acceleration (ACC) area, uniform speed (CF) area and deceleration (DEC) area. These seven segments are speed acceleration and increasing acceleration, speed acceleration and constant acceleration, speed acceleration and decreasing acceleration, uniform speed, speed deceleration and increasing deceleration, speed deceleration and constant deceleration, speed deceleration and decreasing deceleration. In this application document, they are referred to as ViAi, ViAc, ViAd, Vc, VdDi, VdDc, and VdDd respectively. The duration of these 7 segments is {T1, T2, T3, T4, T5, T6, T7}, and the speed of each segment node is {V1, V2, V3, V4, V5, V6, V7}. It should be noted that the symbol of V0 in this article is the same as the starting speed V s Equivalently, V7 and terminal velocity V e Equivalent.
[0088] S4. Obtain the speed sample points on the S-shaped acceleration / deceleration speed curve, mark them as the initial planning values, and divide the S-shaped acceleration / deceleration speed curve into four situations according to the acceleration / deceleration speed of the zone corresponding to the initial planning value, including the situation of only the ACC zone, the situation of only the DEC zone, the situation of only the ACC and DEC zones, and the situation of the CF zone. According to different situations, select the corresponding real-time interpolation speed planning strategy to eliminate the rounding error. Figure 3 , including steps S40-S43: S40, when the S-shaped acceleration / deceleration speed curve is only in the ACC zone, calculate the displacement S of the ACC zone Acc , the length of the current trajectory segment L, according to the displacement S of the ACC area Acc and the length L of the current trajectory segment, calculate the displacement residual ε round =LS Acc , obtain the time coefficient T related to the interpolation cycle, and perform the following steps S400-S404 to select the corresponding real-time interpolation speed planning strategy to eliminate the rounding error; refer to Figure 4 , including steps S400-S404: S400, when ε round <V s When T, first try to round up an interpolation cycle as the starting speed V s , calculate the maximum acceleration A' after rounding error compensation, the maximum jerk J' after rounding error compensation, and the terminal velocity V' after rounding error compensation e :
[0089] make
[0090] L=(2n-1)V s +n 2 AT+1.5knAT+0.5k 2AT)T+V s T
[0091] Available (3)
[0093] A′=[L-2nV s T] / [(n 2 +1.5kn+0.5k 2 +n+k)T]
[0094] V′ e =V s +(n+k)A′T
[0095] J′=A′ / ( nT )
[0096] Where A is the maximum acceleration, A′ is the maximum acceleration after rounding error compensation, and V′ e is the terminal velocity after rounding error compensation, J′ is the maximum jerk after rounding error compensation, when there is a ViAc segment, k is the number of interpolation cycles of the ViAc segment, otherwise k=0;
[0097] If V′ e >V s , then round up to an interpolation cycle as the starting speed V s Otherwise, the transfer process is performed without passing the end point of the current trajectory segment, with the initial planned end speed V e Transition to the next trajectory, the initial planned terminal speed V e The initial planned speed on the VT diagram of the initial plan;
[0098] See also Figure 5 , Figure 5 The figure is a schematic diagram of the transfer processing without passing through the end point. Let the end point be point B, the previous trajectory segment be AB, the next trajectory segment be BC, there is a point p on the trajectory segment AB, there is a point q on the trajectory segment BC, and the initial planning starting speed of the trajectory segment AB is V s , the initial planned terminal speed is V e , let |pB| be the displacement residual in the trajectory segment AB, |pB| satisfies |pB|<V e T s &&|pB|<V s T;
[0099] Solve the trigonometric cosine formula (1) based on the distance between point B and point q |Bq|, the distance between point p and point B |pB|, the distance between point p and point q |pq|, and the angle ∠ABC between the previous trajectory segment AB and the next trajectory segment BC;
[0100] |Bq|2 +|pB| 2 -2|Bq|·|pB|cos∠ABC=|pq| 2 (1)
[0101] Let |pq| satisfy |pq|=V e T, solve equation (2):
[0102]
[0103] Get the position coordinates of point q.
[0104] According to the position coordinates of point q, the next interpolation cycle is interpolated to the next trajectory segment BC, located at point q, so that the terminal speed V initially planned is e Transition to the next track segment BC.
[0105] S401, when V s T<ε round <ΔS′ Acc_1 When the ViAi segment is added with an interpolation cycle, for the ACC area where the ViAc segment does not exist, the maximum acceleration A′ after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal velocity V′ after rounding error compensation are calculated. e :
[0106] Referring to formula (4), let S′ Acc = L, calculate the maximum acceleration A', the jerk J1 of the ViAi segment, and the jerk J3 of the ViAd segment after rounding error compensation; refer to formula (5) to calculate the terminal velocity V' after rounding error compensation e1 :
[0107]
[0108] V′ e1 =V s +nA′T+0.5A′T (5)
[0109] Among them, S′ ViAi is the displacement of the ViAi segment after rounding error compensation, S′ ViAd is the displacement of the ViAd segment after rounding error compensation, J1 is the jerk of the ViAi segment, J3 is the jerk of the ViAd segment, S′ Acc is the total displacement of the ACC area after rounding error compensation;
[0110] For the ACC area with ViAc segments, calculate the maximum acceleration A' and the interpolated terminal velocity V' e :
[0111] Referring to formula (6), let S′Acc = L, calculate the maximum acceleration A′ after rounding error compensation, the jerk J1 of the ViAi segment, the jerk J2 of the ViAc segment, and the jerk J3 of the ViAd segment; refer to formula (7) to calculate the terminal velocity V′ after rounding error compensation e1 :
[0112]
[0113] V′ e1 =V s +(n+k)A′T+0.5A′T (7)
[0114] S402, when ΔS′ Acc_1 <ε round <ΔS′ Acc_2 When the ViAc segment is drawn, an interpolation cycle is added to the ViAc segment. For the ACC area where the ViAc segment does not exist when drawing the S-shaped acceleration and deceleration speed curve, an interpolation cycle is added as the ViAc segment. The maximum acceleration A′ after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V′ after rounding error compensation are calculated. e :
[0115] Referring to formula (8), let S′ Acc = L, calculate the maximum acceleration A' and maximum jerk J after rounding error compensation; refer to formula (9) to calculate the terminal velocity V' after rounding error compensation e2 :
[0116]
[0117] V′ e2 =V s +(n+1)A′T (9)
[0118] Among them, the maximum jerk of the ViAi and ViAd segments is the same, denoted by J;
[0119] For the ACC area with ViAc segments, the maximum acceleration A′ after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal velocity V′ after rounding error compensation are calculated. e :
[0120] Referring to formula (10), let S′ Acc = L, calculate the maximum acceleration A' and maximum jerk J after rounding error compensation; refer to formula (11) to calculate the terminal velocity V' after rounding error compensation e2 :
[0121]
[0122] V′ e2 =V s +(n+k)A′T+A′T (11)
[0123] Among them, the jerk of the ViAi and ViAd segments is the same, denoted by J.
[0124] S403, when ΔS′ Acc_2 <ε round <ΔS′ Acc_3 When the ViAd segment is added with an interpolation cycle, for the ACC area where the ViAc segment does not exist, the maximum acceleration A′ after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal velocity V′ after rounding error compensation are calculated. e :
[0125] Referring to formula (12), let S′ Acc = L, calculate the maximum acceleration A′, the jerk J1 of the ViAi segment, and the jerk J3 of the ViAd segment after rounding error compensation; refer to formula (13) to calculate the terminal velocity V′ after rounding error compensation e3 :
[0126]
[0127] V′ e3 =V0+nA′T+0.5A′T (13)
[0128] For the ACC area with ViAc segments, the maximum acceleration A′ after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal velocity V′ after rounding error compensation are calculated. e :
[0129] Referring to formula (14), let S′ Acc = L, calculate the maximum acceleration A′ after rounding error compensation, the jerk J1 of the ViAi segment, the jerk J2 of the ViAc segment, and the jerk J3 of the ViAd segment; refer to formula (15) to calculate the terminal velocity V′ after rounding error compensation e3 :
[0130]
[0131] V′ e3 =V s +(n+k)A′T+0.5A′T (15)
[0132] S404, when ΔS′ Acc_3 <ε round When the initial planned terminal speed V eAdd an interpolation cycle to calculate the maximum acceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation. e .
[0133] According to formula (16), the maximum acceleration A' and maximum jerk J after rounding error compensation are calculated, and the terminal velocity V' after rounding error compensation is calculated. e :
[0134] Depend on
[0135] L=[(2n-1)V s +n 2 AT+1.5knAT+0.5k 2 AT+V s +(n+k)AT]T
[0136] Available (16)
[0138] A′=[L-((2n-1)V s -V s )T] / [(n 2 +1.5kn+0.5k 2 +n+k)T]
[0139] V′ e =V s +(n+k)A′T
[0140] J′=A′ / ( nT )
[0141] S41. When the S-shaped acceleration / deceleration speed curve has only the DEC zone, calculate the displacement S of the DEC zone. Dec , the length of the current trajectory segment L, according to the displacement S of the DEC area Dec and the length L of the current trajectory segment, calculate the displacement residual ε round =LS Dec , and perform the following steps S410-S416 to select the corresponding real-time interpolation speed planning strategy to eliminate the rounding error; refer to Figure 6 , including steps S410-S416:
[0142] S410, when ΔS′ Dec_1 <ε round <V s When T, add an interpolation cycle as the starting speed V s , calculate the maximum acceleration A' after rounding error compensation, the maximum jerk J' after rounding error compensation, and the terminal velocity V' after rounding error compensation e:According to formula (17), calculate the maximum acceleration A′ and maximum jerk J after rounding error compensation, and calculate the terminal velocity V′ after rounding error compensation e :
[0143] Depend on
[0144] L=((2n-1)V s +n 2 AT+1.5knAT+0.5k 2 AT+V s )T
[0145] Available (17)
[0147] A′=[L-((2n-1)V s -V s )T] / [(n 2 +1.5kn+0.5k 2 )T]
[0148] V′ e =V s +(n+k)A′T
[0149] J′=A′ / ( nT )
[0150] Among them, A is the maximum deceleration, A' is the maximum deceleration after interpolation, V' e is the terminal velocity after interpolation, J′ is the jerk after interpolation, when there is a VdDc segment, k is the interpolation cycle number of the VdDc segment, otherwise k=0.
[0151] S411, when ΔS′ Dec_2 <ε round ≤ΔS′ Dec_1 When an interpolation cycle is added to the VdDi segment, for the DEC area where there is no VdDc segment, the maximum deceleration A′ after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V′ after rounding error compensation are calculated. e :
[0152] Referring to formula (18), let S′ Dec = L, calculate the maximum deceleration A′, the jerk J1 of the VdDi segment, and the jerk J3 of the VdDd segment after rounding error compensation; refer to formula (19) to calculate the terminal speed V′ after rounding error compensation e1 :
[0153]
[0154] V′ e1=V0-nA′T-0.5A′T (19)
[0155] Among them, S′ VdDi is the displacement of the VdDi segment after rounding error compensation, S′ VdDd is the displacement of the VdDd segment after rounding error compensation, J1 is the jerk of the VdDi segment, J3 is the jerk of the VdDd segment, S′ Dec is the total displacement of the DEC area after rounding error compensation.
[0156] For the DEC zone with VdDc segments, the maximum deceleration A′ after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V′ after rounding error compensation are calculated. e :
[0157] Referring to formula (20), let S′ Dec = L, calculate the maximum deceleration A′ after rounding error compensation, the jerk J1 of the VdDi segment, the jerk J2 of the VdDc segment, and the jerk J3 of the VdDd segment; refer to formula (21) to calculate the terminal speed V′ after rounding error compensation e1 :
[0158]
[0159] V′ e1 =V s -(n+k)A′T-0.5A′T (21)
[0160] Among them, S′ VdDc is the displacement of the VdDc segment after rounding error compensation, J2 is the jerk of the VdDc segment, and S′ is the total displacement of the DEC zone after rounding error compensation;
[0161] S412, when ΔS′ Dec_3 <ε round ≤ΔS′ Dec_2 When the VdDc segment is added, an interpolation cycle is added to the VdDc segment. For the DEC area where the VdDc segment does not exist when drawing the S-shaped acceleration and deceleration speed curve, an interpolation cycle is added as the VdDc segment. The maximum deceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation are calculated. e :
[0162] Referring to formula (22), let S′ Dec = L, calculate the maximum acceleration A' and maximum jerk J after rounding error compensation, and refer to formula (23) to calculate the terminal velocity V' after rounding error compensation e2 :
[0163]
[0164] V′ e2 =V0-(n+1)A′T (23)
[0165] Among them, the jerk of VdDi and VdDd segments is the same, denoted by J;
[0166] For the DEC zone with VdDc segments, the maximum deceleration A′ after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V′ after rounding error compensation are calculated. e :
[0167] Referring to formula (24), let S′ Dec = L, calculate the maximum acceleration A' and maximum jerk J after rounding error compensation, and refer to formula (25) to calculate the terminal velocity V' after rounding error compensation e2 :
[0168]
[0169] V′ e2 =V s -(n+k)A′TA′T (25)
[0170] S413, when v e T<ε round ≤ΔS′ Dec_3 When an interpolation cycle is added to the VdDd segment, for the DEC area where the VdDc segment does not exist, the maximum deceleration A′ after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V′ after rounding error compensation are calculated. e :
[0171] Referring to formula (26), let S′ Dec = L, calculate the maximum deceleration A′, the jerk J1 of the VdDi segment, and the jerk J3 of the VdDd segment after rounding error compensation; refer to formula (27) to calculate the terminal speed V′ after rounding error compensation e3 :
[0172]
[0173] V′ e3 =V s -nA′T-0.5A′T (27)
[0174] For the DEC zone with VdDc segments, the maximum deceleration A′ after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V′ after rounding error compensation are calculated. e :
[0175] Referring to formula (28), let S′ Dec = L, calculate the maximum deceleration A′ after rounding error compensation, the jerk J1 of the VdDi segment, the jerk J2 of the VdDc segment, and the jerk J3 of the VdDd segment; refer to formula (29) to calculate the terminal speed V′ after rounding error compensation e3 :
[0176]
[0177] V′ e3 =V s +(n+k)A′T+0.5A′T (29)
[0178] S414, when ΔS′ Dec_3 ≤ε round ≤v e At T, the terminal speed v e Add an interpolation cycle to calculate the maximum deceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation. e ;
[0179] According to formula (30), the maximum acceleration A′ and maximum jerk J after rounding error compensation are calculated, and the terminal velocity V′ after rounding error compensation is calculated. e :
[0180] Depend on
[0181] L=((2n-1)V s -n 2 AT-1.5knAT-0.5k 2 AT+(V s -(n+k)AT))T
[0182] Available (30)
[0184] A′=[((2n-1)V s +V s )TL] / [(n 2 +1.5kn+0.5k 2 +n+k)T]
[0185] V′ e =V s +(n+k)A′T
[0186] J′=A′ / ( nT )
[0187] S415, when ε round <ΔS′Dec_3 , the transfer process is performed without passing the end point of the current trajectory segment, with the initial planned end speed V e Transition to the next track.
[0188] In the embodiment of the present application, the transfer processing step in step S415 is similar to the transfer processing step in the above step S400, and will not be repeated here to avoid repetition.
[0189] S42. When the S-shaped acceleration / deceleration speed curve has only ACC and DEC zones, add an interpolation cycle as the CF zone and calculate the displacement S of the ACC zone. Acc , displacement S of DEC area Dec , displacement S of CF zone Vc , calculate the length L of the current trajectory segment, according to the displacement S of the ACC area Acc , displacement S of DEC area Dec , displacement S of CF zone Vc and the length L of the current trajectory segment, calculate the displacement residual ε round =LS Acc -S Dec -S Vc , and perform the following steps S420-S422 to select the corresponding real-time interpolation speed planning strategy to eliminate the rounding error; refer to Figure 7 , including steps S420-S422: S420, when ε round <V s T&&ε round <V e T, the transfer process is performed without passing the end point of the current trajectory segment, with the initial planned end speed V e Transition to the next section of the trajectory;
[0190] In the embodiment of the present application, the transfer processing step in step S420 is similar to the transfer processing step in the above step S400, and will not be repeated here to avoid repetition.
[0191] S421, when V s T<ε round <V e When T, the interpolation strategy with only the ACC area is selected;
[0192] In the embodiment of the present application, step S421 is similar to the above step S40 and will not be described again here to avoid repetition.
[0193] S422, when V e T<ε round When , the interpolation strategy with only DEC area is selected;
[0194] In the embodiment of the present application, step S422 is similar to the above step S41 and will not be described again here to avoid repetition.
[0195] S43. When the S-shaped acceleration / deceleration speed curve has a CF zone, obtain the initial planned starting speed V s , the initial planned terminal speed V e , the maximum speed V of the initial plan m , perform the following steps S430-S433 to select the corresponding real-time interpolation speed planning strategy to eliminate the rounding error. Figure 8 , including steps S430-S433:
[0196] S430, when there is no ACC and DEC area, that is, V s =V e =V m , then the transfer process is performed without passing the end point of the current trajectory segment, with the initial planned end speed V e Transition to the next section of the trajectory;
[0197] In the embodiment of the present application, the transfer processing step in step S430 is similar to the transfer processing step in the above step S400, and will not be repeated here to avoid repetition.
[0198] S431, when there are ACC and CF regions, that is, V s <V e &&V e =V m , then select the interpolation strategy of only the ACC area; in the embodiment of the present application, step S431 is similar to the above step S40, and will not be repeated here to avoid repetition.
[0199] S432, when there are CF and DEC regions, that is, V s >V e &&V s =V m , then select the interpolation strategy with only DEC area; in the embodiment of the present application, step S432 is similar to the above step S41, and will not be repeated here to avoid repetition.
[0200] S433, when there are ACC, CF and DEC areas, that is, V s <V m &&V e <V m , if V s ≤V e , then the interpolation strategy with only ACC area is selected, otherwise the interpolation strategy with only DEC area is selected.
[0201] In the embodiment of the present application, step S433 is similar to the above steps S41-S42 and will not be described again here to avoid repetition.
[0202] In summary, in steps S40-S43, according to different situations, the corresponding real-time interpolation speed planning strategy is selected to calculate the speed, acceleration, and jerk after rounding error compensation, that is, the re-planned speed, acceleration, and jerk, thereby eliminating the rounding error.
[0203] The implementation principle of the embodiment of the present application is:
[0204] Firstly, according to the processing path of the workpiece, the path to be interpolated is obtained, and the path to be interpolated includes different trajectory segments; according to the path to be interpolated and the maximum feed speed of the machine tool, the starting speed of the starting point of the trajectory segment and the terminal speed of the end point of the trajectory segment are determined, and the S-shaped curve acceleration and deceleration algorithm is used to calculate the acceleration time and acceleration, deceleration time and deceleration, and uniform speed time, and the S-shaped acceleration and deceleration speed curve is drawn according to the acceleration time and acceleration, deceleration time and deceleration, and uniform speed time, that is, the initial planned VT diagram; and the S-shaped acceleration and deceleration speed curve is divided into three areas according to the trend of speed change, including acceleration area ACC, Uniform speed zone CF, deceleration zone DEC; obtain speed sample points on the S-shaped acceleration and deceleration speed curve, mark them as initial planning values, and divide the S-shaped acceleration and deceleration speed curve into four cases according to the acceleration and deceleration speed of the zone corresponding to the initial planning value, including the case of only ACC zone, the case of only DEC zone, the case of only ACC and DEC zones, and the case of CF zone. According to different situations, select the corresponding real-time interpolation speed planning strategy, calculate the speed, acceleration, and jerk after rounding error compensation, that is, the re-planned speed, acceleration, and jerk, so as to eliminate the rounding error.
[0205] An embodiment of the present application also provides a device for eliminating rounding errors in S-shaped acceleration and deceleration speed planning, including an acquisition module, a drawing module, a division module and a selection module.
[0206] The acquisition module is used to acquire the path to be interpolated according to the processing path of the workpiece; the drawing module is used to determine the starting speed of the starting point of the trajectory segment and the terminal speed of the end point of the trajectory segment according to the path to be interpolated and the maximum feed speed, and use the S-shaped curve acceleration and deceleration algorithm to calculate the acceleration time and acceleration, deceleration time and deceleration, and uniform speed time, and draw the S-shaped acceleration and deceleration speed curve according to the acceleration time and acceleration, deceleration time and deceleration, and uniform speed time, that is, the initial planned VT diagram; the division module is used for the S-shaped acceleration and deceleration speed curve, which is divided into 3 areas according to the trend of speed change, including the acceleration area ACC, the uniform speed area CF, and the deceleration area DEC, and is divided into 7 segments according to the time sequence, and the acceleration area includes the acceleration segment V with increased acceleration iAi, an acceleration segment ViAc with constant acceleration, an acceleration segment ViAd with reduced acceleration, the uniform speed zone includes a uniform speed segment Vc, the deceleration zone includes a deceleration segment VdDi with increasing deceleration, a deceleration segment VdDc with constant deceleration, and a deceleration segment VdDd with reduced deceleration; a selection module is used to obtain speed sample points on the S-shaped acceleration and deceleration speed curve, mark them as initial planning values, and divide the S-shaped acceleration and deceleration speed curve into four situations according to the acceleration and deceleration speed of the zone corresponding to the initial planning value, including the situation of only the ACC zone, the situation of only the DEC zone, the situation of only the ACC and DEC zones, and the situation of the CF zone. According to different situations, the corresponding real-time interpolation speed planning strategy is selected to eliminate the rounding error.
[0207] In this embodiment, the acquisition module may acquire the path to be interpolated and transmit the path to be interpolated to the drawing module; the drawing module calculates the relevant parameters of speed and time according to the path to be interpolated, draws the S-shaped acceleration and deceleration speed curve according to the parameters, and transmits the S-shaped acceleration and deceleration speed curve to the division module; the division module divides the S-shaped acceleration and deceleration speed curve into three areas according to the trend of speed change, including the acceleration area ACC, the uniform speed area CF, and the deceleration area DEC, and divides it into seven segments according to the time sequence, and transmits the division result to the selection module; the selection module obtains the initial planning value on the S-shaped acceleration and deceleration speed curve, and divides the S-shaped acceleration and deceleration speed curve into four cases according to the initial planning value and the division result, including the case of only the ACC area, the case of only the DEC area, the case of only the ACC and DEC areas, and the case of the CF area, and selects the corresponding real-time interpolation speed planning strategy according to different cases, thereby eliminating the rounding error.
[0208] In a possible implementation, a device for eliminating rounding errors in S-shaped acceleration and deceleration speed planning further includes: a selection module including an interpolation strategy unit for only the ACC area, an interpolation strategy unit for only the DEC area, an interpolation strategy unit for only the ACC and DEC areas, and an interpolation strategy unit for the CF area. The interpolation strategy unit for only the ACC area, the interpolation strategy unit for only the DEC area, the interpolation strategy unit for only the ACC and DEC areas, and the interpolation strategy unit for the CF area all include a switching processing subunit.
[0209] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0210] The embodiment of the present application provides a device for eliminating rounding errors in S-shaped acceleration and deceleration speed planning. The device for implementing rounding error compensation in S-shaped acceleration and deceleration speed planning may include: at least one processor, at least one network interface, a user interface, a memory, and at least one communication bus.
[0211] The processor is used to call a method for eliminating rounding errors in S-shaped acceleration and deceleration speed planning stored in a memory. When executed by one or more processors, a device for eliminating rounding errors in S-shaped acceleration and deceleration speed planning executes one or more of the methods described in the above embodiments.
[0212] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, a method for eliminating rounding errors in S-shaped acceleration and deceleration speed planning according to the above embodiment is implemented. To avoid repetition, it is not described here.
[0213] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.
[0214] This specific embodiment is merely an explanation of the present invention and is not a limitation of the present invention. After reading this specification, those skilled in the art may make non-creative modifications to the present embodiment as needed. However, as long as they are within the scope of the claims of the present invention, they are protected by the patent law.
Claims
1. A method for eliminating rounding errors in S-shaped acceleration and deceleration speed planning, characterized in that: include: According to the machining path of the workpiece, a path to be interpolated is obtained, wherein the path to be interpolated includes different trajectory segments; According to the path to be interpolated and the maximum feed rate, the starting speed of the starting point of the trajectory segment and the terminal speed of the end point of the trajectory segment are determined, and the acceleration time and acceleration, deceleration time and deceleration, and uniform speed time are calculated using an S-shaped curve acceleration and deceleration algorithm, and an S-shaped acceleration and deceleration speed curve is drawn according to the acceleration time and acceleration, deceleration time and deceleration, and uniform speed time, that is, the VT diagram of the initial planning; The S-shaped acceleration / deceleration speed curve is divided into three zones according to the trend of speed change, including an acceleration zone ACC, a uniform speed zone CF, and a deceleration zone DEC, and is divided into seven segments according to the time sequence, the acceleration zone includes an acceleration segment ViAi with increasing acceleration, an acceleration segment ViAc with constant acceleration, and an acceleration segment ViAd with decreasing acceleration, the uniform speed zone includes a uniform speed segment Vc, and the deceleration zone includes a deceleration segment VdDi with increasing deceleration, a deceleration segment VdDc with constant deceleration, and a deceleration segment VdDd with decreasing deceleration; Obtain speed sample points on the S-shaped acceleration / deceleration speed curve, mark them as initial planning values, and divide the S-shaped acceleration / deceleration speed curve into four situations according to the acceleration / deceleration speed situation of the zone corresponding to the initial planning value, including a situation of only the ACC zone, a situation of only the DEC zone, a situation of only the ACC and DEC zones, and a situation of the CF zone. According to different situations, select corresponding real-time interpolation speed planning strategies to eliminate rounding errors; According to different situations, the corresponding real-time interpolation speed planning strategy is selected to eliminate the rounding error, including: when the S-shaped acceleration and deceleration speed curve is only in the ACC zone, the displacement S of the ACC zone is calculated. Acc , the length of the current trajectory segment L, according to the displacement S of the ACC area Acc and the length L of the current trajectory segment, calculate the displacement residual ε round =LS Acc , obtain the time coefficient T related to the interpolation cycle, and make the following judgments to select the corresponding real-time interpolation speed planning strategy to eliminate the rounding error; When ε round <V s When T, first try to round up an interpolation cycle as the starting speed V s , calculate the maximum acceleration A' after rounding error compensation, the maximum jerk J' after rounding error compensation, and the terminal velocity V' after rounding error compensation e ; If V' e >V s , then round up to an interpolation cycle as the starting speed V s Otherwise, the transfer process is performed without passing the end point of the current trajectory segment, with the initial planned end speed V e Transitioning to the next segment of the trajectory, the initial planned terminal velocity V e is the initially planned speed on the VT map of the initial plan; When V s T<ε round <ΔS' Acc_1 When an interpolation cycle is added to the ViAi segment, for the ACC area where the ViAc segment does not exist, the maximum acceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation are calculated. e ; For the ACC area with ViAc segments, the maximum acceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal velocity V' after rounding error compensation are calculated. e ; When ΔS' Acc_1 <ε round <ΔS' Acc_2 When the ViAc segment is drawn, an interpolation cycle is added to the ViAc segment. For the ACC area where the ViAc segment does not exist when drawing the S-shaped acceleration and deceleration speed curve, an interpolation cycle is added as the ViAc segment. The maximum acceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation are calculated. e ; For the ACC area with ViAc segments, the maximum acceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal velocity V' after rounding error compensation are calculated. e ; When ΔS' Acc_2 <ε round <ΔS' Acc_3 When an interpolation cycle is added to the ViAd segment, for the ACC area where the ViAc segment does not exist, the maximum acceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation are calculated. e ; For the ACC area with ViAc segments, the maximum acceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal velocity V' after rounding error compensation are calculated. e ; When ΔS' Acc_3 <ε round When the initial planned terminal speed V e Add an interpolation cycle to calculate the maximum acceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation. e ; the ΔS' Acc_1 is the displacement increment that keeps the initial planned terminal speed unchanged when adding an interpolation cycle in the ViAi segment; the ΔS' Acc_2 is the displacement increment that keeps the initial planned terminal velocity unchanged when adding an interpolation cycle in the ViAc segment; the ΔS' Acc_3 It is the displacement increment that keeps the initial planned terminal velocity unchanged when adding one interpolation cycle in the ViAd segment; When the S-shaped acceleration / deceleration speed curve has only the DEC zone, the displacement S of the DEC zone is calculated. Dec , the length of the current trajectory segment L, according to the displacement S of the DEC area Dec and the length L of the current trajectory segment, calculate the displacement residual ε round =LS Dec , and make the following judgments to select the corresponding real-time interpolation speed planning strategy to eliminate the rounding error: When ΔS' Dec_1 <ε round <V s When T, add an interpolation cycle as the starting speed V s , calculate the maximum acceleration A' after rounding error compensation, the maximum jerk J' after rounding error compensation, and the terminal velocity V' after rounding error compensation e : When ΔS' Dec_2 <ε round ≤ΔS' Dec_1 When an interpolation cycle is added to the VdDi segment, for the DEC area where there is no VdDc segment, the maximum deceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation are calculated. e ; For the DEC zone with VdDc segments, the maximum deceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation are calculated. e ; When ΔS' Dec_3 <ε round ≤ΔS' Dec_2 When the VdDc segment is added, an interpolation cycle is added to the VdDc segment. For the DEC area where the VdDc segment does not exist when drawing the S-shaped acceleration and deceleration speed curve, an interpolation cycle is added as the VdDc segment. The maximum deceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation are calculated. e ; For the DEC zone with VdDc segments, the maximum deceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation are calculated. e ; When V e T<ε round ≤ΔS' Dec_3 When an interpolation cycle is added to the VdDd segment, for the DEC area where the VdDc segment does not exist, the maximum deceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation are calculated. e ; For the DEC zone with VdDc segments, the maximum deceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation are calculated. e ; When ΔS' Dec_3 ≤ε round ≤V e At T, the terminal speed V e Add an interpolation cycle to calculate the maximum deceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation. e ; When ε round <ΔS' Dec_3 , the transfer process is performed without passing the end point of the current trajectory segment, with the initial planned end speed V e Transition to the next section of the trajectory; The ΔS' Dec_1 It is the displacement increment that keeps the initial planned terminal velocity unchanged by adding one interpolation cycle in the VdDi segment; The ΔS' Dec_2 It is the displacement increment that keeps the initial planned terminal velocity unchanged when adding one interpolation cycle in the VdDc segment; The ΔS' Dec_3 The displacement increment is the displacement increment that keeps the terminal speed unchanged when adding an interpolation cycle in the VdDd segment; the ΔS Dec_3 is the displacement increment of the VdDd segment before rounding error compensation; When the S-shaped acceleration / deceleration speed curve has only ACC and DEC zones, an interpolation cycle is added as the CF zone to calculate the displacement S of the ACC zone. Acc , displacement S of DEC area Dec , displacement S of CF zone Vc , calculate the length L of the current trajectory segment, according to the displacement S of the ACC area Acc , displacement S of DEC area Dec , displacement S of CF zone Vc and the length L of the current trajectory segment, calculate the displacement residual ε round =LS Acc -S Dec -S Vc , and make the following judgments to select the corresponding real-time interpolation speed planning strategy to eliminate the rounding error: When ε round <V s T&&ε round <V e T, the transfer process is performed without passing the end point of the current trajectory segment, with the initial planned end speed V e Transition to the next section of the trajectory; When V s T<ε round <V e When T, the interpolation strategy with only the ACC area is selected; When V e T<ε round When , the interpolation strategy with only DEC area is selected; When the S-shaped acceleration / deceleration speed curve has a CF zone, the initial planned starting speed V is obtained. s , the initial planned terminal speed V e , the maximum speed V of the initial plan m , make the following judgment and select the corresponding real-time interpolation speed planning strategy to eliminate the rounding error: When there is no ACC and DEC area, that is, V s =V e =V m , then the transfer process is performed without passing the end point of the current trajectory segment, with the initial planned end speed V e Transition to the next section of the trajectory; When the ACC and CF regions exist, that is, V s <V e &&V e =V m , then select the interpolation strategy with only ACC area; When there are CF and DEC regions, that is, V s >V e &&V s =V m , then select the interpolation strategy with only DEC area; When ACC, CF and DEC regions exist, that is, V s <V m &&V e <V m , if V s ≤V e , then the interpolation strategy with only ACC area is selected, otherwise the interpolation strategy with only DEC area is selected.
2. The method according to claim 1, characterized in that The switching process is performed without passing the end point of the current trajectory segment, with the initial planned end speed V e Transition to the next section of the trajectory, including: Suppose the end point is point B, the previous trajectory segment is AB, and the next trajectory segment is BC. There is a point p on the trajectory segment AB, and a point q on the trajectory segment BC. Suppose the initial planning starting speed of the trajectory segment AB is V s , the initial planned terminal speed is V e , let |pB| be the displacement residual in the trajectory segment AB, and |pB| satisfies |pB|<V e T s &&|pB|<V s T; Calculate the position coordinates of the point q according to the distance |Bq| between the point B and the point q, the distance |pB| between the point p and the point B, the distance |pq| between the point p and the point q, and the angle ∠ABC between the previous trajectory segment AB and the next trajectory segment BC; According to the position coordinates of the point q, the next interpolation cycle is interpolated to the next trajectory segment BC, located at the point q, so as to achieve the terminal velocity V initially planned. e Transition to the next trajectory segment BC.
3. The method according to claim 2, characterized in that The calculating the position coordinates of the point q according to the distance |Bq| between the point B and the point q, the distance |pB| between the point p and the point B, the distance |pq| between the point p and the point q, and the angle ∠ABC between the previous trajectory segment AB and the next trajectory segment BC, comprises: Solve the trigonometric cosine formula (1); |Bq| 2 +|pB| 2 -2|Bq|·|pB|cos∠ABC=|pq| 2 (1) Let the |pq| satisfy |pq|=V e T, solve equation (2): Get the position coordinates of the point q.
4. A device for eliminating rounding errors in S-shaped acceleration and deceleration speed planning, characterized in that: include: An acquisition module, used for acquiring a path to be interpolated according to a machining path of a workpiece, wherein the path to be interpolated includes different trajectory segments; A drawing module, used to determine the starting speed of the starting point of the trajectory segment and the terminal speed of the end point of the trajectory segment according to the path to be interpolated and the maximum feed speed, calculate the acceleration time and acceleration, deceleration time and deceleration, and uniform speed time by using an S-shaped curve acceleration and deceleration algorithm, and draw an S-shaped acceleration and deceleration speed curve according to the acceleration time and acceleration, deceleration time and deceleration, and uniform speed time, that is, the VT diagram of the initial planning; A division module, for the S-shaped acceleration and deceleration speed curve, is divided into three areas according to the trend of speed change, including an acceleration area ACC, a uniform speed area CF, and a deceleration area DEC, and is divided into seven segments according to the time sequence, the acceleration area includes an acceleration segment ViAi with increasing acceleration, an acceleration segment ViAc with constant acceleration, and an acceleration segment ViAd with decreasing acceleration, the uniform speed area includes a uniform speed segment Vc, and the deceleration area includes a deceleration segment VdDi with increasing deceleration, a deceleration segment VdDc with constant deceleration, and a deceleration segment VdDd with decreasing deceleration; A selection module is used to obtain speed sample points on the S-shaped acceleration / deceleration speed curve, mark them as initial planning values, and divide the S-shaped acceleration / deceleration speed curve into four situations according to the acceleration / deceleration speed situation of the zone corresponding to the initial planning value, including a situation of only the ACC zone, a situation of only the DEC zone, a situation of only the ACC and DEC zones, and a situation of the CF zone, and select corresponding real-time interpolation speed planning strategies according to different situations, so as to eliminate rounding errors; According to different situations, the corresponding real-time interpolation speed planning strategy is selected to eliminate the rounding error, including: when the S-shaped acceleration and deceleration speed curve is only in the ACC zone, the displacement S of the ACC zone is calculated. Acc , the length of the current trajectory segment L, according to the displacement S of the ACC area Acc and the length L of the current trajectory segment, calculate the displacement residual ε round =LS Acc , obtain the time coefficient T related to the interpolation cycle, and make the following judgments to select the corresponding real-time interpolation speed planning strategy to eliminate the rounding error; When ε round <V s When T, first try to round up an interpolation cycle as the starting speed V s , calculate the maximum acceleration A' after rounding error compensation, the maximum jerk J' after rounding error compensation, and the terminal velocity V' after rounding error compensation e ; If V' e >V s , then round up to an interpolation cycle as the starting speed V s Otherwise, the transfer process is performed without passing the end point of the current trajectory segment, with the initial planned end speed V e Transitioning to the next segment of the trajectory, the initial planned terminal velocity V e is the initially planned speed on the VT map of the initial plan; When V s T<ε round <ΔS' Acc_1 When an interpolation cycle is added to the ViAi segment, for the ACC area where the ViAc segment does not exist, the maximum acceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation are calculated. e ; For the ACC area with ViAc segments, the maximum acceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal velocity V' after rounding error compensation are calculated. e ; When ΔS' Acc_1 <ε round <ΔS' Acc_2 When the ViAc segment is drawn, an interpolation cycle is added to the ViAc segment. For the ACC area where the ViAc segment does not exist when drawing the S-shaped acceleration and deceleration speed curve, an interpolation cycle is added as the ViAc segment. The maximum acceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation are calculated. e ; For the ACC area with ViAc segments, the maximum acceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal velocity V' after rounding error compensation are calculated. e ; When ΔS' Acc_2 <ε round <ΔS' Acc_3 When an interpolation cycle is added to the ViAd segment, for the ACC area where the ViAc segment does not exist, the maximum acceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation are calculated. e ; For the ACC area with ViAc segments, the maximum acceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal velocity V' after rounding error compensation are calculated. e ; When ΔS' Acc_3 <ε round When the initial planned terminal speed V e Add an interpolation cycle to calculate the maximum acceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation. e ; The ΔS' Acc_1 It is the displacement increment that keeps the initial planned terminal velocity unchanged when adding one interpolation cycle in the ViAi segment; The ΔS' Acc_2 It is the displacement increment that keeps the initial planned terminal velocity unchanged when adding one interpolation cycle in the ViAc segment; The ΔS' Acc_3 It is the displacement increment that keeps the initial planned terminal velocity unchanged when adding one interpolation cycle in the ViAd segment; When the S-shaped acceleration / deceleration speed curve has only the DEC zone, the displacement S of the DEC zone is calculated. Dec , the length of the current trajectory segment L, according to the displacement S of the DEC area Dec and the length L of the current trajectory segment, calculate the displacement residual ε round =LS Dec , and make the following judgments to select the corresponding real-time interpolation speed planning strategy to eliminate the rounding error: When ΔS' Dec_1 <ε round <V s When T, add an interpolation cycle as the starting speed V s , calculate the maximum acceleration A' after rounding error compensation, the maximum jerk J' after rounding error compensation, and the terminal velocity V' after rounding error compensation e : When ΔS' Dec_2 <ε round ≤ΔS' Dec_1 When an interpolation cycle is added to the VdDi segment, for the DEC area where there is no VdDc segment, the maximum deceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation are calculated. e ; For the DEC zone with VdDc segments, the maximum deceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation are calculated. e ; When ΔS' Dec_3 <ε round ≤ΔS' Dec_2 When the VdDc segment is added, an interpolation cycle is added to the VdDc segment. For the DEC area where the VdDc segment does not exist when drawing the S-shaped acceleration and deceleration speed curve, an interpolation cycle is added as the VdDc segment. The maximum deceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation are calculated. e ; For the DEC zone with VdDc segments, the maximum deceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation are calculated. e ; When V e T<ε round ≤ΔS' Dec_3 When an interpolation cycle is added to the VdDd segment, for the DEC area where the VdDc segment does not exist, the maximum deceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation are calculated. e ; For the DEC zone with VdDc segments, the maximum deceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation are calculated. e ; When ΔS' Dec_3 ≤ε round ≤V e At T, the terminal speed V e Add an interpolation cycle to calculate the maximum deceleration A' after rounding error compensation, the jerk of each segment after rounding error compensation, and the terminal speed V' after rounding error compensation. e ; When ε round <ΔS' Dec_3 , the transfer process is performed without passing the end point of the current trajectory segment, with the initial planned end speed V e Transition to the next section of the trajectory; The ΔS' Dec_1 It is the displacement increment that keeps the initial planned terminal velocity unchanged by adding one interpolation cycle in the VdDi segment; The ΔS' Dec_2 It is the displacement increment that keeps the initial planned terminal velocity unchanged when adding one interpolation cycle in the VdDc segment; The ΔS' Dec_3 The displacement increment is the displacement increment that keeps the terminal speed unchanged when adding an interpolation cycle in the VdDd segment; the ΔS Dec_3 is the displacement increment of the VdDd segment before rounding error compensation; When the S-shaped acceleration / deceleration speed curve has only ACC and DEC zones, an interpolation cycle is added as the CF zone to calculate the displacement S of the ACC zone. Acc , displacement S of DEC area Dec , displacement S of CF zone Vc , calculate the length L of the current trajectory segment, according to the displacement S of the ACC area Acc , displacement S of DEC area Dec , displacement S of CF zone Vc and the length L of the current trajectory segment, calculate the displacement residual ε round =LS Acc -S Dec -S Vc , and make the following judgments to select the corresponding real-time interpolation speed planning strategy to eliminate the rounding error: When ε round <V s T&&ε round <V e T, the transfer process is performed without passing the end point of the current trajectory segment, with the initial planned end speed V e Transition to the next section of the trajectory; When V s T<ε round <V e When T, the interpolation strategy with only the ACC area is selected; When V e T<ε round When , the interpolation strategy with only DEC area is selected; When the S-shaped acceleration / deceleration speed curve has a CF zone, the initial planned starting speed V is obtained. s , the initial planned terminal speed V e , the maximum speed V of the initial plan m , make the following judgment and select the corresponding real-time interpolation speed planning strategy to eliminate the rounding error: When there is no ACC and DEC area, that is, V s =V e =V m , then the transfer is performed without passing the end point of the current trajectory segment Processing, with the initial planned terminal speed V e Transition to the next section of the trajectory; When the ACC and CF regions exist, that is, V s <V e &&V e =V m , then select the interpolation strategy with only ACC area; When there are CF and DEC regions, that is, V s >V e &&V s =V m , then select the interpolation strategy with only DEC area; When ACC, CF and DEC regions exist, that is, V s <V m &&V e <V m , if V s ≤V e , then the interpolation strategy with only ACC area is selected, otherwise the interpolation strategy with only DEC area is selected.
