A method for generating a tool path for a milling tool
By using the de Casteljau interpolation algorithm and an electromagnetic-like stochastic optimization method to generate the five-axis side milling toolpath trajectory for non-developable ruled surfaces, the toolpath trajectory error problem in the machining of non-developable ruled surfaces is solved, thereby improving machining quality and efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHENGDU USEFUL TECH CO LTD
- Filing Date
- 2023-05-26
- Publication Date
- 2026-05-12
AI Technical Summary
现有技术在加工非可展直纹曲面时,难以有效解决刀路轨迹的原理性误差,导致加工质量和效率不足。
The de Casteljau interpolation algorithm and electromagnetic-like stochastic optimization method are used to generate continuous toolpath trajectories for five-axis side milling of non-developable ruled surfaces. The continuity and accuracy of the toolpath are improved by adaptive interpolation and iterative optimization.
实现了非可展直纹曲面的高阶连续性刀具路径,提升了加工质量和效率。
Smart Images

Figure CN116661372B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machining technology, and in particular to a method for generating milling cutter toolpaths. Background Technology
[0002] Today, with the development of various fields such as aerospace and transportation, the demand for high-quality, high-end equipment is becoming increasingly urgent. Precision and complex curved surface parts, widely used in these fields, are subject to higher requirements in terms of processing efficiency, forming accuracy, and yield. Non-developable ruled surfaces are a typical characteristic of this type of complex part, and are generally processed by multi-axis CNC machine tools. Multi-axis CNC machining requires the support of automatic programming technology. Tool path planning methods, as the core technology of automatic programming, determine the processing quality and efficiency of the curved surface.
[0003] Non-developable ruled surfaces are formed by sweeping the generatrix along the guide wire and are therefore non-developable. Because non-developable ruled surfaces have a twist angle (i.e., the normal vectors at each point on the generatrix have an included angle), fundamental errors inevitably occur during side milling. Therefore, how to rationally plan the toolpath becomes paramount.
[0004] To address the aforementioned problems, this invention provides a method for generating milling cutter toolpath trajectories. Summary of the Invention
[0005] The purpose of this invention is to provide a method for generating milling cutter toolpaths, which achieves high-order continuity of toolpath trajectories along ruled surfaces, thereby improving overall machining quality and efficiency.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] A method for generating continuous toolpath trajectories for five-axis side milling of non-developable ruled surfaces includes the following steps:
[0008] Step S1: Based on the kinematic principle of five-axis side milling, the tool motion path for machining non-developable ruled surfaces in five-axis side milling is encoded to obtain the tool tip coordinates, the heading angle and tilt angle of the tool axis vector at a single tool position;
[0009] Step S2: Given the equations of the upper and lower guide wires on the non-developable ruled surface, obtain the expression for the directrix connecting the two points with equal parameters of the upper and lower guide wires on the ruled surface. Based on differential geometry and related mathematical knowledge, the initial tool path can be obtained.
[0010] Step S3: Use the de Casteljau interpolation algorithm to adaptively interpolate the tool center point trajectory curve, heading angle parameter curve, and tilt angle curve in the initial toolpath, and continuously update the three curves;
[0011] Step S4: Use an electromagnetic-like stochastic optimization method to iterate the number and position of control points on the toolpath-related curves until the maximum number of iterations is reached and the search ends;
[0012] Step S5: Take the trajectory curve of the last iteration as the final toolpath trajectory curve.
[0013] Furthermore, in step S1, the tool motion path is encoded according to the kinematic principle of five-axis side milling, thereby determining the tool pose at any moment in the tool path for machining non-developable ruled surfaces. This step is characterized by the following steps:
[0014] Step 1.1: Representation of the tool center point: The trajectory of the tool center point is denoted as... ;
[0015] Step 1.2: Representation of the tool axis vector: The tool axis attitude is expressed using the heading angle. and tilt angle This indicates that, simultaneously, the heading angle and inclination angle vary with the parameters of the traverse line. The changes are constantly changing, affecting the heading angle. and tilt angle The functions represented as curve parameters are denoted as follows: and .
[0016] Furthermore, in step S2, the generation of the initial toolpath includes the following steps:
[0017] Step 2.1: The spline curve equations of the upper and lower directrixes on the non-developable ruled surface are as follows: and During the sweeping motion of a cylindrical cutting tool along a non-developable ruled surface, the tool will be aligned with the lower guideline of the non-developable ruled surface. A series of contact points are generated, and the set of contact points formed by these contact points is denoted as (PiA, i). The set of surface normal vectors and the set of directrix vectors of the non-developable ruled surface corresponding to these contact points are denoted as follows: and ;
[0018] Step 2.2: Offset the set of contact points (PiA, i) where the tool contacts the non-developable ruled surface on the lower guideline by a tool radius along the normal of the non-developable ruled surface at the corresponding contact point. A series of discrete toolpath center points are obtained. ;
[0019] Step 2.3: After fitting the contact point offset with a cubic spline function, the discrete tool center point obtained is used to obtain the complete tool center point trajectory curve equation. for:
[0020] in, The control points for the fitted cubic spline function are obtained using the least squares method.
[0021] Step 2.4: The control points for the fitted cubic spline function are obtained using the least squares method, minimizing the sum of squared distances between the fitted spline parameter curve and the center point of the discrete tool. The error function can be expressed as: The optimal objective function for the cubic spline function fit is: ;
[0022] Step 2.5: Determine the machine tool coordinate system The heading angle of the tool axis vector and tilt angle Because the CLS file is in the workpiece coordinate system Therefore, it is necessary to transform the tool axis vector in the workpiece coordinate system to the machine tool coordinate system through inverse kinematic transformation.
[0023] Furthermore, in step S3, the de Casteljau algorithm is used to adaptively increase curve control points and iterate the toolpath continuously, including the following steps:
[0024] Step 3.1: Through equations Obtain the Bezier curve.
[0025] in, These are the control points of the curve;
[0026] Step 3.2: Subdivide the Bezier curve into two segments using the de Casteljau interpolation algorithm, and then use the equation... To obtain the specific segmentation method;
[0027] Step 3.3: Using the above segmentation method, the third-order Bezier curve is divided into two segments, with the control points for the first segment being the control points for the second segment. With the second control point :
[0028] Step 3.4: Keep the two segments of the Bezier curve at the breakpoints. Continuity, the continuity constraint is: ;
[0029] Where a is a proportionality coefficient.
[0030] Furthermore, in step S4, the electromagnetic-like stochastic optimization method continuously searches for the optimal number of control points and iterates the toolpath, including the following steps:
[0031] Step 4.1: Initialization: Using an electromagnetic-like stochastic optimization method, m sample points are randomly generated in n-dimensional space. Each sample point corresponds to a particle in the electromagnetic-like stochastic optimization method, and the particle has a dimension of 3N.
[0032] Where N is the number of discrete tool positions in the toolpath trajectory;
[0033] Step 4.2: Local search for the optimal solution: Given two local random search parameters LSITER and , representing the number of local search iterations and the multiplier, respectively;
[0034] Step 4.3: Calculate the total force on each charged particle; the total charge carried by particle i. for The total force acting on particle i is :
[0035] in, This is the optimal solution in the iterative process. For the objective function in The value at that point, the expression of the objective function is: :
[0036] in, This refers to the geometric error between two adjacent tool positions;
[0037] Step 4.4: Particle displacement: under force Under the influence of [something], charged particles will undergo displacement, and the displacement formula is: ;
[0038] Step 4.5: Obtain the final optimal solution.
[0039] Furthermore, in step S5, the optimal solution from step 4 is taken as the toolpath trajectory of the optimized non-developable ruled surface.
[0040] Furthermore, the curve parameters corresponding to the contact points within the contact point set (PiA, i) are uniformly distributed.
[0041] Furthermore, to maintain generality, the tool axis vector is transformed using the following formula: , :
[0042] in, The coordinates of the workpiece coordinate system in the table coordinate system are the coordinates of a six-element cell array. This is the representation of the tool position file in the workpiece coordinate system; it represents the tool tip coordinates and the tool axis vector positions in the workpiece coordinate system, respectively. Representation of the tool pose in the machine tool coordinate system; The rotation matrix represents the rotation angle Angle around the axis Axis. The expressions for the translation matrix, rotation matrix, and translation matrix are Rot(X,A) and Trans(x0 y0 z0), respectively: , The initial tool path representation in the machine tool coordinate system is obtained by using rotation and translation matrices.
[0043] Furthermore, in step 4.1, the sample points are evenly distributed, and the sample points are at equal intervals with the corresponding parameters on the upper and lower conductors.
[0044] Compared with the prior art, the beneficial effects of the present invention are:
[0045] In this application, the lower directrix of a non-developable ruled surface is used as the center point of the toolpath trajectory. An optimal toolpath planning method for ruled surfaces based on the deCasteljau interpolation algorithm and an electromagnetic-like stochastic optimization method is proposed. This method achieves high-order continuity of the toolpath trajectory along the ruled surface, thereby improving the overall machining quality and efficiency. Attached Figure Description
[0046] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.
[0047] In the attached diagram:
[0048] Figure 1 This is a flowchart illustrating the optimal tool position planning process for non-developable ruled surfaces based on the de Casteljau interpolation algorithm and an electromagnetic-like stochastic optimization method, according to the present invention.
[0049] Figure 2 This is a schematic diagram of a single tool position code in this patent;
[0050] Figure 3 This is a schematic diagram of the initial toolpath generation method of the present invention;
[0051] Figure 4 This is a schematic diagram of the de Casteljau interpolation algorithm method of the present invention. Detailed Implementation
[0052] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0053] This invention provides the following technical solutions:
[0054] A method for generating continuous toolpath trajectories for five-axis side milling of non-developable ruled surfaces includes the following steps:
[0055] Step S1: Based on the kinematics principle of five-axis side milling, the tool motion path for machining non-developable ruled surfaces in five-axis side milling is encoded. After encoding, we can know the tool tip coordinates, the heading angle and tilt angle of the tool axis vector at a single tool position.
[0056] Step S2: Given the equations of the upper and lower guide wires on a non-developable ruled surface, the expression for the directrix connecting two points of equal parameter on the upper and lower guide wires of the ruled surface can be obtained under any parameters; the initial toolpath can be obtained based on differential geometry and related mathematical knowledge.
[0057] Step S3: Use the de Casteljau interpolation algorithm to adaptively interpolate the tool center point trajectory curve, heading angle parameter curve, and tilt angle curve in the initial toolpath, and continuously update the three curves;
[0058] Step S4: Use an electromagnetic-like mechanism (EM) to iterate over the number and position of control points on the toolpath-related curves until the maximum number of iterations is reached and the search ends.
[0059] Step S5: Take the trajectory curve of the last iteration as the final toolpath trajectory curve.
[0060] Furthermore, in step S1, the step of encoding the tool motion path according to the five-axis side milling kinematics principle to determine the tool pose at any moment in the tool path for machining non-developable ruled surfaces is characterized by including the following steps:
[0061] Step 1.1: Representation of the tool center point: The trajectory of the tool center point is denoted as... ;
[0062] Step 1.2: Representation of the tool axis vector: Different tool axis vectors have different tool axis attitudes. A five-axis machine tool has two rotational degrees of freedom, and the tool axis attitude can be represented by two angles, namely the yaw angle. and tilt angle It is worth noting that the two direction angles describing the tool axis vector are both referenced to the machine tool coordinate system. During the sweeping motion of a cylindrical flat-bottomed tool along the non-developable ruled surface guideline, the yaw angle and tilt angle change with the parameters of the guideline. The changes are constantly changing, affecting the heading angle. and tilt angle The functions represented as curve parameters are denoted as follows: and .
[0063] Furthermore, in step S2, the generation of the initial toolpath includes the following steps:
[0064] Step 2.1: The spline curve equations of the upper and lower directrixes on the non-developable ruled surface are as follows: and During the sweeping motion of a cylindrical cutting tool along a non-developable ruled surface, the tool will be aligned with the lower guideline of the non-developable ruled surface. A series of contact points are generated, and the set of contact points formed by these contact points is denoted as . The curve parameters corresponding to these contact points are uniform. The set of surface normals and directrix vectors of the non-developable ruled surfaces corresponding to these contact points are denoted as follows: and ;
[0065] Step 2.2: Set a series of contact points on the lower guideline where the tool contacts the non-developable ruled surface. Offset by a tool radius along the normal of the non-developable ruled surface at the corresponding contact point. A series of discrete toolpath center points are obtained. The coordinates of the center point of the discrete toolpath trajectory are represented as follows:
[0066] Step 2.3: After fitting the contact point offset with a cubic spline function, the discrete tool center point obtained is used to obtain the complete tool center point trajectory curve equation. for: in, The control points for the fitted cubic spline function are obtained using the least squares method.
[0067] Step 2.4: The control points for the fitted cubic spline function are obtained using the least squares method, minimizing the sum of squared distances between the fitted spline parameter curve and the center point of the discrete tool. The error function can be expressed as:
[0068]
[0069] The optimal objective function for fitting the cubic spline function is:
[0070]
[0071] Step 2.5: Determine the machine tool coordinate system The heading angle of the tool axis vector and tilt angle Because the CLS (tool path) file is in the workpiece coordinate system Therefore, the tool axis vector in the workpiece coordinate system needs to be transformed to the machine tool coordinate system using inverse kinematic transformation. For the sake of generality, taking an AC-type five-axis machine tool as an example, the transformation process is as follows:
[0072]
[0073]
[0074] in, The coordinates of the six-element cell array in the workpiece coordinate system (WCS) within the table coordinate system; This is the representation of the tool position file in the workpiece coordinate system; it represents the tool tip coordinates and the tool axis vector positions in the workpiece coordinate system, respectively. This represents the tool pose in the machine tool coordinate system. The rotation matrix represents the rotation angle Angle around the axis Axis. The expressions for translation, rotation, and translation matrices are as follows:
[0075]
[0076] At this point, we have obtained the initial toolpath representation in the machine tool coordinate system.
[0077] Furthermore, in step S3, the de Casteljau algorithm is used to adaptively increase curve control points and iterate the toolpath continuously, including the following steps:
[0078] Step 3.1: Assume the conductor is a third-order Bezier curve, with the following equation:
[0079]
[0080] in, For Bezier curve parameters, These are the control points of the curve.
[0081] Step 3.2: Subdivide the Bezier curve into two segments using the de Casteljau interpolation algorithm. The specific segmentation method is as follows:
[0082]
[0083] Step 3.3: Using the above segmentation method, the third-order Bezier curve is divided into two segments, with the control points as follows:
[0084]
[0085] Step 3.4: Keep the two segments of the Bezier curve at the breakpoint (divide point). For continuity, the following equation represents the continuity constraint: Where a is a proportionality coefficient.
[0086] Furthermore, in step S4, the Electromagnetism-like mechanism (EM) stochastic optimization method continuously searches for the optimal number of control points and iterates the toolpath, including the following steps:
[0087] Step 4.1: Initialization: Randomly generate m sample points in n-dimensional space. Each sample point corresponds to a particle in the EM algorithm. The particle dimension is 3N, where N is the number of discrete tool positions in the toolpath trajectory. The sample points are evenly distributed, and the corresponding parameter intervals in the upper and lower guide wires are equal.
[0088] Step 4.2: Local search for the optimal solution: Given two local random search parameters LSITER and , representing the number of local search iterations and the multiplier, respectively;
[0089] Step 4.3: Calculate the total force on each charged particle: the total charge carried by particle i for:
[0090]
[0091] The total force acting on particle i is:
[0092]
[0093] in, This is the optimal solution in the iterative process. For the objective function in The value at that location. The expression for the objective function is:
[0094]
[0095] in, This represents the geometric error between two adjacent tool positions.
[0096] Step 4.4: Particle displacement: under force Under the influence of [something], charged particles will undergo displacement, and the displacement formula is:
[0097] Step 4.5: Obtain the final optimal solution .
[0098] Furthermore, in step S5, the optimal solution from step 4 is taken as the toolpath trajectory of the optimized non-developable ruled surface.
[0099] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for generating continuous toolpath trajectories for five-axis side milling of non-developable ruled surfaces, characterized in that: Includes the following steps: Step S1: Based on the kinematics principle of five-axis side milling, the tool motion path for machining non-developable ruled surfaces in five-axis side milling is encoded to obtain the tool tip coordinates and the heading angle of the tool axis vector at a single tool position. and tilt angle ; The encoding steps are as follows: Step 1.1: Representation of the tool center point: The trajectory of the tool center point is denoted as... ; Step 1.2: Representation of the tool axis vector: The tool axis attitude is expressed using the heading angle. and tilt angle This indicates that, simultaneously, the heading angle and inclination angle vary with the parameters of the traverse line. The changes are constantly changing, affecting the heading angle. and tilt angle The functions represented as curve parameters are denoted as follows: and ; Step S2: Given the equations of the upper and lower guide wires on the non-developable ruled surface, obtain the expression for the directrix connecting the two points with equal parameters of the upper and lower guide wires on the ruled surface, and obtain the initial toolpath; The generation of the initial toolpath includes the following steps: Step 2.1: The spline curve equations of the upper and lower directrixes on the non-developable ruled surface are as follows: and During the sweeping motion of a cylindrical cutting tool along a non-developable ruled surface, the tool will be aligned with the lower guideline of the non-developable ruled surface. A series of contact points are generated, and the set of contact points formed by these contact points is denoted as (PiA, i). The set of surface normal vectors and the set of directrix vectors of the non-developable ruled surface corresponding to these contact points are denoted as follows: and ; Step 2.2: Offset the set of contact points (PiA, i) where the tool contacts the non-developable ruled surface on the lower guideline by a tool radius along the normal of the non-developable ruled surface at the corresponding contact point. A series of discrete toolpath center points are obtained. ; Step 2.3: After fitting the contact point offset with a cubic spline function, the discrete tool center point obtained is used to obtain the complete tool center point trajectory curve equation. for: ; in, The control points for the fitted cubic spline function are obtained using the least squares method. Step 2.4: The control points for the fitted cubic spline function are obtained using the least squares method, minimizing the sum of squared distances between the fitted spline parameter curve and the center point of the discrete tool. The error function can be expressed as: The optimal objective function for the cubic spline function fit is: ; Step 2.5: Determine the machine tool coordinate system The heading angle of the tool axis vector and tilt angle Because the CLS file is in the workpiece coordinate system Therefore, it is necessary to transform the tool axis vector in the workpiece coordinate system to the machine tool coordinate system through inverse kinematic transformation; Step S3: Use the de Casteljau interpolation algorithm to adaptively interpolate the tool center point trajectory curve, heading angle parameter curve, and tilt angle curve in the initial toolpath, and continuously update the three curves; The steps involved in adaptively increasing curve control points and iterating the toolpath using the de Casteljau algorithm are as follows: Step 3.1: Through equations Obtain the Bezier curve. in, These are the control points of the curve; Step 3.2: Subdivide the Bezier curve into two segments using the de Casteljau interpolation algorithm, and then use the equation... To obtain the specific segmentation method; Step 3.3: Using the above segmentation method, the third-order Bezier curve is divided into two segments, with the control points for the first segment being the control points for the second segment. With the second control point : Step 3.4: Keep the two segments of the Bezier curve at the breakpoints. Continuity, the continuity constraint is: ; Where a is a proportionality coefficient; Step S4: Use an electromagnetic-like stochastic optimization method to iterate the number and position of control points on the toolpath-related curves until the maximum number of iterations is reached, then end the search. The electromagnetic-like stochastic optimization method continuously searches for the optimal number of control points and iterates the toolpath, including the following steps: Step 4.1: Initialization: Using an electromagnetic-like stochastic optimization method, m sample points are randomly generated in n-dimensional space. Each sample point corresponds to a particle in the electromagnetic-like stochastic optimization method, and the particle has a dimension of 3N. Where N is the number of discrete tool positions in the toolpath trajectory; Step 4.2: Local search for the optimal solution: Given two local random search parameters LSITER and , representing the number of local search iterations and the multiplier, respectively; Step 4.3: Calculate the total force on each charged particle; the total charge carried by particle i. for The total force acting on particle i is : in, This is the optimal solution in the iterative process. For the objective function in The value at that point, the expression for the objective function is: : in, This refers to the geometric error between two adjacent tool positions; Step 4.4: Particle displacement: under force Under the influence of [something], charged particles will undergo displacement, and the displacement formula is: ; Step 4.5: Obtain the final optimal solution; Step S5: Take the trajectory curve of the last iteration as the final toolpath trajectory curve.
2. The method for generating continuous toolpath trajectories for five-axis side milling of non-developable ruled surfaces according to claim 1, characterized in that: In step S5, the optimal solution from step 4 is taken as the toolpath trajectory of the optimized non-developable ruled surface.
3. The method for generating continuous toolpath trajectories for five-axis side milling of non-developable ruled surfaces according to claim 2, characterized in that: The curve parameters corresponding to the contact points in the contact point set (PiA, i) are uniformly distributed.
4. The method for generating continuous toolpath trajectories for five-axis side milling of non-developable ruled surfaces according to claim 3, characterized in that: To maintain generality, the tool axis vector is transformed using the following formula: , : in, The coordinates of the workpiece coordinate system in the table coordinate system are the coordinates of a six-element cell array. This is the representation of the tool position file in the workpiece coordinate system; it represents the tool tip coordinates and the tool axis vector positions in the workpiece coordinate system, respectively. Representation of the tool pose in the machine tool coordinate system; The rotation matrix represents the rotation angle Angle around the axis Axis. The expressions for the translation matrix, rotation matrix, and translation matrix are Rot(X,A) and Trans(x0 y0 z0), respectively: , The initial tool path representation in the machine tool coordinate system is obtained by using rotation and translation matrices.
5. The method for generating continuous toolpath trajectories for five-axis side milling of non-developable ruled surfaces according to claim 3, characterized in that: In step 4.1, the sample points are evenly distributed, and the sample points are at equal intervals with the parameters corresponding to the upper and lower conductors.