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

By optimizing the rotation drive commands and B-spline curve fitting of the five-axis CNC machine tool, an equidistant double B-spline curve tool trajectory is generated, which solves the problems of insufficient number of control points and smoothing error control in the existing technology and achieves high-precision and efficient machining effects.

CN119828587BActive Publication Date: 2025-10-21TSINGHUA UNIVERSITY +1
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the existing five-axis CNC machining technology, the equidistant B-spline curve tool path lacks an effective method to simultaneously compress the number of control points while taking into account smoothing error control and parameter synchronization, resulting in limited machining quality and efficiency.

Method used

By obtaining the rotation drive command of the tool axis vector in the spherical coordinate system, the optimized rotation drive command is generated after processing using the optimization model. Combined with B-spline curve fitting, the equidistant double B-spline tool trajectory is generated, and the parameter synchronization of the tool tip point and the tool axis vector is optimized to meet the requirements of high precision and smoothness.

Benefits of technology

Significantly reduce the angle change of the rotating axis, generate a smoother tool path, reduce cutting impact, improve the workpiece surface quality and processing efficiency, and reduce tool wear.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119828587B_ABST
    Figure CN119828587B_ABST
Patent Text Reader

Abstract

A method and device for generating a tool path in a five-axis numerical control machine tool and a storage medium, the method comprising: obtaining a rotation driving command of a tool axis vector in a spherical coordinate system in a plane coordinate system; processing the rotation driving command using a preset optimization model to obtain an optimized rotation driving command; performing B-spline curve fitting using the optimized tool rotation driving command and pre-obtained tool tip point data 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.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This article relates to five-axis CNC technology, and in particular 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 tool paths by optimizing tool orientation, achieving high-quality and efficient milling of complex surfaces. This technology is widely used due to its significant advantages in the production of free-form surface components in fields such as aerospace, precision medical equipment, and the automotive industry. Five-axis CNC machining primarily uses G01 code segments composed of a large number of discrete data points and line segments to generate tool paths. Discontinuities in the path's tangents and curvature often require frequent acceleration and deceleration of the machine tool during machining, causing feed oscillation, which affects machining quality and reduces efficiency. Therefore, obtaining high-quality, smooth tools is 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 produce smoother machining trajectories. While describing the tool trajectory and determining the tool posture, equidistant dual B-spline curves also provide 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 dual spline curves often use shared curve parameters to synchronize two trajectories. However, since the tool orientation is only synchronized with the tool tip position parameters, the rotational motion may be discontinuous in certain 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, a B-spline curve fitting is performed 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, where 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 and ending axes of the tool axis vector remain unchanged before and after optimization;

[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 derivative value of the C-axis angle relative to the chord length in the optimized rotation 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 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 the memory stores a computer program, and the processor is configured to run the computer program to execute the method described above.

[0020] In this embodiment, a rotational drive command for the tool axis vector in a plane coordinate system is obtained from a spherical coordinate system and processed using a preset optimization model to generate an optimized rotational drive command. This significantly reduces the variation in the rotation axis angle, resulting in a smoother tool trajectory based on the optimized rotational drive command. This generates an equidistant double B-spline tool trajectory with continuous curvature and tangent direction, meeting high-precision fitting requirements. This effectively reduces cutting impact, reduces tool wear, and improves workpiece surface quality.

[0021] Other features and advantages of the present application will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present application. Other advantages of the present application can be realized and obtained by the solutions 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 flow chart of a method for generating a tool path 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 an embodiment of the present application;

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

[0026] Figure 4 This is a schematic diagram of an application 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 fitting provided in an embodiment of the present application;

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

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

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

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

[0035] This application describes multiple embodiments, but this description is exemplary rather than restrictive, and it will be apparent to those skilled in the art that there may be more embodiments and implementations within the scope of the embodiments described herein. Although many possible feature combinations are shown in the drawings and discussed in the detailed description, 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 this application may also be combined with any conventional features or elements to form a unique inventive solution. Any features or elements of any embodiment may also be combined with features or elements from other inventive solutions to form another unique inventive solution. Therefore, it should be understood that any feature shown and / or discussed in this application may be implemented individually or in any appropriate combination. Therefore, except for the limitations made according to the appended claims and their equivalents, the embodiments are not subject to other limitations. In addition, various modifications and changes may be made within the scope of protection of the appended 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 in the specific order described. As will be understood by those skilled in the art, other orders of steps are also possible. Therefore, the specific order 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 performing their steps in the order written, and those skilled in the art can readily understand that these orders 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 paths in a five-axis CNC machine tool according to an embodiment of the present application. Figure 1 As shown, the method includes:

[0039] Step 101: Obtain the rotation drive command of the tool axis vector in the plane coordinate system under the spherical coordinate system;

[0040] In practical applications, each tool axis vector in the spherical coordinate system may be processed; or, based on actual needs, some 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 Converted to [α1,β1] T , α and β correspond to the rotation drive command A-axis angle and C-axis angle in the plane coordinate system, respectively, where α1=arccos(O 1,K ),

[0042] Step 102: Process 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 and ending axes of the tool axis vector remain unchanged before and after optimization;

[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 derivative value of the C-axis angle relative to the chord length in the optimized rotation 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 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 change in the rotation axis angle and a smoother path 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 needs to be minimized. Since the rotation axes are not independent, the rotation axes need to be optimized simultaneously.

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

[0054]

[0055] Where n = 0, 1, 2, ..., N.

[0056] Among them, the machine tool coordinate origin is Oo, and the distance between adjacent tool tip points is approximately equal to the chord length Among them 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 Cartesian coordinate system is θ n ′, since the starting axis and the ending 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 optimized model is:

[0061]

[0062] Step 103: Perform B-spline curve fitting using the optimized tool rotation drive command and the pre-acquired tool tip point data 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, where 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, B-spline curve fitting is performed on the sample data of the tool tip point and the optimized tool rotation drive command respectively to obtain an equidistant double B-spline trajectory, including:

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

[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] For the tool tip point and the optimized tool axis vector, respectively, according to the local curvature difference value ξ 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 point 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 is M+1, and the total number of control vertices of the tool axis vector is 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 ] are node parameter values, where the basis functions are calculated using 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, we use the node configuration technique to obtain the node vector of the tool tip:

[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 methods for obtaining the node vector of the tool axis vector include:

[0092] Get the nth parameter value using centripetal parameterization

[0093]

[0094] In the above expression, The parameter value corresponding to the endpoint is Next, we use the node configuration technique to obtain the node vector:

[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 and iterative updates are 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 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.

[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.

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

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

[0109]

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

[0111] in:

[0112]

[0113] In addition, after completing the t-th iteration of the B-spline curve to the tool tip, the number of control vertices remains unchanged, and the position of each control vertex in the B-spline curve of the tool tip in the t-th iteration is corrected and used as the control vertex for the t+1-th iteration of the B-spline curve of the tool tip. 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 corresponding point on the 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] Further, 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] During 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 evaluated in a 3D coordinate system, while the tool axis vector fitting curve is evaluated in a spherical coordinate system. If the conditions are met, the smoothing process ends; if not, node insertion and node parameter update are performed to improve iterative efficiency and accuracy, and the fitting process is repeated.

[0123] Figure 3 Schematic diagram of the error of the equal-distance double B-spline machining trajectory in the embodiment 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 error condition of the tool tip point fitting curve 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 of the corresponding 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] Calculate the difference between the preset tool axis vector error threshold and the error correction value 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 the tool tip point error, the tool axis vector error is defined in the 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 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 bi-B-spline curve is determined by the accuracy of the two trajectories in the WCS. The tool tip curve error is expressed as an equation, while the tool axis curve includes the optimization adjustment of the tool axis vector in the MCS and the fitting error in the WCS. This ultimately affects the error of the tool axis vector in the 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 be inserted into nodes and updated in parameters. The implementation method is the same as that of the tool tip point, so it 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 any 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 This is a schematic diagram of the application of the parameter synchronization model provided by 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 The parameter value of u is 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. Estimating the 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, wherein the storage medium stores a computer program, 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 graph of the 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 fitting provided in the embodiment of this application. Figure 8 The comparison results show that the A-axis angle change is reduced by 11.3% compared with that before optimization.

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

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

[0180] Figure 12 It is a curve diagram of the adjustment amount of the given tool axis vector optimization provided by the embodiment of the present application. Figure 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 behavior of the tool axis. By optimizing the tool axis vector, the change in the rotation axis angle 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 is also 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 is well 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 tape, 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 skilled in the art that communication media generally embodies 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; The optimized tool rotation drive command and the pre-acquired tool tip point data are used to perform B-spline curve fitting to obtain the B-spline curve of the tool tip point. and the B-spline curve of the tool axis vector , where u represents the node parameter value of the tool tip point, Indicates the parameter value of the tool axis vector; Among them, the B-spline curve of the tool axis vector Ways to obtain include: After completing the B-spline curve of the tool axis vector After the tth iteration operation, the B-spline curve of the tool axis vector is maintained The number of control vertices remains unchanged, and the B-spline curve of the tool axis vector in the t-th iteration is The position of each control vertex is corrected as the B-spline curve of the tool axis vector The control vertex used in the t+1th iteration operation, where t is a positive integer; Wherein, the B-spline curve of the tool axis vector in the t-th iteration is The position of each control vertex in is corrected, including: 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 between each tool axis vector in the t-th iteration operation, and calculate the sum of the weighted sum and the constant The product of , get each control vertex correction value; where the constant B-spline curve that can affect the tool axis vector The convergence rate of the iteration; 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; 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 and ending axes of the tool axis vector remain unchanged before and after optimization; 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 derivative value of the C-axis angle relative to the chord length in the optimized rotation 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 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: The B-spline curve at the tool tip point and the B-spline curve of the tool axis vector Then, synchronize the model using the preset parameters , get the B-spline curve of the tool tip point Parameter values ​​of two adjacent nodes Any value between the curve of the tool axis vector Corresponding parameter values ; The parameter synchronization model The following conditions must be met: The interpolation constraints are ; Monotone non-decreasing function; The second derivative is continuous; Where 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 The calculation expression is ; in: ; , , 。 4. The method according to claim 1, wherein: μ= ; in They are matrices The maximum and minimum eigenvalues ​​of the matrix It is generated based on the basis functions.

5. The method according to any one of claims 1 to 4, characterized in that The B-spline curve is fitted using the progressive least squares iterative approximation method to obtain the B-spline curve of the tool tip. and the B-spline curve of the tool axis vector .

6. The method according to any one of claims 1 to 4, characterized in that The method further comprises: After completing the B-spline curve of the tool axis vector After the t-th iteration operation, the error between the tool axis vector in the spherical coordinate system and the vector of the corresponding parameter value in the B-spline curve of the tool tip point in the spherical coordinate system is obtained; After the error meets the preset error condition, the B-spline curve of the tool axis vector is stopped. Otherwise, continue with the B-spline curve of the tool axis vector Iterate 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.

7. 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 6 when executed.

8. 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 6.

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