A numerical control five-axis fairing tool path generation method based on a free-form surface model

By using a multi-objective optimized five-axis CNC toolpath generation method, the problems of path drift and insufficient smoothness in the machining of complex curved surfaces by the equal residual height method are solved, realizing high-precision and high-efficiency machining of complex curved surfaces, and improving machining stability and surface quality.

CN122018425BActive Publication Date: 2026-07-03ZHEJIANG UNIV +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG UNIV
Filing Date
2026-04-10
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

The existing five-axis CNC machining medium residual height method has problems with path drift and insufficient smoothness, which affects the machining stability and accuracy, especially in the machining of complex curved surfaces.

Method used

A five-axis CNC toolpath generation method based on multi-objective optimization is adopted. By constructing an initial tool subpath, boundary extension and resampling, equal residual height offset, multi-objective evolutionary algorithm and adaptive segmentation processing, a smooth path is generated. The toolpath is optimized by combining adaptive discretization and overlapping domain shared point connection strategy.

Benefits of technology

It effectively avoids path drift and sharp corners, improves the machining quality of complex curved surface parts and the stability of machine tool operation, and ensures machining accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122018425B_ABST
    Figure CN122018425B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on free-form surface model's numerical control five-axis fairing tool path generation method, comprising: first, the initial tool sub-path of the parameter surface to be processed is determined;Boundary continuation and resampling are carried out to the current tool sub-path to obtain reference center line;Offset line of equal residual height is obtained by using equal residual height offset algorithm to reference center line;For equal residual height offset line, the corresponding Pareto optimal solution set is obtained based on multi-objective evolutionary algorithm;Based on the obtained Pareto optimal solution set, the best fairing path point set is obtained, and finally the next tool sub-path is fitted;One by one cycle processing, until all tool sub-paths are obtained, connect all tool sub-paths obtained, and obtain complete numerical control five-axis fairing tool path.The method realizes effective trade-off between equal residual height path and fairness in numerical control machining of complex surface, significantly reduces path curvature fluctuation, and optimizes global machining efficiency and surface forming quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of CNC machining and toolpath planning technology, specifically relating to a method for generating smooth toolpaths for five-axis CNC freeform surfaces based on multi-objective optimization. Background Technology

[0002] In modern manufacturing, numerical control (CNC) technology plays a crucial role, especially in fields such as aerospace, automotive, and mold manufacturing, which require high-precision machining of complex parts. Five-axis CNC machining, as an advanced form of CNC machining, offers advantages such as high machining flexibility, excellent precision, and the ability to handle complex curved surfaces. It is particularly suitable for shell machining in the aerospace field, such as aircraft wings, fuselage shells, and engine casings. These complex parts typically have large curvatures, free-form surfaces, and thin-walled structures, requiring high-precision and high-quality machining. Five-axis CNC machining can perform cutting at multiple angles and directions, meeting these requirements.

[0003] In modern CNC machining, the equal residual height method aims to maximize the use of local curvature information of the surface, making the residual height distribution between adjacent trajectories uniform and constant, thereby theoretically achieving the maximum line spacing and the minimum number of paths. This method typically employs a recursive bias strategy for generation: selecting an initial trajectory, and calculating the next trajectory point that satisfies the residual height constraint point by point based on the sampled points.

[0004] Although the equal residual height method has obvious advantages in shortening the total path length, it still faces two major challenges: First, path drift, that is, the overall path shape is highly dependent on the initial trajectory. If the initial selection is not appropriate, the subsequent path will deviate significantly from the ideal feed direction. Second, insufficient smoothness. At the point of curvature change, geometric offset is very easy to introduce sharp points or discontinuities, affecting the processing stability. Summary of the Invention

[0005] In view of the shortcomings of the existing technology, this invention proposes a five-axis CNC toolpath smoothing generation method based on multi-objective optimization, in order to solve the defects of path drift and insufficient smoothness in the medium residual height toolpath of the existing technology.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] A method for generating smooth toolpaths for CNC five-axis machining based on a freeform surface model includes: first, determining the initial tool path of the parameter surface to be machined; then, performing boundary extension and resampling on the current tool path to obtain a reference centerline; offsetting the current reference centerline using an equal residual height offset algorithm to obtain an equal residual height offset line; obtaining the corresponding Pareto optimal solution set based on a multi-objective evolutionary algorithm for the current equal residual height offset line; obtaining the optimal smooth path point set based on the currently obtained Pareto optimal solution set, and finally fitting the next tool path; using this tool path as the current tool path for iterative processing until all tool paths are obtained, and connecting all obtained tool paths to obtain a complete smooth toolpath for CNC five-axis machining.

[0008] Furthermore, a method for generating CNC smooth toolpaths based on multi-objective optimization includes the following steps:

[0009] (1) The initial guide line is selected based on the topological features of the surface to be processed, and the initial tool subpath is constructed by adaptive discretization in combination with the chord height error constraint;

[0010] (2) Extend and resample the current tool subpath to extract the reference centerline for generating the path with equal residual height;

[0011] (3) Based on the reference center line, an offset line is generated using the equal residual height offset algorithm, which serves as the next sub-path of the tool to be processed;

[0012] (4) Adaptive segmentation is performed on the current reference centerline and the offset line with equal residual height, and then a shared point extended dataset based on the overlapping domain is constructed to form multiple sub-path segments;

[0013] (5) For each sub-path segment, construct a multi-objective optimization model (or multi-objective evolutionary algorithm) based on linear interpolation in the parameter domain, with the goal of minimizing curvature fluctuations and maximizing processing efficiency. Solve the model using the multi-objective evolutionary algorithm to obtain a discrete Pareto optimal solution set.

[0014] (6) Using the marginal effect analysis method based on curve fitting, the best set of smooth path points is identified and screened from the Pareto optimal solution set;

[0015] (7) Perform B-spline fitting on the selected smooth path point set to obtain the next tool sub-path, and use it as the new current tool sub-path to repeat steps (2) to (6) until the generated path set completely covers the surface to be machined;

[0016] (8) Connect the generated sub-path sets by connecting the beginning and end of the same group and reciprocating bidirectionally (Zigzag) between different groups to synthesize a complete continuous CNC toolpath.

[0017] Furthermore, when determining the initial tool subpath for the surface to be machined: firstly, an initial guide line is determined based on the topological features of the surface to be machined, and then the initial guide line is discretely sampled to obtain the initial tool subpath.

[0018] Furthermore, an isoparametric line (generally a geometric boundary) can be selected as the initial guide line based on the smoothness of a line on the surface and the surface coverage. During the above discrete sampling, an adaptive step-size algorithm can be used. In practice, the maximum allowable chord height error is first set, and then the adaptive step-size algorithm is used to discretely sample the guide line. Using this method, dense sampling can be achieved in areas with high curvature and sparse sampling in flat areas, thereby constructing an initial discrete toolpath point set that meets the accuracy requirements.

[0019] Furthermore, based on the unit guidance vectors at both ends of the current tool subpath and the bounding box of the surface model, the boundary extension of the current tool subpath is realized.

[0020] Furthermore, when extending the boundary of the current toolpath:

[0021] Extract several discrete point sequences at the beginning and end of the current tool subpath, calculate the weighted average of their direction vectors, and obtain the unit guiding vectors extending outward from the beginning and end.

[0022] Obtain the bounding box of the surface model, expand the bounding box in three coordinate directions, and construct the expanded bounding box;

[0023] Based on the unit guidance vector, the first and last endpoints of the current tool subpath are extended outward in straight lines, and the spatial intersection points with the bounding box plane of the extended surface are calculated. The obtained intersection points are used as extension endpoints to complete the boundary extension of the current tool subpath.

[0024] When constructing the extended bounding box, based on the bounding box, the bounding box is extended in three coordinate directions according to the statistical value of the lateral step distance corresponding to each discrete point during the current equal residual height offset process or the reference machining tool radius value, thus constructing the extended bounding box.

[0025] The current toolpath is extended by boundary extension to obtain an extended toolpath. The extended toolpath is then resampled to obtain the reference centerline. This resampling can be performed using equidistant sampling or adaptive discrete sampling, ultimately yielding the current reference centerline.

[0026] When offsetting the current reference centerline using the equal residual height offset algorithm, the curvature of each point on the initial polyline is first calculated based on the classical residual height model and the selected tool geometry parameters (such as the radius of a ball end mill). The lateral step distance of each point under the residual height constraint is calculated based on the curvature, and the lateral step distance of all points on the center polyline is obtained. Then, along the cross product direction of the surface normal and tangent (i.e., the offset direction), the points on the reference centerline are projected and offset to the corresponding lateral step distance, thereby generating a theoretical equal residual height offset line.

[0027] To reduce the dimensionality of decision variables in multi-objective optimization and avoid the "curse of dimensionality" that would result from directly applying multi-objective optimization to the overall toolpath containing thousands of discrete points, an adaptive segmentation process is first performed on the current reference centerline and the equal-residual-height offset line after obtaining the equal-residual-height offset line. Then, the corresponding Pareto optimal solution set is obtained based on a multi-objective evolutionary algorithm.

[0028] As a preferred approach, a constrained heuristic forward search algorithm is used for segmentation.

[0029] Specifically, a constrained heuristic forward search algorithm is used for segmentation, including the following steps:

[0030] (5-1) The original curvature of each discrete point in the reference center line and the offset line with equal residual height is estimated by using the second-order central difference method, and the original curvature sequence is convolved by a Gaussian smoothing filter to obtain a smooth curvature sequence that represents the macroscopic geometric features.

[0031] (5-2) Based on the preset sub-segment point number constraint interval [N] min N max Within the dynamic search window following the current segment start point index, retrieve the local minimum point (i.e., the trough of curvature) of the smooth curvature sequence.

[0032] (5-3) The local minimum point is determined as the cutting boundary point, and the overall tool path is divided into several sub-path segments with simple geometric features to reduce the dimensionality of decision variables for a single optimization task;

[0033] The above strategy not only ensures that the number of control points in a single segment is controllable, but also makes the connection between adjacent segments occur in geometrically flat regions, which significantly reduces the boundary fitting error.

[0034] After adaptive segmentation of the current reference centerline and the offset line with equal residual height, a shared point extended dataset based on the overlapping domain is constructed for each sub-path segment. Using this shared point extended dataset as input, the corresponding Pareto optimal solution set is obtained using the multi-objective evolutionary algorithm.

[0035] To ensure the continuity of each sub-path after segmentation, a shared point connection strategy based on overlapping regions is adopted to construct an extended dataset based on shared points of overlapping regions. Specifically:

[0036] (6-1) When optimizing the fitting of the i-th sub-path segment (i=1,2,3,…N, N is the number of segments in the current equal residual height offset line), define the single-sided extension length (denoted as a, i.e. the number of shared points) as a geometric buffer, and extract the extended dataset containing the overlapping data of adjacent sub-path segments before and after.

[0037] (6-2) For the first sub-path segment, extend it backward by a points to build an extended dataset; for the middle sub-path segment, extend it in both directions by a points to build an extended dataset; for the last sub-path segment, extend it forward by a points to build an extended dataset.

[0038] This invention utilizes the tangential trend provided by the shared point extended dataset as an implicit constraint to participate in subsequent multi-objective optimization, so that the end tangent vector of adjacent sub-path segments at the splicing point tends to be consistent with the beginning tangent vector, thereby achieving smooth splicing between sub-paths.

[0039] Furthermore, the multi-objective evolutionary algorithm includes the following two objective functions:

[0040] The first objective function is to minimize the deviation between the area enclosed by the reference centerline and the offset line of equal residual height, and the area enclosed by the reference centerline and the smooth path of the target.

[0041] The second objective function is to minimize the trajectory smoothness index based on bending energy measurement of the target smooth path.

[0042] That is, the multi-objective optimization model is specifically: the first objective function is to minimize the deviation between the area enclosed by the reference center line and the offset line with equal residual height, and the area enclosed by the reference center line and the smooth path line; the second objective function is to minimize the trajectory smoothness index based on bending energy.

[0043] In constructing the objective function, this invention normalizes each sub-objective to eliminate dimensional differences and conducts multi-objective collaborative optimization. At the same time, it pre-adopts a segmentation strategy based on shared anchor points for long paths, constraining the geometric continuity of adjacent segments at anchor points to ensure smooth global paths and reduce computational complexity.

[0044] Furthermore, using the marginal effect analysis method based on curve fitting, the optimal set of smooth path points is identified and selected from the Pareto optimal solution set.

[0045] Furthermore, the marginal effect analysis method based on curve fitting includes the following specific steps:

[0046] (5-1) A spline curve with monotonicity constraint is used to fit the discrete Pareto optimal solution set to construct a strictly monotonically decreasing fitting curve that passes through some solution points, in order to characterize the competitive trade-off between area error and path smoothness.

[0047] (5-2) Calculate the absolute value of the derivative of the fitted curve, and define the marginal effect function by analyzing the improvement of bending energy corresponding to the unit area error increment;

[0048] (5-3) Identify the critical inflection point on the fitted curve where the marginal effect significantly decays, and determine the coordinate point that satisfies the preset derivative threshold or the maximum value of the front curvature as the theoretical optimal decision point;

[0049] (5-4) Search the Pareto optimal solution set for the discrete solution that is closest to the Euclidean distance of the theoretical optimal decision point, and use it as the final output set of smooth path points.

[0050] Compared with the prior art, the present invention has the following beneficial effects:

[0051] This invention breaks through the limitations of the traditional equal residual height method that simply pursues processing efficiency. By constructing a multi-objective optimization model with area deviation and bending energy as the core, it minimizes the curvature fluctuation of the trajectory while ensuring that the local residual height meets the processing accuracy, and effectively avoids acceleration and deceleration impacts during the machine tool feed process.

[0052] To address the high-dimensional computational challenges posed by long-path optimization on complex curved surfaces, this invention proposes an adaptive segmentation strategy and a shared-point connection strategy based on overlapping domains. By forcing segmentation at curvature troughs and utilizing an extended dataset to provide tangential trend constraints, the computational cost of the optimization algorithm is significantly reduced, while achieving a smooth and continuous transition between adjacent path segments without adding hard constraints.

[0053] To address the discrete Pareto optimal solution set generated by multi-objective evolutionary algorithms, this invention introduces a marginal effect analysis method based on monotonic spline fitting. By quantifying the inflection point relationship between the area error increment and the bending energy improvement rate, the blindness of human selection is eliminated, and the automatic identification and stable output of the optimal trade-off point that balances both factors are achieved.

[0054] By combining optimized guide lines, adaptive discretization, and boundary re-extension techniques, the topological consistency of the toolpath and its ability to fully cover the surface are ensured. This method not only eliminates the local drift and sharp corners that are prone to occur in equal-residual-height paths, but also significantly improves the surface forming quality and machine tool operation stability in five-axis machining of complex free-form surface parts. Attached Figure Description

[0055] Figure 1 This is a schematic diagram of the overall process of the CNC smooth toolpath generation method based on multi-objective optimization according to an embodiment of the present invention.

[0056] Figure 2 This is a schematic diagram of the parametric surface and its extended bounding box in an embodiment of the present invention.

[0057] Figure 3 This is a schematic diagram illustrating the intersection of the tool subpath beginning and end boundary extensions and the extended bounding box in an embodiment of the present invention.

[0058] Figure 4 This is a schematic diagram of the reference center line and the offset line of equal residual height in an embodiment of the present invention.

[0059] Figure 5 This is a schematic diagram of the shared point extended dataset obtained by the shared point connection based on the overlapping domain and the adaptive segmentation strategy in an embodiment of the present invention (there are 6 segments in the figure, shown in different colors; at the same time, the gray parts at the beginning and end of adjacent segments are overlapping shared points).

[0060] Figure 6 This is a schematic diagram of point pairs used for smoothing optimization in a certain sub-path segment based on shared point constraints in an embodiment of the present invention.

[0061] Figure 7 This is a schematic diagram of the Pareto front (i.e., the discrete Pareto optimal solution set) obtained by multi-objective optimization of sub-path segments in an embodiment of the present invention.

[0062] Figure 8 This is a schematic diagram of the Pareto front of the sub-path segment obtained by monotonic cubic B-spline fitting in an embodiment of the present invention.

[0063] Figure 9 This is a schematic diagram illustrating how, in an embodiment of the present invention, the optimal decision point is selected on the fitted curve based on marginal effect analysis, and the Pareto front solution (i.e., the optimal smooth path point set) that is closest to that point in Euclidean distance is matched.

[0064] Figure 10 This is a schematic diagram of the geometric relationship between the reference center line, the equal residual height offset line, and the smooth path line in an embodiment of the present invention (dark blue is the equal residual height offset line, purple is the smooth path line, and the other is the reference center line).

[0065] Figure 11 This is a schematic diagram of the tool path distribution formed by all smooth path lines in an embodiment of the present invention.

[0066] Figure 12 This is a schematic diagram of the final generated full-surface continuous CNC toolpath in an embodiment of the present invention.

[0067] Figure 13 The image shows a product with complex curved surface features, which was actually processed according to the above method. Detailed Implementation

[0068] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.

[0069] like Figures 1 to 12 As shown, a method for generating CNC smooth toolpaths based on multi-objective optimization includes the following steps:

[0070] S10: Based on the topological features of the surface to be machined, a guide line is selected and adaptively discretized using chord height error constraints to construct the initial toolpath. Specifically, the freeform surface model file to be machined (such as STEP or IGES format) is parsed to extract the surface's parameter domain information and topological features. An isoparametric line (generally a geometric boundary) is selected as the initial guide line based on the smoothness of a line on the surface and the surface coverage. The maximum allowable chord height error is set, and an adaptive step-size algorithm is used to discretize and sample this initial guide line; dense sampling is performed in areas with high curvature, and sparse sampling is performed in flat areas, thereby constructing an initial discrete toolpath point set that meets the accuracy requirements, thus obtaining the initial toolpath.

[0071] In this step, the surface model file is read, and the supported formats include IGES, STEP, or other CAD file formats. It is then parsed into surface parameter form (such as control points, basis functions, and parameter ranges). The model file is then parsed to extract the control points, basis functions, and parameter range information of the surface.

[0072] S20: Perform boundary extension and resampling on the current tool subpath to extract the reference centerline used to generate the equal-height path.

[0073] In this step, to prevent the toolpath from shrinking at the surface boundary during the offset process, boundary extension is required. The specific method is as follows:

[0074] (1) Extract several discrete point columns at the beginning and end of the current tool subpath (usually select 2-5 sampling points near the end).

[0075] (2) Perform linear regression on the local line segments formed by these discrete point sequences or calculate the weighted average of their direction vectors (the method used in this embodiment) to construct unit guiding vectors that extend outward from the beginning and end respectively.

[0076] (3) Calculate the bounding box of the surface model, and based on the bounding box, expand the bounding box in three coordinate directions according to the lateral step distance or its statistical value or the radius size of the machining tool (used in this embodiment) of each discrete point during the equal residual height offset process, to construct an extended bounding box (e.g. Figure 2As shown); extend the unit guidance vector outward in a straight line from the beginning and end endpoints of the tool path, and calculate its spatial intersection with the extended bounding box plane (e.g. Figure 3 (As shown).

[0077] (4) The obtained intersection point is used as the extension endpoint to complete the path growth, that is, to complete the boundary extension of the current tool subpath. Then, the extended path is re-discrete at equal intervals or adaptively according to the resampling interval threshold (used in this embodiment), and it is used as the subsequent reference center line.

[0078] S30, based on the reference centerline, an offset line is generated using the equal residual height offset algorithm, which serves as the polyline of the next toolpath to be machined (e.g., ...). Figure 4 (As shown).

[0079] Specifically, based on the classic residual height model and the selected tool geometry parameters (such as the radius of a ball end mill), the curvature of each point on the reference centerline is calculated, and the lateral step distance of each point under the residual height constraint is calculated based on the curvature, thus obtaining the lateral step distance of all points on the center polyline.

[0080] Along the cross product of the surface normal and tangent (i.e., the offset direction), the point on the reference center line is projected and offset to the corresponding lateral step, thereby generating a theoretically equal residual height offset line.

[0081] S40, adaptive segmentation processing is performed on the reference centerline and the equal residual height offset line (e.g., ... Figure 5 As shown, this reduces the dimensionality of decision variables in multi-objective optimization. Directly applying multi-objective optimization to a global toolpath containing thousands of discrete points leads to the "curse of dimensionality." Furthermore, a shared point extension dataset based on overlapping regions is constructed to reduce the decision dimensionality of multi-objective optimization and ensure geometric continuity between path segments.

[0082] This embodiment uses a constrained heuristic forward search algorithm for divide-and-conquer processing:

[0083] (1) Use the second-order central difference method to estimate the original curvature of each discrete point in the constant residual height offset line.

[0084] (2) Since the original curvature often contains high-frequency noise (which can easily lead to spurious minimum values), the standard deviation is used as... A Gaussian kernel is used to convolve the original absolute curvature sequence to remove noise and obtain a smooth curvature sequence that characterizes macroscopic geometric features. This preprocessing ensures that the segmentation focuses on macroscopic shape changes.

[0085] (3) Set the minimum number of points N allowed for each sub-segment min And the maximum number of points N max The dynamic search window [N] following the current segment start point. min Nmax Within the range, find the local minimum point (i.e., the trough of the curvature wave) of the smooth curvature sequence.

[0086] (4) Force the local minimum point to be set as the dividing boundary point to complete the adaptive segmentation operation.

[0087] This strategy not only ensures that the number of control points in a single segment is controllable, but also makes the connection between adjacent segments occur in geometrically flat regions, significantly reducing boundary fitting error.

[0088] (5) Furthermore, to ensure the continuity of each sub-path after segmentation, an extended dataset of the current reference centerline and the equal residual height offset line is constructed using a shared point connection strategy based on the overlapping domain (as shown in Figure 5 and...). Figure 6 ):

[0089] When optimizing the i-th sub-path segment (i=1,2,3,…N, where N is the number of segments after segmentation of the reference centerline and the equal residual height offset line), the single-sided extension length a is defined as a geometric buffer.

[0090] For the first sub-path segment, extend it backward by a points; for the middle sub-path segment, extend it in both directions by a points; for the last sub-path segment, extend it forward by a points, thus constructing an extended dataset. Figure 6 (This shows the pairs of points contained in a given sub-path segment), where a is 4.

[0091] Finally, the extended dataset of shared points based on the overlapping domain corresponding to the current reference centerline and the offset line with equal residual height is obtained.

[0092] S50: For each sub-path segment of the current toolpath, construct and solve a multi-objective optimization model based on linear interpolation in the parameter domain. Perform synergistic optimization of residual height deviation and path smoothness to obtain a discrete Pareto optimal solution set. This step aims to balance the area fluctuation caused by residual height offset with the smoothness of the path itself. Specifically, for the shared point extension dataset based on overlapping domains, establish a multi-objective optimization architecture:

[0093] (1) First objective function (machining accuracy objective): Minimize the deviation between the area of ​​the polygon enclosed by the reference center line and the theoretical equal residual height offset line, and the area enclosed by the reference center line and the current optimized smooth path line. The smaller the area deviation, the closer the path is to the equal residual height requirement, and the higher the machining efficiency.

[0094] (2) Second objective function (trajectory smoothing objective): minimize bending energy.

[0095] Before optimization, each sub-objective is dimensionlessly normalized to eliminate the dimensional differences between area and bending energy. The input data for both the first and second objective functions are extended datasets corresponding to the reference centerline and the theoretical constant residual height offset line.

[0096] By leveraging overlapping data in the extended dataset to "predict" the neighborhood geometry, this information is used as a latent constraint in multi-objective evolutionary algorithms (such as NSGA-II). Since the overlapping region provides an implicit tangential trend constraint, the tangent vector at the end of the optimized segment at the splice point naturally tends to be consistent with the tangent vector at the beginning, achieving an approximate C1. 1 The algorithm smoothly stitches together the solutions. After solving the problem, the algorithm outputs a set of non-dominant discrete Pareto optimal solutions (such as...). Figure 7 (As shown).

[0097] S60, using a curve-fit-based marginal effect analysis method, identifies and filters the optimal set of smooth path points from the Pareto optimal solution set. To automatically select the optimal compromise solution from numerous Pareto solutions:

[0098] (1) A spline curve with monotonicity constraints (preferably a monotonic cubic B-spline) is used to interpolate and fit the discrete Pareto optimal solution set. This curve is strictly monotonically decreasing, which intuitively represents the competitive trade-off between area error and path smoothness (e.g., Figure 8 (As shown).

[0099] (2) Calculate the absolute value of the derivative of the mapping curve and define the marginal effect function to quantify the rate of reduction in bending energy that can be obtained by increasing the error per unit area.

[0100] (3) Find the critical inflection point on the curve where the marginal effect significantly diminishes (e.g., the absolute value of the derivative decreases to a preset threshold), and determine it as the theoretically optimal decision point (i.e., Figure 9 (The red fitting point in the image).

[0101] (4) Calculate the Euclidean distance from all discrete solutions in the Pareto solution set to the theoretically optimal decision point, and select the discrete solution with the closest distance as the nearest true point. Figure 9 (As shown by the green dot in the middle), the point set in the iterative layer corresponding to the nearest true point is used as the final output. The overlapping extended points at both ends are removed to obtain the optimal smooth tool sub-path segment point set.

[0102] (5) Piece together the point sets of each sub-path segment to form a complete smoothing tool sub-path (e.g., Figure 10 (As shown).

[0103] S70, perform B-spline fitting on the selected smooth path point set to obtain the next tool subpath adjacent to the current tool subpath.

[0104] The tool path output by S70 is input as the new current tool path in steps S20 to S70.

[0105] By iteratively offsetting and optimizing towards both sides or one side of the surface (in this embodiment, one side), parallel and smooth toolpaths are generated one by one until the boundary of the generated path set completely exceeds or covers the bounding box of the surface to be machined (e.g., ...). Figure 11 (As shown).

[0106] After the path set is generated (S80), for all parallel smooth tool subpaths, end-to-end connections are made using a zigzag method (connecting the beginning and end of the same group and reciprocating bidirectionally between different groups). For short polylines that are cut off at the surface boundary due to intersection, the nearest endpoints on the same side are sequentially found and connected to form a complete and continuous five-axis CNC toolpath file with no interference and minimal tool lifting (output to the machine tool in G-code format).

[0107] Figure 13 The image shows a product with complex curved surface features, which was actually processed according to the above method.

Claims

1. A method for generating a five-axis NC tool path based on a free-form surface model, characterized in that, include: First, determine the initial tool path of the surface to be machined; then, perform boundary extension and resampling on the current tool path to obtain the reference centerline. The current reference centerline is offset using an equal residual height offset algorithm to obtain an equal residual height offset line. For the current equal residual height offset line, the corresponding Pareto optimal solution set is obtained based on a multi-objective evolutionary algorithm. Based on the obtained Pareto optimal solution set, the best smooth path point set is obtained, and finally, the next tool subpath is fitted. This tool subpath is used as the current tool subpath and processed iteratively until all tool subpaths are obtained. All the obtained tool subpaths are connected to obtain a complete CNC five-axis smooth toolpath. When determining the initial tool path for the surface to be machined: first, the initial guide line is determined based on the topological features of the surface to be machined, and the initial guide line is discretely sampled to obtain the initial tool path; Based on the unit guidance vectors at both ends of the current tool path and the bounding box of the surface model, the boundary extension of the current tool path is realized. When solving for the Pareto optimal solution set, the current reference center line and the equal residual height offset line are first adaptively segmented, and then the corresponding Pareto optimal solution set is obtained for each sub-path segment based on the multi-objective evolutionary algorithm. The multi-objective evolutionary algorithm includes the following two objective functions: The first objective function is to minimize the deviation between the area enclosed by the reference centerline and the offset line of equal residual height, and the area enclosed by the reference centerline and the smooth path of the target. The second objective function is to minimize the trajectory smoothness index based on bending energy measurement of the target smooth path.

2. The method for generating a smooth toolpath for five-axis CNC machining based on a freeform surface model according to claim 1, characterized in that, When performing boundary extension on the current toolpath: Extract several discrete point sequences at the beginning and end of the current tool subpath, calculate the weighted average of their direction vectors, and obtain the unit guiding vectors extending outward from the beginning and end. Obtain the bounding box of the surface model, expand the bounding box in three coordinate directions, and construct the expanded bounding box; Based on the unit guidance vector, the first and last endpoints of the current tool subpath are extended outward in straight lines, and the spatial intersection points with the bounding box plane of the extended surface are calculated. The obtained intersection points are used as extension endpoints to complete the boundary extension of the current tool subpath.

3. The method for generating a smooth toolpath for five-axis CNC machining based on a freeform surface model according to claim 1, characterized in that, A constrained heuristic forward search algorithm is used for segmentation.

4. The method for generating a smooth toolpath for five-axis CNC machining based on a freeform surface model according to claim 1, characterized in that, After adaptive segmentation of the current reference centerline and the offset line with equal residual height, a shared point extended dataset based on the overlapping domain is constructed. Using this shared point extended dataset as input, the corresponding Pareto optimal solution set is obtained using the multi-objective evolutionary algorithm.

5. The method for generating a smooth toolpath for five-axis CNC machining based on a freeform surface model according to claim 1, characterized in that, Using the marginal effect analysis method based on curve fitting, the optimal set of smooth path points is identified and selected from the Pareto optimal solution set.

6. The method for generating a smooth toolpath for five-axis CNC machining based on a freeform surface model according to claim 5, characterized in that, The marginal effect analysis method based on curve fitting has the following specific steps: (5-1) Use spline curves with monotonic constraints to fit the discrete Pareto optimal solution set, and construct a fitting curve that is strictly monotonically decreasing and passes through some solution points. (5-2) Calculate the absolute value of the derivative of the fitted curve; (5-3) When the absolute value of the derivative decreases to a preset threshold, the coordinate point that satisfies the preset derivative threshold is determined as the theoretical optimal decision point; (5-4) Search the Pareto optimal solution set for the discrete solution that is closest to the Euclidean distance of the theoretical optimal decision point, and use it as the final output set of smooth path points.