Method for calculating and processing optimized processing speed during path turning based on dynamic planning in numerical control system
By optimizing the turning instructions of all moving axes in three-dimensional space based on dynamic programming in CNC system, the problem of redundant machining time during turning in the prior art is solved, and faster machining speed and higher accuracy are achieved.
Patent Information
- Application Number
- CN202510020068.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-01-07
AI Technical Summary
During the straight interpolation and turning process, the existing CNC machine tools have redundant processing time, and fail to effectively take into account the maximum acceleration and appropriate turning start point, resulting in the processing speed not being fast enough.
The dynamic programming method is used to optimize the processing speed calculation and processing when turning instructions with all moving axes in three-dimensional space as objects. The specific steps include comparing the coordinates of the start and end points of multiple movement instructions, judging the turn situation, calculating the total turn time, determining the maximum acceleration direction, calculating the acceleration waveform, calculating the displacement and coordinates, and finally calculating the coordinates of all moving axes in each time period based on the control period of the CNC system.
It realizes the fastest processing speed when turning and interpolation in CNC system, and has the characteristics of fast speed, high accuracy, simple processing and strong adaptability, and meets the real-time requirements of CNC system.
Smart Images

Figure CN119882592A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of CNC machine tools, in particular to the field of interpolation, and specifically refers to a method, device, processor and computer-readable storage medium thereof for optimizing machining speed calculation and processing when a path is turned based on dynamic programming with all moving axes in three-dimensional space as objects in a CNC system. Background Art
[0002] The core of CNC machine tools is CNC software, and the core of CNC software is interpolation. Interpolation determines the accuracy, smoothness and processing efficiency of parts processed by CNC machine tools. Among them, the turning process of linear interpolation is extremely important to the processing process. In the linear interpolation algorithm, the algorithm for the processing speed of turning instructions in the CNC field is still immature. The reason is that the starting point position and the jerk in a single direction when processing the turning instruction are improperly controlled, resulting in redundant processing time. An appropriate algorithm has not been found to take into account the maximum jerk and the appropriate turning starting point to achieve a faster processing speed. Summary of the invention
[0003] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and to provide a method, device, processor and computer-readable storage medium thereof for optimizing processing speed calculation and processing when implementing turning instructions based on dynamic programming with three axes in a numerical control system that meets the requirements of short working time, small error and a wide range of applications.
[0004] In order to achieve the above-mentioned purpose, the method, device, processor and computer-readable storage medium thereof are as follows:
[0005] The method for optimizing the processing speed calculation when the path turns based on dynamic programming with all the moving axes in three-dimensional space as the object in the numerical control system is mainly characterized in that the method comprises the following steps:
[0006] (1) Compare the starting point coordinates and the ending point coordinates of multiple movement instructions in the set path to determine whether the previous and next movement instructions have a turning situation;
[0007] (2) Calculate the total turning time T based on the accelerations in all moving axis directions during the process of reaching the turning interpolation starting point;
[0008] (3) Determine the magnitude of the acceleration in all moving axis directions and determine the direction in which the jerk reaches its maximum value;
[0009] (4) Calculate the jerk in all moving axis directions according to the maximum jerk and the axis ratio;
[0010] (5) Calculate the acceleration waveform according to (4) to obtain the time u of the acceleration increase phase and the time p of the acceleration constant phase during the turning process;
[0011] (6) Calculate the displacements Sx and Sy in all moving axis directions during the turning process;
[0012] (7) Calculate the A1 coordinates based on the displacements in all moving axis directions;
[0013] (8) Based on the displacement, velocity and acceleration waveform parameters, the coordinates of all moving axes in each time period are calculated using the control cycle of the CNC system.
[0014] Preferably, the step (2) specifically comprises the following steps:
[0015] (2.1) Compare the speed differences in the x, y, and z directions, take the speed difference ΔV as the value in the direction with the largest speed difference, and continue with step (2.2);
[0016] (2.2) Determine whether the speed difference ΔV is less than the maximum jerk Jmax. If so, proceed to step (2.3); otherwise, proceed to step (2.4);
[0017] (2.3) Calculate the total turning time based on the speed difference ΔV and the maximum jerk Jmax;
[0018] (2.4) Calculate the total turning time based on the speed difference ΔV, the maximum jerk Jmax, and the time Ta for the acceleration to increase from 0 to the maximum value.
[0019] Preferably, the step (5) specifically comprises the following steps:
[0020] (5.1) Compare the turning time T with the time Ta for the acceleration to increase from 0 to the maximum value, calculate the axis ratio to determine whether the acceleration waveform is a triangle. If so, proceed to step (5.2); otherwise, proceed to step (5.3);
[0021] (5.2) If the acceleration waveform is a triangle, the time u of the acceleration increase phase is half of the turning time T, and the time p of the acceleration constant phase is 0;
[0022] (5.3) If the acceleration waveform is not a triangle, the value of the time u of the acceleration increase phase is the time Ta for the acceleration to increase from 0 to the maximum value, and the time p of the acceleration constant phase is the turning time T minus twice Ta.
[0023] Preferably, the step (6) specifically comprises the following steps:
[0024] (6.1) Using the triangle area formula, with the sum of the velocities in the x direction as the base and the turning time T as the height, calculate the displacement in the x direction;
[0025] (6.2) Using the triangle area formula, with the sum of the velocities in the y direction as the base and the turning time T as the height, calculate the displacement in the y direction;
[0026] Preferably, the step (7) specifically comprises the following steps:
[0027] (7.1) The turning starting point in the first movement instruction that is judged to meet the turning condition is called point A1, and its coordinates in three-dimensional space are set to (Xa, Ya, Za); the turning end point in the second movement instruction is called point C1, and its coordinates in three-dimensional space are set to (Xc, Yc, Zc);
[0028] (7.2) The starting point B0 of the first moving instruction has coordinates (X0, Y0, Z0), and the end point B1 has coordinates (X1, Y1, Z1). The starting point of the second moving instruction is B1, and the end point B2 has coordinates (X2, Y2, Z2). The geometric relationship between the above B0, B1, and B2 and the coordinates of points A1 and C1 is calculated in proportion.
[0029] (7.3) In three-dimensional space, the difference between the coordinates of point A1 and point C1 in each moving axis direction is equal to the displacement formed by the moving instructions in each moving axis direction, and the equation of the coordinates of point A1 and point C1 about the displacement is obtained;
[0030] (7.4) Use the coordinates of points B0, B1, and B2 to perform interpolation calculations on the geometric relationship, and use the resulting formula to replace the formula related to the coordinates of points B0, B1, and B2 in the formula obtained in step (7.2);
[0031] (7.5) Simplify the equation obtained in (7.4) to obtain an equation that only concerns the coordinates of points B0, B1, and B2;
[0032] (7.6) Determine whether equation (7.5) has a solution. If so, proceed to step (7.7); otherwise, proceed to step (7.8);
[0033] (7.7) If the equation obtained in step (7.5) has no solution, that is, the current situation does not meet the turning condition, end the step;
[0034] (7.8) If the equation obtained in step (7.5) has a solution, then a set of equations about the coordinates of point A1 (Xa, Ya, Za) and the coordinates of points B0, B1, and B2 are calculated from the equation obtained in (7.5), and then continue with step (7.9);
[0035] (7.9) Simplify the equation obtained in (7.8) to obtain the coordinates of point A1 (Xa, Ya, Za), and continue with step (7.10);
[0036] (7.10) According to the geometric relationship between the coordinates of point A1 (Xa, Ya, Za) and the coordinates of point C1 (Xc, Yc, Zc) and the displacement of the turning process in all moving axis directions, Xc = Sx-Xa, Yc = Sy-Ya, calculate the coordinates of point C1 (Xc, Yc).
[0037] The device for realizing optimized processing speed calculation and processing when performing turning instructions based on dynamic programming with three axes as objects in a numerical control system is mainly characterized in that the device comprises:
[0038] a processor configured to execute computer-executable instructions;
[0039] A memory stores one or more computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the method for optimizing the processing speed calculation when implementing turning instructions based on dynamic programming with three axes as the object in the above-mentioned numerical control system are implemented.
[0040] The processor for realizing the optimization of processing speed calculation processing when turning instructions are carried out with three axes as the object based on dynamic programming in the numerical control system has the main feature that the processor is configured to execute computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the method for optimizing processing speed calculation processing when turning instructions are carried out with three axes as the object based on dynamic programming in the above-mentioned numerical control system are realized.
[0041] The computer-readable storage medium has the main feature of storing a computer program thereon, which can be executed by a processor to implement the various steps of the method for optimizing the processing speed calculation and processing when implementing turning instructions based on dynamic programming with three axes as the object in the above-mentioned numerical control system.
[0042] The method, device, processor and computer-readable storage medium thereof for optimizing processing speed calculation processing when implementing turning instructions based on dynamic programming with three axes in a numerical control system of the present invention are adopted to ensure that the jerk in one of the axis directions is always kept at the maximum, thereby achieving the fastest processing during turning interpolation. The method, device, processor and computer-readable storage medium thereof for optimizing processing speed calculation processing when implementing turning instructions based on dynamic programming with three axes as the object ... have the characteristics of fast speed, high precision, simple processing and strong adaptability to changes in input parameters and instruction parameters. The method, device, processor and computer-readable storage medium thereof for optimizing processing speed calculation processing when implementing turning instructions BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1The present invention is a flow chart of a method for optimizing processing speed calculation and processing when implementing turning instructions with three axes as objects based on dynamic programming in a numerical control system of the present invention, which distinguishes different turning duration situations.
[0044] Figure 2 It is a schematic diagram of the interpolation instruction starting point and the turning starting point of the method for optimizing the processing speed calculation when implementing the turning instruction based on dynamic programming with three axes as the object in the numerical control system of the present invention.
[0045] Figure 3 It is a schematic diagram of a curve generated by acceleration data obtained by a method for optimizing machining speed calculation processing when implementing turning instructions with three axes as objects based on dynamic programming in the numerical control system of the present invention.
[0046] Figure 4 It is a schematic diagram of a curve generated by speed data obtained by a method for optimizing processing speed calculation processing when implementing turning instructions with three axes as objects based on dynamic programming in the numerical control system of the present invention.
[0047] Figure 5 It is a schematic diagram of a trajectory curve obtained by a method for optimizing processing speed calculation when implementing turning instructions with three axes as objects based on dynamic programming in the numerical control system of the present invention.
[0048] Figure 6 The present invention is a flow chart of a method for optimizing processing speed calculation based on dynamic programming when implementing turning instructions with three axes as objects in the numerical control system of the present invention. DETAILED DESCRIPTION
[0049] In order to more clearly describe the technical content of the present invention, further description is given below in conjunction with specific embodiments.
[0050] The method for optimizing the processing speed calculation when the path turns based on dynamic programming in the numerical control system of the present invention with all the moving axes in three-dimensional space as objects comprises the following steps:
[0051] (1) Compare the starting point coordinates and the ending point coordinates of multiple movement instructions in the set path to determine whether the previous and next movement instructions have a turning situation;
[0052] (2) Calculate the total turning time T based on the accelerations in all moving axis directions during the process of reaching the turning interpolation starting point;
[0053] (3) Determine the magnitude of the acceleration in all moving axis directions and determine the direction in which the jerk reaches its maximum value;
[0054] (4) Calculate the jerk in all moving axis directions according to the maximum jerk and the axis ratio;
[0055] (5) Calculate the acceleration waveform according to (4) to obtain the time u of the acceleration increase phase and the time p of the acceleration constant phase during the turning process;
[0056] (6) Calculate the displacements Sx and Sy in all moving axis directions during the turning process;
[0057] (7) Calculate the A1 coordinates based on the displacements in all moving axis directions;
[0058] (8) Based on the displacement, velocity and acceleration waveform parameters, the coordinates of all moving axes in each time period are calculated using the control cycle of the CNC system.
[0059] As a preferred embodiment of the present invention, the step (2) specifically comprises the following steps:
[0060] (2.1) Compare the speed differences in the x, y, and z directions, take the speed difference ΔV as the value in the direction with the largest speed difference, and continue with step (2.2);
[0061] (2.2) Determine whether the speed difference ΔV is less than the maximum jerk Jmax. If so, proceed to step (2.3); otherwise, proceed to step (2.4);
[0062] (2.3) Calculate the total turning time based on the speed difference ΔV and the maximum jerk Jmax;
[0063] (2.4) Calculate the total turning time based on the speed difference ΔV, the maximum jerk Jmax, and the time Ta for the acceleration to increase from 0 to the maximum value.
[0064] As a preferred embodiment of the present invention, the step (5) specifically comprises the following steps:
[0065] (5.1) Compare the turning time T with the time Ta for the acceleration to increase from 0 to the maximum value, calculate the axis ratio to determine whether the acceleration waveform is a triangle. If so, proceed to step (5.2); otherwise, proceed to step (5.3);
[0066] (5.2) If the acceleration waveform is a triangle, the time u of the acceleration increase phase is half of the turning time T, and the time p of the acceleration constant phase is 0;
[0067] (5.3) If the acceleration waveform is not a triangle, the value of the time u of the acceleration increase phase is the time Ta for the acceleration to increase from 0 to the maximum value, and the time p of the acceleration constant phase is the turning time T minus twice Ta.
[0068] As a preferred embodiment of the present invention, the step (6) specifically comprises the following steps:
[0069] (6.1) Using the triangle area formula, with the sum of the velocities in the x direction as the base and the turning time T as the height, calculate the displacement in the x direction;
[0070] (6.2) Using the triangle area formula, with the sum of the velocities in the y direction as the base and the turning time T as the height, calculate the displacement in the y direction;
[0071] As a preferred embodiment of the present invention, the step (7) specifically comprises the following steps:
[0072] (7.1) The turning starting point in the first movement instruction that is judged to meet the turning condition is called point A1, and its coordinates in three-dimensional space are set to (Xa, Ya, Za); the turning end point in the second movement instruction is called point C1, and its coordinates in three-dimensional space are set to (Xc, Yc, Zc);
[0073] (7.2) The starting point B0 of the first moving instruction has coordinates (X0, Y0, Z0), and the end point B1 has coordinates (X1, Y1, Z1). The starting point of the second moving instruction is B1, and the end point B2 has coordinates (X2, Y2, Z2). The geometric relationship between the above B0, B1, and B2 and the coordinates of points A1 and C1 is calculated in proportion.
[0074] (7.3) In three-dimensional space, the difference between the coordinates of point A1 and point C1 in each moving axis direction is equal to the displacement formed by the moving instructions in each moving axis direction, and the equation of the coordinates of point A1 and point C1 about the displacement is obtained;
[0075] (7.4) Use the coordinates of points B0, B1, and B2 to perform interpolation calculations on the geometric relationship, and use the resulting formula to replace the formula related to the coordinates of points B0, B1, and B2 in the formula obtained in step (7.2);
[0076] (7.5) Simplify the equation obtained in (7.4) to obtain an equation that only concerns the coordinates of points B0, B1, and B2;
[0077] (7.6) Determine whether equation (7.5) has a solution. If so, proceed to step (7.7); otherwise, proceed to step (7.8);
[0078] (7.7) If the equation obtained in step (7.5) has no solution, that is, the current situation does not meet the turning condition, end the step;
[0079] (7.8) If the equation obtained in step (7.5) has a solution, then a set of equations about the coordinates of point A1 (Xa, Ya, Za) and the coordinates of points B0, B1, and B2 are calculated from the equation obtained in (7.5), and then continue with step (7.9);
[0080] (7.9) Simplify the equation obtained in (7.8) to obtain the coordinates of point A1 (Xa, Ya, Za), and continue with step (7.10);
[0081] (7.10) According to the geometric relationship between the coordinates of point A1 (Xa, Ya, Za) and the coordinates of point C1 (Xc, Yc, Zc) and the displacement of the turning process in all moving axis directions, Xc = Sx-Xa, Yc = Sy-Ya, calculate the coordinates of point C1 (Xc, Yc).
[0082] The device of the present invention is used to realize the calculation and processing of optimizing the processing speed when the path turns based on dynamic programming with all the moving axes in the three-dimensional space as the object in the numerical control system, wherein the device comprises:
[0083] a processor configured to execute computer executable instructions;
[0084] A memory stores one or more computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the method for optimizing the calculation and processing of the machining speed when the path turns based on dynamic programming with all the moving axes in the three-dimensional space as the object in the above-mentioned numerical control system are implemented.
[0085] The present invention is a processor for realizing a method for optimizing the calculation and processing of the processing speed when a path turns based on dynamic programming with all moving axes in three-dimensional space as objects in a numerical control system, wherein the processor is configured to execute computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the method for optimizing the calculation and processing of the processing speed when a path turns based on dynamic programming with all moving axes in three-dimensional space as objects in the above-mentioned numerical control system are realized.
[0086] The computer-readable storage medium of the present invention stores a computer program thereon, and the computer program can be executed by a processor to implement the various steps of the method for optimizing the calculation and processing of the processing speed when the path turns based on dynamic programming with all moving axes in three-dimensional space as objects in the above-mentioned numerical control system.
[0087] In a specific embodiment of the present invention, the calculation defects of the above-mentioned existing algorithms are overcome, and a method for optimizing the calculation and processing of the processing speed when the path is turned is provided in a CNC system with a wide range of applications, taking all moving axes in three-dimensional space as objects based on dynamic programming, while taking into account both acceleration and the selection of the starting point of the turn.
[0088] The method for optimizing the processing speed calculation when the path turns based on dynamic programming in the numerical control system of the present invention with all the moving axes in three-dimensional space as objects comprises the following steps:
[0089] (1) Compare the starting point coordinates and the ending point coordinates of multiple movement instructions in the set path to determine whether the previous and next movement instructions have a turning situation;
[0090] (2) Calculate the total turning time T based on the accelerations in all moving axis directions during the process of reaching the turning interpolation starting point;
[0091] (3) Determine the magnitude of the acceleration in all moving axis directions and determine the direction in which the jerk reaches its maximum value;
[0092] (4) Calculate the jerk in all moving axis directions according to the maximum jerk and the axis ratio;
[0093] (5) Calculate the acceleration waveform according to (4) to obtain the time u of the acceleration increasing stage and the time p of the acceleration remaining constant stage during the turning process (referred to as acceleration waveform parameters);
[0094] (6) Calculate the displacements Sx and Sy in all moving axis directions during the turning process;
[0095] (7) Calculate the A1 coordinates based on the displacements in all moving axis directions;
[0096] (8) Based on the displacement, velocity and acceleration waveform parameters, the paths (coordinates) of all moving axes in each time period are calculated in units of the control cycle of the CNC system (this is called interpolation).
[0097] The step (2) specifically comprises the following steps:
[0098] (2.1) Compare the speed differences in the x, y, and z directions, take the speed difference ΔV as the value in the direction with the largest speed difference, and continue with step (2.2);
[0099] (2.2) Determine whether the speed difference ΔV is less than the maximum jerk Jmax. If so, proceed to step (2.3); otherwise, proceed to step (2.4);
[0100] (2.3) According to the speed difference ΔV and the maximum jerk Jmax, calculate the total turning time T = 2 × sqrt (ΔV / Jmax);
[0101] (2.4) Based on the speed difference ΔV, the maximum jerk Jmax, and the time Ta for the acceleration to increase from 0 to the maximum value, calculate the total turning time T = ΔV / Jmax / Ta+Ta.
[0102] The step (5) specifically comprises the following steps:
[0103] (5.1) Compare the turning time T with the time Ta for the acceleration to increase from 0 to the maximum value, calculate the axis ratio to determine whether the acceleration waveform is a triangle. If so, proceed to step (5.2); otherwise, proceed to step (5.3);
[0104] (5.2) If the acceleration waveform is a triangle, the time u of the acceleration increase phase is half of the turning time T, and the time p of the acceleration constant phase is 0;
[0105] (5.3) If the acceleration waveform is not a triangle, the value of the time u of the acceleration increase phase is the time Ta for the acceleration to increase from 0 to the maximum value, and the time p of the acceleration constant phase is the turning time T minus twice Ta.
[0106] The step (6) specifically comprises the following steps:
[0107] (6.1) Using the triangle area formula, with the sum of the velocities in the x direction as the base and the turning time T as the height, calculate the displacement in the x direction;
[0108] (6.2) Using the triangle area formula, with the sum of the velocities in the y direction as the base and the turning time T as the height, calculate the displacement in the y direction;
[0109] The step (7) specifically comprises the following steps:
[0110] (7.1) The turning starting point in the first movement instruction that is judged to meet the turning condition is called point A1, and its coordinates in three-dimensional space are set to (Xa, Ya, Za); the turning end point in the second movement instruction is called point C1, and its coordinates in three-dimensional space are set to (Xc, Yc, Zc);
[0111] (7.2) The starting point B0 of the first moving instruction has coordinates (X0, Y0, Z0), and the end point B1 has coordinates (X1, Y1, Z1). The starting point of the second moving instruction is B1, and the end point B2 has coordinates (X2, Y2, Z2). The geometric relationship between the above B0, B1, and B2 and the coordinates of points A1 and C1 is calculated in proportion.
[0112] (7.3) In three-dimensional space, the difference between the coordinates of point A1 and point C1 in each moving axis direction is equal to the displacement formed by the moving instructions in each moving axis direction, and the equation of the coordinates of point A1 and point C1 about the displacement is obtained;
[0113] (7.4) Use the coordinates of points B0, B1, and B2 to perform interpolation calculations on the geometric relationship, and use the resulting formula to replace the formula related to the coordinates of points B0, B1, and B2 in the formula obtained in step (7.2);
[0114] (7.5) Simplify the equation obtained in (7.4) to obtain an equation that only concerns the coordinates of points B0, B1, and B2;
[0115] (7.6) Determine whether equation (7.5) has a solution. If so, proceed to step (7.7); otherwise, proceed to step (7.8);
[0116] (7.7) If the equation obtained in step (7.5) has no solution, that is, the current situation does not meet the turning condition, end the step;
[0117] (7.8) If the equation obtained in step (7.5) has a solution, then a set of equations about the coordinates of point A1 (Xa, Ya, Za) and the coordinates of points B0, B1, and B2 are calculated from the equation obtained in (7.5), and then continue with step (7.9);
[0118] (7.9) Simplify the equation obtained in (7.8) to obtain the coordinates of point A1 (Xa, Ya, Za), and continue with step (7.10);
[0119] (7.10) According to the geometric relationship between the coordinates of point A1 (Xa, Ya, Za) and the coordinates of point C1 (Xc, Yc, Zc) and the displacement of the turning process in all moving axis directions, Xc = Sx-Xa, Yc = Sy-Ya, calculate the coordinates of point C1 (Xc, Yc).
[0120] The algorithm principle of the present invention is as follows:
[0121] 1. Achievement of the fastest goal:
[0122] There must be an axis in which the jerk reaches its maximum value;
[0123] The speeds V1 and V2 must be tangent to the interpolation trajectory;
[0124] In the tangent direction, t1 (the time from the start point of the turn to the point with the minimum accuracy) is equal to t2 (the time from the point with the minimum accuracy to the end point of the turn);
[0125] The turning start point A1 and the turning end point C2 are predetermined by calculating the geometric relationship between the coordinates of B0, B1, B2 and A1, C1.
[0126] 2. Classification planning algorithm:
[0127] In order to achieve the above goals, it is necessary to find the best (i.e. fastest) turning interpolation solution in the two displacement instructions under the constraints of time, speed and acceleration.
[0128] The present invention adopts a classification planning algorithm to distinguish different turning durations. The algorithm flow is as follows: Figure 1 The principle of the algorithm is as follows:
[0129] The velocity interpolation of the corresponding axis is determined based on the velocity interpolation of the two displacements in the x, y, and z directions. The relationship between the turning time T and the jerk and acceleration time Ta is determined by comparing with the maximum and jerk, and then the corresponding u and p are calculated based on the different acceleration waveforms. In this way, the same mathematical model can cope with various scenarios, and the calculation is relatively simple and the response speed is fast.
[0130] The interpolation method mentioned in this method is:
[0131] Record the current time as t, displacement as s, velocity as v, acceleration as a, and J as the jerk in the axial direction:
[0132] t+=T;
[0133] s+=v×T;
[0134] Where T is the interpolation time period.
[0135] If the current speed is uniform, v remains unchanged, otherwise v+=a×T;
[0136] There are three situations according to the different stages:
[0137] If it is in the stage of increasing acceleration, then a+=J×T;
[0138] If it is in the stage of decreasing acceleration, then a-=J×T;
[0139] Otherwise, a remains unchanged.
[0140] According to the acceleration of all moving axis directions during the process of reaching the turning interpolation starting point, the total turning time T is calculated, which specifically includes the following steps:
[0141] (2.1) Compare the speed differences in the x, y, and z directions, take the speed difference ΔV as the value in the direction with the largest speed difference, and continue with step (2.2);
[0142] (2.2) Determine whether the speed difference ΔV is less than the maximum jerk Jmax. If so, proceed to step (2.3); otherwise, proceed to step (2.4);
[0143] (2.3) According to the speed difference ΔV and the maximum jerk Jmax, calculate the total turning time T1 = 2 × sqrt (ΔV / Jmax);
[0144] (2.4) Based on the speed difference ΔV, the maximum jerk Jmax, and the time Ta for the acceleration to increase from 0 to the maximum value, calculate the total turning time T2 = ΔV / Jmax / Ta+Ta.
[0145] The total turning time T1 is calculated in step (2.3), specifically:
[0146] The total turning time T1 is calculated according to the following formula:
[0147] T1 = 2 × sqrt (ΔV / Jmax);
[0148] The total turning time T2 is calculated in step (2.3), specifically:
[0149] The total turning time T2 is calculated according to the following formula:
[0150] T2=ΔV / Jmax / Ta+Ta;
[0151] Where ΔV is the velocity difference, Jmax is the maximum jerk, and Ta is the time of the maximum value.
[0152] The implementation results of the embodiment are as follows:
[0153] In the numerical control system of the present invention, a method for optimizing the processing speed calculation process when the path turns is realized based on dynamic programming with all the moving axes in three-dimensional space as the object, wherein the x-direction acceleration and y-direction acceleration values obtained by calculation generate a curve and the waveform is as follows Figure 2 shown.
[0154] In the numerical control system of the present invention, a method for optimizing the processing speed calculation process when the path turns is realized based on dynamic programming with all the moving axes in three-dimensional space as the object, wherein the speed value obtained by calculation generates a curve and the waveform is as follows Figure 3 shown.
[0155] The method for optimizing the processing speed calculation when the path turns based on dynamic programming in the numerical control system of the present invention is implemented with all the moving axes in three-dimensional space as objects, wherein the interpolation trajectory obtained by calculation is in the form of Figure 4 shown.
[0156] The specific implementation scheme of this embodiment can refer to the relevant description in the above embodiment, which will not be repeated here.
[0157] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.
[0158] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" refers to at least two.
[0159] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.
[0160] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution device. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0161] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the corresponding program may be stored in a computer-readable storage medium, which, when executed, includes one of the steps of the method embodiment or a combination thereof.
[0162] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0163] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0164] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0165] The method, device, processor and computer-readable storage medium thereof for optimizing processing speed calculation processing when implementing turning instructions based on dynamic programming with three axes in a numerical control system of the present invention are adopted to ensure that the jerk in one of the axis directions is always kept at the maximum, thereby achieving the fastest processing during turning interpolation. The method, device, processor and computer-readable storage medium thereof for optimizing processing speed calculation processing when implementing turning instructions based on dynamic programming with three axes as the object ... have the characteristics of fast speed, high precision, simple processing and strong adaptability to changes in input parameters and instruction parameters. The method, device, processor and computer-readable storage medium thereof for optimizing processing speed calculation processing when implementing turning instructions
[0166] In this specification, the present invention has been described with reference to specific embodiments thereof. However, it is apparent that various modifications and variations may be made without departing from the spirit and scope of the present invention. Therefore, the specification and drawings should be regarded as illustrative rather than restrictive.
Claims
1. A method for optimizing processing speed calculation based on dynamic programming in a numerical control system with all moving axes in three-dimensional space as objects when realizing path turning, characterized in that: The method comprises the following steps: (1) Compare the starting point coordinates and the ending point coordinates of multiple movement instructions in the set path to determine whether the previous and next movement instructions have a turning situation; (2) Calculate the total turning time T based on the accelerations in all moving axis directions during the process of reaching the turning interpolation starting point; (3) Determine the magnitude of the acceleration in all moving axis directions and determine the direction in which the jerk reaches its maximum value; (4) Calculate the jerk in all moving axis directions according to the maximum jerk and the axis ratio; (5) Calculate the acceleration waveform according to (4) to obtain the time u of the acceleration increase phase and the time p of the acceleration constant phase during the turning process; (6) Calculate the displacements Sx and Sy in all moving axis directions during the turning process; (7) Calculate the A1 coordinate based on the displacement in all moving axis directions; (8) Based on the displacement, velocity and acceleration waveform parameters, the coordinates of all moving axes in each time period are calculated using the control cycle of the CNC system.
2. The method for optimizing the processing speed calculation when the path turns based on dynamic programming with all moving axes in three-dimensional space as objects in a numerical control system according to claim 1, characterized in that: The step (2) specifically comprises the following steps: (2.1) Compare the speed differences in the x, y, and z directions, take the speed difference ΔV as the value in the direction with the largest speed difference, and continue with step (2.2); (2.2) Determine whether the speed difference ΔV is less than the maximum jerk Jmax. If so, proceed to step (2.3); otherwise, proceed to step (2.4); (2.3) Calculate the total turning time based on the speed difference ΔV and the maximum jerk Jmax; (2.4) Calculate the total turning time based on the speed difference ΔV, the maximum jerk Jmax, and the time Ta for the acceleration to increase from 0 to the maximum value.
3. The method for optimizing the processing speed calculation when the path turns based on dynamic programming with all the moving axes in three-dimensional space as the object in the numerical control system according to claim 1, characterized in that: The step (5) specifically comprises the following steps: (5.1) Compare the turning time T with the time Ta for the acceleration to increase from 0 to the maximum value, calculate the axis ratio to determine whether the acceleration waveform is a triangle. If so, proceed to step (5.2); otherwise, proceed to step (5.3); (5.2) If the acceleration waveform is a triangle, the time u of the acceleration increase phase is half of the turning time T, and the time p of the acceleration constant phase is 0; (5.3) If the acceleration waveform is not a triangle, the value of the time u of the acceleration increase phase is the time Ta for the acceleration to increase from 0 to the maximum value, and the time p of the acceleration constant phase is the turning time T minus twice Ta.
4. The method for optimizing the processing speed calculation when the path turns based on dynamic programming with all the moving axes in three-dimensional space as objects in a numerical control system according to claim 1, characterized in that: The step (6) specifically comprises the following steps: (6.1) Using the triangle area formula, with the sum of the velocities in the x direction as the base and the turning time T as the height, calculate the displacement in the x direction; (6.2) Using the triangle area formula, with the sum of the velocities in the y direction as the base and the turning time T as the height, calculate the displacement in the y direction.
5. The method for optimizing the processing speed calculation when the path turns based on dynamic programming with all the moving axes in three-dimensional space as objects in a numerical control system according to claim 1, characterized in that: The step (7) specifically comprises the following steps: (7.1) The turning starting point in the first movement instruction that is judged to meet the turning condition is called point A1, and its coordinates in three-dimensional space are set to (Xa, Ya, Za); the turning end point in the second movement instruction is called point C1, and its coordinates in three-dimensional space are set to (Xc, Yc, Zc); (7.2) The starting point B0 of the first moving instruction has coordinates (X0, Y0, Z0), and the end point B1 has coordinates (X1, Y1, Z1). The starting point of the second moving instruction is B1, and the end point B2 has coordinates (X2, Y2, Z2). The geometric relationship between the above B0, B1, and B2 and the coordinates of points A1 and C1 is calculated in proportion. (7.3) In three-dimensional space, the difference between the coordinates of point A1 and point C1 in each moving axis direction is equal to the displacement formed by the moving instructions in each moving axis direction, and the equation of the coordinates of point A1 and point C1 about the displacement is obtained; (7.4) Use the coordinates of points B0, B1, and B2 to perform interpolation calculations on the geometric relationship, and use the resulting formula to replace the formula related to the coordinates of points B0, B1, and B2 in the formula obtained in step (7.2); (7.5) Simplify the equation obtained in (7.4) to obtain an equation that only concerns the coordinates of points B0, B1, and B2; (7.6) Determine whether equation (7.5) has a solution. If so, proceed to step (7.7); otherwise, proceed to step (7.8); (7.7) If the equation obtained in step (7.5) has no solution, that is, the current situation does not meet the turning condition, end the step; (7.8) If the equation obtained in step (7.5) has a solution, then a set of equations about the coordinates of point A1 (Xa, Ya, Za) and the coordinates of points B0, B1, and B2 are calculated from the equation obtained in (7.5), and then continue with step (7.9); (7.9) Simplify the equation obtained in (7.8) to obtain the coordinates of point A1 (Xa, Ya, Za), and continue with step (7.10); (7.10) According to the geometric relationship between the coordinates of point A1 (Xa, Ya, Za) and the coordinates of point C1 (Xc, Yc, Zc) and the displacement of the turning process in all moving axis directions, Xc = Sx-Xa, Yc = Sy-Ya, calculate the coordinates of point C1 (Xc, Yc).
6. A device for realizing the calculation and processing of optimizing the processing speed when the path turns based on dynamic programming with all moving axes in three-dimensional space as objects in a numerical control system, characterized in that: The device comprises: a processor configured to execute computer executable instructions; A memory storing one or more computer executable instructions, wherein when the computer executable instructions are executed by the processor, the steps of the method for optimizing the calculation and processing of the machining speed when implementing a turning instruction based on dynamic programming with three axes as the object in the numerical control system according to any one of claims 1 to 3 are implemented.
7. A processor for realizing the optimization of processing speed calculation when the path turns based on dynamic programming with all moving axes in three-dimensional space as objects in a numerical control system, characterized in that: The processor is configured to execute computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the method for optimizing the calculation and processing of processing speed when implementing turning instructions based on dynamic programming with three axes as the object in the numerical control system described in any one of claims 1 to 3 are implemented.
8. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program can be executed by a processor to implement the various steps of optimizing the processing speed calculation process when the path turns based on dynamic programming with all moving axes in three-dimensional space as objects in the numerical control system described in any one of claims 1 to 3.
Citation Information
Patent Citations
Speed optimization method, device and equipment
CN113552839A
Method and device for realizing interpolation superposition processing based on dynamic programming in numerical control system, processor and computer readable storage medium thereof
CN118838254A
Robot trajectory control method
JP1993297916A
Cited By
Method and device for processing displacement instruction with non-zero end point speed based on dynamic programming, processor and storage medium thereof
CN120909225A
Method and device for processing displacement instruction with non-zero end point speed based on dynamic programming, processor and storage medium thereof
CN120909225B