A method for planning acceleration and deceleration parameters of a numerical control system based on a cuckoo algorithm
By constructing an abstract model with centrally symmetric acceleration and deceleration curves and combining iterative solutions using the Cuckoo algorithm, the problems of low iterative efficiency and poor portability in the CNC system acceleration and deceleration parameter planning method are solved, achieving efficient parameter planning and model adaptability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JIANGNAN UNIV
- Filing Date
- 2023-10-27
- Publication Date
- 2026-06-19
Smart Images

Figure CN117434891B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of motion control in industrial numerical control systems, and specifically to a method for planning acceleration and deceleration parameters based on the Cuckoo algorithm. Background Technology
[0002] Numerical control (NC) machining technology is a key technology in modern manufacturing systems and an important indicator of a country's manufacturing level. Acceleration and deceleration control, as a core technology in NC machining, directly affects the machining quality and efficiency of NC machine tools.
[0003] Currently, the most widely used acceleration and deceleration parameter planning method in engineering is based on the seven-segment S-shaped model. This method solves for the time of each stage of the entire motion process by giving the initial and final velocities, displacements, and dynamic parameter constraints. While the acceleration curve of the seven-segment S-shaped model is continuous throughout the motion, thus avoiding some flexible impacts, the multiple step accelerations within the model can still cause impacts on high-precision machine tools. Furthermore, the internal formulas of the acceleration and deceleration parameter planning method based on this model are complex, resulting in low iterative solution efficiency. Additionally, the acceleration and deceleration parameter planning method based on the seven-segment S-shaped model is only applicable to seven-segment S-shaped models and is not suitable for other models such as eleven-segment S-shaped models or sinusoidal models, exhibiting poor portability.
[0004] Therefore, there is still no solution to the problem of how to design a numerical control system acceleration and deceleration parameter planning method that is applicable to most acceleration and deceleration models with continuous acceleration and deceleration while improving iterative efficiency. Summary of the Invention
[0005] To address the problems existing in the aforementioned technologies, this invention provides a method for planning acceleration and deceleration parameters in CNC systems based on the Cuckoo algorithm. First, it constructs abstract acceleration and deceleration models with centrally symmetric acceleration and deceleration curves for both the acceleration and deceleration phases. Based on the principle of time optimization, the parameter planning problem during motion is transformed into an optimization problem. Combining the constraints in the problem, the optimal parameters are determined by scaling the acceleration and deceleration curves. Second, it concretizes the initial acceleration and deceleration curves for both phases, establishing a mapping relationship between the maximum speed and the shortest motion time, simplifying the calculation formula, reducing the dimensionality of the solution space, and improving iteration efficiency. Finally, it designs a fitness function within the Cuckoo algorithm. Based on this function, it iterates multiple times to find the optimal solution with the largest fitness value, thus ensuring higher iteration efficiency while being adaptable to other specific acceleration and deceleration models.
[0006] A method for planning acceleration and deceleration parameters of a CNC system based on the Cuckoo algorithm includes the following steps:
[0007] Step 1: Construct abstract acceleration / deceleration models with centrally symmetric acceleration / deceleration curves for both acceleration and deceleration phases.
[0008] Step 2: Establish a function of jerk with respect to time, and construct the maximum velocity V during the motion process based on this function. m With acceleration segment displacement S a and the displacement S of the deceleration phase d The functional relationship between them. The function J(t) of the acceleration phase with respect to time is shown in equation (1):
[0009]
[0010] in
[0011]
[0012] Where f(t) is the acceleration curve function of the first segment of the acceleration phase, and T i (i = 1...11) represent the time intervals within the model, t i (i = 1...11) represent the time nodes within the model, from which the maximum acceleration A during the acceleration phase can be derived. am Maximum acceleration A during deceleration phase dm The expression is shown in equation (2):
[0013]
[0014] Where g(t) is the curve function of the initial acceleration during the deceleration phase. The acceleration time T can also be derived. a and deceleration time T d The expression is shown in equation (3):
[0015]
[0016] Where V s V e Let V be the initial and final velocities during the motion. Then, the maximum velocity V during the motion can be constructed. m and acceleration segment displacement S a and the displacement S of the deceleration phase d The relationship is expressed as shown in equation (4):
[0017]
[0018] Step 3: Based on the time-optimal criterion, the problem of solving the dynamic parameters is transformed into a multi-constraint optimization problem, and the maximum jerk constraint J during the acceleration phase is set. am-set Maximum acceleration constraint J during deceleration phase dm-set Maximum acceleration constraint A during acceleration phase am-set Maximum acceleration constraint A during deceleration phase dm-set and the maximum velocity constraint V throughout the entire motion process m-setThe expression for the optimization problem is shown in equation (5):
[0019]
[0020]
[0021] J am For the maximum acceleration during the acceleration phase, J dm S represents the maximum acceleration during the deceleration phase. set To set the displacement, S pla To plan the total displacement, the constraints are divided into five inequality constraints, namely dynamic parameter constraints, and one equality constraint, which represents the requirement for the moving part to accurately reach the given position; the objective function is the total motion time. The smaller the objective function value, the shorter the time it takes for the moving part to reach the given position. The solution space is [T1,T3,T6,T7,T9].
[0022] Step 4: Assume the initial velocity is less than the final velocity, and assume acceleration throughout the entire motion axis. The maximum velocity V during the motion is... m =V e The length of the domain interval of the function f(t) is denoted as T. 1-init T 1-init Determining the value of T is crucial to whether an optimization problem has a solution. Given the curve type, T... 1-init Take the maximum value first If in the domain [0, T] 1-init Within [the specified range], the maximum value J of the function f(t) is [the specified value]. am The acceleration constraint J is greater than the acceleration phase. am-set The entire curve is compressed; otherwise, it remains unchanged. The initial curve of the new acceleration segment, f(t), is shown. init The expression is as follows:
[0023]
[0024] Step 5: Determine whether the motion axis can accelerate from the initial velocity to the final velocity under the set maximum acceleration and given displacement.
[0025] Step 6: Based on the set maximum acceleration constraint J for the deceleration phase dm-set Initialize the function expression g(t) of the first segment of the deceleration acceleration curve in the deceleration phase, and simultaneously determine the length of its domain interval, denoted as T. 7-init T 7-init The range of values is In the domain [0,T] 7-init Within [the specified range], the maximum value J of the function g(t) is [the specified value]. dm The acceleration constraint J is greater than the deceleration phase constraint. dm-set The entire curve is compressed; otherwise, the curve remains unchanged. The initial curve of the new deceleration section, g(t), is shown.init The expression is as follows:
[0026]
[0027] Step 7: Design the cuckoo algorithm to solve for the maximum velocity V during the motion process. m Meanwhile, the number of initial solutions N and the probability of solution elimination P are set. a The maximum number of iterations T and the iteration count t=0.
[0028] Step 8: Design the formulas for updating and eliminating solutions using the Cuckoo algorithm. The formulas for updating solutions are shown in equations (8) and (9).
[0029]
[0030] in Let i be the value of the i-th solution in the (t+1)-th iteration. This represents the solution formed by the i-th solution in the t-th iteration. and Let represent two random solutions in the t-th iteration, α0 be the step size scaling factor, and Levy(β) be a random number that satisfies the Levy distribution, which can be determined by the following formula.
[0031]
[0032] The elimination solution formula is shown in equation (10).
[0033]
[0034] Where r ~ u(0,1) and ε ~ u(0,1). Heaviside(x) is a unit step function, where x≥0, Heaviside(x)=1; x<0, Heaviside(x)=0.
[0035] Step 9: Based on equation (4), establish the shortest motion time T for the entire process. m and maximum speed V m The mapping relationship between them is established, and the fitness function within the Cuckoo algorithm is constructed.
[0036] Step 10: In [V] e V m-set [Inner random initialization with respect to maximum speed V] m There are N solutions.
[0037] Step 11: Based on the fitness function constructed in step 9, calculate the fitness values of N initial solutions. According to equations (8) and (9), update the solutions randomly and calculate the fitness values of the updated solutions. Compare with the old solutions. The new solutions with higher fitness values replace the old solutions with lower fitness values; otherwise, they are not replaced.
[0038] Step 12: According to equation (10), randomly update a portion of the solutions to eliminate old solutions. Based on the fitness function constructed in step 9, calculate the fitness value of the new solution. The new solution with a higher fitness value replaces the old solution with a lower fitness value; otherwise, it is not replaced.
[0039] Step 13: Determine the solution with the largest fitness value among the N solutions in this iteration, and record the solution and its fitness value.
[0040] Step 14: Determine if the current iteration number t is less than the maximum iteration number T. If not, identify the solution with the largest fitness value among the T iterations, record the solution and its fitness value, consider the optimization problem solved and the planning task completed, and end the subsequent steps; if yes, increment t and jump to step 11.
[0041] The process of constructing the abstract acceleration / deceleration model with centrally symmetric acceleration and deceleration curves in step 1 is as follows:
[0042] (1) The acceleration and deceleration phases are designed separately. The deceleration motion is regarded as the reverse process of the acceleration motion. When building the model, it is necessary to ensure that the dynamic parameters are matched from the acceleration to uniform speed and from uniform speed to deceleration transition point.
[0043] (2)T1=T2=T4=T5, T7=T8=T 10 =T 11 Parametric programming for T1, T3, T6, T7 and T9.
[0044] (3) When t∈[0,t1], the accelerometer curve is characterized by the function f(t). The curve in [t1,t2] is symmetric to the curve in [0,t1] about the axis of t=t1, and the curve in [t3,t5] is symmetric to the curve in [0,t2] about the axis of t=t1. It is centrally symmetric; when t∈[t6,t7], the jerk curve is characterized by the function -g(t-t6), and the characteristics of the jerk curve in the deceleration segment are consistent with those in the acceleration segment.
[0045] (4) The velocity curve of the acceleration segment within the model about point Centrally symmetric, the velocity curve of the deceleration segment about point It is centrally symmetric, but globally asymmetric.
[0046] (5) f(t) in The expression is continuous within the expression and f′(t) exists, while |f′(t)|≤snap_a, f(t) max =J am , f(t) min ≥0.
[0047] (6) g(t) in The expression is continuous within the expression and g′(t) exists, while |g′(t)|≤snap_d, g(t) max =J dm , g(t) min ≥0.
[0048] (7) S(0)=0,V(0)=V s , A(0)=0.
[0049] Where S set To set the displacement, snap_a is the slope constraint of the acceleration curve of the acceleration segment, snap_d is the slope constraint of the acceleration curve of the deceleration segment, S(0) is the initial position, V(0) is the initial velocity, and A(0) is the initial acceleration.
[0050] In step 5, it is determined whether the motion axis can accelerate from the initial velocity to the final velocity under the set maximum acceleration and given displacement, according to the following set of inequalities:
[0051]
[0052] Where, ΔV e-s =V e -V s , representing the final velocity V e and initial velocity V s The speed difference, when the solution sets of the four inequalities intersect, the intersection must be an interval. The subintervals are defined, and a T is determined within the intersection. 1-init That should solve the problem.
[0053] If there is no intersection, calculate the maximum acceleration and the total motion time according to the following formula. Then, consider the optimization problem solved and the planning task completed, and end the subsequent steps.
[0054] when At this moment, acceleration A am and acceleration time T s-e The expression is as follows:
[0055] A am =A am-set (12)
[0056]
[0057] when At this moment, acceleration A am and acceleration time T s-e The expression is as follows:
[0058]
[0059]
[0060] In step 9, the mapping relationship between the shortest movement time and the maximum speed of the entire process is established. The specific steps for constructing the fitness function within the Cuckoo algorithm are as follows:
[0061] (1) The acceleration curve f(t) of the first segment of the acceleration phase. init The initial acceleration curve g(t) during the deceleration phase. init Perform lateral scaling, and denote the lateral scaling factor *a* for the acceleration segment curve and the lateral scaling factor *d* for the deceleration segment. The lengths of the domain intervals after scaling are T1 and T7. Simultaneously, denote the initial curves of the acceleration segment as F(t,a) and the initial curves of the deceleration segment as G(t,d) during the scaling process. The expressions for T1 and T7 are as follows:
[0062]
[0063] The expression for F(t,a) is as follows:
[0064]
[0065] Where a snap For the curve f(t) init The scaling factor when the slope is about to exceed the limit during compression. a set Let a be the upper bound of the scaling factor a.
[0066] Let the curve g(t) be denoted as g(t). init The scaling factor d is the value of the slope when it is about to exceed the limit during compression. snap , The upper bound of the scaling factor d can be d set , or
[0067] when That is, d set ≤d snap When , the expression for G(t,d) is as follows:
[0068]
[0069] when That is, d set >d snap When , the expression for G(t,d) is as follows:
[0070]
[0071] (2) Construct the shortest acceleration time T amin With maximum speed V m The mapping relationship between them. Let ΔVm-s =V m -V s According to equations (2), (3) and (17), the acceleration time T can be obtained. a The expression for the scaling factor 'a':
[0072]
[0073] According to equation (20), when T amin About V m The expression is as follows:
[0074]
[0075] at the same time
[0076] when T amin About V m The expression is as follows:
[0077]
[0078] at the same time
[0079] (3) Construct the shortest deceleration time T dmin With maximum speed V m The mapping relationship between them. Let ΔV m-e =V m -V e According to equations (2), (3) and (18), we can obtain That is, d set ≤d snap When, deceleration time T d The expression for the scaling factor d:
[0080]
[0081] According to equation (23), when T dmin About V m The expression is as follows:
[0082]
[0083] at the same time
[0084] when or T dmin about Vm The expression is as follows:
[0085]
[0086] at the same time
[0087] According to equations (2), (3), and (18), we can obtain That is, d set >d snap When, deceleration time T d The expression for the scaling factor d:
[0088]
[0089] According to equation (26), when T dmin About V m The expression is as follows:
[0090]
[0091] at the same time
[0092] when T dmin About V m The expression is as follows:
[0093]
[0094] at the same time
[0095] when T dmin About V m The expression is as follows:
[0096]
[0097] at the same time
[0098] (4) Construct the shortest motion time T for the entire process m With maximum speed V m The mapping relationship between them, T m About V m The relationship is as follows:
[0099]
[0100] Then, the fitness function (V) in the Cuckoo algorithm is constructed. m The function expression is as follows:
[0101]
[0102] Equation (31) adds a penalty term to Equation (30). If the acceleration / deceleration displacement exceeds the given displacement, the denominator of the fitness function will increase, and the fitness value will decrease. This completes the transformation of the solution space from [T1,T3,T6,T7,T9] to [V]. m The transformation of [] leads to dimensionality reduction in the solution space.
[0103] The beneficial effects of this invention are as follows: This invention provides a method for planning acceleration and deceleration parameters in CNC systems based on the Cuckoo algorithm. Since the method is designed based on an abstract model where the acceleration-acceleration curve and the deceleration-acceleration curve are respectively centrally symmetric, and the method uses a lateral scaling approach for parameter planning, it is applicable to any specific acceleration and deceleration model with such characteristics, such as a seven-segment S-shape or an eleven-segment S-shape, exhibiting high portability. Simultaneously, the method internally establishes a mapping relationship between the maximum speed and the shortest motion time during the motion process, simplifying the calculation formula, reducing the dimensionality of the solution space, and improving iteration efficiency. Attached Figure Description
[0104] Figure 1 This is a flowchart of a method for planning acceleration and deceleration parameters in a CNC system based on the Cuckoo algorithm.
[0105] Figure 2 The acceleration and deceleration curves for the acceleration and deceleration phases are respectively centrally symmetric acceleration and deceleration models.
[0106] Figure 3 Figures (a), (b), and (c) represent the jerk curves in the seven-segment S-shaped model, the jerk curves in the eleven-segment S-shaped model, and the jerk curves in the sinusoidal model, respectively.
[0107] Figure 4 The graph shows a comparison of the convergence times of the bisection method, Newton's iteration method, genetic algorithm, and the method designed in this paper. Detailed Implementation
[0108] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings.
[0109] See attached document Figure 1 and attached Figure 2 The present invention provides a method for planning acceleration and deceleration parameters of a CNC system based on the cuckoo algorithm, comprising the following steps:
[0110] Step 1: Construct specific acceleration / deceleration models that are centrally symmetric for both the acceleration and deceleration phases, based on the criteria. This means that the function expressions for the first segment of the acceleration phase (f(t)) and the first segment of the deceleration phase (g(t)) are clearly defined, and their characteristics are shown in the appendix. Figure 2 As shown.
[0111] Step 2: Establish the jerk as a function of time J(t) as shown in equation (1), and construct the maximum velocity V during the motion process based on this. m With acceleration segment displacement S a Displacement S of the deceleration section d The functional relationship between them is shown in equation (4).
[0112] Step 3: Based on the time-optimal criterion, the problem of solving the dynamic parameters is transformed into a multi-constraint optimization problem, and constraints are set for the maximum jerk, maximum acceleration, and maximum velocity during the acceleration and deceleration phases. The expression for the optimization problem is shown in Equation (5).
[0113] Step 4: Assume initial velocity V s Less than the final velocity V e According to the set maximum acceleration constraint J during the acceleration phase am-set The initial acceleration segment's jerk curve function expression f(t) is initialized. init As shown in equation (6).
[0114] Step 5: According to equation (11), determine whether the motion axis can reach the set maximum acceleration J. am-set Maximum acceleration A am-set and given displacement S set The acceleration is increased from the initial velocity to the final velocity. If this is not possible, the jerk constraint is abandoned, and the actual acceleration and motion time during the motion process are determined according to equations (12) to (15). Considering that the optimization problem has been solved and the planning task has been completed, the subsequent steps are terminated. If this is possible, the domain T of the first segment curve of the acceleration segment is determined. 1-init .
[0115] Step 6: Based on the set maximum acceleration constraint J for the deceleration phase dm-set Initialize the function expression g(t) for the first segment of the deceleration phase acceleration curve. init As shown in equation (7), its domain T is also determined. 7-init .
[0116] Step 7: Design the cuckoo algorithm to solve for the maximum velocity V during the motion process. m Meanwhile, the number of initial solutions N and the probability of solution elimination P are set. a The maximum number of iterations T and the iteration count t=0.
[0117] Step 8: Design the formulas for updating and eliminating solutions using the Cuckoo algorithm. The formulas for updating solutions are shown in equations (8) and (9), and the formulas for eliminating solutions are shown in equation (10).
[0118] Step 9: According to equation (4), first construct the shortest acceleration time T. amin With maximum speed Vm The mapping relationship between them is shown in equations (21) and (22). Next, the shortest deceleration time T is constructed. dmin With maximum speed V m The mapping relationships between them are shown in equations (24), (25), (27), (28), and (29). Finally, the shortest motion time T for the entire process is established. m and maximum speed V m The mapping relationship between them is shown in Equation (30), and the fitness function of the Cuckoo algorithm is constructed as shown in Equation (31).
[0119] Step 10: In [V] e V m-set [Inner random initialization with respect to maximum speed V] m There are N solutions.
[0120] Step 11: Calculate the fitness values of N initial solutions according to equations (21), (22), (24), (25), (27) to (31). Update the solutions according to equations (8) and (9) and calculate the fitness value of the updated solutions. Compare the updated solutions with the old solutions. The new solutions with higher fitness values replace the old solutions with lower fitness values. Otherwise, they are not replaced.
[0121] Step 12: According to equation (10), randomly update a portion of the solutions to eliminate the old solutions. According to equations (21), (22), (24), (25), (27) to (31), calculate the fitness value of the new solution. The new solution with a higher fitness value replaces the old solution with a lower fitness value, otherwise it is not replaced.
[0122] Step 13: Determine the solution with the largest fitness value among the N solutions in this iteration, and record the solution and its fitness value.
[0123] Step 14: Determine if the current iteration number t exceeds the maximum iteration T. If yes, identify the solution with the largest fitness value among the T iterations, record the solution and its fitness value, consider the optimization problem solved and the planning task completed, and end the subsequent steps; if no, increment t and jump to step 11.
[0124] To verify the applicability of the method proposed in this invention, the algorithm was tested on MATLAB using a seven-segment S-shaped model, an eleven-segment S-shaped model, and a sine model. Figure 3 In the diagram, (a), (b), and (c) represent the acceleration curves in the seven-segment S-shaped model, the eleven-segment S-shaped model, and the sinusoidal model, respectively. The test provides the slope constraints of the acceleration curves during the acceleration and deceleration phases, the dynamic constraints during the motion process, the displacement, the initial and final velocities, and determines the specific expressions for functions f(t) and g(t), as well as the determination of T. 1-init and T 7-init .
[0125] Within the seven-segment S-shaped model, the initial velocity V is set. s The final velocity is 20 mm / s, V. e The acceleration speed is 40 mm / s, and the acceleration constraint J during the acceleration phase is... am-set and jerk constraint J during deceleration phase dm-set 120mm / s 3 100mm / s 3 Acceleration constraint A during acceleration phase am-set and acceleration constraint A during deceleration phase dm-set 500mm / s 2 600mm / s 2 Velocity constraint V m-set The acceleration speed is 1000 mm / s, and the slope constraint of the acceleration curve snap_a during the acceleration phase and the slope of the acceleration curve snap_d during the deceleration phase are both 50 mm / s. 4 The functions f(t) = 80 and g(t) = 100, T 1-init =1s,T 7-init =2s, displacement S set The value is 800mm. The iteration results of each algorithm are shown in Table 1. In Table 1, the high dimension refers to the dimension of the solution space [T1,T3,T6,T7,T9].
[0126] Table 1. Iterative Results of Each Algorithm Based on the Seven-Segment S-Shaped Model
[0127]
[0128] Within an eleven-segment S-shaped model, with constant dynamic constraints and given displacements, and an initial velocity V is set. s The final velocity is 10 mm / s, V. e The velocity is 20 mm / s, the functions are f(t) = 4t, g(t) = 5t, T1 = 1s, and T7 = 2s. The iterative results of each algorithm are shown in Table 2.
[0129] Table 2 shows the iterative effects of each algorithm based on the eleven-segment S-shaped model.
[0130]
[0131] Within the sinusoidal model, without changing the dynamic constraints, displacement settings, and initial and final velocities set for the fourth-order S-shaped model, the functions f(t) = sin(t) and g(t) = 2sin(t) are given. The iterative results of each algorithm are shown in Table 3.
[0132] Table 3 shows the iteration results of each algorithm based on the sinusoidal model.
[0133]
[0134] As can be seen from Tables 1, 2, and 3, the design method of this invention is applicable to seven-segment S-shaped, eleven-segment S-shaped, and sinusoidal models. For the parameter planning problem of the entire motion process, it converges faster and has higher iteration accuracy than other algorithms in finding the optimal value of the function. When the solution space is not reduced in dimensionality, the application of genetic algorithms and cuckoo algorithms to find the optimal value of multidimensional functions is time-consuming and the final converged value is not the optimal value.
[0135] To further illustrate the efficiency of the proposed method, based on the aforementioned sinusoidal model, without changing the dynamic constraints, initial and final velocities, and functions f(t) and g(t), only the given displacement is changed, increasing by 200mm each time from 200mm to 1400mm. The convergence time of the algorithm is tested after each change in the given displacement. The convergence times of each algorithm after multiple tests are shown below. Figure 4 As shown. Since the convergence time of the high-dimensional cuckoo algorithm is greater than 10ms in each test, therefore... Figure 4 The comparison only considers the convergence time of the other four algorithms.
[0136] from Figure 4 It can be seen that the convergence time of the high-dimensional genetic algorithm fluctuates drastically, and its convergence speed is much slower than the other three algorithms in multiple tests. The convergence time of the proposed method, the bisection method, and the Newton iteration method is stable. In multiple tests, the proposed method has the fastest convergence speed and higher iteration efficiency.
[0137] Although embodiments of the present invention have been given, those skilled in the art will understand that the above embodiments should not be regarded as limitations on the present invention. In practical applications, various changes in form and detail can be made to the above embodiments without departing from the spirit and scope of the present invention.
Claims
1. A method for planning acceleration and deceleration parameters of a CNC system based on the Cuckoo algorithm, characterized in that, Includes the following steps: Step 1: Construct abstract acceleration / deceleration models that are centrally symmetric for both the acceleration and deceleration phases; Step 2: Establish a function of jerk with respect to time, and construct the maximum velocity V during the motion process based on this function. m With acceleration segment displacement S a and the displacement S of the deceleration phase d The functional relationship between them; the acceleration jerk J(t) as a function of time during the acceleration phase is shown in equation (1): in Where f(t) is the acceleration curve function of the first segment of the acceleration phase, and T i (i = 1...11) represent the time intervals within the model, t i (i = 1...11) represent the time nodes within the model, from which the maximum acceleration A during the acceleration phase can be derived. am Maximum acceleration A during deceleration phase dm The expression is shown in equation (2): Where g(t) is the acceleration curve function of the first segment of the deceleration phase; the acceleration time T can also be derived. a and deceleration time T d The expression is shown in equation (3): Where V s V e The initial and final velocities during the motion can be used to construct the maximum velocity V during the motion. m and acceleration segment displacement S a and the displacement S of the deceleration phase d The relationship is expressed as shown in equation (4): Step 3: Based on the time-optimal criterion, the problem of solving the dynamic parameters is transformed into a multi-constraint optimization problem, and the maximum jerk constraint J during the acceleration phase is set. am-set Maximum acceleration constraint J during deceleration phase dm-set Maximum acceleration constraint A during acceleration phase am-set Maximum acceleration constraint A during deceleration phase dm-set and the maximum velocity constraint V throughout the entire motion process m-set The expression for the optimization problem is shown in equation (5): J am For the maximum acceleration during the acceleration phase, J dm S represents the maximum acceleration during the deceleration phase. set To set the displacement, S pla The total displacement is planned; the constraints are divided into five inequality constraints, namely dynamic parameter constraints and one equality constraint, which represents the requirement that the moving parts can accurately reach the given position; the objective function is the total motion time. The smaller the objective function value, the shorter the time it takes for the moving parts to reach the given position. The solution space is [T1,T3,T6,T7,T9]. Step 4: Assume the initial velocity is less than the final velocity, and assume acceleration throughout the entire motion axis. The maximum velocity V during the motion is... m =V e The length of the domain interval of the function f(t) is denoted as T. 1-init T 1-init Determining the value of T is crucial to whether the optimization problem has a solution; given the curve type, T... 1-init Take the maximum value first If in the domain [0, T] 1-init Within [the specified range], the maximum value J of the function f(t) is [the specified value]. am The acceleration constraint J is greater than the acceleration phase. am-set The entire curve is compressed; otherwise, it remains unchanged. The initial curve of the new acceleration segment, f(t), is accelerated. init The expression is shown in equation (6): Step 5: Determine whether the motion axis can accelerate from the initial velocity to the final velocity under the set maximum acceleration and given displacement; Step 6: Based on the set maximum acceleration constraint J for the deceleration phase dm-set Initialize the function expression g(t) of the first segment of the deceleration acceleration curve in the deceleration phase, and simultaneously determine the length of its domain interval, denoted as T. 7-init T 7-init The range of values is In the domain [0,T] 7-init Within [the specified range], the maximum value J of the function g(t) is [the specified value]. dm The acceleration constraint J is greater than the deceleration phase constraint. dm-set The entire curve is compressed; otherwise, the curve remains unchanged. The new deceleration section's initial acceleration curve g(t) is compressed. init The expression is as follows: Step 7: Design the cuckoo algorithm to solve for the maximum velocity V during the motion process. m Meanwhile, the number of initial solutions N and the probability of solution elimination P are set. a The maximum number of iterations T and the iteration count t=0; Step 8: Design the formulas for updating and eliminating solutions using the Cuckoo algorithm; The updated solution formulas are shown in equations (8) and (9); in Let i be the value of the i-th solution in the (t+1)-th iteration. This represents the solution formed by the i-th solution in the t-th iteration. and Let represent two random solutions in the t-th iteration, α0 be the step size scaling factor, and Levy(β) be a random number that satisfies the Levy distribution, which can be determined by the following formula; The elimination solution formula is shown in equation (10); Where r ~ u(0,1) and ε ~ u(0,1); Heaviside(x) is the unit step function: when x≥0, Heaviside(x)=1; when x<0, Heaviside(x)=0; Step 9: Based on equation (4), establish the shortest motion time T for the entire process. m and maximum speed V m The mapping relationship between them is determined, and the fitness function within the Cuckoo algorithm is constructed simultaneously. Step 10: In [V] e V m-set [Inner random initialization with respect to maximum speed V] m N solutions; Step 11: Based on the fitness function constructed in step 9, calculate the fitness values of N initial solutions. According to equations (8) and (9), update the solutions randomly and calculate the fitness values of the updated solutions. Compare the updated solutions with the old solutions. The new solutions with higher fitness values replace the old solutions with lower fitness values; otherwise, they are not replaced. Step 12: According to equation (10), randomly update a portion of the solutions to eliminate old solutions; according to the fitness function constructed in step 9, calculate the fitness value of the new solution. The new solution with a higher fitness value replaces the old solution with a lower fitness value, otherwise it is not replaced. Step 13: Determine the solution with the largest fitness value among the N solutions in this iteration, and record the solution and its fitness value; Step 14: Determine if the current iteration number t is less than the maximum iteration number T; if not, determine the solution with the largest fitness value in the T iterations, record the solution and its fitness value, consider the optimization problem solved and the planning task completed, and end the subsequent steps; If so, then increment t and jump to step 11.
2. The method for planning acceleration and deceleration parameters of a CNC system based on the cuckoo algorithm according to claim 1, characterized in that, The process of constructing the abstract acceleration / deceleration models that are centrally symmetric for both the acceleration and deceleration phases in step 1 is as follows: (1) The acceleration and deceleration phases are designed separately. The deceleration motion is regarded as the reverse process of the acceleration motion. When building the model, it is necessary to ensure that the dynamic parameters are matched from the acceleration to uniform speed and from uniform speed to deceleration transition point. (2)T1=T2=T4=T5, T7=T8=T 10 =T 11 Parametric programming for T1, T3, T6, T7, and T9; (3) When t∈[0,t1], the accelerometer curve is characterized by the function f(t). The curve in [t1,t2] is symmetric to the curve in [0,t1] about the axis of t=t1, and the curve in [t3,t5] is symmetric to the curve in [0,t2] about the axis of t=t1. It is centrally symmetric; when t∈[t6,t7], the acceleration curve is characterized by the function -g(t-t6), and the characteristics of the acceleration curve in the deceleration phase are consistent with those in the acceleration phase. (4) The velocity curve of the acceleration segment within the model about point Centrally symmetric, the velocity curve of the deceleration segment about point Centrally symmetric, globally asymmetric; (5) f(t) in The expression is continuous within the expression and f′(t) exists, while |f′(t)|≤snap_a, f(t) max =J am , f(t) min ≥0; (6) g(t) in The expression is continuous within the expression and g′(t) exists, while |g′(t)|≤snap_d, g(t) max =J dm , g(t) min ≥0; (7)S(0)=0, V(0)=V s ,A(0)=0; Where S set To set the displacement, snap_a is the slope constraint of the acceleration curve of the acceleration segment, snap_d is the slope constraint of the acceleration curve of the deceleration segment, S(0) is the initial position, V(0) is the initial velocity, and A(0) is the initial acceleration.
3. The method for planning acceleration and deceleration parameters of a CNC system based on the cuckoo algorithm according to claim 1, characterized in that, In step 5, it is determined whether the motion axis can accelerate from the initial velocity to the final velocity under the set maximum acceleration and given displacement, according to the following set of inequalities: Where, ΔV e-s =V e -V s , representing the final velocity V e and initial velocity V s The speed difference; when the solution sets of the four inequalities intersect, the intersection must be an interval. The subintervals are defined, and a T is determined within the intersection. 1-init That should solve the problem; If there is no intersection, calculate the maximum acceleration and the total motion time according to the following formulas. Then, consider the optimization problem solved and the planning task completed, and end the subsequent steps. when At this moment, acceleration A am and acceleration time T s-e The expression is as follows: A am =A am-set (12) when At this moment, acceleration A am and acceleration time T s-e The expression is as follows:
4. The method for planning acceleration and deceleration parameters of a CNC system based on the cuckoo algorithm according to claim 1, characterized in that, In step 9, the specific steps for establishing the mapping relationship between the shortest movement time and the maximum speed throughout the entire process, and for constructing the fitness function within the Cuckoo algorithm, are as follows: (1) The acceleration curve f(t) of the first segment of the acceleration phase. init The initial acceleration curve g(t) during the deceleration phase. init Perform lateral scaling, and denote the lateral scaling factor 'a' for the acceleration segment curve and the lateral scaling factor 'd' for the deceleration segment curve. The lengths of the domain intervals after scaling are T1 and T7. Simultaneously, denote the initial curve of the acceleration segment as F(t,a) and the initial curve of the deceleration segment as G(t,d) during the scaling process; where the expressions for T1 and T7 are as follows: The expression for F(t,a) is as follows: Where a snap For the curve f(t) init The scaling factor when the slope is about to exceed the limit during compression. a set Let a be the upper bound of the scaling factor a. Let the curve g(t) be denoted as g(t). init The scaling factor d is the value of the slope when it is about to exceed the limit during compression. snap , The upper bound of the scaling factor d can be d set , or when That is, d set ≤d snap When , the expression for G(t,d) is as follows: when That is, d set >d snap When , the expression for G(t,d) is as follows: (2) Construct the shortest acceleration time T amin With maximum speed V m The mapping relationship between them; let ΔV m-s =V m -V s According to equations (2), (3) and (17), the acceleration time T can be obtained. a The expression for the scaling factor 'a': According to equation (20), when T amin About V m The expression is as follows: at the same time when T amin About V m The expression is as follows: at the same time (3) Construct the shortest deceleration time T dmin With maximum speed V m The mapping relationship between them; let ΔV m-e =V m -V e According to equations (2), (3) and (18), we can obtain That is, d set ≤d snap When, deceleration time T d The expression for the scaling factor d: According to equation (23), when T dmin About V m The expression is as follows: at the same time when or T dmin About V m The expression is as follows: at the same time According to equations (2), (3), and (18), we can obtain That is, d set >d snap When, deceleration time T d The expression for the scaling factor d: According to equation (26), when T dmin About V m The expression is as follows: at the same time when T dmin About V m The expression is as follows: at the same time when T dmin About V m The expression is as follows: at the same time (4) Construct the shortest motion time T for the entire process m With maximum speed V m The mapping relationship between them, T m About V m The relationship is as follows: Then, the fitness function (V) in the Cuckoo algorithm is constructed. m The function expression is as follows: Equation (31) adds a penalty term to Equation (30). If the acceleration / deceleration displacement exceeds the given displacement, the denominator of the fitness function will increase, and the fitness value will decrease; thus, the solution space will expand from [T1,T3,T6,T7,T9] to [V]. m The transformation of [] leads to dimensionality reduction in the solution space.