A time-optimal speed curve planning method for multi-axis CNC machine tools
Through the time optimal speed curve planning method for multi-axis CNC machine tools, and using technologies such as particle swarm algorithm and iterative dichotomy, the speed curve is optimized in segments, which solves the problem of high calculation pressure in high-speed machining of traditional CNC machine tools, and realizes efficient and accurate speed curve planning.
Patent Information
- Application Number
- CN202510124010.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-26
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-01-26
AI Technical Summary
In high-speed processing of traditional CNC machine tools, real-time speed planning brings too much computing pressure to the computer, resulting in 'data hunger' phenomenon, affecting motion accuracy and efficiency. The existing offline planning methods have low computational efficiency and are prone to falling into local optimality.
The time optimal speed curve planning method for multi-axis CNC machine tools is adopted. By converting machine tool dynamic constraints, machining accuracy constraints, and tool tip end velocity constraints into velocity curve constraints represented by B-splines, an fitness model is established, and the speed curve is optimized independently in segments. The particle swarm algorithm, iterative dichotomy and gradual node insertion are used to gradually approach the optimal speed curve.
On the basis of satisfying dynamic constraints and machining accuracy, the speed curve optimization time is reduced, the calculation efficiency is improved, the local optimality is broken, and the time-optimal speed curve planning is achieved.
Smart Images

Figure CN119556636B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of feed path control of numerical control systems, and in particular to a time-optimal speed curve planning method for multi-axis numerical control machine tools. Background Art
[0002] Traditional CNC machine tool speed planning methods generally calculate the speed and position at the next moment in real time based on the current tool position and the current operating speed combined with the dynamic constraints of the CNC machine tool. However, in high-speed machining, the real-time planning method brings tremendous computing pressure to the computer. If the computer cannot calculate the next position in time, it will cause "data hunger" phenomenon, affecting all subsequent movements.
[0003] In order to reduce the real-time pressure of the computer, some scholars planned the speed of the tool at each point on the path through forward calculation according to the path and machine tool parameters before the machine tool runs, and fitted the arc length, curvature and other position information through forward calculation. Then in actual production, the computer only needs to calculate the position of the next point according to the speed of the current position. Although this reduces the real-time pressure of the calculation, the overall calculation amount is too large and the calculation efficiency is low.
[0004] At present, there are three main offline planning methods for the feed speed (the relative speed of the contact point or tool position point relative to the surface of the workpiece being processed when the tool processes the workpiece) of CNC machine tools: the first type is to comprehensively consider the parameters of each point on the path, the machine tool dynamics constraints, etc., and obtain the speed of each point through calculation, but these methods are too conservative and the overall speed is too slow; the second type of method is to use spline curves to represent the speed, and optimize the speed curve by optimizing the control points of the spline curve, but this method is prone to fall into local optimality; the third type of method is to use genetic algorithms or greedy algorithms on the basis of the second type of method. This type of method can jump out of the local optimality, but the calculation efficiency is too low. Summary of the invention
[0005] The purpose of the present invention is to provide a time-optimal speed curve planning method for multi-axis CNC machine tools, which can jump out of the local optimum and reduce the optimization time of the speed curve and improve the optimization calculation efficiency on the basis of satisfying the dynamic constraints, machining accuracy constraints, tool tip end speed constraints and machining efficiency requirements of the CNC machine tools.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] The present invention provides a time-optimal speed curve planning method for a multi-axis CNC machine tool, comprising:
[0008] The machine tool dynamics constraints, machining accuracy constraints, and tool tip end speed constraints are transformed into tool trajectory speed curve constraints represented by B-splines, and the constraint fitness model and overall speed fitness model are established;
[0009] Divide the tool trajectory speed curve to obtain multiple segmented speed curves;
[0010] Based on the constraint fitness model and the overall speed fitness model, the speed curves of multiple segments are optimized independently in sequence to obtain the optimal speed curve of each segment; the speed curves of the connecting segments between adjacent segments are optimized independently to obtain the optimal speed curve of each connecting segment;
[0011] Based on the optimal speed curves of each segment and connecting segment, the optimal speed curve of the tool trajectory is obtained;
[0012] The steps of independent optimization include:
[0013] S1: taking the control points of the speed curve of a single segment or a connecting segment as decision variables, and performing the first optimization using the particle swarm algorithm to obtain a control point vector 1;
[0014] S2: Based on the iterative bisection method, the control point vector 1 is optimized for the second time to obtain the control point vector 2 and the preliminary velocity curve;
[0015] S3: progressively inserting nodes into the preliminary speed curve to obtain a preliminary speed curve with increased node density;
[0016] S4: Take the new control point vector in the preliminary speed curve with increased node density as the particle swarm preferred individual, repeat steps S1-S3 n times, and obtain the optimal speed curve of a single segment or connection segment, 3≤n≤5.
[0017] Optionally, the constraint fitness model includes:
[0018] (1) The machine tool dynamics constraints are transformed into speed curve constraints:
[0019] ;
[0020] Among them, q τ , v τ , a τ , j τ They represent the position, velocity, acceleration and jerk of the multi-axis CNC machine tool corresponding to the axis τ, where τ represents any axis in the CNC machine tool; v represents the feed rate, that is, the tool trajectory speed represented by the B-spline; v' and v'' represent the first-order and second-order derivatives of the feed rate with respect to u, respectively, where u is a B-spline parameter or a tool trajectory parameter; s represents the arc length of the tool trajectory velocity curve; V limτ , A lim τ and J lim τ They are the speed, acceleration and jerk limit of each axis of the CNC machine tool; Indicates time; k1, k2, k3, q s τ , q ss τ , q sss τ All are formula parameters, expressed by the following formula:
[0021] ;
[0022] Where, s', s" are the first-order and second-order arc differentials of the arc length s of the tool trajectory velocity curve; q u τ , q uu τ , q uuu τ Respectively represent q τ The first, second and third order derivatives of tool path parameter u;
[0023] (2) The machining accuracy constraint is transformed into the speed curve constraint:
[0024] ;
[0025] ;
[0026] Among them, V lim v is the upper limit of the speed of the tool end relative to the workpiece without considering the constraints; i Indicates that the tool path parameter is u i Corresponding feed speed, u i represents the tool trajectory parameters of the i-th sampling point; T i is the interval period between the i-th sampling point and the i+1-th sampling point; ρ i is the curvature radius of the tool trajectory curve corresponding to the i-th sampling point; δ i is the chord error of the tool trajectory curve corresponding to the ith sampling point in CNC machining; ∆L i is the step length of the interval between the i-th sampling point and the i+1-th sampling point; δ max is the maximum chord error; i is the sequence number;
[0027] (3) The tool tip velocity constraint is converted into a velocity curve constraint:
[0028] ;
[0029] Among them, v, a, j are tool path velocity, acceleration and jerk respectively, A lim , J lim are respectively the acceleration and upper limit of jerk of the tool end relative to the workpiece without considering constraints;
[0030] (4) Constrained fitness function:
[0031] ;
[0032] ;
[0033] ;
[0034] Among them, constraint α is the sum of the excess tolerances of all sampling points on the tool trajectory velocity curve in the αth constraint formula; n' is the total number of sampling points of the tool trajectory velocity; is the intermediate function, that is, the excess of the i-th sampling point in the α-th constraint formula; constraint α i is the deviation of the ith sampling point under the αth constraint; constraint α max is the upper limit of the deviation of the αth constraint; fitness c is the constraint fitness of the tool trajectory velocity curve, that is, the excess tolerance of the velocity curve; nc represents the total number of constraint formulas, and the constraint formula is any one of the above-mentioned machine tool dynamics constraints converted into velocity curve constraints, machining accuracy constraints converted into velocity curve constraints, and machining accuracy constraints converted into velocity curve constraints.
[0035] Optionally, the overall speed fitness model includes:
[0036] ;
[0037] ;
[0038] Among them, fitness v is the velocity adaptability v of the tool trajectory velocity curve i and v i+1 They represent the speed of the tool trajectory velocity curve corresponding to the i-th sampling point and the i+1-th sampling point, that is, the tool trajectory parameter is u i and u i+1 Corresponding feed speed; x i, y i Respectively represent the horizontal and vertical coordinate values of the tool trajectory velocity curve corresponding to the i-th sampling point; i+1,y i+1 They respectively represent the horizontal and vertical coordinate values of the tool trajectory velocity curve corresponding to the i+1th sampling point.
[0039] Optionally, the control points of the speed curve of a single segment or a connecting segment are used as decision variables, and a particle swarm algorithm is used for a first optimization to obtain a control point vector 1, including:
[0040] S11: Random Generation individuals as the initial population, and calculate the constraint fitness and speed fitness of the speed curve represented by each individual, where the individual is the control point vector of the speed curve, including multiple control points;
[0041] S12: Sort the initial population based on non-dominated sorting to obtain the frontier individual set;
[0042] S13: Based on the constraint fitness and speed fitness of the speed curve represented by each individual, find the optimal individual in the frontier individual set;
[0043] S14: determining the position with the highest deviation in the speed curve represented by the optimal individual, and adjusting the control points closest to the position once, thereby obtaining a control point vector after one adjustment, that is, the optimal individual after one adjustment;
[0044] S15: Based on the optimal individual after the first adjustment, all individuals in the initial population are adjusted twice to obtain new individuals as a new population;
[0045] S16: Perform non-dominated sorting on the individuals in the new population and the initial population to select the top The individuals are used as the initial population in step S11, and multiple iterations are performed based on steps S11-S15 to obtain a control point vector 1.
[0046] Optionally, the optimal individual is found in the frontier individual set, and the optimal individual is obtained by calculating the individual with the lowest total fitness in the frontier individual set. The calculation formula is as follows:
[0047] ;
[0048] Where fitness(z) represents the total fitness of the speed curve represented by the zth individual in the frontier individual set; v (z) represents the speed fitness of the speed curve represented by the zth individual; c (z) represents the constrained fitness of the speed curve represented by the zth individual; w is the weight coefficient, which is adjusted according to the number of times the node is inserted.
[0049] Optionally, the formula for adjusting the control point closest to the position is as follows:
[0050] ;
[0051] Among them, l v , l a , l j are the control point positions closest to the highest positions of velocity, acceleration and jerk deviations respectively; ctrl(·) represents the control point vector; ε is the formula coefficient, and its value depends on the deviations of the highest positions of velocity, acceleration and jerk deviations.
[0052] Optionally, the formula for secondary adjustment of all individuals includes:
[0053] ;
[0054] Among them, ctrl1 is the individual before the second adjustment, that is, the optimal individual after the first adjustment or other individuals without adjustment; ctrl best is the optimal individual after one adjustment; ctrl2 is the individual after two adjustments; shrink is the shrinkage factor 1, which increases with the number of iterations; is a random vector with the same length as the individual; shrink2 is the shrinkage factor of two, which decreases as the number of iterations increases.
[0055] Optionally, the second optimization of the control point vector 1 based on the iterative bisection method to obtain the control point vector 2 includes:
[0056] Calculate the first excess deviation F1 of the speed curve represented by the control point vector 1;
[0057] Perform binary adjustment on a certain control point in the control point vector 1 to obtain a binary adjusted control point vector;
[0058] Calculate the second deviation F2 of the speed curve represented by the control point vector after binary adjustment;
[0059] Based on the first excess difference F1 and the second excess difference F2, the upper and lower limit values of the control point in the binary adjustment formula are adjusted, wherein the first excess difference F1 and the second excess difference F2 are calculated according to the constraint fitness formula;
[0060] Perform multiple loop calculations based on the upper and lower limits of the control point to obtain the optimized size of a control point in the control point vector 1;
[0061] Based on the above optimization step of a certain control point, all control points in the control point vector one are optimized to obtain the control point vector two.
[0062] Optionally, the upper and lower limits of the control points in the binary adjustment formula are adjusted by the following formula:
[0063] ;
[0064] Among them, P2 is the optimized control point; P1 is the lower limit of the control point before optimization in the control point vector 1, P max is the upper limit of the control point.
[0065] Optionally, the step of performing progressive node insertion on the preliminary speed curve to obtain a preliminary speed curve with increased node density includes:
[0066] For the node vector UU of the preliminary velocity curve, insert new nodes at intervals in the intermediate node sequence of the node vector UU to obtain the node vector UU'; the intermediate node sequence is the nodes between the k+1th node and the Nkth node of the node vector UU; wherein k is the B-spline degree of the preliminary velocity curve, N is the total number of nodes of the node vector UU, and the new node is the average value of two adjacent nodes;
[0067] Based on the node vector UU'
[0068] Adjust the control point vector 2 to obtain a new control point vector;
[0069] According to the node vector UU' and the new control point vector, a preliminary speed curve of node density increase is obtained. Compared with the prior art, the beneficial effects achieved by the present invention are:
[0070] The invention provides a time optimal speed curve planning method for a multi-axis numerical control machine tool. On the basis of satisfying the machine tool dynamics constraint, the machining accuracy constraint and the tool tip end speed constraint, the tool trajectory speed curve represented by a B-spline is firstly optimized in sections independently to obtain the optimal speed curve of each section; then the connecting section in the middle of the optimal speed curve of each section is independently optimized to finally obtain the optimal speed curve of the tool trajectory; wherein, the independent optimization method of the speed curve uses a particle swarm algorithm-iterative dichotomy-progressive node insertion process to perform multiple loop calculations to obtain the optimal speed curve, which can jump out of the local optimum of the existing curve optimization calculation method, greatly improve the calculation efficiency and reduce the calculation cost without affecting the calculation result.
[0071] The present invention proposes to use a particle swarm algorithm to provide a good initial value for subsequent optimization in the random optimization process, and the binary optimization will only optimize upward when the excess difference remains unchanged, thereby solving the problem that it is difficult to approach the optimal direction in the particle swarm algorithm.
[0072] The independent optimization process provided by the present invention progressively inserts nodes after a round of optimization by the particle swarm algorithm and the iterative bisection method. Before the nodes are inserted, the nodes are sparsely arranged and the optimization efficiency is high. After the nodes are inserted, the optimization potential can be further improved on the basis of before the nodes are inserted, and the progressive insertion of nodes can greatly improve the calculation efficiency.
[0073] The present invention provides a time-optimal speed curve planning method for multi-axis CNC machine tools. The optimization of the entire prop trajectory speed curve is performed independently in sections, which can achieve the effect of parallel operation, double the calculation speed, and achieve higher efficiency.
[0074] The invention discloses a time-optimal speed curve planning method for a multi-axis CNC machine tool. The speed curve of a segmented or connected segment is optimized based on a particle swarm algorithm to jump out of the local optimum, and binary optimization is used to make it approach the optimal value based on the particle swarm optimization. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 The figure is a flow chart of a time optimal speed curve planning method in one embodiment of the present invention;
[0076] Figure 2 Shown is a flow chart of an independent optimization method in an embodiment of the present invention;
[0077] Figure 3 Shown is a schematic diagram of a target tool trajectory curve before optimization in an embodiment of the present invention;
[0078] Figure 4 The figure is a schematic diagram of the overall optimization process of the target tool trajectory speed curve in one embodiment of the present invention;
[0079] Figure 5 The figure shows a schematic diagram of the result after each segment of the target tool trajectory speed curve is optimized in one embodiment of the present invention;
[0080] Figure 6 The figure shows a schematic diagram of the optimization results of each connecting segment of the target tool trajectory speed curve in one embodiment of the present invention;
[0081] Figure 7 The figure shows a comparison diagram between the optimized target tool trajectory speed and the upper speed limit in one embodiment of the present invention;
[0082] Figure 8 The figure shows a comparison diagram between the acceleration and the upper limit of the acceleration of the optimized target tool trajectory velocity curve in one embodiment of the present invention;
[0083] Fig. 9 Shown is a comparison diagram of the jerk and the jerk upper limit of the optimized target tool trajectory velocity curve in an embodiment of the present invention. DETAILED DESCRIPTION
[0084] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present invention and its application or use. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0085] Example 1
[0086] The embodiment of the present invention introduces a time-optimal speed curve planning method for a multi-axis CNC machine tool, such as Figure 1 As shown, the specific steps are as follows:
[0087] S01: converting the machine tool dynamics constraint, machining accuracy constraint, and tool tip end speed constraint into the tool path speed curve constraint represented by B-spline, and establishing the constraint fitness model and the overall speed fitness model;
[0088] S02: Divide the tool trajectory speed curve to obtain multiple segmented speed curves;
[0089] S03: Based on the constraint fitness model and the overall speed fitness model, the speed curves of multiple segments are optimized independently in sequence to obtain the optimal speed curve of each segment; the speed curves of the connecting segments between adjacent segments are optimized independently to obtain the optimal speed curve of each connecting segment;
[0090] S04: based on the optimal speed curves of each segment and connecting segment, obtaining the optimal speed curve of the tool trajectory;
[0091] Among them, the independent optimization steps are as follows Figure 2 As shown, including:
[0092] S1: taking the control points of the speed curve of a single segment or a connecting segment as decision variables, and performing the first optimization using the particle swarm algorithm to obtain a control point vector 1;
[0093] S2: Based on the iterative bisection method, the control point vector 1 is optimized for the second time to obtain the control point vector 2 and the preliminary velocity curve;
[0094] S3: progressively inserting nodes into the preliminary speed curve to obtain a preliminary speed curve with increased node density;
[0095] S4: Take the new control point vector in the preliminary speed curve with increased node density as the particle swarm preferred individual, repeat steps S1-S3 n times, and obtain the optimal speed curve of a single segment or connection segment, 3≤n≤5.
[0096] The present invention proposes a time-optimal speed curve planning method for multi-axis CNC machine tools, which can jump out of the local optimum and reduce the optimization time of the speed curve and improve the optimization calculation efficiency on the basis of satisfying the dynamic constraints, machining accuracy constraints, tool tip end speed constraints and machining efficiency requirements of the CNC machine tools.
[0097] In this embodiment, in step S01, the machine tool dynamics constraint, machining accuracy constraint, and tool tip end speed constraint are converted into constraints of a tool trajectory speed curve represented by a B-spline, and a constraint fitness model and an overall speed fitness model are established, specifically including:
[0098] 1. Constrained Fitness Model
[0099] (1) In order to avoid the reduction of the surface quality of the machined surface due to tool wear, overheating, vibration, etc., it is necessary to dynamically constrain the CNC machine tool tool. The machine tool dynamics constraint is converted into a speed curve constraint:
[0100] ;
[0101] Among them, q τ , v τ , a τ , j τ They represent the position, velocity, acceleration and jerk of the multi-axis CNC machine tool corresponding to the axis τ, where τ represents any axis in the CNC machine tool; v represents the feed rate, that is, the tool trajectory speed represented by the B-spline; v' and v'' represent the first-order and second-order derivatives of the feed rate with respect to u, respectively, where u is a B-spline parameter or a tool trajectory parameter; s represents the arc length of the tool trajectory velocity curve; V lim τ , A lim τ and J lim τ They are the speed, acceleration and jerk limit of each axis of the CNC machine tool; Indicates time; k1, k2, k3, q s τ ,q ss τ ,q sss τ All are formula parameters, expressed by the following formula:
[0102] ;
[0103] Where, s', s" are the first-order and second-order arc differentials of the arc length s of the tool trajectory velocity curve; q u τ , q uu τ , q uuu τ Respectively represent q τ The first, second and third order derivatives of tool path parameter u;
[0104] The superscripts 2 and 3 in the formula respectively represent the meaning of the square and cube formulas. This is common knowledge and will not be explained in detail in the subsequent formulas. For example, v 2 Expressed as v squared;
[0105] (2) The machining accuracy constraint is transformed into the speed curve constraint:
[0106] ;
[0107] ;
[0108] Among them, V lim v is the upper limit of the speed of the tool end relative to the workpiece without considering the constraints; i Indicates that the tool path parameter is u i Corresponding feed speed, u i represents the tool trajectory parameters of the i-th sampling point; T i is the interval period between the i-th sampling point and the i+1-th sampling point; ρ i is the curvature radius of the tool trajectory curve corresponding to the i-th sampling point; δ i is the chord error of the tool trajectory curve corresponding to the ith sampling point in CNC machining; ∆L i is the step length of the interval between the i-th sampling point and the i+1-th sampling point; δ max is the maximum chord error; i is the sequence number;
[0109] Specifically, the curvature radius ρ at the i-th sampling point i It can be calculated by the following formula:
[0110]
[0111] in, is the tool path coordinate The first derivative of its parameter u is is the tool path coordinate The second derivative of its parameter u; ||·||2 is the second norm of ·; u i is the trajectory parameter corresponding to the i-th sampling point;
[0112] Specifically, the step length ∆L of the interval period between the i-th sampling point and the i+1-th sampling point is i It can be calculated by the following formula:
[0113] ;
[0114] (3) The tool tip velocity constraint is converted into a velocity curve constraint:
[0115] ;
[0116] Among them, v, a, j are tool path velocity, acceleration and jerk respectively, A lim , J lim are respectively the acceleration and upper limit of jerk of the tool end relative to the workpiece without considering constraints;
[0117] (4) Constrained fitness function:
[0118] Based on the above constraint formulas, it is possible to calculate whether each point of the tool trajectory speed curve exceeds the upper limit value. In order to accurately express the severity of exceeding the constraint, each axis of the CNC machine tool needs to normalize the amount exceeding each constraint. The severity of exceeding the constraint is characterized by the tolerance constraint. The normalization formula is as follows;
[0119] ;
[0120] ;
[0121] Among them, constraint α is the sum of the excess tolerances of all sampling points on the tool trajectory velocity curve in the αth constraint formula; n' is the total number of sampling points of the tool trajectory velocity; is the intermediate function, that is, the excess of the i-th sampling point in the α-th constraint formula; constraint α i is the deviation of the ith sampling point under the αth constraint; constraint α max is the upper limit of the deviation of the αth constraint;
[0122] Based on the above normalized formula, the constraint fitness of the tool trajectory velocity curve can be calculated as follows:
[0123] ;
[0124] fitness cis the constraint fitness of the tool trajectory velocity curve, that is, the excess tolerance of the velocity curve; nc represents the total number of constraint formulas, and the constraint formula is any one of the above-mentioned machine tool dynamics constraints converted into velocity curve constraints, machining accuracy constraints converted into velocity curve constraints, and machining accuracy constraints converted into velocity curve constraints.
[0125] 2. Overall speed fitness model
[0126] The overall speed of the tool path velocity curve represented by the B-spline can be represented by the time the machine tool spends running along the velocity curve. However, integrating a complex velocity curve undoubtedly requires a lot of computing time. Therefore, in order to reduce the computing pressure, n' sampling points are evenly taken on the curve. Then the running time of the machine tool along the velocity curve, that is, the velocity adaptability of the tool path velocity curve is:
[0127] ;
[0128] ;
[0129] Among them, fitness v is the velocity adaptability v of the tool trajectory velocity curve i and v i+1 They represent the speed of the tool trajectory velocity curve corresponding to the i-th sampling point and the i+1-th sampling point, that is, the tool trajectory parameter is u i and u i+1 Corresponding feed speed; x i, y i Respectively represent the horizontal and vertical coordinate values of the tool trajectory velocity curve corresponding to the i-th sampling point; i+1, y i+1 They respectively represent the horizontal and vertical coordinate values of the tool trajectory velocity curve corresponding to the i+1th sampling point.
[0130] In this embodiment, step S02 divides the tool trajectory speed curve into multiple segmented speed curves, specifically including: dividing based on the node vector of the tool trajectory speed curve, taking 2 node vector intervals for each segment, namely , where U i represents the i-th node of the tool path velocity curve, U i+1 represents the i+1th node, U i+2 represents the i+2th node; specifically, the initial length of the node vector of this segment of the velocity curve is based on the node vector of this segment of the motion trajectory. At the same time, in order to ensure the velocity continuity of the two adjacent segments, the first and last control points of this segment of the velocity curve need to be fixed to 0, and it is necessary to ensure that the speeds of its two endpoints coincide with the control points. Therefore, in the subsequent independent optimization process, select As the initial node vector of the velocity curve, is the initial point control vector, and the part that needs to be optimized is the control point .
[0131] In this embodiment, for the independent optimization step S1, the control points of the speed curve of a single segment or a connecting segment are used as decision variables, and the particle swarm algorithm is used for the first optimization to obtain a control point vector 1, including:
[0132] S11: Random Generation individuals as the initial population, and calculate the constraint fitness and speed fitness of the speed curve represented by each individual, where the individual is the control point vector of the speed curve, including multiple control points;
[0133] Specifically, for the segmented speed curve, based on the initial control point vector form set above, randomly generate Different control point vectors are used as the initial population. The lower limit of each individual in the population is 0 and the upper limit is the maximum speed.
[0134] S12: Sort the initial population based on non-dominated sorting to obtain the frontier individual set;
[0135] S13: Based on the constraint fitness and speed fitness of the speed curve represented by each individual, find the optimal individual in the frontier individual set;
[0136] Specifically, the optimal individual is obtained by calculating the individual with the lowest total fitness in the frontier individual set. The calculation formula is as follows:
[0137] ;
[0138] Where fitness(z) represents the total fitness of the speed curve represented by the zth individual in the frontier individual set; v (z) represents the speed fitness of the speed curve represented by the zth individual; c (z) represents the constrained fitness of the speed curve represented by the zth individual; w is the weight coefficient, which is adjusted according to the number of times the node is inserted.
[0139] Specifically, since the nodes are sparsely arranged in the early stage of optimization, the excess deviation needs to be reduced as soon as possible, and the excess deviation is 0 in the later stage, the speed needs to be increased. Therefore, as an optimal solution, in this embodiment, the relationship between the weight coefficient w and the number of node insertions is expressed as follows:
[0140] ;
[0141] S14: determining the position with the highest deviation in the speed curve represented by the optimal individual, and adjusting the control points closest to the position once, thereby obtaining a control point vector after one adjustment, that is, the optimal individual after one adjustment;
[0142] Specifically, the formula for adjusting the control point closest to the position is as follows:
[0143] ;
[0144] Among them, l v , l a , l j are the control point positions closest to the highest positions of velocity, acceleration and jerk deviations respectively; ctrl(·) represents the control point vector; ε is the formula coefficient, and its value depends on the deviations of the highest positions of velocity, acceleration and jerk deviations.
[0145] Specifically, in this embodiment, .
[0146] S15: Based on the optimal individual after the first adjustment, all individuals in the initial population are adjusted twice to obtain new individuals as a new population;
[0147] Specifically, the formula for secondary adjustment of all individuals includes:
[0148] ;
[0149] Among them, ctrl1 is the individual before the second adjustment, that is, the optimal individual after the first adjustment or other individuals without adjustment; ctrl best is the optimal individual after one adjustment; ctrl2 is the individual after two adjustments; shrink is the shrinkage factor 1, which increases with the number of iterations increase and grow; is a random vector with the same length as the individual, and the value range of each item in the random vector is -10 to 10; shrink2 is the shrinkage factor of 2, which increases with the number of iterations Increase and decrease.
[0150] Specifically, the shrinkage factor 1 and the shrinkage factor 2 are expressed as follows:
[0151] ;
[0152] ;
[0153] S16: Perform non-dominated sorting on the individuals in the new population and the initial population to select the top The individuals are used as the initial population in step S11, and multiple iterations are performed based on steps S11-S15 to obtain a control point vector 1.
[0154] In this embodiment, in step S2, the control point vector 1 is optimized for the second time based on the iterative bisection method to obtain the control point vector 2, which specifically includes:
[0155] Calculate the first excess deviation F1 of the speed curve represented by the control point vector 1;
[0156] Perform binary adjustment on a certain control point in the control point vector 1 to obtain a binary adjusted control point vector;
[0157] Calculate the second deviation F2 of the speed curve represented by the control point vector after binary adjustment;
[0158] Based on the first excess tolerance F1 and the second excess tolerance F2, the upper and lower limits of the control points in the binary adjustment formula are adjusted. The formula is as follows:
[0159]
[0160] Among them, P2 is the optimized control point; P1 is the lower limit of the control point before optimization in the control point vector 1, P max is the upper limit value of the control point;
[0161] The first excess difference F1 and the second excess difference F2 are calculated according to the constraint fitness formula;
[0162] Perform multiple loop calculations based on the upper and lower limits of the control point to obtain the optimized size of a control point in the control point vector 1;
[0163] Based on the above optimization step of a certain control point, all control points in the control point vector one are optimized to obtain the control point vector two.
[0164] In this embodiment, step S3 performs progressive node insertion on the preliminary speed curve to obtain a preliminary speed curve with increased node density, including:
[0165] S31: For the node vector UU of the preliminary velocity curve, insert new nodes at intervals in the intermediate node sequence of the node vector UU to obtain the node vector UU'; the intermediate node sequence is the nodes between the k+1th node and the Nkth node of the node vector UU; wherein k is the B-spline degree of the preliminary velocity curve, N is the total number of nodes of the node vector UU, and the new node is the average value of two adjacent nodes;
[0166] Specifically, when a node is inserted for the first time, the initial node vector for the initial velocity curve is , insert new nodes one by one, so that it becomes ,
[0167] in:
[0168]
[0169]
[0170] When you insert a node for the second time, it becomes:
[0171]
[0172] in:
[0173]
[0174] The subsequent insertion steps are carried out according to the above rules;
[0175] S32: adjusting the control point vector 2 based on the node vector UU' to obtain a new control point vector;
[0176] Specifically, after inserting a new node, in order to keep the shape of the velocity curve represented by the B-spline unchanged, the control points in the control point vector need to be adjusted; for example, for a node vector U =[U0, U1, ..., U n*+k+1 ] and the control point vector C=[c0, c1, …, c n ], a new node ∈[U i , U i+1 ] [U k ,U n*+1 ] is inserted into the node vector U of the B-spline velocity curve, and the new node vector U' and control point vector C' are obtained as follows:
[0177]
[0178] Each entry in the new control point vector is adjusted as follows:
[0179]
[0180] in, is the mth control point after the inserted control point, is the mth control point before the inserted control point, r is the repetition of the new node in the B-spline, k is the number of B-spline, n* is a random number, and the coefficient The values are as follows:
[0181]
[0182] S33: According to the node vector UU' and the new control point vector, a preliminary speed curve of increasing node density is obtained.
[0183] In this embodiment, based on the above independent optimization steps S1-S3, the current optimal individual, that is, the preliminary speed curve with increased node density, is used as the new control point vector as the particle swarm preferred individual, and the particle swarm optimization-binary optimization-node insertion is repeated as the optimal solution. After inserting the node three times, the optimization of the speed curve is completed;
[0184] In this embodiment, based on steps S1-S4, the speed curves of the various segments of the tool trajectory speed curve are optimized in sequence until each segment is optimized;
[0185] The connecting section of two adjacent speed curves is optimized. To avoid changing the shape of the remaining sections, the first and last k control points of the optimized interval are kept unchanged, where k is the degree of the B-spline.
[0186] The selection of the unchanged control points at the beginning and end of the connection segment is based on the following formula:
[0187]
[0188] in, is the starting point of the optimized connection segment; is the end point of the optimized connection segment, , , They are the starting point, middle point and end point of the two adjacent B-splines connected respectively;
[0189] The optimization of the connecting segment is consistent with the segment optimization method. Finally, each connecting segment is optimized to obtain the nodes and control points of the final speed curve B-spline, that is, the optimal speed curve of the tool trajectory;
[0190] Example 2
[0191] Based on the embodiment 1 of the present invention, a time-optimal speed curve planning method for a multi-axis CNC machine tool is introduced. Figure 4 As shown, we adopt the following Figure 3 The three-dimensional target tool trajectory curve in the shape of a thousand paper cranes is used for speed planning;
[0192] Figure 3 The red line in the middle is the trajectory of the tool end, and the short blue line represents the direction of the tool axis at each point on the trajectory. The control point vector of the crane-shaped curve is:
[0193] [(67.977,-0.005,36.659),(63.682,4.079,80.255),(61.468,4.339,74.019),(11.983,11.125,-39.238),( 38.757,21.631,38.549),( 12.423,23.172,30.127 ),( -0.220,146.508,24.772 ),( -2.673,70.259,17.139),( -36.818,18.851,60.084),( -23.458,18.454,-18.584),( -20.809,1.6012,11.298),(-85.977,0.0102,115.51),(-20.809,-1.5967,11.302),(-23.457,-18.454,-18.586),(-36.819,-18.85,60.081),(-2.6744,-7 0.251,17.139),(-0.22019,-146.51,24.773),(12.421,-23.175,30.124),(38.758,-21.63,38.553),(11.985,-11.127,-39.237),(61.461,-4.336,74.018 ),(63.677,-4.076,80.257 ),( 67.978, -0.005,36.66)];
[0194] The weight vector is:
[0195] [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
[0196] The node vector is:
[0197] [0, 0, 0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1, 1, 1];
[0198] Table 1 Dynamic constraints of each axis of the machine tool
[0199]
[0200] According to the dynamic constraint matching accuracy requirements of the axes in Table 1 above, a dynamic constraint model is established, and based on Example 1 of the present invention, a time optimal speed curve planning method for a multi-axis CNC machine tool is introduced, and the following are obtained successively: Figure 5 The target tool path velocity curve is shown in the figure after optimization of each segment, and Figure 6 The results of the target tool trajectory speed curve after each connection segment is optimized are shown; since the specific steps have been described in detail in Example 1, no further description is given in this example;
[0201] Based on the dynamic constraints shown in Table 1, the speed, acceleration and jerk upper limit of the target tool trajectory are calculated respectively, and based on the results of the optimization of each connecting segment of the target tool trajectory speed curve (target tool trajectory optimal speed curve), the following is obtained: Figure 7 , 8 , the speed, acceleration, and jerk deviation result diagram shown in 9, that is, the comparison diagram of the target tool trajectory speed curve and the upper limit speed, acceleration, and jerk;
[0202] from Figure 7 , 8 As can be seen from Figure 9, the speed curve deviation can be ignored, so the present invention can plan the time-optimal speed curve without exceeding the constraints.
[0203] Traditional intelligent optimization algorithms require a large number of populations and iterations to approach the optimal value, while the present invention only needs to provide an optimal solution through the particle swarm algorithm for the next step of optimization, so only a small number of populations and a small number of iterations are required. Therefore, the present invention has a higher computational efficiency than the intelligent optimization algorithm while achieving the same effect as the intelligent optimization algorithm. Based on the optimization method proposed in Example 1, for the independent optimization process of the segmented or connected segments, steps S1-S3 are repeated 3 times, and the number of particle swarm iterations is set to 25 times, and the number of individuals in the example swarm is set to 20. Experiments have shown that the optimal speed curve is finally obtained, and the calculation time of the entire process only takes about 30 seconds, which greatly improves the calculation efficiency.
[0204] Example 3
[0205] This embodiment provides a computer-readable storage medium storing a computer program, which, when executed, implements the time-optimal speed curve planning method for a multi-axis CNC machine tool as described in Embodiment 1 of Claim 1.
[0206] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0207] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0208] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0209] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present invention and the claims, which all fall within the protection of the present invention.
Claims
1. A time-optimal speed curve planning method for multi-axis CNC machine tools, characterized in that: include: The machine tool dynamics constraints, machining accuracy constraints, and tool tip end speed constraints are transformed into tool trajectory speed curve constraints represented by B-splines, and the constraint fitness model and overall speed fitness model are established; Divide the tool trajectory speed curve to obtain multiple segmented speed curves; Based on the constraint fitness model and the overall speed fitness model, the speed curves of multiple segments are optimized independently in sequence to obtain the optimal speed curve of each segment; the speed curves of the connecting segments between adjacent segments are optimized independently to obtain the optimal speed curve of each connecting segment; Based on the optimal speed curves of each segment and connecting segment, the optimal speed curve of the tool trajectory is obtained; The steps of independent optimization include: S1: taking the control points of the speed curve of a single segment or a connecting segment as decision variables, and performing the first optimization using the particle swarm algorithm to obtain a control point vector 1; S2: Based on the iterative bisection method, the control point vector 1 is optimized for the second time to obtain the control point vector 2 and the preliminary velocity curve; S3: progressively inserting nodes into the preliminary speed curve to obtain a preliminary speed curve with increased node density; S4: Take the new control point vector in the preliminary speed curve with increased node density as the particle swarm preferred individual, repeat steps S1-S3 n times, and obtain the optimal speed curve of a single segment or connection segment, 3≤n≤5.
2. The time-optimal speed curve planning method for multi-axis CNC machine tools according to claim 1 is characterized in that: The constrained fitness model includes: (1) The machine tool dynamics constraints are transformed into speed curve constraints: ; Among them, q τ , v τ , a τ , j τ They represent the position, velocity, acceleration and jerk of the multi-axis CNC machine tool corresponding to the axis τ, where τ represents any axis in the CNC machine tool; v represents the feed rate, that is, the tool trajectory speed represented by the B-spline; v' and v'' represent the first-order and second-order derivatives of the feed rate with respect to u, respectively, where u is a B-spline parameter or a tool trajectory parameter; s represents the arc length of the tool trajectory velocity curve; V lim τ , A lim τ and J lim τ are the speed, acceleration and jerk limit of each axis of the CNC machine tool; t represents time; k1, k2, k3, q s τ ,q ss τ , q sss τ All are formula parameters, expressed by the following formula: ; Where, s', s" are the first-order and second-order arc differentials of the arc length s of the tool trajectory velocity curve; q u τ , q uu τ , q uuu τ Respectively represent q τ The first, second and third order derivatives of tool path parameter u; (2) The machining accuracy constraint is transformed into the speed curve constraint: ; ; Among them, V lim v is the upper limit of the speed of the tool end relative to the workpiece without considering the constraints; i Indicates that the tool path parameter is u i Corresponding feed speed, u i represents the tool trajectory parameters of the i-th sampling point; T i is the interval period between the i-th sampling point and the i+1-th sampling point; ρ i is the curvature radius of the tool trajectory curve corresponding to the i-th sampling point; δ i is the chord error of the tool trajectory curve corresponding to the ith sampling point in CNC machining; ∆L i is the step length of the interval between the i-th sampling point and the i+1-th sampling point; δ max is the maximum chord error; i is the sequence number; (3) The tool tip velocity constraint is converted into a velocity curve constraint: ; Among them, v, a, j are tool path velocity, acceleration and jerk respectively, A lim , J lim are respectively the acceleration and upper limit of jerk of the tool end relative to the workpiece without considering constraints; (4) Constrained fitness function: ; ; ; Among them, constraint α is the sum of the excess tolerances of all sampling points on the tool trajectory velocity curve in the αth constraint formula; n' is the total number of sampling points of the tool trajectory velocity; is the intermediate function, that is, the excess of the i-th sampling point in the α-th constraint formula; constraint α i is the deviation of the ith sampling point under the αth constraint; constraint α max is the upper limit of the deviation of the αth constraint; fitness c is the constraint fitness of the tool trajectory velocity curve, that is, the excess tolerance of the velocity curve; nc represents the total number of constraint formulas, and the constraint formula is any one of the above-mentioned machine tool dynamics constraints converted into velocity curve constraints, machining accuracy constraints converted into velocity curve constraints, and machining accuracy constraints converted into velocity curve constraints.
3. The time-optimal speed curve planning method for multi-axis CNC machine tools according to claim 2 is characterized in that: The overall speed fitness model includes: ; ; Among them, fitness v is the speed adaptability of the tool trajectory speed curve; v i and v i+1 They represent the speed of the tool trajectory velocity curve corresponding to the i-th sampling point and the i+1-th sampling point, that is, the tool trajectory parameter is u i and u i+1 Corresponding feed speed; x i, y i Respectively represent the horizontal and vertical coordinate values of the tool trajectory velocity curve corresponding to the i-th sampling point; i+1, y i+1 They respectively represent the horizontal and vertical coordinate values of the tool trajectory velocity curve corresponding to the i+1th sampling point.
4. The time-optimal speed curve planning method for multi-axis CNC machine tools according to claim 3 is characterized in that: The control points of the speed curve of a single segment or a connecting segment are used as decision variables, and the particle swarm algorithm is used for the first optimization to obtain a control point vector 1, including: S11: Random Generation individuals as the initial population, and calculate the constraint fitness and speed fitness of the speed curve represented by each individual, where the individual is the control point vector of the speed curve, including multiple control points; S12: Sort the initial population based on non-dominated sorting to obtain the frontier individual set; S13: Based on the constraint fitness and speed fitness of the speed curve represented by each individual, find the optimal individual in the frontier individual set; S14: determining the position with the highest deviation in the speed curve represented by the optimal individual, and adjusting the control points closest to the position once, thereby obtaining a control point vector after one adjustment, that is, the optimal individual after one adjustment; S15: Based on the optimal individual after the first adjustment, all individuals in the initial population are adjusted twice to obtain new individuals as a new population; S16: Perform non-dominated sorting on the individuals in the new population and the initial population to select the top The individuals are used as the initial population in step S11, and multiple iterations are performed based on steps S11-S15 to obtain a control point vector 1.
5. The time-optimal speed curve planning method for multi-axis CNC machine tools according to claim 4 is characterized in that: The optimal individual is found in the frontier individual set, and the optimal individual is obtained by calculating the individual with the lowest total fitness in the frontier individual set. The calculation formula is as follows: ; Where fitness(z) represents the total fitness of the speed curve represented by the zth individual in the frontier individual set; v (z) represents the speed fitness of the speed curve represented by the zth individual; c (z) represents the constrained fitness of the speed curve represented by the zth individual; w is the weight coefficient, which is adjusted according to the number of times the node is inserted.
6. The time-optimal speed curve planning method for multi-axis CNC machine tools according to claim 4 is characterized in that: The formula for adjusting the control point closest to the position is as follows: ; Among them, l v , l a , l j are the control point positions closest to the highest positions of velocity, acceleration and jerk deviations respectively; ctrl(·) represents the control point vector; ε is the formula coefficient, and its value depends on the deviations of the highest positions of velocity, acceleration and jerk deviations.
7. The time-optimal speed curve planning method for multi-axis CNC machine tools according to claim 4 is characterized in that: The formula for secondary adjustment for all individuals includes: ; Among them, ctrl1 is the individual before the second adjustment, that is, the optimal individual after the first adjustment or other individuals without adjustment; ctrl best is the optimal individual after one adjustment; ctrl2 is the individual after two adjustments; shrink is the shrinkage factor one, which increases with the number of iterations; rand is a random vector with the same length as the individual; shrink2 is the shrinkage factor two, which decreases with the number of iterations.
8. The time-optimal speed curve planning method for multi-axis CNC machine tools according to claim 4 is characterized in that: The second optimization of the control point vector 1 based on the iterative bisection method to obtain the control point vector 2 includes: Calculate the first excess deviation F1 of the speed curve represented by the control point vector 1; Perform binary adjustment on a certain control point in the control point vector 1 to obtain a binary adjusted control point vector; Calculate the second deviation F2 of the speed curve represented by the control point vector after binary adjustment; Based on the first excess difference F1 and the second excess difference F2, the upper and lower limit values of the control point in the binary adjustment formula are adjusted, wherein the first excess difference F1 and the second excess difference F2 are calculated according to the constraint fitness formula; Perform multiple loop calculations based on the upper and lower limits of the control point to obtain the optimized size of a control point in the control point vector 1; Based on the above optimization step of a certain control point, all control points in the control point vector one are optimized to obtain the control point vector two.
9. The time-optimal speed curve planning method for multi-axis CNC machine tools according to claim 8, characterized in that: The upper and lower limits of the control points in the binary adjustment formula are adjusted by the following formula: ; Among them, P2 is the optimized control point; P1 is the lower limit of the control point before optimization in the control point vector 1, P max is the upper limit of the control point.
10. The time-optimal speed curve planning method for multi-axis CNC machine tools according to claim 9, characterized in that: The step of inserting nodes progressively into the preliminary speed curve to obtain a preliminary speed curve with increased node density includes: For the node vector UU of the preliminary velocity curve, insert new nodes at intervals in the intermediate node sequence of the node vector UU to obtain the node vector UU'; the intermediate node sequence is the nodes between the k+1th node and the Nkth node of the node vector UU; wherein k is the B-spline degree of the preliminary velocity curve, N is the total number of nodes of the node vector UU, and the new node is the average value of two adjacent nodes; Adjust the control point vector 2 based on the node vector UU' to obtain a new control point vector; According to the node vector UU' and the new control point vector, the preliminary velocity curve with increasing node density is obtained.
Citation Information
Patent Citations
Multi-constraint numerical control machining feed rate customization method based on bidirectional proportional adjustment
CN111487929A
Speed planning method and device, numerical control equipment, numerical control machine tool, medium and product
CN118226802A