A numerical control machine tool machining path optimization method
Patent Information
- Application Number
- CN202611132949.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-29
- Publication Date
- 2026-10-09
AI Technical Summary
离线全局路径优化方法完全脱离加工过程实际物理状态,所生成的路径虽然在几何意义上最短,但往往因未考虑刀具受力变形、振动特性和局部几何突变,导致实际加工中出现让刀、过切或严重振纹,优化效果大打折扣
1、本发明通过构建工艺知识图谱并利用图注意力网络生成初始加工路径,能够从海量历史加工实例中自动学习特征之间的工艺关联关系,对新零件的加工特征组合进行泛化,推理出高度合理的操作序列与刀路。所生成的初始路径考虑了空行程最小化及切入切出平滑性,首件加工即具有低振动和高材料去除率特性,大幅减少了传统依赖人工编程和试切调整的时间与成本,显著提升了首件质量与生产效率。
Smart Images

Figure CN122883774A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent machining technology for CNC machine tools, and in particular to a method for optimizing machining paths for CNC machine tools. Background Technology
[0002] Optimization of machining paths in CNC machine tools is a core factor determining machining efficiency and accuracy. Existing technologies fall into three categories: First, offline global path optimization methods, such as those based on genetic algorithms, ant colony optimization, or particle swarm optimization for optimizing the idle travel path points in hole and cavity machining. Their objective function is typically only related to the total tool travel length or time, reducing non-cutting movement by optimizing the tool access sequence. Second, rule-based or static model-based process parameter and path recommendation methods utilize pre-built rule bases or knowledge graphs to match similar part features and retrieve recommended machining strategies and parameters. Some schemes also integrate simulation models of cutting forces and power to pre-adjust the feed rate. Third, online adaptive control methods monitor spindle power or single vibration signals and use fuzzy control, PID control, etc., to adjust the feed rate or compensate for tool radius in real time to maintain a constant cutting load or avoid chatter zones.
[0003] All of the aforementioned existing technologies have significant drawbacks. Offline global path optimization methods are completely detached from the actual physical state of the machining process. Although the generated path may be geometrically shortest, it often fails to consider tool stress deformation, vibration characteristics, and local geometric abrupt changes, leading to tool deflection, overcutting, or severe vibration marks during actual machining, significantly reducing the optimization effect. Recommendation methods based on rules or static models rely on precise matching of existing instances, have weak generalization ability for new and complex combinations of features, cannot intelligently generate structurally reasonable process sequences and toolpath topologies, and cannot make online adjustments based on the constantly changing state during machining. Online adaptive control methods typically only passively respond to a single physical quantity, lacking the fusion and reasoning of multi-source sensor information, and even more so, lacking the forward-looking compensation capability based on future quality trend predictions. More importantly, the above three technologies are isolated from each other, unable to transform actual machining results into reusable knowledge to improve the next path planning, making the machining optimization capability lack self-evolutionary growth and relying on manual intervention by process engineers in the long term. Summary of the Invention
[0004] The purpose of this invention is to address the shortcomings of existing technologies by proposing a method for optimizing machining paths in CNC machine tools.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: A method for optimizing machining paths on a CNC machine tool includes the following steps: Construct a process knowledge graph oriented towards processing characteristics. The process knowledge graph includes feature-type entities, process-type entities, resource-type entities, and quality-type entities and their relationships, which are used to store historical processing experience. Obtain the CAD model and blank model of the part to be processed, perform feature recognition, and construct a feature topology graph of the part, where nodes represent processing features and edges represent adjacency, inclusion, or datum relationships between features; The part feature topology map is input into a pre-trained graph attention network to generate an initial machining path containing operation sequences, process parameters and parameterized path templates, and an initial tool position sequence is obtained by instantiating the path template with the feature geometric boundary. During the machining process of the CNC machine tool according to the initial tool position sequence, multi-source sensor signals are collected in real time, the current machining state is evaluated using a pre-trained state evaluation model, and a deep reinforcement learning agent makes forward-looking decisions based on the state space containing future path information and the current state, outputting the tool position offset and feed rate correction, and online compensation for unexecuted path segments to obtain an optimized machining path. After processing is completed, processing instances are generated based on the actual optimized path, full-time sensing data, and processing quality detection results. The process knowledge graph is updated using the processing instances, and the graph attention network and deep reinforcement learning agent are incrementally trained using the accumulated processing instances to achieve self-evolution of processing path optimization capabilities.
[0006] Preferably, the construction of the process knowledge graph oriented towards machining features specifically involves: feature entities including slots, holes, cavities, freeform surfaces, and steps, storing their geometric dimensions, tolerances, and material properties; process entities including machining strategies, parameterized path templates, cutting tools, and machining operation sequences; resource entities including machine tool models and spindle characteristics; quality entities including surface roughness, contour error, and tool wear rate; relationships between entities including applicable process strategies for features, process-included path templates, and quality results generated by machining instances; each feature-process-quality triplet in the graph is assigned a confidence weight, which is dynamically adjusted based on new machining instances.
[0007] Preferably, the graph attention network uses a multi-head attention mechanism to aggregate neighborhood information of feature nodes. For each feature node, the input includes feature type, key dimensions, accuracy level, and material machinability vector. For each edge, the input includes relative direction vector, angle between adjacent faces, and distance. The network decodes and generates a machining operation sequence, and outputs a corresponding process strategy, parameterized path template identifier, tool identifier, and preliminary process parameters for each operation. The preliminary process parameters include spindle speed, feed rate, depth of cut, and stepover.
[0008] Preferably, the real-time acquired multi-source sensor signals include spindle power signal, triaxial vibration acceleration signal, acoustic emission signal, and cutting force signal; the pre-trained state evaluation model is a convolutional long short-term memory network, which outputs the cutting stability index, tool wear state probability distribution, and surface roughness prediction interval in real time; the cutting stability index is obtained by linearly mapping the ratio of the chatter-sensitive frequency band energy to the total energy after wavelet packet decomposition of the vibration acceleration signal to the interval 0 to 1, and the larger the value, the more stable the cutting.
[0009] Preferably, the deep reinforcement learning agent employs a proximal policy optimization algorithm. Its state space includes the current tool position coordinates and the curvature and twist of a preset number of subsequent path points, the statistical characteristics of each sensor signal, the predicted tool wear value, the current contour error vector, and the predicted surface roughness value for the next segment. Its action space includes the offset of the tool position in the tangential, normal, and axial directions, as well as the feed rate multiplier. The reward function is the sum of a multi-objective weighted negative reward based on contour error, surface roughness, tool wear rate, and machining time, and a stable cutting reward.
[0010] Preferably, during the online compensation process, the deep reinforcement learning agent performs forward reasoning within the machining gap, performs micro-offsets and feed speed corrections on the path segment to be executed, and the compensated path is directly written into the CNC system buffer.
[0011] Preferably, updating the process knowledge graph using processing instances specifically includes: packaging the actually executed compensated path, full-time domain sensing data, in-machine measurement profile, and final quality inspection data as new processing instance nodes, establishing relationships with the used features, processes, resources, and quality entities, and adjusting the confidence weights of the feature-process-quality triplet, strengthening the association weights of strategies with consistently excellent performance, and weakening them otherwise.
[0012] Preferably, the graph attention network and the deep reinforcement learning agent are incrementally trained using accumulated machining instances. Specifically, this includes: periodically retraining the graph attention network using a newly accumulated instance library, and updating the parameters of the policy network and value network of the deep reinforcement learning agent using the experience trajectories generated by the new instances, in order to adapt to machine tool state drift, tool batch differences and the introduction of new materials.
[0013] Preferably, during the switching of each processing stage, a contact-type on-the-job probe or a laser scanning probe is used to perform a rapid contour scan on the processed surface to obtain the actual geometric error, which is then used as the contour error vector in the state space.
[0014] Preferably, the initial tool position sequence is generated by: using a parameterized path template and the specific geometric boundaries of the features, calculating an ordered tool position sequence and tool axis vector through a parameterized curve, and then generating the initial NC code.
[0015] The present invention has the following beneficial effects: 1. This invention constructs a process knowledge graph and utilizes a graph attention network to generate initial machining paths. It automatically learns the process relationships between features from a vast amount of historical machining instances, generalizes the combination of machining features for new parts, and infers highly reasonable operation sequences and toolpaths. The generated initial paths consider minimizing idle travel and smooth entry and exit points, resulting in low vibration and high material removal rates in the first piece machining. This significantly reduces the time and cost of traditional manual programming and trial-cut adjustments, and substantially improves first-piece quality and production efficiency.
[0016] 2. This invention integrates multi-source sensor information such as spindle power, triaxial vibration, acoustic emission, and cutting force during the machining process. It combines a convolutional long short-term memory network to evaluate cutting stability and tool wear status in real time and predict surface roughness trends. Then, a deep reinforcement learning agent performs forward-looking path compensation. This compensation not only corrects minor errors that have already occurred, but more importantly, it proactively adjusts the tool position and feed rate based on future roughness predictions. This effectively suppresses chatter, avoids tool deflection and sudden tool damage, ensures high consistency between contour accuracy and surface integrity in batch machining, and balances tool load, extending tool life.
[0017] 3. This invention feeds real-world processing data back to the process knowledge graph, adjusts the strategy confidence weights, and incrementally trains the graph attention network and reinforcement learning strategy using accumulated instances, enabling the system's path planning and online compensation capabilities to continuously evolve autonomously. The longer the system is used, the richer its experience of successes and failures becomes, resulting in more accurate initial paths and more timely and effective online compensation. It can automatically adapt to changes in operating conditions caused by machine tool drift, batch differences in cutting tools, or the introduction of new materials, maintaining a high level of optimization performance over the long term, reducing reliance on highly skilled process personnel, and driving the development of intelligent manufacturing systems towards self-optimization. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating a CNC machine tool machining path optimization method provided in Embodiment 1 of the present invention. Detailed Implementation
[0019] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0020] Example 1 This embodiment provides a self-evolutionary optimization method for CNC machine tool machining paths based on knowledge graphs and deep reinforcement learning, referring to... Figure 1Specifically, it includes the following four steps.
[0021] Step 1: Construct a process knowledge graph oriented towards machining features. Structured knowledge is extracted from historical machining task packages, process cards, simulation records, and coordinate measuring machine (CMM) inspection reports accumulated by the enterprise to construct a knowledge graph containing four types of entities and their relationships. Feature-type entities specifically include through slots, keyways, blind holes, through holes, cavities, freeform surfaces, and steps, storing geometric information such as length, width, depth, diameter, and tolerance grade, and associating them with material grade and hardness. Process-type entities include line cutting strategies, circumferential cutting strategies, helical milling strategies, trochoidal milling strategies, and corresponding parameterized toolpath templates. Path templates include tool entry methods, tool retraction methods, path connection macros, and specific tool entities and machining operation sequences. Resource-type entities record machine tool model, maximum spindle speed and torque characteristics, tool type, tool material, and tool diameter. Quality-type entities include measured surface roughness values, maximum contour error, and tool flank wear width. Relationships between entities are defined as "feature-applicable-process strategy," "process-included-path template," and "machining instance-generated-quality result," etc. Each "feature-process-quality" triple in the graph has a confidence weight. The initial value is set based on historical statistical data and is adjusted according to subsequent new instances during system operation.
[0022] Step 2: Initial machining path generation based on graph attention network. First, the CAD model and blank model of the part to be machined are read. An automatic feature recognition algorithm based on graph and attribute adjacency graph is run to extract all machining features and identify their adjacency, containment, and datum relationships, generating a part feature topology graph. Each node in the graph represents a machining feature, and the node attribute vector is composed of one-hot encoding of the feature type, key dimensions, accuracy level code, and material machinability index. Each edge represents two adjacent or datum constraints in the feature space, and the edge attribute vector includes the relative direction vector, the angle between adjacent faces, and the nearest distance between features. The constructed part feature topology graph is input into a pre-trained multi-head graph attention network with four attention heads. By calculating the influence weights of adjacent features on the current feature's process decision, neighborhood information is aggregated to update the node representation. After three layers of graph attention aggregation, a global graph representation and node representation are obtained. Then, a pointer network is used as a decoder to sequentially select and generate machining operation sequences. For each operation, its corresponding process strategy label, parameterized path template identifier, tool identifier, and preliminary process parameters are output. The preliminary process parameters include spindle speed, feed rate, depth of cut, and stepover. Using the selected path template and the corresponding geometric boundaries of the features, an ordered sequence of tool position coordinates and tool axis vectors are obtained through NURBS parametric curves and isoparametric step calculations, ultimately generating the initial NC code. This graph attention network is pre-trained using historical part feature maps and corresponding optimal process operation sequences from a knowledge graph as supervisory signals. The loss function is the sum of the cross-entropy loss of the operation sequence and the mean square error of the process parameter regression.
[0023] Step 3: Multi-source sensor linkage and online path compensation using deep reinforcement learning. During the initial NC code machining operation on the CNC machine tool, signals are synchronously acquired at a sampling rate of 10 kHz through a power sensor mounted on the spindle, a three-axis acceleration and vibration sensor on the worktable, an acoustic emission sensor near the workpiece, and an integrated cutting force tool holder. When switching between roughing and finishing stages for each machining feature, a contact-type on-machine probe is used to perform discrete point measurements on the just-machined surface to obtain the actual contour error vector. The acquired fixed-length time-domain multi-channel signal segments are input into a pre-trained convolutional-long short-term memory network state evaluation model. The model's front end is a one-dimensional convolutional layer for extracting local frequency domain features, followed by two long short-term memory network layers to capture temporal evolution, outputting three quantities: the cutting stability index, a continuous value whose definition and acquisition method are detailed in Example 3; the probability distribution of tool wear state, divided into three categories: normal, slight wear, and severe wear; and the lower and upper bounds of the predicted surface roughness interval if machining continues with the current parameters. Online compensation is performed by a deep reinforcement learning agent trained based on a proximal policy optimization algorithm. This agent has been pre-trained offline using historical processed instance data before deployment, and the specific scheme is given in Example 3. Its state space It is composed of the following elements: the coordinates of the current tool position and the curvature and torsion of the subsequent 15 tool positions along the path; statistical characteristics of signals such as the mean and variance of spindle power, the root mean square value of vibration acceleration, and acoustic emission count; the probability vector for predicting tool wear state; the latest acquired contour error vector; and the predicted roughness value for the next segment. Its motion space... The tool position offset along the surface includes tangential, normal, and axial offsets, as well as the feed rate multiplier; all four values are continuous. Reward function. Designed for The stability bonus is a normal number when the cutting stability index is higher than a set threshold; otherwise, it is zero. Weighting coefficient. to Adjustments are made according to quality requirements. The agent performs forward inference during the machining intervals of each path segment, outputting offset and magnification correction values. It then directly modifies the NC program segment to be executed in the CNC system buffer via the machine tool communication interface, achieving forward-looking path compensation.
[0024] Step 4: Processing Instance Feedback and Knowledge Model Evolution. After all processing tasks for this part are completed, the actual executed complete path data including all compensated offsets, full-time multi-source sensor records, in-machine measured contour point cloud, and final quality data such as surface roughness and contour error measured by the coordinate measuring machine are packaged into a new processing instance node and written into the knowledge graph. The relationship between this node and the feature nodes, tool nodes, process strategy nodes, and quality nodes is established. A score is calculated based on the processing quality compliance, and this score is used to update the confidence weights of the "feature-process-quality" triplet. The update formula is: new weight equals old weight multiplied by a decay factor plus the normalized value of this score multiplied by one minus the decay factor. When the cumulative number of new instances reaches the preset batch size, incremental training of the graph attention network is triggered, and parameters are fine-tuned for several rounds using a mixture of new and old samples. Simultaneously, the state-action-reward trajectory generated by the reinforcement learning agent during this processing is stored in the experience replay pool. The policy network and value network are periodically updated offline to gradually adapt to slow time-varying factors such as increased machine tool lead screw backlash and batch performance fluctuations of the tool, completing closed-loop evolution.
[0025] Example 2 This embodiment provides another implementation method, which has the same basic process and architecture as Embodiment 1. The difference lies in the details of the sensor configuration, state evaluation model input, and reinforcement learning action space, in order to adapt to more precise thin-walled part processing scenarios. The method in this embodiment also includes four steps. The differences will be emphasized below, while the other similarities will not be repeated.
[0026] In step one, the construction of the knowledge graph further integrates the characteristics of thin-walled structures and their typical deformation data. Mass-type entities have added indicators of deformation caused by wall thickness deviation and residual stress after processing, so that the knowledge can cover the special process constraints of thin-walled processing.
[0027] In step two, the feature topology graph constructed after part feature recognition incorporates additional wall thickness information and support stiffness parameters in its edge attributes to express the stiffness coupling relationship between thin-walled features. The input vector and training method of the graph attention network are consistent with those in Example 1, enabling the generation of initial paths and parameters suitable for hierarchical processing of thin-walled parts.
[0028] In step three, the sensing configuration, based on embodiment one, adds a non-contact laser scanning probe to acquire dense point clouds of the machined surface in real time during processing, replacing the contact-type on-machine probe for higher-speed contour measurement. Simultaneously, temperature sensors are installed at key locations on the spindle end and bed to monitor thermal drift. The input to the state evaluation model is expanded to include spindle temperature rise and its trend characteristics, while the output includes predicted thermal errors. In the state space of the reinforcement learning agent, the discrete point contour error vector is replaced by the statistical features of the discretized continuous contour error curve obtained from laser scanning, and predicted thermal errors are added. In addition to the tool position tangential, normal, and axial offsets and feed rate multiplier, the action space also includes spindle speed fine-tuning to control cutting temperature while mitigating vibration. The reward function introduces a penalty term for the impact of thermal errors on contour accuracy, specifically... Add one item The product of the predicted absolute value of the thermal error and the rest of the structure are the same as in Example 1. The agent uses this richer information to reason and implements joint compensation for toolpath micro-offsets, feed, and rotational speed to ensure that the deformation of thin-walled parts is controlled and the wall thickness is uniform during processing.
[0029] In step four, thermal error time series data and laser scanning contours were added to the processing instance nodes. When updating the map weights, the qualified indicators of deformation and wall thickness deviation were considered simultaneously. The incremental training process is the same as in Example 1. By continuously accumulating processing instances of thin-walled parts, the network and strategy can gradually learn stiffness compensation strategies for different thin-walled characteristics, realizing the self-evolution of processing path optimization capabilities in the field of precision thin-walled parts.
[0030] Example 3 This embodiment provides a detailed description of the specific definition of the cutting stability index, the complete training scheme of the state evaluation model, and the offline pre-training scheme of the deep reinforcement learning agent involved in the foregoing embodiments, so as to ensure that those skilled in the art can implement the present invention.
[0031] The definition and calibration method of the cutting stability index are as follows. The cutting stability index quantifies the ability of the current cutting process to resist self-excited vibrations. Its value ranges from 0 to 1; a higher value indicates more stable machining and a lower risk of chatter. This index is obtained through the following steps: First, vibration signals are collected using a triaxial accelerometer mounted on the machine tool table or spindle, with a sampling rate of no less than 10 kHz. For each 0.1-second time window segment of the collected vibration signal, the Z-axis signal is selected for third-order Daubechies wavelet packet decomposition, with three decomposition levels, resulting in eight sub-bands. The energy of each sub-band is calculated, and the total energy is the sum of the energies of the eight sub-bands. Based on the pre-calibrated chatter-sensitive frequency band range on the machine tool and tool system, the three sensitive frequency bands with the highest energy percentage are selected. The ratio of the energy of these three frequency bands to the total signal energy is calculated and denoted as the chatter energy ratio. Then, the chatter energy ratio is converted into a stability index using a four-parameter logistic mapping function established beforehand through cutting experiments: in, This is the curve steepness parameter. The median threshold for chatter energy ratio is used. The specific calibration experiment is as follows: Under the same machine tool and typical tool combination, slot milling or side milling experiments with different cutting depths and speeds are conducted. Acceleration signals are simultaneously acquired, and chatter is checked using a laser vibrometer or a microscope on the machined surface to determine whether chatter occurs. The chatter energy ratio of stable cutting samples with slight chatter and severe chatter samples is statistically analyzed, and the parameters are determined through maximum likelihood estimation or least squares method. and This ensures that the stability index approaches 1 during stable cutting and approaches 0 during severe chatter. This calibration process only needs to be performed once after each machine tool installation, and the resulting mapping function is embedded in the state assessment model and reinforcement learning reward calculation. During the actual online machining phase, the state assessment model calculates the chatter energy ratio based on real-time vibration signals and directly uses this mapping to output the stability index.
[0032] A complete training implementation of the state evaluation model. The state evaluation model is a convolutional long short-term memory network, and its training data comes from a pre-designed multi-condition cutting experiment. The experiment was conducted on a three-axis vertical machining center equipped with a Siemens CNC system, using carbide end mills as tools, and workpiece materials including 7075 aluminum alloy and 45 steel. Cutting parameters covered a wide range, including spindle speed from 3000 rpm to 15000 rpm, feed per tooth from 0.02 mm to 0.12 mm, radial width from 0.5 mm to tool diameter, and axial depth of cut from 0.5 mm to 10 mm, and intentionally introduced different tool wear stages to generate data diversity. For each cutting pass, the following data was collected and labeled: spindle power, three-axis vibration acceleration, effective acoustic emission, and cutting force signals were synchronously recorded via a data acquisition card. All signals were sampled at 10 kHz and divided into sample segments every 0.1 seconds. For each sample segment, three labels were added. Label 1 represents the true value of cutting stability. Based on the wavelet packet energy ratio and combined with visual inspection of the machined surface for chatter, a stable state is defined as no obvious chatter and a chatter energy ratio below a threshold; otherwise, it is defined as unstable. The true value is a continuous value, calculated using the logistic mapping to obtain the stability index as the regression target. Label 2 represents the tool wear condition. After machining is interrupted, the average wear width of the tool flank is measured offline using a tool microscope. ,when A surface roughness of 0.1 mm to 0.3 mm is classified as normal; a roughness between 0.1 mm and 0.3 mm is classified as slight wear; and a roughness greater than 0.3 mm is classified as rapid wear. These are represented by unique thermal coding. Label 3 represents the predicted surface roughness value. Immediately after machining, the arithmetic mean deviation of the corresponding machined surface profile is measured using a white light interferometer. The regression target was determined. Ultimately, 200,000 valid sample segments were collected and labeled, randomly divided into training, validation, and test sets in an 8:1:1 ratio. The model structure was designed as follows: the input was a 6-channel time series, including power, triaxial vibration, acoustic emission, and resultant force. After passing through a 64-channel one-dimensional convolutional layer and max pooling, it was fed into a two-layer Long Short-Term Memory network with 128 hidden units each. Finally, three fully connected heads were used in parallel to output the stability index, wear classification probability, and roughness prediction interval, respectively. Roughness interval prediction used quantile regression, outputting the 0.1 quantile and 0.9 quantiles as lower and upper bounds, respectively. The loss function was the sum of the mean squared error of the stability index output, the cross-entropy loss of wear classification, and the roughness quantile loss, using a smoothed quantile loss function. Training used the Adam optimizer with an initial learning rate of 0.001, a batch size of 256, and 500 training epochs. The model with the minimum loss on the validation set was selected as the final evaluation model. Once deployed, this model performs real-time inference. By inputting the current 0.1-second signal window, it can output the required cutting stability index, tool wear probability, and roughness prediction range.
[0033] An offline pre-training scheme for deep reinforcement learning agents. To ensure that deep reinforcement learning agents possess reasonable initial decision-making capabilities before online compensation in actual machining, and to avoid tool or workpiece damage due to random exploration, this invention adopts an offline batch reinforcement learning paradigm. It utilizes historical machining instance data accumulated in the process knowledge graph to construct a static dataset for pre-training. The specific process is as follows: First, an offline dataset is constructed: all completed machining instances with multi-source sensor records are extracted from the knowledge graph. Each instance contains complete full-time domain sensor data and the corresponding actual execution path. For each instance, according to the state space definition in Example 1, a state is generated along the machining trajectory. ;action The offset and feed rate are calculated from the deviation between the actual recorded compensated tool position and the corresponding point on the initial path; bonus Based on the final local quality results and sensor data of the instance, the reward function is back-calculated using the aforementioned method. This constructs a static dataset containing a large number of state-action-next-state-reward tuples. The dataset contains millions of records. Then, a conservative Q-learning algorithm is trained offline on this static dataset. Two Q-networks with identical structures are trained. and The input is a concatenation of state and action, and the output is the Q-value of that state-action pair. Simultaneously, a conditional variational autoencoder is trained as a behavior perturbation generator, taking the state as input and generating a set of possible action candidates for that state. During offline training, for each batch of data, in addition to minimizing the regular Bellman error, a conservative regularization term is added. This encourages the Q-network to assign higher Q-values to actions appearing in the dataset, while penalizing out-of-domain actions generated by the perturbation generator, thus limiting the Q-value extrapolation error. A policy network is also trained, whose goal is to select actions from the action candidate set generated by the perturbation generator that are suitable for a given state. The action with the highest value is selected. The policy network is updated using a deterministic policy gradient approach. After hundreds of thousands of iterations, the policy network is able to select reasonable compensation actions based on historical data, thus completing offline pre-training. The pre-trained policy network and value network are directly used as the initial networks for the online proximal policy optimization algorithm. During the online deployment phase, following the process in Example 1, real-time interaction is used to further fine-tune the network parameters, enabling the policy to quickly adapt to the dynamics of the real environment. Simultaneously, newly collected online experience data is added to the replay pool and periodically updated offline conservatively to maintain data efficiency and prevent catastrophic forgetting. This combination of offline pre-training and online fine-tuning ensures that the reinforcement learning agent has a stable and effective compensation policy from the outset, significantly reducing initial trial-and-error risks and accelerating engineering implementation.
[0034] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for optimizing machining paths on a CNC machine tool, characterized in that, Includes the following steps: Construct a process knowledge graph oriented towards processing characteristics. The process knowledge graph includes feature-type entities, process-type entities, resource-type entities, and quality-type entities and their relationships, which are used to store historical processing experience. Obtain the CAD model and blank model of the part to be processed, perform feature recognition, and construct a feature topology graph of the part, where nodes represent processing features and edges represent adjacency, inclusion, or datum relationships between features; The part feature topology map is input into a pre-trained graph attention network to generate an initial machining path containing operation sequences, process parameters and parameterized path templates, and an initial tool position sequence is obtained by instantiating the path template with the feature geometric boundary. During the machining process of the CNC machine tool according to the initial tool position sequence, multi-source sensor signals are collected in real time, the current machining state is evaluated using a pre-trained state evaluation model, and a deep reinforcement learning agent makes forward-looking decisions based on the state space containing future path information and the current state, outputting the tool position offset and feed rate correction, and online compensation for unexecuted path segments to obtain an optimized machining path. After processing is completed, processing instances are generated based on the actual optimized path, full-time sensing data, and processing quality detection results. The process knowledge graph is updated using the processing instances, and the graph attention network and deep reinforcement learning agent are incrementally trained using the accumulated processing instances to achieve self-evolution of processing path optimization capabilities.
2. The method for optimizing machining paths on a CNC machine tool according to claim 1, characterized in that, The construction of the process knowledge graph oriented towards machining features specifically involves: feature entities including slots, holes, cavities, freeform surfaces, and steps, storing their geometric dimensions, tolerances, and material properties; process entities including machining strategies, parameterized path templates, cutting tools, and machining operation sequences; resource entities including machine tool models and spindle characteristics; quality entities including surface roughness, contour error, and tool wear rate; and relationships between entities including applicable process strategies for features, process-included path templates, and quality results generated by machining instances. Each feature-process-quality triplet in the graph is assigned a confidence weight, which is dynamically adjusted based on new machining instances.
3. The method for optimizing machining paths on a CNC machine tool according to claim 1, characterized in that, The graph attention network employs a multi-head attention mechanism to aggregate neighborhood information of feature nodes. For each feature node, it inputs feature type, critical dimension, accuracy level, and material machinability vector. For each edge, it inputs relative direction vector, angle between adjacent faces, and distance. The network decodes and generates machining operation sequences through a pointer network, and outputs corresponding process strategies, parameterized path template identifiers, tool identifiers, and preliminary process parameters for each operation. The preliminary process parameters include spindle speed, feed rate, depth of cut, and stepover.
4. The method for optimizing machining paths on a CNC machine tool according to claim 1, characterized in that, The real-time acquired multi-source sensor signals include spindle power signal, triaxial vibration acceleration signal, acoustic emission signal, and cutting force signal; the pre-trained state evaluation model is a convolutional long short-term memory network, which outputs the cutting stability index, tool wear state probability distribution, and surface roughness prediction interval in real time; the cutting stability index is obtained by linearly mapping the ratio of the chatter-sensitive frequency band energy to the total energy after wavelet packet decomposition of the vibration acceleration signal to the interval 0 to 1, and the larger the value, the more stable the cutting.
5. The CNC machine tool machining path optimization method according to claim 4, characterized in that, The deep reinforcement learning agent employs a near-end policy optimization algorithm. Its state space includes the current tool position coordinates and the curvature and twist of a preset number of subsequent path points, the statistical characteristics of each sensor signal, the predicted tool wear value, the current contour error vector, and the predicted surface roughness value for the next segment. Its action space includes the offset of the tool position point in the tangential, normal and axial directions, as well as the feed rate multiplier; the reward function is the sum of a multi-objective weighted negative reward and a stable cutting reward based on contour error, surface roughness, tool wear rate and machining time.
6. The method for optimizing machining paths on a CNC machine tool according to claim 5, characterized in that, During the online compensation process, the deep reinforcement learning agent performs forward reasoning within the machining gap, performs micro-offsets and feed speed corrections on the path segment to be executed, and the compensated path is directly written into the CNC system buffer.
7. The method for optimizing machining paths on a CNC machine tool according to claim 1, characterized in that, Updating the process knowledge graph using processing instances specifically includes: packaging the actually executed compensated path, full-time domain sensing data, in-machine measurement profile, and final quality inspection data as new processing instance nodes, establishing relationships with the features, processes, resources, and quality entities used, and adjusting the confidence weights of the feature-process-quality triplet, strengthening the association weights of strategies with consistently excellent performance, and weakening them otherwise.
8. The method for optimizing machining paths on a CNC machine tool according to claim 1, characterized in that, Incremental training of graph attention networks and deep reinforcement learning agents is carried out using accumulated machining instances. Specifically, this includes: periodically retraining the graph attention network using a newly accumulated instance library, and updating the parameters of the policy network and value network of deep reinforcement learning using the experience trajectories generated by the new instances, in order to adapt to machine tool state drift, tool batch differences and the introduction of new materials.
9. The method for optimizing machining paths on a CNC machine tool according to claim 1, characterized in that, During each processing stage transition, a contact-type on-the-job probe or a laser scanning probe is used to quickly scan the profile of the processed surface to obtain the actual geometric error, which is then used as the profile error vector in the state space.
10. The method for optimizing machining paths in a CNC machine tool according to claim 1, characterized in that, The initial tool position sequence is generated by using a parameterized path template and the specific geometric boundaries of the features to calculate an ordered tool position sequence and tool axis vector through parameterized curves, thereby generating the initial NC code.