Self-adaptive optimization generation method for cylinder machining tool path
By employing fractal dimension analysis, four-color theorem region partitioning, and an improved Dijkstra algorithm, combined with a two-layer game model and B-spline curve fitting, the tool path for cylinder machining was optimized. This solved the problem of balancing efficiency and quality in traditional methods, achieving efficient machining and high-quality surfaces for complex cylinder surfaces.
Patent Information
- Application Number
- CN202511008231.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-22
- Publication Date
- 2025-11-18
AI Technical Summary
Traditional toolpath planning methods for cylinder machining cannot balance machining efficiency and surface quality. In particular, under complex geometric features, overcutting and undercutting are prone to occur, making it difficult to achieve synergistic optimization of efficiency and quality.
By employing fractal dimension analysis, four-color theorem region partitioning, improved Dijkstra algorithm, and two-layer game model, combined with real-time collision detection and B-spline curve fitting, the tool trajectory is dynamically adjusted to optimize the machining path.
This method achieves synergistic optimization of machining efficiency and surface quality on complex cylinder surfaces, avoiding path conflicts and repetitive machining problems in traditional methods, and improving machining efficiency and surface quality.
Smart Images

Figure CN120972774A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of cylinder machining technology, and more specifically, relates to a method for adaptive optimization generation of cylinder machining tool paths. Background Technology
[0002] As a core component of the engine, the surface finish of the cylinder directly affects engine performance and service life. Traditional cylinder machining toolpath generation techniques mainly employ methods based on CAM software, such as the equal residual height method, the isoparametric line method, and the projection method. These methods achieve toolpath planning by pre-setting fixed toolpath patterns and machining parameters, and they have a certain degree of practicality and stability in machining regular surfaces. However, traditional methods have significant shortcomings when dealing with complex geometric features of the cylinder surface. Due to the complex curvature changes and irregular geometric shapes of the cylinder's inner surface, traditional fixed-parameter path planning methods cannot adaptively adjust according to local geometric features, leading to frequent overcutting and undercutting during machining. Furthermore, due to the lack of quantitative analysis of surface geometric complexity, traditional methods struggle to identify repetitive patterns and optimal machining area divisions, resulting in redundant toolpaths and low machining efficiency. In current cylinder precision machining applications, traditional toolpath planning methods cannot achieve synergistic optimization of machining efficiency and surface quality. In engineering practice, it is often necessary to sacrifice machining efficiency to ensure surface quality, or to reduce surface quality requirements to improve machining efficiency. In other words, existing technologies have the technical problem that toolpath planning under the complex geometric features of cylinder surfaces cannot take into account both machining efficiency and surface quality. Summary of the Invention
[0003] In view of this, the present invention provides a method for adaptive optimization generation of cylinder machining toolpaths, which can solve the technical problem in the prior art that toolpath planning under the complex geometric features of the cylinder surface is difficult to balance machining efficiency and surface quality.
[0004] This invention is implemented as follows: A method for adaptively optimizing and generating toolpaths for cylinder machining includes the following steps: importing a cylinder CAD model file and establishing a triangular mesh matrix; performing fractal dimension analysis on the triangular mesh matrix, calculating the fractal dimension of each sub-region in the matrix, identifying the matrix sub-block with the minimum fractal dimension as the minimum fractal matrix, which represents the minimum geometric repeating unit of the cylinder surface; performing region coloring segmentation on the triangular mesh matrix based on the four-color theorem, dividing the cylinder surface into four-color segmented regions with different colors for adjacent regions, and establishing a region adjacency graph; extracting the geometric features of the cylinder surface within the four-color segmented regions and establishing a surface feature database; initializing a multi-axis linkage machining parameter set; performing global path planning on the surface feature database based on an improved Dijkstra algorithm to search for the optimal toolpath sequence; performing real-time collision detection and tool axis vector optimization on the optimal toolpath sequence; performing path adaptive adjustment and trajectory smoothing on the optimal tool axis direction vector, dynamically adjusting the feed rate and tool posture according to the local curvature change of the minimum fractal matrix, and generating a smooth toolpath using a B-spline curve fitting method; and outputting the final optimized toolpath file based on the smoothed toolpath.
[0005] Specifically, the step of establishing the triangular mesh matrix involves reading cylinder geometric data through an STL format interface, establishing a triangular mesh model of the cylinder surface, and converting the vertex coordinates and topological relationships of the triangular mesh model into a triangular mesh matrix.
[0006] Specifically, the fractal dimension analysis involves calculating the self-similarity of the surface mesh at different scales to determine the fractal characteristics of the surface geometry, identifying repeating units with minimal complexity, and taking into account triangular mesh topology and multi-scale measurement data as inputs. The outputs are fractal dimension values and the matrix of minimum repeating units.
[0007] Specifically, the four-color segmentation region is based on the four-color theorem principle to color the dual graph of the triangular mesh, ensuring that any two adjacent faces belong to different color regions, thus providing a non-intersecting region division scheme for toolpath planning.
[0008] Specifically, the step of extracting the geometric features of the cylinder surface involves identifying the curvature variation areas, boundary contours, and key feature points within each color region, and establishing a surface feature database.
[0009] Specifically, the set of multi-axis linkage machining parameters includes setting tool geometry parameters, machine tool kinematic parameters, machining accuracy requirements, and material removal rate targets. The tool geometry parameters include tool diameter, tool length, and tool tip radius. At the same time, the rated power of the machine tool spindle, maximum feed force, initial tool size, and optimal chip temperature of the material are obtained as optimization benchmark parameters.
[0010] Specifically, the improved Dijkstra algorithm introduces a multi-objective weight function and a dynamic priority adjustment mechanism on the basis of the traditional Dijkstra algorithm. It considers the comprehensive optimization of path length, curvature change and processing time, discretizes the four-color segmentation region into a path node network, and uses processing efficiency and path smoothness as weight functions.
[0011] Specifically, the real-time collision detection and tool axis vector optimization steps involve using an envelope surface detection algorithm to determine the interference between the tool and the workpiece, and employing differential geometry to calculate the optimal tool axis direction vector to avoid overcutting and undercutting.
[0012] Specifically, the envelope surface detection algorithm constructs a family of envelope surfaces on a given tool trajectory, calculates the intersection distribution of the envelope surface and the workpiece surface, and detects potential overcut or collision areas.
[0013] Before adaptive path adjustment, a two-layer game model is established: an upper-layer game model aimed at maximizing machining efficiency and a lower-layer game model aimed at maximizing surface quality. The coupling terms reflect the dual impact of tool feed rate on machining efficiency and surface quality. The upper-layer game model includes unilateral optimization terms to minimize total machining time and optimize machine tool power utilization and feed force control. The lower-layer game model includes unilateral optimization terms to minimize residual height and optimize tool wear control and chip temperature control. Both unilateral optimization terms are optimized using the Grey Wolf Hunting Algorithm.
[0014] Specifically, the differential geometry method calculates the principal curvature and principal direction based on the first and second fundamental forms of the surface. By solving for the optimal tilt angle of the surface normal vector under tool constraints, the optimal posture of the tool relative to the cylinder surface is determined. The gray wolf hunting algorithm simulates the social hierarchy and hunting behavior of a gray wolf pack. It guides the ω wolf pack towards the optimal solution position through α, β, and δ wolves, and uses a position update formula and convergence parameters to control the search process.
[0015] Specifically, the path adaptive adjustment and trajectory smoothing steps involve real-time monitoring of spindle power, feed force, tool wear, and chip temperature as feedback parameters for adaptive adjustment, and dynamically adjusting the feed rate and tool posture based on the local curvature changes of the minimum fractal matrix.
[0016] Specifically, the B-spline curve fitting method achieves local shape control of the curve by optimizing control point weights and adjusting node vectors, ensuring the geometric and kinematic continuity of the path, and smoothly connecting discrete path points.
[0017] Among them, the two-layer game model adopts the cross-optimization rule. In each iteration of solving the game model, the α wolf position information of the upper gray wolf algorithm is passed to the lower gray wolf algorithm as the initial search position. The optimal solution of the lower gray wolf algorithm is fed back to the upper algorithm to adjust the search boundary, forming an information interaction mechanism and realizing the co-evolution of cross-optimization.
[0018] This invention establishes a method for quantifying the geometric features of cylinder surfaces based on fractal dimension analysis. Combining a region partitioning strategy based on the four-color theorem and a global path optimization technique based on an improved Dijkstra algorithm, it constructs a toolpath adaptive generation system driven by a two-layer game model, achieving synergistic optimization of machining efficiency and surface quality during cylinder machining. This invention identifies the minimum geometrically repeating unit on the cylinder surface through fractal dimension analysis, providing a quantified geometric complexity evaluation standard for toolpath planning. The four-color theorem divides complex surfaces into non-intersecting machining regions, avoiding path conflicts and repetitive machining problems in traditional methods. The improved Dijkstra algorithm achieves global optimal path search under multiple constraints, solving the problem of traditional local optimization methods easily getting trapped in suboptimal solutions. The two-layer game model establishes a mathematical relationship between machining efficiency and surface quality, achieving dynamic balance and synergistic optimization of the two objectives. Real-time monitoring and adaptive adjustment of machining parameters avoids the shortcomings of traditional fixed-parameter methods that cannot adapt to complex geometric features. In summary, this invention solves the technical problem in the prior art where toolpath planning for complex cylinder surface geometry struggles to balance machining efficiency and surface quality. Attached Figure Description
[0019] Figure 1 This is a flowchart of the method of the present invention.
[0020] Figure 2 A schematic diagram of the adaptive optimization system for toolpath in cylinder machining.
[0021] Figure 3 This is a schematic diagram of the triangular mesh matrix structure on the cylinder surface.
[0022] Figure 4 This is a schematic diagram of partial surface region segmentation based on the four-color theorem.
[0023] Figure 5 for Figure 4 The corresponding dual graph of regional adjacency relationships. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.
[0025] like Figure 1The diagram shown is a flowchart of a method for adaptive optimization generation of toolpaths for cylinder machining provided by the present invention. This method includes the following steps:
[0026] S01. Import the cylinder CAD model file and establish a triangular mesh matrix. Read the cylinder geometric data through the STL format interface, establish a triangular mesh model of the cylinder surface, and convert the vertex coordinates and topological relationships of the triangular mesh model into a triangular mesh matrix.
[0027] S02. Perform fractal dimension analysis on the triangular mesh matrix, calculate the fractal dimension of each sub-region in the matrix, and identify the matrix sub-block with the minimum fractal dimension as the minimum fractal matrix. The minimum fractal matrix represents the minimum geometric repeating unit of the cylinder surface.
[0028] S03. Based on the four-color theorem, the triangular mesh matrix is divided into regions by coloring, and the cylinder surface is divided into four-color segmented regions with different colors for adjacent regions. A region adjacency graph is established to provide topological constraints for subsequent path planning.
[0029] S04. Extract the cylinder surface geometric features within the four-color segmentation area, identify the curvature change area, boundary contour line and key feature point within each color area, and establish a surface feature database.
[0030] S05. Initialize the multi-axis linkage machining parameter set, set the tool geometry parameters, machine tool kinematic parameters, machining accuracy requirements and material removal rate targets. The tool geometry parameters include tool diameter, tool length and tool tip radius. At the same time, obtain the machine tool spindle rated power, maximum feed force, initial tool size and optimal material chip temperature as optimization benchmark parameters.
[0031] S06. Based on the improved Dijkstra algorithm, global path planning is performed on the surface feature database. The four-color segmentation region is discretized into a path node network. With processing efficiency and path smoothness as weight functions, the optimal tool trajectory sequence from the starting processing point to the ending processing point is searched.
[0032] S07. Perform real-time collision detection and tool axis vector optimization on the optimal tool trajectory sequence. Use the envelope surface detection algorithm to determine the interference between the tool and the workpiece. Use differential geometry to calculate the optimal tool axis direction vector to avoid overcutting and undercutting.
[0033] S08. Perform path adaptive adjustment and trajectory smoothing on the optimal tool axis direction vector. Dynamically adjust the feed rate and tool posture according to the local curvature change of the minimum fractal matrix. At the same time, monitor the spindle power, feed force, tool wear and chip temperature in real time as feedback parameters for adaptive adjustment. Use B-spline curve fitting method to smoothly connect discrete path points to generate a smooth tool trajectory.
[0034] S09. Based on the smooth tool trajectory, output the final optimized tool path file, generate an NC code sequence containing tool position coordinates, attitude angle parameters, and feed rate parameters, forming a complete machining program for CNC machine tool execution.
[0035] The triangular mesh matrix is used to store discrete geometric information of the cylinder surface. The input includes the vertex coordinates, patch indices, and topological relationships of the triangular mesh model, and the output is structured matrix data.
[0036] The minimum fractal matrix is used to characterize the minimum repeating unit of the cylinder surface geometry. The input includes sub-region data of the triangular mesh matrix and the fractal dimension calculation result. The output is the matrix representation of the minimum geometric repeating unit.
[0037] The four-color segmentation region is used to divide the cylinder surface into topologically adjacent but different colored machining regions. Based on the four-color theorem, the dual graph of the triangular mesh is colored to ensure that any two adjacent faces belong to different color regions, providing a non-intersecting region division scheme for toolpath planning. The input includes the triangular mesh matrix and the region adjacency relationship, and the output is the surface segmentation result with color labels.
[0038] The surface feature database stores the geometric feature information of the cylinder surface. The input includes the vertex coordinates, normal vector direction, and curvature value of the four-color segmentation region, and the output is the set of feature points and constraint boundaries.
[0039] The tool geometry parameters are used to describe the physical dimensional characteristics of the machining tool. The inputs include tool design drawings and material property data, and the outputs are the values of tool diameter, tool length, and tool tip radius.
[0040] Among them, the kinematic parameters of the machine tool are used to describe the motion capability limitations of the CNC machine tool. The inputs include the machine tool technical specifications and axis configuration information, and the outputs are the maximum feed rate, acceleration, and stroke range of each axis.
[0041] The optimal tool trajectory sequence represents the optimal motion path of the tool on the cylinder surface. The input includes the path node network, weight function, and constraints. The output is a sequence of tool position points arranged in chronological order.
[0042] The optimal tool axis direction vector is used to determine the best posture of the tool relative to the cylinder surface. The inputs include the surface normal vector, curvature tensor, and tool geometric parameters, and the output is a unit direction vector in three-dimensional space.
[0043] Among them, the smooth tool trajectory is used to generate a continuous and differentiable tool motion path. The input includes discrete path point coordinates, fitting accuracy requirements, and boundary conditions. The output is a continuous and smooth parametric curve.
[0044] The NC code sequence is used to control the CNC machine tool to perform cylinder machining operations. The inputs include tool position coordinates, attitude angle parameters, and feed rate parameters, and the output is program code that conforms to the CNC system standard.
[0045] Among them, the differential geometry method is used to calculate the optimal orientation of the tool on complex curved surfaces. Based on the first and second basic forms of the surface, the principal curvature and principal direction are calculated. By solving the optimal tilt angle of the surface normal vector under tool constraints, the input includes the surface parametric equation, curvature tensor matrix, and tool geometric constraints. The output is the tool axis direction vector that meets the machining requirements.
[0046] The envelope surface detection algorithm is used to determine the geometric interference relationship between the tool sweep body and the workpiece surface. By constructing a family of envelope surfaces of the tool on a given trajectory, the algorithm calculates the intersection distribution of the envelope surface and the workpiece surface, and detects potential overcut or collision areas. The inputs include the tool geometry model, motion trajectory parameters, and workpiece surface mesh, and the outputs are the location of the interference area and the safety clearance distance.
[0047] Among them, the improved Dijkstra algorithm is used to solve the shortest path problem under multiple constraints. Based on the traditional Dijkstra algorithm, a multi-objective weight function and a dynamic priority adjustment mechanism are introduced to consider the comprehensive optimization of path length, curvature change and processing time. The input includes a graph structure node set, edge weight matrix and multi-objective constraints, and the output is a path node sequence that satisfies the comprehensive optimality.
[0048] Fractal dimension analysis is used to quantify the geometric complexity of the cylinder surface and identify repeating patterns. By calculating the self-similarity of the surface mesh at different scales, the fractal characteristics of the surface geometry are determined, and repeating units with minimum complexity are identified. The inputs include triangular mesh topology and multi-scale measurement data, and the outputs are fractal dimension values and minimum repeating unit matrix.
[0049] Among them, the B-spline curve fitting method is used to connect discrete toolpath points into a smooth and continuous parametric curve. It achieves local shape control of the curve by optimizing control point weights and adjusting node vectors, ensuring the geometric and kinematic continuity of the path. The input includes the discrete path point coordinate sequence, fitting order, and continuity requirements. The output is a B-spline parametric representation that satisfies the smoothness condition.
[0050] Among them, spindle power P spindle Derived from machine tool kinematic parameter measurements, spindle rated power P rated Derived from the machine tool technical specifications, feed force F feed Derived from the mechanical analysis of the machining process, the maximum feed force F max This stems from limitations in the machine tool's structural design.
[0051] Among them, tool wear W tool Originating from the tool condition monitoring system, the initial tool size W initial Derived from tool geometry settings, chip temperature T chip Derived from thermodynamic calculations of the processing, the optimal chip temperature T optimal Sourced from a materials properties database.
[0052] Among them, the gray wolf hunting algorithm is used to solve the optimal solution of the unilateral optimization term, simulate the social hierarchy and hunting behavior of the gray wolf pack, guide the ω wolf pack to converge toward the optimal solution position through α wolf, β wolf, and δ wolf, and use position update formula and convergence parameters to control the search process. The input includes objective function, variable boundary, and population size, and the output is the optimal parameter combination of the unilateral optimization term.
[0053] Game Theory Model Design:
[0054] Establish a higher-level game model with the objective of maximizing processing efficiency and a lower-level game model with the objective of maximizing surface quality. The objective function of the higher-level game model is: The constraint condition is the tool feed rate V. feed Within the range of 0.1 to 5.0 m / min, the cutter shaft tilt angle θ spindle Within the range of -90° to 90°, the objective function of the lower-level game model is: The constraint condition is surface roughness R. surface Less than 1.6 μm, residual height D residual Less than 0.01 mm.
[0055] The objective function of the upper-level game theory model is used to maximize machining efficiency and minimize machining time. The inputs include the tool feed rate V. feed Tool path length L path Total processing time T total Number of tool changes N tool_change , spindle tilt angle θ spindle Spindle power P spindle Spindle rated power P rated Feed force F feed Maximum feed force F max The output is the processing efficiency evaluation value; the objective function of the lower-level game model is used to maximize surface quality and minimize processing error, and the input includes surface roughness R. surface Residual height D residual Cutting force F cutting , Tool rake angle α rake Tool wear W tool Initial tool size Winitial Chip temperature T chip Optimal chip temperature T optimal The output is the surface quality evaluation value.
[0056] Coupling term λ1·V feed ·R surface and λ2·V feed ·R surface This demonstrates the dual impact of tool feed rate on machining efficiency and surface quality. The upper-level game model includes unilateral optimization terms. To minimize total machining time and optimize machine tool power utilization and feed force control, the lower-level game model includes unilateral optimization terms. To minimize residual height and optimize tool wear control and chip temperature control, both unilateral optimization terms are optimized using the Grey Wolf Hunting Algorithm.
[0057] The cross-optimization rule is designed as follows: In each iteration of the game model solution, the α wolf position information of the upper-level gray wolf algorithm is passed to the lower-level gray wolf algorithm as the initial search position. The optimal solution of the lower-level gray wolf algorithm is fed back to the upper-level algorithm to adjust the search boundary, forming an information interaction mechanism. At the same time, the convergence parameter 'a' of the two algorithms is adjusted according to 'a'. upper =2-2t / T max and a lower =2-1.5t / T max Perform a differential update, where t is the current iteration number, T max To achieve the maximum number of iterations, we can implement cross-optimization and co-evolution.
[0058] The specific implementation methods of the above steps are described in detail below.
[0059] The specific implementation of step S01 involves first reading the three-dimensional geometric model file of the cylinder through a computer-aided design software interface. This file typically stores complete geometric information in STEP or IGES format. The system calls the STL format conversion module to discretize the complex parametric surface model into a mesh structure composed of multiple triangular facets, with the discretization accuracy controlled within 0.01 mm to ensure geometric precision. During the conversion process, the system extracts the coordinates of the three vertices, the normal vector direction, and the adjacency information of each triangular facet, and organizes and stores this data according to a predefined matrix format. The row index of the triangular mesh matrix corresponds to the vertex number, and the column index contains the X, Y, and Z coordinate values as well as the topological connection information of adjacent facets. The matrix elements are stored in double-precision floating-point format to maintain computational accuracy. The purpose of this step is to convert the continuous cylinder surface geometry into a discrete data structure suitable for computer processing, providing basic data support for subsequent geometric analysis and path planning.
[0060] The specific implementation of step S02 is based on multi-scale fractal dimension calculation of the triangular mesh matrix using the box counting method. This method quantifies the surface geometric complexity by statistically analyzing the minimum number of boxes required to cover the cylinder surface at different scales. The system divides the triangular mesh into several sub-regions according to spatial location, with each sub-region having a size of 5 mm × 5 mm. Then, the fractal dimension value is calculated for each sub-region. The measurement scale used in the calculation process increases from 0.1 mm to 1.0 mm, with a step size of 0.05 mm. The fractal dimension value is determined by statistically analyzing the rate of change of the number of boxes at different scales. By comparing the fractal dimension values of each sub-region, the system identifies the matrix sub-block with the smallest value as the minimum fractal matrix. This matrix typically corresponds to the region with the most regular geometric changes on the cylinder surface. The threshold range for the fractal dimension is set between 1.0 and 3.0. When the fractal dimension of a sub-region is close to 1.0, it indicates that the region has a high degree of geometric regularity. The purpose of this step is to identify the geometric repetition patterns on the cylinder surface using mathematical methods, providing a theoretical basis for optimizing the repeatability and regularity of toolpaths.
[0061] The specific implementation of step S03 is based on the four-color theorem in graph theory to perform region coloring and segmentation of the triangular mesh. This method transforms the dual graph of the triangular mesh into a planar graph coloring problem. The system first constructs the dual graph structure of the triangular mesh, where each triangular facet corresponds to a node in the graph, and the boundary relationships between adjacent faces correspond to connecting edges in the graph. The coloring algorithm uses a greedy strategy to assign color identifiers to each node sequentially, ensuring that any two adjacent nodes have different color numbers. The color types are limited to four basic colors: red, green, blue, and yellow. During the coloring process, the system prioritizes assigning colors to regions with significant geometric features, such as edges and corners with drastic curvature changes. The coloring order is arranged from high to low geometric importance. The region adjacency graph is stored in the form of an adjacency matrix, where a matrix element value of 1 indicates that two regions are adjacent, and a value of 0 indicates that regions are not adjacent. The purpose of this step is to divide the complex cylinder surface into several non-overlapping processing regions, each with similar geometric features, providing a clear basis for region division and topological constraints for subsequent path planning.
[0062] The specific implementation of step S04 involves geometric feature identification and extraction for each region after four-color segmentation. This process uses differential geometry principles to calculate the curvature distribution characteristics within each region. The system first calculates the principal curvature value of each vertex in the triangular mesh. The principal curvature calculation uses a discrete curvature estimation method, determining the curvature value by analyzing the rate of change of the normal vector within the vertex's neighborhood. The threshold for identifying curvature variation regions is set to a curvature variation rate of 0.1 per millimeter; regions exceeding this threshold are marked as high curvature variation regions. Boundary contour extraction uses a boundary tracking algorithm, starting from the boundary triangular facet of each color region and sequentially tracking adjacent boundary facets until a closed contour line is formed. Key feature point identification is based on local geometric invariant calculations, including Gaussian curvature extrema, average curvature extrema, and principal direction abrupt change points. The importance evaluation threshold for feature points is set to be more than twice the local curvature standard deviation. The surface feature database uses a hierarchical storage structure, categorized and organized according to feature importance and geometric type. The database index uses a spatial hash table for fast lookup. The purpose of this step is to establish a complete description system of the cylinder surface geometry, providing detailed geometric constraints and optimization objectives for toolpath planning.
[0063] The specific implementation of step S05 involves initializing the parameter set for multi-axis linkage machining based on specific machining task requirements and machine tool parameters. This process requires comprehensive consideration of tool performance, machine tool capabilities, and machining accuracy requirements. Tool geometry parameters include a tool diameter range of 6 mm to 20 mm, a tool length range of 50 mm to 150 mm, and a tool tip radius range of 0.5 mm to 2.0 mm. Parameter selection is determined based on the specific dimensions of the cylinder and machining accuracy requirements. Machine tool kinematic parameters include setting the maximum feed rate of each axis to 10 m / min to 50 m / min, the maximum acceleration to 5 m / s² to 15 m / s², and the travel range of each axis determined according to the machine tool model. Machining accuracy requirements are set as follows: surface roughness less than 1.6 micrometers, dimensional accuracy controlled within ±0.02 mm, and shape accuracy controlled within 0.01 mm. The target material removal rate is set based on the workpiece material characteristics. For aluminum alloys, the target is 50 to 200 cubic centimeters per minute, and for cast iron, it is 20 to 80 cubic centimeters per minute. The system simultaneously acquires key performance parameters such as the machine tool spindle's rated power and maximum feed force as baseline data for optimization calculations. The purpose of this step is to establish a complete machining parameter system, providing accurate constraints and objective function parameters for subsequent path optimization algorithms.
[0064] Step S06 is specifically implemented based on the improved Dijkstra algorithm for global optimal path search. This algorithm introduces a multi-objective weight function and a dynamic priority adjustment mechanism on the basis of the traditional shortest path algorithm. The system first discretizes the surface feature points within the four-color segmentation region into a node network for path planning. The node spacing is set to 0.3 to 0.5 times the tool diameter to ensure complete machining coverage. The weight function is designed as a linear combination of machining efficiency weight and path smoothness weight. The machining efficiency weight considers path length and machining time factors, while the path smoothness weight considers the direction change angle and curvature continuity factors. During the algorithm search, a priority queue data structure is used to maintain the nodes to be visited. The node priority is dynamically updated based on the current path cost and heuristic estimate. The heuristic function uses a combination of Euclidean distance and geometric constraint penalty terms. The geometric constraints include tool interference detection and surface normal vector constraints. The search termination condition is set to reaching the target node or the search queue being empty. The path backtracking process constructs the optimal trajectory sequence through node predecessor pointers. The purpose of this step is to find the optimal tool motion trajectory that satisfies multiple constraints in a complex three-dimensional curved surface environment, achieving comprehensive optimization of machining efficiency and path quality.
[0065] The specific implementation of step S07 involves real-time collision detection and tool axis direction optimization of the generated optimal tool trajectory sequence. This process employs an envelope surface detection algorithm and a differential geometry optimization method. The envelope surface detection algorithm constructs a three-dimensional sweep body of the tool along its motion trajectory and calculates the intersection area between the sweep body and the workpiece surface to determine potential interference. Tool sweep body modeling uses a discretization method, dividing the tool's motion along the trajectory into several time steps, each set to 0.01 seconds. At each time node, the spatial position and orientation of the tool are calculated. Collision detection uses a hierarchical bounding box algorithm to accelerate the calculation process. First, a coarse bounding box intersection detection is performed, followed by precise geometric interference calculation for the intersection area. The safety clearance distance is set to 0.1 times the tool radius. When the detected clearance distance is less than the safety threshold, a tool axis adjustment mechanism is triggered. Tool axis direction optimization uses a differential geometry method to calculate the optimal tilt angle of the surface normal vector. The optimization objectives include minimizing cutting force and maximizing surface quality. The adjustment range of the tool axis tilt angle is set to within ±30 degrees relative to the surface normal vector, with an angle step of 1 degree for iterative search. The purpose of this step is to ensure the safety of the tool path and the quality of machining, avoid collisions between the tool and the workpiece, and optimize cutting conditions.
[0066] The specific implementation of step S08 involves adaptively adjusting and smoothing the tool trajectory based on the local geometric features of the minimum fractal matrix. This process combines real-time monitoring data and B-spline curve fitting. The adaptive adjustment mechanism dynamically adjusts the tool feed rate and attitude angle based on local curvature changes. When the local curvature radius is less than 5 times the tool radius, the feed rate is reduced to 60% to 80% of the standard speed. When the rate of curvature change exceeds 0.2 mm, the tool attitude adjustment frequency is increased. The system monitors key parameters such as spindle power, feed force, tool wear, and chip temperature in real time as feedback signals. The spindle power monitoring threshold is set to 85% of the rated power, the feed force monitoring threshold is set to 75% of the maximum feed force, and the chip temperature monitoring threshold is set to 0.6 times the material melting point. When the monitored parameters exceed the set thresholds, the parameter adjustment mechanism is triggered. The adjustment range is determined according to the degree of exceedance and controlled within ±20% of the original set value. The trajectory smoothing process uses a cubic B-spline curve fitting method with a fitting accuracy set to 0.005 mm. The node vectors are determined using a uniform distribution or chord length parameterization method. During curve fitting, geometric and tangent vector continuity are ensured, and fitting error is controlled by increasing the number of control points or raising the fitting order. The purpose of this step is to improve the smoothness and adaptability of the tool path, ensuring the stability of the machining process and surface quality.
[0067] The specific implementation of step S09 is to generate machining program code that conforms to the CNC system standard based on a smooth tool path. This process includes coordinate transformation, code formatting, and program verification. The system first converts the world coordinate system of the tool path into the machine tool coordinate system. The coordinate transformation matrix is determined according to the workpiece clamping method and the machine tool zero point setting. The tool position coordinate accuracy is set to 0.001 mm, the attitude angle accuracy is set to 0.01 degrees, and the feed rate accuracy is set to 1 mm per minute. NC code generation adopts the ISO standard format, containing a complete sequence of G-code, M-code, and F-code instructions. The program structure includes an initialization segment, a machining segment, and an end segment. The initialization segment includes instructions such as tool selection, spindle start, and coolant activation. The machining segment contains detailed motion instructions for the tool path. The end segment includes instructions such as tool return, spindle stop, and program termination. The code verification process uses simulation software to check the program's syntactic correctness and motion rationality. Verification includes tool interference detection, motion continuity checking, and machining range confirmation. Program optimization includes measures such as redundant instruction deletion, adjacent instruction merging, and execution efficiency improvement. The purpose of this step is to convert the optimized toolpath into a machining program that can be directly executed by the CNC machine tool, thus achieving a complete transformation from theoretical design to actual machining.
[0068] It should be noted that the fractal dimension calculation formula is based on the self-similarity principle of fractal geometry. It quantifies geometric complexity by statistically analyzing the minimum number of boxes required to cover the target area at different measurement scales. The core of this formula lies in using a power-law relationship to reveal the statistical regularity of surface geometric features at multiple scales. When the surface has fractal characteristics, the number of boxes exhibits a stable power function relationship with the measurement scale. Compared to traditional geometric parameter analysis methods, fractal dimension calculation can capture the inherent correlation between microscopic and macroscopic surface geometric features and identify repeating units with minimal complexity. This provides a mathematical foundation for modular design and repeatability optimization of toolpaths. In cylinder machining, by identifying the minimum fractal matrix, the system can establish standardized machining patterns, reduce the computational complexity of path planning, improve the reusability and consistency of machining programs, and thus achieve an overall improvement in machining efficiency.
[0069] The principal curvature calculation formula is based on classical differential geometry theory, accurately describing the intrinsic geometric properties of a surface through the coefficients of its first and second fundamental forms. The first fundamental form reflects the surface's metric characteristics, while the second fundamental form reflects its bending characteristics; their combination can fully characterize the local geometric structure of complex surfaces. The calculation formulas for mean curvature and Gaussian curvature embody the essential characteristics of surface geometry, where mean curvature reflects the overall degree of curvature of the surface, and Gaussian curvature reflects its intrinsic bending properties. Through the calculation of principal curvature, the system can accurately identify geometric singularities, high-curvature regions, and flat regions on the cylinder surface, providing reliable geometric constraints for refined toolpath design. Compared to traditional experience-based geometric analysis methods, differential geometry methods have rigorous mathematical theoretical support, ensuring the accuracy and consistency of geometric feature extraction and significantly improving the reliability of tool attitude optimization and collision detection.
[0070] The design principle of the multi-objective weighting function lies in transforming competing optimization objectives into a unified mathematical expression, achieving coordinated optimization of multiple objectives through linear weighting. The processing efficiency weight considers the influence of path length and processing time, reflecting the requirements for production efficiency; the path smoothness weight considers directional changes and curvature continuity, reflecting the requirements for processing quality. The selection of weight coefficients reflects the relative importance of different optimization objectives, and flexible configuration of processing strategies can be achieved by adjusting the weight ratios. Compared to single-objective optimization methods, the multi-objective weighting function can consider other performance requirements while ensuring the main performance indicators, avoiding the performance bias problems that may occur with single-objective optimization. In practical applications, this function can dynamically adjust the optimization focus according to the specific processing task requirements, achieving adaptive configuration of the processing scheme and improving the balance and stability of overall processing performance.
[0071] The tool axis direction vector optimization formula, based on vector geometry and optimization theory, transforms the complex tool posture optimization problem into a scalar function minimization problem through geometric transformation. This formula uses a linear combination of the surface normal vector and the tangent vector to describe the tool axis direction. The introduction of an inclination angle allows the tool to avoid interference while maintaining effective cutting. The objective function design comprehensively considers the two core requirements of minimizing cutting force and avoiding interference, and ensures tool safety through a penalty function mechanism. Compared to traditional fixed angle settings or empirical adjustment methods, the optimization formula can dynamically determine the optimal tool posture based on local geometric features, achieving the best match between the tool and the workpiece surface. This adaptive posture adjustment mechanism can significantly reduce vibration and impact during the cutting process, improve surface finish, extend tool life, and reduce machining costs.
[0072] The adaptive adjustment function, based on feedback control theory, achieves dynamic optimization of the machining process through multivariate feedback of real-time monitored parameters. The function employs an exponential decay form to handle the influence of local curvature, reflecting the nonlinear impact of geometric complexity on machining parameters; it also uses a product form to handle multiple monitored parameters, demonstrating the coupling effect of different machining state factors. The design of the adjustment sub-function considers the physical characteristics and safety thresholds of each monitored parameter, ensuring that the machining process operates within a safe range. Compared to traditional fixed-parameter control methods, the adaptive adjustment function can respond to changes in machining conditions in real time, automatically adjusting machining parameters to maintain optimal machining conditions. This intelligent parameter adjustment mechanism effectively addresses the influence of uncertainties such as material inhomogeneity, tool wear, and machine tool thermal deformation, significantly improving the stability and consistency of the machining process and reducing scrap rates and reprocessing costs.
[0073] B-spline curve fitting formulas are based on spline function theory, achieving smooth connections of discrete points through linear combinations of basis functions. B-spline basis functions possess excellent mathematical properties such as local support, non-negativity, and unit partitioning, ensuring the stability and controllability of the fitted curve. Parametric representation gives the curve good geometric and parametric continuity, meeting the trajectory smoothness requirements of CNC machine tools. Adjusting control points allows for local control of the curve shape, while the design of node vectors controls the fitting accuracy and computational efficiency. Compared to traditional straight-segment connections or circular interpolation methods, B-spline curves generate smoother and more natural tool trajectories, reducing speed abrupt changes and acceleration shocks during machining. This smooth trajectory characteristic significantly reduces machine tool dynamic errors, vibration and noise, improves the quality of machined surfaces, and extends the machine tool's service life.
[0074] The design principle of the objective function of the upper-level game theory model lies in maximizing machining efficiency as the primary optimization objective, comprehensively considering various factors affecting machining efficiency through polynomial combination. The ratio of feed rate to path length reflects the machining efficiency per unit path; the logarithmic term of the total machining time reflects the nonlinear characteristics of time cost; the negative impact of the number of tool changes reflects the cost of auxiliary time; and the sine function of the spindle tilt angle reflects the periodic influence of tool posture on machining efficiency. The introduction of coupling terms considers the mutual constraint between machining efficiency and surface quality, preventing the pursuit of efficiency at the expense of quality. Compared with traditional single-objective efficiency optimization methods, this objective function can improve machining efficiency while taking into account machining quality and equipment safety, achieving comprehensive optimization of the machining process.
[0075] The objective function of the lower-level game theory model focuses on maximizing surface quality, quantifying the key factors affecting surface quality through a carefully designed mathematical expression. The reciprocal term of surface roughness reflects the positive pursuit of surface quality; the exponential decay term of residual height reflects the importance of geometric accuracy; the square root term of cutting force considers the dynamic influence of the cutting process; and the cosine function of the tool rake angle reflects the periodic influence of tool geometric parameters. The mathematical form of this objective function is meticulously designed to accurately reflect the mechanism and degree of influence of each factor on surface quality. Compared with traditional quality control methods, this function can achieve quantitative optimization of surface quality, providing a scientific theoretical basis for high-precision machining.
[0076] The design of the unilateral optimization terms reflects the independent interests of each participant in the game model. The upper-level unilateral optimization terms focus on optimizing time cost, power utilization, and feed control, reflecting an efficiency-oriented optimization strategy; the lower-level unilateral optimization terms focus on controlling residual height, tool wear, and chip temperature, reflecting a quality-oriented optimization strategy. This hierarchical design allows optimization objectives at different levels to develop independently, while achieving mutual coordination through coupling terms, embodying the equilibrium concept in game theory.
[0077] The convergence parameter update formula of the Gray Wolf algorithm embodies the adaptive characteristics of biomimetic optimization algorithms, achieving global optimization by simulating the hierarchy and cooperation mechanism of a wolf pack. The differentiated convergence parameter design allows the upper and lower layers of the algorithm to have different search characteristics: the upper layer algorithm uses a faster convergence speed to quickly locate high-efficiency regions, while the lower layer algorithm uses a slower convergence speed to accurately search for high-quality solutions. This coordinated evolutionary mechanism enables complementary algorithmic performance, avoids getting trapped in local optima, and improves global search capability. Compared to traditional single-algorithm optimization methods, the cooperative Gray Wolf algorithm can better handle complex multi-objective optimization problems, achieving a dual improvement in optimization effect and computational efficiency.
[0078] The key technical ideas of this invention mainly include surface feature recognition technology based on fractal dimension, region segmentation strategy guided by the four-color theorem, multi-objective optimization method of two-layer game model, and real-time control technology for adaptive parameter adjustment.
[0079] Fractal dimension-based surface feature recognition technology achieves accurate identification of repetitive surface patterns by quantifying the geometric complexity of cylinder surfaces. Traditional methods typically use fixed geometric parameters for surface analysis, making it difficult to accurately capture the inherent regularities of complex surfaces. This invention employs fractal dimension analysis to reveal the self-similarity of surface geometric features at multiple scales, providing a more scientific geometric basis for toolpath planning by identifying the minimum fractal matrix. This method significantly improves the adaptability and accuracy of toolpath planning, reducing the subjective influence of manually set parameters.
[0080] The four-color theorem-guided region segmentation strategy provides a novel topological constraint framework for path planning on complex surfaces. Traditional region segmentation methods often rely on geometric similarity or machining requirements, lacking rigorous mathematical support and prone to region overlap or omission. This invention utilizes the four-color theorem to ensure no overlapping of adjacent regions, providing clear boundary conditions and topological constraints for subsequent path planning. This effectively avoids toolpath conflicts and repetitions, improving machining efficiency and path quality.
[0081] A multi-objective optimization method based on a two-level game model achieves synergistic optimization of processing efficiency and surface quality. Traditional optimization methods typically employ a single objective function or a simple weighted combination of multiple objectives, making it difficult to handle conflicting optimization goals. The two-level game model constructed in this invention uses maximizing processing efficiency and maximizing surface quality as the objectives of the upper and lower levels of the game, respectively, achieving a dynamic balance between the two objectives through a game equilibrium mechanism. Combined with the cross-optimization strategy of the Grey Wolf Hunting Algorithm, the algorithm can search for the optimal solution globally, avoiding getting trapped in local optima and significantly improving the quality and stability of the optimization results.
[0082] The synergistic effect of these key technological approaches forms a complete intelligent toolpath generation system. Fractal dimension analysis provides the system with a precise geometric foundation, the four-color segmentation strategy ensures the topological rationality of path planning, two-level game optimization achieves multi-objective coordination and unity, and adaptive control technology guarantees the dynamic adaptability of the machining process. Compared with traditional methods, this collaborative mechanism can significantly improve machining efficiency, reduce tool wear and energy consumption, and enhance overall machining quality while ensuring machining accuracy, providing a complete technical solution for the efficient and precise machining of complex surfaces.
[0083] Specifically, the principle of this invention is as follows: The fundamental principle behind this invention's ability to solve the technical problem of balancing machining efficiency and surface quality in toolpath planning under complex geometric features of cylinder surfaces lies in the construction of an adaptive path optimization system based on quantitative analysis of geometric features. First, the geometric complexity of the cylinder surface is quantified through fractal dimension analysis. The fractal dimension accurately reflects the self-similarity and complexity of the surface geometric features, and the identified minimum fractal matrix provides a geometric benchmark for subsequent path planning, avoiding the problem of insufficient quantitative analysis of complex surfaces in traditional methods. Second, a region coloring segmentation method based on the four-color theorem divides the complex cylinder surface into topologically adjacent but color-different machining regions. This segmentation method ensures that there are no path intersections between adjacent regions, providing a conflict-free search space for global path optimization and solving the problem of interference in path planning in traditional methods. Third, the improved Dijkstra algorithm, by introducing a multi-objective weight function and a dynamic priority adjustment mechanism, can find a comprehensive optimal solution while considering path length, curvature changes, and machining time. Compared with traditional greedy algorithms and local search methods, this algorithm has global optimization capabilities, avoiding the problem of getting trapped in local optima. Most importantly, the design of the two-level game model realizes the mathematical correlation and dynamic balance between processing efficiency and surface quality. The upper-level game model aims to maximize processing efficiency, while the lower-level game model aims to maximize surface quality. The mutual influence relationship between the two objectives is established through coupling terms. The gray wolf hunting algorithm optimizes the individual optimization terms of each objective, and the cross-optimization rule realizes information interaction and co-evolution between the two levels. This game mechanism can maximize processing efficiency while ensuring surface quality, or maximize surface quality while ensuring processing efficiency, thus achieving the co-optimization of two mutually constraining objectives. Therefore, the technical solution of this invention can effectively solve the technical problem that traditional methods cannot balance processing efficiency and surface quality.
[0084] The following provides a specific embodiment 1 of the present invention, and the specific implementation of each step in this embodiment 1 is described in detail below.
[0085] The specific implementation of step S01 involves establishing a triangular mesh matrix and constructing a surface mesh model after reading the cylinder geometry data through an STL format interface. The mathematical expression of the triangular mesh matrix is:
[0086]
[0087] In the formula, M grid V is a triangular mesh matrix; i Let V be the three-dimensional coordinate vector of the i-th vertex. i =[x i y i , z i ]T ;x i y i z i T represents the coordinate components of the i-th vertex in the X, Y, and Z directions, respectively, in millimeters; j Let n be the topological relation vector of the j-th triangular facet; triangle This represents the total number of triangular faces. Vertex coordinate vector V i Obtained directly from CAD model files, with coordinate accuracy maintained at 0.001 mm. Topological relationship vector T j It contains three vertex indices and adjacent face connection information, and is automatically generated using an STL file parsing algorithm.
[0088] The specific implementation of step S02 involves performing fractal dimension analysis, using box counting to calculate the fractal dimension of each sub-region. The formula for calculating the fractal dimension is:
[0089]
[0090] In the formula, D fractal Here, N is the fractal dimension; N(δ) is the minimum number of boxes required to cover the cylinder surface at scale δ; δ is the measurement scale, ranging from 0.1 mm to 1.0 mm. In actual calculations, a discretized approximation formula is used:
[0091]
[0092] In the formula, m represents the number of measurement scales; and These are the arithmetic mean of the logarithmic values. Minimum fractal matrix M. min Determined by comparing the fractal dimensions of each sub-region, D was selected. fractal The matrix sub-block with the smallest value.
[0093] The specific implementation of step S03 is based on region coloring and segmentation using the four-color theorem, constructing a region adjacency graph. The expression for the adjacency matrix is:
[0094]
[0095] In the formula, A adjacent Let a be an adjacency matrix; ij For adjacency elements, when region i is adjacent to region j, a ij =1, otherwise a ij =0; k is the total number of segmented regions. The four-coloring result vector is represented as C. color = [c1, c2, ..., c k ] T , where c i ∈{1,2,3,4} corresponds to the four colors: red, green, blue, and yellow, respectively.
[0096] The specific implementation of step S04 involves extracting the geometric features of the cylinder surface and calculating the curvature distribution in each region. The principal curvature is calculated using a differential geometry method, and its expression is:
[0097]
[0098] In the formula, κ principal H is the principal curvature; H is the mean curvature; K is the Gaussian curvature. The mean curvature and Gaussian curvature are calculated using the first and second fundamental forms:
[0099]
[0100] In the formula, E, F, and G are the coefficients of the first fundamental form; L, M, and N are the coefficients of the second fundamental form. These coefficients are obtained by calculating the partial derivatives of the surface parameter equation.
[0101] The specific implementation method of step S05 is the same as described above, and will not be repeated in detail here.
[0102] The specific implementation of step S06 is based on global path planning using the improved Dijkstra algorithm. The expression for the multi-objective weight function is:
[0103] W total =w1·W efficiency +w2·W smoothness ;
[0104] In the formula, W total The total weight is represented by w1 and w2, which are weight coefficients satisfying w1 + w2 = 1. efficiency Weighted by processing efficiency; W smoothness The path smoothness weight is used. The processing efficiency weight is defined as:
[0105] W efficiency =α eff ·d ij +β eff ·t machining ;
[0106] The path smoothness weight is defined as:
[0107] W smoothness =γ path ·|θ change |+δ path ·κ path ;
[0108] In the formula, d ij t is the Euclidean distance from node i to node j; machining To estimate processing time; θ change κ represents the angle of change in path direction.path α represents the path curvature. eff β eff γ path δ path The adjustment coefficient has a value range of 0.4–0.6, 0.3–0.5, 0.2–0.4, and 0.1–0.3, respectively.
[0109] The specific implementation of step S07 involves collision detection and tool axis vector optimization. The optimal tool axis direction vector is calculated using differential geometry, and its expression is:
[0110]
[0111] In the formula, φ is the optimal tool axis direction vector; φ is the tool axis tilt angle, ranging from -π / 6 to π / 6. It is the surface normal vector; The surface tangent vector is denoted by φ. The tilt angle φ is determined by optimizing the objective function.
[0112] φ optimal =argmin φ [F cutting (φ)+λ axis ·P interference (φ)];
[0113] In the formula, F cutting (φ) is the cutting force function; P interference (φ) is the interference penalty function; λ axis This is the penalty weighting coefficient, with a value ranging from 0.1 to 0.5.
[0114] The specific implementation of step S08 involves adaptive path adjustment and trajectory smoothing. The adaptive adjustment rules for the real-time monitoring parameters are expressed as follows:
[0115] V feed_adaptive =V feed_base ·η(κ local P monitor );
[0116] In the formula, V feed_adaptive For adaptive feed rate; V feed_base η is the reference feed rate; η is the adjustment function; κ is the reference feed rate. local For local curvature; P monitor To monitor the parameter vector, which includes spindle power, feed rate, tool wear, and chip temperature, the specific form of the adjustment function is as follows:
[0117]
[0118] In the formula, α curvψ is the curvature sensitivity coefficient, with a value ranging from 0.5 to 2.0; i p is the adjustment subfunction for the i-th monitored parameter; i Let be the value of the i-th monitoring parameter. The parameterized expression for the B-spline curve fitting is:
[0119]
[0120] In the formula, Points on the B-spline curve; N i,pdegree (u) is p degree B-spline basis functions; n is the control point; u is the parameter, ranging from [0, 1]; n is the parameter. control p represents the number of control points. degree The degree of the B-spline curve is usually 3 or 4.
[0121] The specific implementation method of step S09 is the same as described above, and will not be repeated in detail here.
[0122] The objective function of the upper-level game model is expressed as:
[0123]
[0124] In the formula, F1 is the objective function value of the upper-level game; α1, α2, α3, and α4 are weight coefficients, with values ranging from 0.3 to 0.5, 0.2 to 0.4, 0.1 to 0.3, and 0.1 to 0.2, respectively; V feed L is the tool feed rate, measured in meters per minute. path T represents the toolpath length in meters. total N represents the total processing time, in minutes. tool_change θ represents the number of tool changes; spindle λ is the spindle tilt angle, in radians; λ1 is the coupling coefficient, ranging from 0.05 to 0.15; R surface Surface roughness, measured in micrometers.
[0125] The unilateral optimization term in the upper-level game model is expressed as:
[0126]
[0127] In the formula, O1 is the upper-level unilateral optimization term; α5 and α6 are weight coefficients, with values ranging from 0.1 to 0.2 and 0.05 to 0.15, respectively; P spindle Real-time spindle power, in kilowatts; P rated The rated power of the spindle, in kilowatts (kW); F feed This is the real-time feed force, measured in Newtons (F). max The maximum feed force is expressed in Newtons.
[0128] The objective function of the lower-level game model is expressed as:
[0129]
[0130] In the formula, F2 is the objective function value of the lower-level game; β1, β2, β3, and β4 are weight coefficients, with values ranging from 0.4 to 0.6, 0.2 to 0.4, 0.1 to 0.3, and 0.1 to 0.2, respectively; D residual Residual height, in millimeters; F cutting α is the cutting force, measured in Newtons. rake λ is the tool rake angle, in radians; λ2 is the coupling coefficient, ranging from 0.05 to 0.15.
[0131] The unilateral optimization term in the lower-level game model is expressed as:
[0132]
[0133] In the formula, O2 is the lower-level unilateral optimization term; β5 and β6 are weight coefficients, with values ranging from 0.15 to 0.25 and 0.1 to 0.2, respectively; W tool This represents the current tool wear, in millimeters; W initial This is the initial tool size, in millimeters; T chip This refers to the real-time chip temperature, in degrees Celsius; T optimal The optimal chip temperature is expressed in degrees Celsius.
[0134] The convergence parameter update formula for the Grey Wolf algorithm is:
[0135] a upper =2-2t / T max a lower =2-1.5t / T max ;
[0136] In the formula, a upper and a lower These are the convergence parameters for the upper and lower gray wolf algorithms, respectively; t is the current iteration number; T max The maximum number of iterations is usually set to 100 to 500.
[0137] It should be noted that the cylinder surface region coloring rule based on the four-color theorem is established on a rigorous mathematical foundation. Its core lies in transforming the triangular mesh of the cylinder surface into a dual graph structure of a planar graph, and then using the four-color theorem to ensure that any two adjacent regions are labeled with different colors. Specifically, the coloring algorithm first needs to construct the dual graph G = (V, E) of the triangular mesh, where the vertex set V represents each triangular facet in the original mesh, and the edge set E represents the adjacency relationship between faces with shared edges. This transformation converts the complex three-dimensional surface geometry problem into a classic graph theory coloring problem. In the actual implementation, the algorithm uses a greedy strategy for color allocation. For each region R to be colored... i Check all its adjacent regions {R} j1 R j2 , ..., R jk The color state of the cylinder is determined, and then the first unused color from the four basic colors {Red, Blue, Green, Yellow} is selected for assignment. This strategy ensures the local optimality of the coloring process, and the existence of a global solution is guaranteed by the mathematical guarantee of the four-color theorem. Each color in this invention is not just a simple identifier, but carries different geometric semantic information. The red area usually corresponds to the low-curvature smooth area of the cylinder surface. These areas have a large radius of curvature and a gentle change, which is suitable for high-speed roughing strategies. The blue area represents the standard machining area with medium curvature. Its geometric features are between smooth and complex areas, requiring balanced machining parameter settings. The green area identifies the high-curvature precision machining area. These areas usually contain abrupt geometric changes and complex surface features, requiring precise tool control and low feed rates. The yellow area is used to identify areas with special geometric features, such as sharp edges, deep grooves, or complex cavities, which require special tools and machining processes. The coloring process also needs to consider the topological connectivity and geometric continuity of regions, ensuring that regions of the same color are similar in geometric features. This requires introducing a geometric similarity weight w during the dual graph construction stage. ij =exp(-|κ i -κ j | / σ), where κ i and κ j σ represents the average curvature of regions i and j respectively, and σ is the standardized parameter of curvature difference. This weighting mechanism can prioritize assigning the same color to regions with similar geometric features while satisfying the four-color constraint, thereby achieving more reasonable region division and subsequent path planning optimization.
[0138] The toolpath planning strategy based on four-color segmentation adopts a hierarchical design concept, decomposing the complex global path optimization problem into multiple relatively independent and parallel sub-problems. Path planning within each color region can be optimized according to the region's geometric features and machining requirements, while path connections between regions are uniformly planned through a global coordination mechanism. Within a single color region, the path planning algorithm automatically selects the appropriate machining strategy and parameter configuration based on the region's color attributes. For red regions, the algorithm uses a larger row spacing and a higher feed rate v. feed =2.5m / min, tool tilt angle set to θ=15°, path mode selected as simple reciprocating or helical trajectory to maximize machining efficiency, while for green high curvature areas, the algorithm adopts a denser path distribution and a lower feed rate v feed =1.5m / min, tool tilt angle increased to θ=35°, path mode selected as equal residual height method or isoparametric line method to ensure machining accuracy and surface quality. Path connections between regions are globally optimized using an improved Dijkstra algorithm, which introduces a multi-objective weight function W based on the traditional shortest path algorithm. ij =α1·d ij +α2·Δκ ij +α3·t ij , where d ij Δκ represents the geometric distance from region i to region j. ij t represents the change in curvature between two regions. ij The algorithm represents the time cost required for region switching, with weight coefficients α1, α2, and α3 controlling the importance of path length, geometric continuity, and time efficiency, respectively. During the search process, the algorithm maintains a priority queue, sorting candidate paths according to their comprehensive weight values. A dynamic priority adjustment mechanism is also introduced, adjusting the search strategy in real-time based on the current tool status and machining progress. When tool wear is high, the algorithm prioritizes smoother, tool-friendly paths; when machining time is tight, the algorithm prioritizes path efficiency at the expense of surface quality requirements. To ensure no path intersections or conflicts between different colored regions, the algorithm employs a planarity detection method from graph theory, using Kuratowski's theorem to determine the planar embedding of the path graph. Once a potential path intersection is detected, the algorithm automatically initiates a conflict resolution mechanism, eliminating conflicts through path replanning or introducing transitional path segments. This mechanism has a time complexity of O(n log n). 2 The algorithm, logn), where n is the number of regions, exhibits good computational efficiency and stability in practical engineering applications.
[0139] Boundary feature constraints and analysis in four-color segmentation of cylinder surfaces constitute a multi-dimensional technical framework. This framework needs to simultaneously address constraints at multiple levels, including geometric continuity, kinematic continuity, dynamic continuity, and process feasibility, to ensure smooth transitions between different color regions and consistency in overall machining quality. From a geometric continuity perspective, the boundaries of different color regions must maintain G... 1 or G 2 Level geometric continuity requires that the tool trajectories on both sides of the boundary remain continuous or approximately continuous in terms of position, tangent vector, and curvature. This is specifically achieved through tool posture optimization algorithms at the boundary. To calculate the optimal tool axis direction at the boundary, where and These represent the normal vectors of two adjacent regions. Kinematic continuity constraints primarily concern the changes in the tool's velocity and acceleration as it crosses region boundaries, requiring a specific rate of change of the feed rate. Not exceeding the machine tool's maximum acceleration capability a max Meanwhile, the rate of change of the tool attitude angle The speed and acceleration should be controlled within a reasonable range to avoid machine tool vibration and abnormal tool wear. These constraints are achieved through a smooth transition using the velocity interpolation function v(t) = v1 + (v2 - v1)·S(t) at the boundary, where S(t) is a fifth-order polynomial interpolation function to ensure the continuity of speed and acceleration. Dynamic continuity constraints involve the smooth changes in cutting force, spindle power, and tool load. Especially when transitioning from a low-curvature region to a high-curvature region, sudden changes in cutting parameters can lead to tool impact and surface quality deterioration. Therefore, a cutting force prediction model F is needed. c =K c ·a p The cutting force variation at the boundary is estimated using ·f·cos(k), where K c To compare the cutting force, a p Let f be the axial depth of cut, f be the feed rate, and k be the tool approach angle. Based on this model, cutting parameters can be adjusted in advance to achieve a smooth transition in dynamics. Boundary feature analysis also needs to consider special handling strategies for different types of boundaries. For transition regions from low to medium curvature, such as red-blue boundaries, a progressive parameter adjustment strategy can be adopted, gradually increasing the path density and decreasing the feed rate. However, for transition regions from high curvature to special features, such as green-yellow boundaries, a more conservative strategy is required, which may require setting a transition zone at the boundary or using a special toolpath mode. In addition, some special boundaries may require the introduction of additional safety constraints, such as a minimum safety distance d. safe =r tool +δ clearance , where r tool For the tool radius, δ clearanceTo ensure safety clearance, these multi-level constraints and analysis methods can ensure that the cylinder surface machining after four-color segmentation achieves high quality and high stability while maintaining high efficiency.
[0140] To better understand and implement this invention, the following is a specific application scenario example 2: A technical team needs to optimize the precision machining path design for a new type of V8 engine cylinder. The cylinder has an inner diameter of 88.5mm, a height of 96.8mm, is made of cast iron HT250, and has a surface roughness requirement of Ra≤1.6μm and a cylindricity error requirement of ≤0.01mm. The technical team decided to use the cylinder machining toolpath adaptive optimization generation method of this invention to solve the technical difficulties of traditional machining methods in handling complex geometric features; the entire method flow is as follows: Figure 2 As shown.
[0141] First, the technical team imported the 3D geometric model of the cylinder using CAD software. This model contains complete geometric information of the cylinder's inner surface, including the main cylindrical surfaces, the transition area between the upper and lower end faces, and special geometric features such as the lubricating oil grooves. The system reads the cylinder geometric data through an STL format interface and automatically builds a triangular mesh model of the cylinder surface. The initial mesh contains 23,760 triangular faces and 11,882 vertices. The mesh quality evaluation index shows that the minimum interior angle is 28.6° and the maximum interior angle is 125.4°, meeting the quality requirements of subsequent algorithm processing. The vertex coordinates and topological relationships of the triangular mesh model are converted into a structured triangular mesh matrix. This matrix contains a vertex coordinate matrix V (11,882×3), a face index matrix F (23,760×3), a normal vector matrix N (23,760×3), and a curvature information matrix K (11,882×2), providing a complete data foundation for subsequent fractal dimension analysis and region segmentation. A schematic diagram of the triangular mesh matrix is shown below. Figure 3 As shown.
[0142] Next, the technical team performed fractal dimension analysis on the established triangular mesh matrix. The system divided the mesh into 16×12 sub-region meshes, each containing approximately 120 triangular facets. The fractal dimension of each sub-region was calculated using a multi-scale measurement method. The analysis results showed that the fractal dimension of the main cylindrical surface region of the cylinder was between 2.12 and 2.18, indicating that these regions have relatively simple geometric features. In contrast, the fractal dimension of the lubricating oil groove and end face transition region reached 2.45 to 2.67, reflecting the geometric complexity of these regions. The system identified an 8×6 sub-region mesh located in the middle section of the main cylindrical surface as the minimum fractal matrix. This region had an average fractal dimension of 2.14 and contained 48 triangular facets, representing the minimum repeating unit of the cylinder surface geometry, providing a geometric benchmark for subsequent adaptive path adjustment.
[0143] In the four-color theorem region coloring and segmentation stage, the system first constructs a dual graph of the triangular mesh, which contains 23,760 vertices (corresponding to the original facets) and 71,280 edges (corresponding to the relationships between adjacent facets). Then, a greedy coloring algorithm is used for region segmentation. The coloring process considers curvature similarity weights, and the normalized parameter σ in the weight function is set to 0.25 to ensure that regions with similar geometric features are preferentially assigned the same color. The final segmentation result divides the cylinder surface into 52 four-color regions, including 18 red regions (mainly distributed in the smooth areas of the main cylinder surface), 16 blue regions (distributed in the transition areas with medium curvature), 12 green regions (distributed in the high-curvature lubricating oil groove areas), and 6 yellow regions (distributed in the end faces and areas with special geometric features), resulting in the following image. Figure 4 and Figure 5 The example diagram shown illustrates this. The region adjacency graph displays that any adjacent regions have different colors, satisfying the constraints of the four-color theorem, thus providing a topological basis for non-intersecting path planning.
[0144] Subsequently, the technical team extracted the detailed geometric features of the cylinder surface within the four-color segmentation areas. The system identified curvature variation regions, boundary contours, and key feature points within each color region, establishing a surface feature database containing 2847 feature points. The average radius of curvature of the red region was 44.25 mm, and the rate of curvature change was less than 0.02 mm. -1 / mm, suitable for efficient rough machining; the average radius of curvature of the blue area is 28.67mm, and the rate of curvature change is between 0.02 and 0.08mm. -1 Between / mm, a balanced processing strategy is needed. The average radius of curvature in the green area is 12.34mm, and the rate of curvature change exceeds 0.08mm. -1 The area is approximately 0.5 mm in diameter and requires precise machining control. The yellow area contains complex geometric abrupt changes, with the radius of curvature varying from 3.2 to 45.6 mm, necessitating special machining processes.
[0145] Regarding the initialization of multi-axis linkage machining parameters, the technical team set detailed tool geometry parameters and machine tool kinematic parameters, as shown in Table 1:
[0146] Table 1 Multi-axis linkage machining parameter configuration table
[0147] Parameter type Parameter name numerical values unit Tool parameters Cutting tool diameter 12 mm Tool parameters Tool length 85 mm Tool parameters Blade tip radius 0.5 mm Machine tool parameters Spindle rated power 15 kW Machine tool parameters Maximum feed force 3500 N Machine tool parameters Maximum speed along the X-axis 25 m / min Machine tool parameters Maximum speed along the Y-axis 25 m / min Machine tool parameters Maximum speed along the Z-axis 20 m / min Processing parameters Optimal chip cutting temperature of material 350 ℃ Processing parameters Surface roughness requirements 1.6 μm
[0148] Based on the parameter configuration in Table 1, the system employs an improved Dijkstra algorithm for global path planning on the surface feature database. The algorithm discretizes the four-color segmented regions into a path node network containing 2847 nodes, using machining efficiency and path smoothness as weight functions. The weight coefficients are set to α1 = 0.4 (path length weight), α2 = 0.35 (curvature change weight), and α3 = 0.25 (machining time weight). The search process begins at the initial machining point on the upper end face of the cylinder. After 687 iterations, the optimal tool trajectory sequence from the starting point to the ending point is found. This sequence contains 2634 path nodes, with a total path length of 18.4 m and an expected machining time of 42.6 minutes.
[0149] In the real-time collision detection and tool axis vector optimization stages, the system uses an envelope surface detection algorithm to determine the interference between the tool and the workpiece, with a detection accuracy set to 0.01 mm and a safety clearance set to 0.05 mm. The detection process identified 23 potential overcutting risk points, mainly concentrated at geometric abrupt changes in the green and yellow areas. The system then uses differential geometry to calculate the optimal tool axis direction vector, calculating the principal curvature and principal direction based on the first and second fundamental forms of the surface. By solving for the optimal tilt angle of the surface normal vector under tool constraints, all potential collision risks were successfully eliminated. The final determined tool axis direction vector ensures the optimal posture of the tool relative to the cylinder surface.
[0150] The technical team established a two-layer game theory model to achieve synergistic optimization of processing efficiency and surface quality. The upper-layer game theory model aims to maximize processing efficiency, with the objective function being: The constraint condition is the tool feed rate V. feed Within the range of 0.5–4.2 m / min, the cutter shaft tilt angle θ spindle Within the range of -75° to 75°. The lower-level game model aims to maximize surface quality, with the objective function being... The constraint condition is surface roughness R. surface Less than 1.6 μm, residual height D residual Less than 0.01 mm. Two game theory models were optimized using the gray wolf hunting algorithm, with a population size of 30, a maximum number of iterations of 150, and a convergence accuracy of 10⁻¹⁰. -6 .
[0151] During the path adaptive adjustment and trajectory smoothing stages, the system dynamically adjusts the feed rate and tool posture based on the local curvature changes of the minimum fractal matrix, and monitors parameters in real time, including spindle power, feed force, tool wear, and chip temperature. The machining parameter settings for different color regions are shown in Table 2.
[0152] Table 2. Adaptive Machining Parameters for Four-Color Regions
[0153] Color area feed rate Cutter shaft tilt angle Spindle speed Depth of cut Red zone 3.8 12° 2800 0.25 Blue area 2.9 22° 3200 0.18 Green area 1.8 38° 3800 0.12 Yellow area 1.2 48° 4200 0.08
[0154] Table 2 shows the parameter configuration, which enables adaptive adjustment based on geometric complexity. The system uses a B-spline curve fitting method to smoothly connect discrete path points, with the fitting order set to 3. The node vectors are uniformly distributed, and the continuity requirement is C. 2 Level. The smoothed tool path meets the requirements of high-precision machining in terms of both geometric and kinematic continuity, with a minimum trajectory curvature radius of 8.5 mm, which is much larger than the constraint requirement of the tool radius.
[0155] Ultimately, the system output a complete NC code sequence based on a smooth tool path. The generated program contains 37,842 lines of code, covering complete information such as tool position coordinates, attitude angle parameters, and feed rate parameters. The code sequence is organized according to the machining order of the four-color areas. The machining code in each area includes corresponding process parameter settings and safety check instructions, ensuring that the CNC machine tool can reliably execute the entire machining program. Simulation results show that the maximum cutting force during machining is 2850N, and the peak spindle power is 12.8kW, both within the machine tool's capabilities. The expected surface roughness is 1.28μm, and the cylindricity error is 0.007mm, fully meeting the technical requirements.
[0156] Compared to traditional fixed-parameter path planning methods in CAM software, this invention achieves precise quantification of the geometric complexity of the cylinder surface through fractal dimension analysis, avoiding the lack of scientific evaluation standards for complex geometric features in traditional methods. It establishes a rigorous mathematical constraint framework through four-color theorem region segmentation, completely resolving the technical difficulties of path intersection and conflict in traditional methods. An improved Dijkstra algorithm achieves global optimal path search, overcoming the technical defect of traditional greedy algorithms easily getting trapped in local optima. A two-level game model establishes a mathematical correlation mechanism between processing efficiency and surface quality, achieving multi-objective collaborative optimization that traditional methods cannot achieve. A real-time adaptive adjustment mechanism dynamically optimizes processing parameters based on local geometric features, solving the fundamental problem that traditional fixed-parameter methods cannot adapt to complex geometric changes. The entire technical solution achieves a significant improvement in processing efficiency while ensuring processing accuracy, providing a completely new technical path for the precision machining of complex curved surfaces.
[0157] It should be noted that the variables involved in this invention are explained in detail in Tables 3 and 4 below.
[0158] Table 3. Variable Explanation Table (Part 1)
[0159]
[0160]
[0161] Table 4. Variable Explanation Table (Part Two)
[0162]
[0163] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for adaptively optimizing and generating toolpaths for cylinder machining, characterized in that, Includes the following steps: Import the cylinder CAD model file and create a triangular mesh matrix; Fractal dimension analysis is performed on the triangular mesh matrix to calculate the fractal dimension of each sub-region in the matrix. The matrix sub-block with the minimum fractal dimension is identified as the minimum fractal matrix. The minimum fractal matrix represents the minimum geometric repeating unit on the cylinder surface. Based on the four-color theorem, the triangular mesh matrix is divided into four-color regions with different colors for adjacent regions, and a region adjacency graph is established. Geometric features of the cylinder surface within the four-color regions are extracted to establish a surface feature database. A multi-axis linkage machining parameter set is initialized. Global path planning is performed on the surface feature database based on an improved Dijkstra algorithm to search for the optimal tool path sequence. Real-time collision detection and tool axis vector optimization are performed on the optimal tool path sequence. The optimal tool axis direction vector is adaptively adjusted and smoothed. The feed rate and tool attitude are dynamically adjusted based on the local curvature changes of the minimum fractal matrix, and a smooth tool path is generated using a B-spline curve fitting method. The final optimized tool path file is output based on the smoothed tool path.
2. The method for adaptively optimizing and generating toolpaths for cylinder machining according to claim 1, characterized in that, The step of establishing the triangular mesh matrix specifically involves reading cylinder geometric data through an STL format interface, establishing a triangular mesh model of the cylinder surface, and converting the vertex coordinates and topological relationships of the triangular mesh model into a triangular mesh matrix.
3. The method for adaptively optimizing and generating toolpaths for cylinder machining according to claim 2, characterized in that, The fractal dimension analysis specifically determines the fractal characteristics of surface geometry by calculating the self-similarity of surface mesh at different scales, and identifies repeating units with minimum complexity. The inputs include triangular mesh topology and multi-scale measurement data, and the outputs are fractal dimension values and the minimum repeating unit matrix.
4. The method for adaptively optimizing and generating toolpaths for cylinder machining according to claim 3, characterized in that, The four-color segmentation region is specifically based on the four-color theorem principle to color the dual graph of the triangular mesh, ensuring that any two adjacent faces belong to different color regions, thus providing a non-intersecting region division scheme for toolpath planning.
5. The method for adaptively optimizing and generating toolpaths for cylinder machining according to claim 4, characterized in that, The step of extracting the geometric features of the cylinder surface specifically involves identifying the curvature variation areas, boundary contours, and key feature points within each color region, and establishing a surface feature database.
6. The method for adaptively optimizing and generating toolpaths for cylinder machining according to claim 5, characterized in that, The set of multi-axis linkage machining parameters specifically includes setting tool geometry parameters, machine tool kinematic parameters, machining accuracy requirements, and material removal rate targets. The tool geometry parameters include tool diameter, tool length, and tool tip radius. At the same time, the rated power of the machine tool spindle, maximum feed force, initial tool size, and optimal chip temperature of the material are obtained as optimization benchmark parameters.
7. The method for adaptively optimizing and generating toolpaths for cylinder machining according to claim 6, characterized in that, The improved Dijkstra algorithm specifically introduces a multi-objective weight function and a dynamic priority adjustment mechanism on the basis of the traditional Dijkstra algorithm. It considers the comprehensive optimization of path length, curvature change and processing time, and discretizes the four-color segmentation region into a path node network, with processing efficiency and path smoothness as the weight functions.
8. The method for adaptively optimizing and generating toolpaths for cylinder machining according to claim 7, characterized in that, The steps of real-time collision detection and tool axis vector optimization specifically involve using an envelope surface detection algorithm to determine the interference between the tool and the workpiece, and using differential geometry to calculate the optimal tool axis direction vector to avoid overcutting and undercutting.
9. The method for adaptively optimizing and generating toolpaths for cylinder machining according to claim 8, characterized in that, The envelope surface detection algorithm specifically involves constructing a family of envelope surfaces on a given tool trajectory, calculating the intersection distribution of the envelope surface and the workpiece surface, and detecting potential overcut or collision areas.
10. The method for adaptively optimizing and generating toolpaths for cylinder machining according to claim 9, characterized in that, Before performing path adaptive adjustment, a two-layer game model is established, consisting of an upper-layer game model aimed at maximizing machining efficiency and a lower-layer game model aimed at maximizing surface quality. The coupling terms reflect the dual impact of tool feed rate on machining efficiency and surface quality. The upper-layer game model includes unilateral optimization terms to minimize total machining time and optimize machine tool power utilization and feed force control. The lower-layer game model includes unilateral optimization terms to minimize residual height and optimize tool wear control and chip temperature control. Both unilateral optimization terms are optimized using the Grey Wolf Hunting Algorithm.
Citation Information
Cited By
Advanced anti-collision detection method and equipment for laser head of pipe machine and medium
CN121423862A
Cutter axis vector optimization method for wear homogenization
CN121635088A
High-precision tool path planning method and system considering material deformation compensation
CN121763941A
A high-precision tool path planning method and system considering material deformation compensation
CN121763941B
Aspherical lens grinding and polishing method based on curvature partition matching
CN122442457A