Method and device for generating tool path in five-axis numerical control machine tool and storage medium

By optimizing the rotational drive command and B-spline fitting in five-axis CNC machine tools, the problem of tool path tangent and curvature is solved, and a smoother and higher-precision tool trajectory is achieved, and the machining quality and efficiency are improved.

CN119828587AActive Publication Date: 2025-04-15TSINGHUA UNIVERSITY +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411998292.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-15
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

In the existing five-axis CNC machining technology, the tangent and curvature of the tool path are discontinuous, resulting in frequent acceleration and deceleration of the machine tool during processing, causing feed oscillation, and affecting processing quality and efficiency.

Method used

By obtaining the rotation driving command of the tool axis vector under the spherical coordinate system, and processing the rotation driving command using the preset optimization model, the optimized rotation driving command is obtained. Then, the optimized tool rotation driving command and tool tip point data are used to perform B-spline fitting to generate a smoother and more continuous tool trajectory.

Benefits of technology

The change in the rotation axis angle is significantly reduced, making the tool trajectory smoother, generating an equidistant double B-spline curve tool trajectory with curvature and tangential continuous, meeting the requirements of high-precision fitting, reducing cutting impact, reducing tool wear, and improving workpiece surface quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119828587A_ABST
    Figure CN119828587A_ABST
Patent Text Reader

Abstract

The invention discloses a method and device for generating a tool path in a five-axis numerical control machine tool and a storage medium. The method comprises the steps that a rotation driving command of a tool axis vector in a plane coordinate system under a spherical coordinate system is obtained; processing the rotation driving command by using a preset optimization model to obtain an optimized rotation driving command; b spline curve fitting is conducted through the optimized tool rotation driving command and tool nose point data obtained in advance, a B spline curve A (u) of a tool nose point and a B spline curve C (w) of a tool axis vector are obtained, u represents the node parameter value of the tool nose point, and w represents the parameter value of the tool axis vector.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to five-axis CNC technology, and more particularly to a method and device for generating tool paths in a five-axis CNC machine tool and a storage medium. Background Art

[0002] Five-axis CNC machining technology optimizes the tool path by optimizing the tool direction to achieve high-quality and efficient milling of complex surfaces. This technology is widely used because it has shown significant advantages in the production of free-form surface parts in fields such as aerospace, precision medical equipment and the automotive industry. Five-axis CNC machining mainly uses G01 code segments composed of a large number of discrete data points and line segments to generate tool paths. Due to the discontinuity of the path tangent and curvature, the machine tool often needs to accelerate and decelerate frequently during the machining process, which in turn causes feed oscillation, thereby affecting the machining quality and reducing the machining efficiency. Therefore, obtaining high-quality smooth tools becomes the key to improving machining efficiency and quality.

[0003] B-spline curves are often used to accurately describe discrete machining trajectories in CNC machining due to their powerful shape adjustment capabilities. Using tool trajectories based on B-spline curves can obtain smoother machining trajectories. While describing the tool trajectory and determining the tool posture, equidistant double B-spline curves also give expressions for the tool tip point and tool axis point, thereby generating smoother and more accurate tool paths and achieving controllable processing of smoothing errors. In addition, equidistant double spline curves often use shared curve parameters to synchronize two trajectories. However, since the tool orientation is only the same as the tool tip position synchronization parameters, the rotational motion may be discontinuous in some positions.

[0004] It can be seen that in the related art, for equidistant B-spline curve tool paths, there is still a lack of technical solutions that can simultaneously compress the number of control points and take into account both smoothing error control and parameter synchronization. Summary of the invention

[0005] The embodiments of the present application provide a method and device for generating a tool trajectory in a five-axis CNC machine tool, and a storage medium.

[0006] A method for generating a tool path in a five-axis CNC machine tool, comprising:

[0007] Obtain the rotation drive command of the tool axis vector in the plane coordinate system under the spherical coordinate system;

[0008] Processing the rotation drive command using a preset optimization model to obtain an optimized rotation drive command;

[0009] Using the optimized tool rotation drive command and the pre-acquired tool tip point data to perform B-spline curve fitting, a B-spline curve A(u) of the tool tip point and a B-spline curve C(w) of the tool axis vector are obtained, wherein u represents a node parameter value of the tool tip point, and w represents a parameter value of the tool axis vector;

[0010] The optimization model satisfies the following conditions, including:

[0011] The adjustment amount of the rotation axis corresponding to the optimized rotation drive command in the plane coordinate system is less than or equal to the machining error of the rotation axis in the tool axis direction;

[0012] The starting axis and the ending axis of the tool axis vector before and after optimization are fixed;

[0013] The objective function is to minimize the cumulative sum of the following values ​​corresponding to each optimized rotation drive command, including:

[0014] The second-order derivative value of the A-axis angle relative to the chord length in the optimized rotation drive command;

[0015] The second-order derivative value of the C-axis angle relative to the chord length in the optimized rotational drive command;

[0016] The square value of the difference between the A-axis angle in the optimized rotation drive command and the A-axis angle in the next optimized rotation drive command;

[0017] The square value of the difference between the C-axis angle in the optimized rotary drive command and the C-axis angle in the next optimized rotary drive command.

[0018] A storage medium stores a computer program, wherein the computer program is configured to execute the method described above when running.

[0019] A device for generating a tool trajectory in a five-axis CNC machine tool comprises a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the method described above.

[0020] In the embodiment of the present application, the rotation drive command of the tool axis vector in the plane coordinate system under the spherical coordinate system is obtained, and the rotation drive command is processed by using a preset optimization model to obtain an optimized rotation drive command, which significantly reduces the change of the rotation axis angle, making the tool trajectory obtained based on the optimized tool rotation drive command smoother, and can generate an equidistant double B-spline curve tool trajectory with continuous curvature and tangent, meeting the high-precision fitting requirements, thereby effectively reducing cutting impact, reducing tool wear, and improving the surface quality of the workpiece. .

[0021] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by implementing the present application. Other advantages of the present application can be realized and obtained by the schemes described in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings are used to provide an understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.

[0023] Figure 1 A schematic diagram of a flow chart of a method for generating a tool trajectory in a five-axis CNC machine tool provided in an embodiment of the present application;

[0024] Figure 2 A schematic diagram of the mutual mapping between the spherical coordinate system and the plane coordinate system in the embodiment of the present application;

[0025] Figure 3 Schematic diagram of the machining trajectory error of equal-distance double B-spline in the example of the present invention;

[0026] Figure 4 is an application diagram of a parameter synchronization model provided in an embodiment of the present application;

[0027] Figure 5 A graph of an equidistant double B-spline trajectory provided in an embodiment of the present application;

[0028] Figure 6 A three-dimensional coordinate diagram of a given tool axis vector before and after optimization provided in an embodiment of the present application;

[0029] Figure 7 A comparison diagram of the tool axis vector before and after optimization in a given spherical coordinate system provided in an embodiment of the present application;

[0030] Figure 8 A comparison diagram of the given tool axis vector A-axis angle before and after optimization and after fitting provided in an embodiment of the present application;

[0031] Fig. 9 A comparison diagram of a given tool axis vector C-axis angle before and after optimization and after smoothing provided in an embodiment of the present application;

[0032] Fig.10 An error diagram of a given tool tip trajectory fitting provided in an embodiment of the present application;

[0033] Fig.11 An error diagram of a given tool axis trajectory fitting provided in an embodiment of the present application;

[0034] Fig.12 It is a curve chart of the adjustment amount of a given tool axis vector optimization provided in an embodiment of the present application. DETAILED DESCRIPTION

[0035] The present application describes multiple embodiments, but the description is exemplary rather than restrictive, and it is obvious to those skilled in the art that there may be more embodiments and implementations within the scope of the embodiments described in the present application. Although many possible feature combinations are shown in the drawings and discussed in the specific embodiments, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with any other feature or element in any other embodiment, or may replace any other feature or element in any other embodiment.

[0036] The present application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed in the present application may also be combined with any conventional features or elements to form a unique invention scheme. Any features or elements of any embodiment may also be combined with features or elements from other invention schemes to form another unique invention scheme. Therefore, it should be understood that any feature shown and / or discussed in the present application may be realized individually or in any appropriate combination. Therefore, except for the limitations made according to the attached claims and their equivalents, the embodiments are not subject to other restrictions. In addition, various modifications and changes may be made within the scope of protection of the attached claims.

[0037] In addition, when describing representative embodiments, the specification may have presented the method and / or process as a specific sequence of steps. However, to the extent that the method or process does not rely on the specific order of the steps described herein, the method or process should not be limited to the steps of the specific order described. As will be understood by those of ordinary skill in the art, other sequences of steps are also possible. Therefore, the specific sequence of the steps set forth in the specification should not be interpreted as a limitation to the claims. In addition, the claims for the method and / or process should not be limited to the steps of performing them in the order written, and those skilled in the art can easily understand that these sequences can be changed and still remain within the spirit and scope of the embodiments of the present application.

[0038] Figure 1 The following is a flow chart of a method for generating tool trajectories in a five-axis CNC machine tool provided in an embodiment of the present application. Figure 1 As shown, the method includes:

[0039] Step 101, obtaining a rotation drive command of a tool axis vector in a plane coordinate system under a spherical coordinate system;

[0040] In practical applications, each tool axis vector in the spherical coordinate system may be processed; or, according to actual needs, part of the tool axis vectors in the spherical coordinate system may be selected for processing.

[0041] Figure 2 Schematic diagram of the mutual mapping between the spherical coordinate system and the plane coordinate system in the embodiment of the present application. Figure 2 As shown, a tool axis vector O1 = [O 1,I ,O 1,J ,O 1,K ] T Convert to [α1,β1] T , α and β correspond to the A-axis angle and C-axis angle of the rotation drive command in the plane coordinate system, where α1 = arccos(O 1,K ),

[0042] Step 102: Processing the rotation drive command using a preset optimization model to obtain an optimized rotation drive command;

[0043] The optimization model satisfies the following conditions, including:

[0044] The adjustment amount of the rotation axis corresponding to the optimized rotation drive command in the plane coordinate system is less than or equal to the machining error of the rotation axis in the tool axis direction;

[0045] The starting axis and the ending axis of the tool axis vector before and after optimization are fixed;

[0046] The objective function is to minimize the sum of the following values, including:

[0047] The optimal objective function is to minimize the cumulative sum of the following values ​​corresponding to each optimized rotation drive command, including:

[0048] The second-order derivative value of the A-axis angle relative to the chord length in the optimized rotation drive command;

[0049] The second-order derivative value of the C-axis angle relative to the chord length in the optimized rotational drive command;

[0050] The square value of the difference between the A-axis angle in the optimized rotation drive command and the A-axis angle in the next optimized rotation drive command;

[0051] The square value of the difference between the C-axis angle in the optimized rotary drive command and the C-axis angle in the next optimized rotary drive command.

[0052] The optimization goal of the above optimization model is to generate a tool axis path with the smallest rotation axis angle change and smoother within the tolerance zone. The second-order derivative of the angle corresponding to each tool axis relative to the chord length is minimized. At the same time, while reducing the tool axis angle change rate, the tool axis processing distance needs to be minimized, that is, the difference in the rotation axis angles corresponding to two adjacent tool tip points is minimized. Since the rotation axes are not independent, they need to be optimized simultaneously.

[0053] Among them, taking N+1 tool axis vectors in the spherical coordinate system as an example, the objective function is:

[0054]

[0055] Among them, n=0,1,2,…,N.

[0056] Among them, the origin of the machine tool coordinate is Oo, and the distance between adjacent tool tip points is approximately equal to the chord length Where D n , D n+1 They represent the nth tool tip point and the n+1th tool tip point respectively.

[0057] The adjustment amount of the rotation axis corresponding to the optimized rotation drive command in the plane coordinate system is Δε, and the machining error in the tool axis direction is a, so the error constraint is Δε≤a.

[0058] Tool axis vector O before optimization i The corresponding point in the Cartesian coordinate system is θ n =[α n ,β n ] T The point corresponding to the optimized tool axis vector in the plane Cartesian coordinate system is θ n ′, since the starting axis and the end axis of the tool axis vector remain fixed before and after optimization, the optimization model also needs to meet the following conditions:

[0059]

[0060] The final optimization model is:

[0061]

[0062] Step 103, using the optimized tool rotation drive command and the pre-acquired tool tip point data to perform B-spline curve fitting, to obtain a B-spline curve A(u) of the tool tip point and a B-spline curve C(w) of the tool axis vector, wherein u represents a node parameter value of the tool tip point, and w represents a parameter value of the tool axis vector;

[0063] In the embodiment of the present application, based on the progressive least squares iterative approximation method, the sample data of the tool tip point and the optimized tool rotation drive command are respectively fitted with a B-spline curve to obtain an equidistant double B-spline trajectory, including:

[0064] Step 1031, extracting initial control vertices, including:

[0065] The method to obtain the discrete point curvature value of the tool tip is:

[0066]

[0067] Among them, D n-1 , D n , D n+1 There are three consecutive tool tip points.

[0068] The method to obtain the curvature value of the tool axis vector is:

[0069]

[0070] Among them, O n-1 , O n , O n+1 are three continuous tool axis vectors.

[0071] According to the local curvature difference value ξ, the tool tip point and the optimized tool axis vector are respectively n Determine the initial control vertex, where the local curvature difference value ξ n The following conditions must be met:

[0072]

[0073] Among them, the local curvature difference value ξ is calculated n :

[0074]

[0075] Among them, in determining the local curvature difference value ξ of the tool tip n When n Represents the local curvature difference value of the nth tool tip point; after determining the local curvature difference value ξ of the optimized tool axis vector n When n Represents the local curvature difference value of the nth optimized tool axis vector.

[0076] In the above expression, σ is a positive integer that defines the domain and affects the sparsity of the selected control vertices; the larger σ is, the sparser the distribution is.

[0077] By adopting the above method, the total number of control vertices of the tool tip point can be obtained to be M+1, and the total number of control vertices of the tool axis vector can be obtained to be L+1.

[0078] Step 1032, performing B-spline curve fitting on the tool tip point and the tool axis vector in different coordinate systems, including:

[0079] The definition expression of the B-spline curve of the tool tip is as follows:

[0080]

[0081] In the above expression, P m is the control vertex of the tool tip, B n.k (u) is the basis function, where k is the order of the basis function, U = [u0,u1,…,u N ] is the node parameter value, where the basis function is calculated by the De Boor recursive relation:

[0082]

[0083] Based on the above expression, the initial B-spline curve of the tool tip point and the tool axis vector can be obtained:

[0084] The methods for obtaining the node vector of the tool tip include:

[0085] Use the centripetal parameterization to obtain the nth parameter value ψ i :

[0086]

[0087] In the above expression, The parameter values ​​corresponding to the endpoints are Ψ0=0, Ψ n = 1. Then, the node vector of the tool tip is obtained using the node configuration technique:

[0088] u0=…=u k =0;u M+1 =…=u M+k+1 =1;

[0089] When j=1,…,Mk, u k+j =(1-α)ψ p-1 +αψ p ; where p = int(jc), α=jc-p.

[0090] In the above expression, int(jc) represents the integer value of the product of the value j and the value c.

[0091] The node vector of the tool axis vector is obtained by:

[0092] Using centripetal parameterization to obtain the nth parameter value

[0093]

[0094] In the above expression, The parameter values ​​corresponding to the endpoints are Secondly, the node vector is obtained using the node configuration technique:

[0095] w0=…=w k =0; w L+1 =…=w L+k+1 =1;

[0096] When j = 1, ..., Lk, Where p = int(jc), α=jc-p.

[0097] Among them, the initial B-spline curves are the initial B-spline curves A of the tool tip point and 0 (u) and the initial B-spline curve O of the tool axis vector 0 (w); of which:

[0098]

[0099] For the initial B-spline curve, iterative update equations are established respectively, and iterative update is performed to obtain the B-spline fitting curve.

[0100] The equidistant double B-spline curve finally obtained at the t+1th iteration is:

[0101]

[0102] in, The position of the mth control vertex of the B-spline curve representing the tool tip in the t+1th iteration operation, The position of the lth control vertex of the B-spline curve representing the tool axis vector in the t+1th iteration operation.

[0103] In practical applications, it can not only be combined with the progressive least squares approximation fitting algorithm, but also be compatible with other fitting methods, and can flexibly adjust the tool axis direction optimization target to meet the requirements of different machine tool dynamics performance.

[0104] The method provided in the embodiment of the present application obtains the rotation drive command of the tool axis vector in the plane coordinate system under the spherical coordinate system, and processes the rotation drive command using a preset optimization model to obtain an optimized rotation drive command, which significantly reduces the change in the angle of the rotation axis, making the tool trajectory obtained based on the optimized tool rotation drive command smoother, and can generate an equidistant double B-spline curve tool trajectory with continuous curvature and tangent, meeting the high-precision fitting requirements, thereby effectively reducing cutting impact, reducing tool wear, and improving the surface quality of the workpiece.

[0105] In an exemplary embodiment, after completing the t-th iteration operation of the B-spline curve C(w) of the tool axis vector, the number of control vertices is kept unchanged, and the position of each control vertex in the B-spline curve C(w) of the tool axis vector in the t-th iteration is corrected as the control vertex used in the t+1-th iteration operation of the B-spline curve C(w) of the tool axis vector, where t is a positive integer.

[0106] Specifically, the difference between each tool axis vector and the corresponding parameter value in the B-spline curve of the tool axis vector in the spherical coordinate system is obtained to obtain the difference corresponding to each tool axis vector in the t-th iteration operation; the weighted sum between the basis function and the difference corresponding to each tool axis vector in the t-th iteration operation is calculated, and the product of the weighted sum and the constant μ is calculated to obtain the correction value of each control vertex; wherein the constant μ can affect the convergence speed of the iteration of the B-spline curve C(w) of the tool axis vector; the correction value of each control vertex is used to correct the position of the corresponding control vertex in the t-th iteration to obtain the position of each control vertex in the B-spline curve C(w) of the tool axis vector at the t+1-th iteration.

[0107] The calculation expression of the above process is as follows:

[0108] δ n t =O n -O t (w n );

[0109]

[0110] Furthermore, where λ max ,λ min The matrices ZZ are T The maximum and minimum eigenvalues ​​of

[0111] in:

[0112]

[0113] In addition, after completing the t-th iteration operation of the B-spline curve to the tool tip point, the number of control vertices is kept unchanged, and the position of each control vertex in the B-spline curve of the tool tip point in the t-th iteration is corrected as the control vertex used in the t+1-th iteration operation of the B-spline curve of the tool tip point. The calculation expression of the specific operation process is as follows:

[0114] δ n t =D n -A t (u n );

[0115]

[0116] In the formula is the distance between the nth discrete data point and the point on the corresponding node parameter calculation curve at the tth iteration; is the distance the mth control vertex needs to move; is the position of the mth control vertex at the t+1th iteration; μ is a constant that affects the iterative convergence speed of the B-spline curve at the tool tip point, also known as the learning rate.

[0117] Furthermore, where λ max and λ min Represents the matrix ZZ T The maximum and minimum eigenvalues ​​of ;

[0118] in:

[0119]

[0120] Among them, the largest and smallest eigenvalues ​​can be estimated using the Gale disk theorem.

[0121] In the process of generating the double B-spline fitting curve in step 103, it is also necessary to determine whether the double B-spline fitting curve meets the fitting error requirement.

[0122] Specifically, the tool tip point fitting curve is judged in the three-dimensional coordinate system; the tool axis vector fitting curve is judged in the spherical coordinate system. When the conditions are met, the smoothing process ends; when the conditions are not met, node insertion and node parameter update are performed to improve the iteration efficiency and accuracy, and the fitting is re-iterated.

[0123] Figure 3 Schematic diagram of the machining trajectory error of equal-distance double B-spline in the example of the present invention. Figure 3 As shown, when the distance value is H, ε o is the set tool tip point error threshold, and ε1 is the set tool axis vector error threshold.

[0124] Among them, the tool tip point fitting curve error condition is as follows:

[0125] ac n =||D n -A(u n )||≤max(ac n )≤ε o ;

[0126] In the above expression, ac n is the error of the nth tool tip point.

[0127] After completing the t-th iteration operation of the B-spline curve C(w) of the tool axis vector, the error between the tool axis vector in the spherical coordinate system and the vector corresponding to the parameter value in the B-spline curve of the tool tip point in the spherical coordinate system is obtained;

[0128] After the error satisfies a preset error condition, the iterative operation on the B-spline curve C(w) of the tool axis vector is stopped; otherwise, the iterative operation on the B-spline curve C(w) of the tool axis vector is continued;

[0129] The maximum value of the threshold in the error condition is obtained by:

[0130] Determine the error correction value according to the tool axis vector in the spherical coordinate system and the vector of the optimized rotation drive command in the spherical coordinate system;

[0131] The difference between the preset tool axis vector error threshold and the error correction value is calculated to obtain the maximum value of the threshold. The tool axis vector fitting curve error is as follows:

[0132] bc n =||O j -O(w j )||≤max(bc n )≤ε′1;

[0133] In the above expression, bc n is the error of the nth tool axis vector.

[0134] Different from tool tip point error, tool axis vector error is defined in spherical coordinate system.

[0135] In addition, ε′1 is the maximum value of the threshold in the error condition, which can also be called the fitting error threshold.

[0136] Since the amount of optimization model adjustment performed in step 102 also needs to be converted into the error amount in the spherical coordinate system for measurement, let θ = [α, β] T The corresponding tool axis vector is O. After pre-optimization, α and β are slightly adjusted by Δα and Δβ, respectively, to obtain a new θ′ and a new tool axis vector O′. The corresponding angle of the tool axis vector change in the spherical coordinate system is λ, which is:

[0137] λ=arccos(O,O′)

[0138] The accuracy of the equidistant double B-spline curve is determined by the accuracy of the two trajectories in WCS. The error of the tool tip curve is given by the equation, while the tool axis curve includes the optimization adjustment of the tool axis vector in MCS and the fitting error in WCS. It ultimately affects the error of the tool axis vector in WCS. Therefore, the error condition is updated to λ+ε′1≤ε1.

[0139] The following describes how to insert nodes and update node parameters:

[0140] Step 4.1: Node insertion part:

[0141] The fitting error of the insertable interval is defined as:

[0142]

[0143] When the fitting error is greater than the set fitting error threshold, a new node and corresponding control point are inserted in the insertable interval. If the number of discrete points in the interval is only two discrete data points D n ,D n+1, Then insert a new node at the midpoint: If there are more than two discrete data points D n ,D n+1 ,…,D n+G The corresponding node parameter value is u n ,u n+1 ,…,u n+G , then the new node inserted satisfy:

[0144]

[0145] Complete the node insertion process, where g and G are both positive integers.

[0146] Among them, the tool axis vector also needs to perform node insertion and parameter update. The implementation method is the same as the principle of the tool tip point, which will not be repeated here.

[0147] Step 4.2: Node parameter update process:

[0148] Use the Newton-Raphson iterative update method to obtain more accurate node parameters:

[0149] (D n -C(u n ))·C′(u n )=0

[0150] Where D n is the discrete tool tip point, C(u n ) is the curve value corresponding to the required node parameter value, C′(u n ) is the first-order derivative value.

[0151] When the fitting error is not satisfied, node insertion and node parameter update are performed, and step 103 is executed again.

[0152] In addition, a monotone second-order continuous bispline parameter synchronization model is established to achieve that for the node parameter value u of the tool tip curve A(u) at any time, a corresponding parameter value ω can be found on the tool axis point curve C(w), including:

[0153] Figure 4 Schematic diagram of the application of the parameter synchronization model provided in the embodiment of the present application. Figure 4 As shown, the parameter synchronization model can be used to obtain the e and u e+1 Parameter value of u between , where e is a positive integer less than N.

[0154] Step 5.1, determine the synchronization parameter model constraints:

[0155] First, the synchronization parameters need to satisfy the interpolation constraints:

[0156] w n =f n (u n ),w n+1 =f n+1 (u n+1 )

[0157] Second, the parameter synchronization model needs to maintain the monotonic non-decreasing constraint.

[0158] Finally, the parameter synchronization model satisfies C at the nth node 2 Continuity constraints.

[0159]

[0160] Step 5.2, introduce spline curve: use C 2 Continuous Fritsch-Carlson:

[0161] 1. Calculate the difference q between adjacent points n , where n = 0, 1, ..., N:

[0162]

[0163] 2. Estimation of derivative δ n :

[0164]

[0165] 3. Maintain monotonicity: To ensure monotonicity, the derivative δ needs to be adjusted i :

[0166]

[0167] 4. Construct a spline function and calculate the corresponding u in the subinterval i <u<ui+1 Spline function expression:

[0168] w=f n (u n )=a n (uu n ) 3 +b n (uu n ) 2 +c n (uu n )+d n ;

[0169] Coefficient a n ,b n ,c n ,d n Determined by the following conditions:

[0170]

[0171] The solution coefficient matrix equation is:

[0172]

[0173] According to the above steps, it is confirmed that the interpolation function maintains monotonicity in each interval and the cubic spline function of the entire interval satisfies the second-order continuity, thereby obtaining the parameter synchronization model of the bispline curve.

[0174] An embodiment of the present application further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the method described above when running.

[0175] An embodiment of the present application also provides a device for generating a tool trajectory in a five-axis CNC machine tool, comprising a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the method described above.

[0176] Figure 5 A curve diagram of an equidistant double B-spline trajectory provided in an embodiment of the present application. Figure 6 A three-dimensional coordinate diagram of a given tool axis vector before and after optimization provided in an embodiment of the present application; Figure 7 The comparison diagram of the tool axis vector before and after optimization in a given spherical coordinate system provided in the embodiment of the present application. Figures 5 to 7 It can be seen that the optimized rotation drive command is obtained by processing the rotation drive command using the optimization model, which significantly reduces the change of the rotation axis angle and makes the tool trajectory obtained based on the optimized tool rotation drive command smoother.

[0177] Figure 8The comparison diagram of the given tool axis vector A axis angle before and after optimization and after fitting provided in the embodiment of the present application. Figure 8 The comparison results show that the A-axis angle change is reduced by 11.3% compared with that before optimization.

[0178] Fig. 9 The C-axis angle of the given tool axis vector provided in the embodiment of the present application is compared before and after optimization and after smoothing. Fig. 9 The comparison results show that the C-axis angle change is reduced by 8.1% compared to before optimization.

[0179] Fig.10 The error diagram of the given tool tip trajectory fitting provided in the embodiment of the present application is: Fig.11 The error diagram of the given tool axis trajectory fitting provided in the embodiment of the present application. Fig.10 and Fig.11 It can be seen that when the given error thresholds are 0.02 mm and 0.02° respectively, the maximum errors in the generated trajectories are 0.0199 mm and 0.0179° respectively, which are both within their respective error ranges.

[0180] Fig.12 : is a curve diagram of the adjustment amount of a given knife axis vector optimization provided by an embodiment of the present application. Fig.12 It can be seen that the given adjustment amount is set to 0.05 mm, and the maximum adjustment amount in the optimization is 0.0499 mm.

[0181] In summary, the solution provided by the embodiment of the present application can generate an equidistant double B-spline tool trajectory with continuous curvature and tangent, meet the high-precision fitting requirements, and effectively compress the number of control vertices required in the NURBS curve fitting process, thereby reducing the storage and computing load. The parameter synchronization model ensures that the tool length remains constant during the curve direction interpolation, while avoiding the unstable swing back behavior of the tool axis. By optimizing the tool axis vector, the change in the angle of the rotation axis is significantly reduced, and the smoothness of the tool trajectory is improved. This optimization can not only be combined with the progressive least squares approximation fitting algorithm, but also is compatible with other fitting methods, and can flexibly adjust the tool axis direction optimization target to meet the requirements of different machine tool dynamics performance.

[0182] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term "computer storage medium" includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

Claims

1. A method for generating tool paths in a five-axis CNC machine tool, characterized in that: include: Obtain the rotation drive command of the tool axis vector in the plane coordinate system under the spherical coordinate system; Processing the rotation drive command using a preset optimization model to obtain an optimized rotation drive command; Using the optimized tool rotation drive command and the pre-acquired tool tip point data to perform B-spline curve fitting, a B-spline curve A(u) of the tool tip point and a B-spline curve C(w) of the tool axis vector are obtained, wherein u represents a node parameter value of the tool tip point, and w represents a parameter value of the tool axis vector; The optimization model satisfies the following conditions, including: The adjustment amount of the rotation axis corresponding to the optimized rotation drive command in the plane coordinate system is less than or equal to the machining error of the rotation axis in the tool axis direction; The starting axis and the ending axis of the tool axis vector before and after optimization are fixed; The objective function is to minimize the cumulative sum of the following values ​​corresponding to each optimized rotation drive command, including: The second-order derivative value of the A-axis angle relative to the chord length in the optimized rotation drive command; The second-order derivative value of the C-axis angle relative to the chord length in the optimized rotational drive command; The square value of the difference between the A-axis angle in the optimized rotation drive command and the A-axis angle in the next optimized rotation drive command; The square value of the difference between the C-axis angle in the optimized rotary drive command and the C-axis angle in the next optimized rotary drive command.

2. The method according to claim 1, characterized in that The method further comprises: After obtaining the B-spline curve A(u) of the tool tip and the B-spline curve C(w) of the tool axis vector, the model f is synchronized using the preset parameters. n (u n ), obtain the parameter value ω corresponding to the curve C(w) of the tool axis vector of any value between two adjacent node parameter values ​​u in the B-spline curve A(u) of the tool tip point; The parameter synchronization model f n (u n ) meets the following conditions: The interpolation constraint is w n =f n (u n ) and w n+1 =f n+1 (u n+1 ); Monotone non-decreasing function; The second derivative is continuous; Wherein, n=0, 1, 2, ..., N, where N is an integer greater than or equal to 2.

3. The method according to claim 2, characterized in that The parameter synchronization model f n (u n ) is calculated as in:

4. The method according to claim 1, characterized in that The method further comprises: After completing the t-th iteration operation of the B-spline curve C(w) of the tool axis vector, keep the number of control vertices of the B-spline curve C(w) of the axis vector unchanged, correct the position of each control vertex in the B-spline curve C(w) of the tool axis vector in the t-th iteration, and use it as the control vertex used in the t+1-th iteration operation of the B-spline curve C(w) of the tool axis vector, where t is a positive integer.

5. The method according to claim 4, characterized in that The step of correcting the position of each control vertex in the B-spline curve C(w) of the tool axis vector in the t-th iteration includes: Obtain the difference between each tool axis vector and the corresponding parameter value in the B-spline curve of the tool axis vector in the spherical coordinate system, and obtain the difference corresponding to each tool axis vector in the t-th iteration operation; Calculate the weighted sum between the basis function and the difference corresponding to each tool axis vector in the t-th iteration operation, and calculate the product of the weighted sum and a constant μ to obtain a correction value for each control vertex; wherein the constant μ can affect the convergence speed of the iteration of the B-spline curve C(w) of the tool axis vector; The position of each control vertex in the tth iteration is corrected using the correction value of each control vertex to obtain the position of each control vertex in the t+1th iteration.

6. The method according to claim 5, characterized in that: where λ max and λ min The matrices ZZ are T The largest and smallest eigenvalues ​​of , where the matrix Z is generated based on the basis functions.

7. The method according to any one of claims 1 to 6, characterized in that: The B-spline curve fitting is performed using the progressive least squares iterative approximation method to obtain the B-spline curve A(u) of the tool tip and the B-spline curve C(w) of the tool axis vector.

8. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: After completing the t-th iteration operation of the B-spline curve C(w) of the tool axis vector, the error between the tool axis vector in the spherical coordinate system and the vector corresponding to the parameter value in the B-spline curve of the tool tip point in the spherical coordinate system is obtained; After the error satisfies a preset error condition, the iterative operation on the B-spline curve C(w) of the tool axis vector is stopped; otherwise, the iterative operation on the B-spline curve C(w) of the tool axis vector is continued; The maximum value of the threshold in the error condition is obtained by: Determine the error correction value according to the tool axis vector in the spherical coordinate system and the vector of the optimized rotation drive command in the spherical coordinate system; The difference between the preset tool axis vector error threshold and the error correction value is calculated to obtain the maximum value of the threshold.

9. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 8 when executed.

10. A device for generating tool paths in a five-axis CNC machine tool, comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Five-axis side milling machining cutter path smoothing method

    CN105425727A

  • Processing cutter shaft vector fairing method of annular cutter based on AC type five-axis numerical control machine tool

    CN106933189A

  • Five-axis numerical control machiningcutter-axisvector local optimization method under machine tooldriving constraint

    CN110209123A

  • Complex curved surface five-degree-of-freedom flat-bottomed cutter end milling cutter path optimization method and system

    CN118311919A

  • Linear processing path fairing method and system

    CN118732606A