A process-in-the-loop CNC device and method
By introducing a non-real-time process optimizer and process prediction observer into the CNC device, and combining virtual machine tool simulation and physical machine tool feedback, real-time error compensation and process optimization in multi-axis machining were achieved, improving machining accuracy and surface quality.
Patent Information
- Application Number
- CN202610156125.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-04
- Publication Date
- 2026-05-05
- Estimated Expiration
- 2046-02-04
AI Technical Summary
Existing CNC devices cannot achieve process closed-loop, process optimization relies on manual experiments, and traditional controllers have limited error adjustment range in multi-axis machining, making it difficult to cope with dynamic factors such as thermal errors and cutting force disturbances.
By employing a non-real-time process optimizer and a process predictive observer, combined with virtual machine tool simulation and physical machine tool feedback, and using deep learning and neural network technologies, real-time process optimization and error compensation are achieved, thus realizing dynamic closed-loop control.
It enables real-time error compensation and process optimization in multi-axis machining, improves machining trajectory accuracy and surface quality, and solves the limitations of traditional CNC systems in error adjustment in complex multi-axis machining.
Smart Images

Figure CN121635070B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of numerical control technology, and in particular to a process-in-the-loop numerical control device and method. Background Technology
[0002] Existing CNC devices or systems generally cannot solve the process loop problem because process information cannot be integrated into the CNC device. Process optimization relies on manual experimentation and adjustment, and the optimization results cannot be reflected in the CNC device in real time. Furthermore, traditional cross-coupling control methods are often limited by the performance of the controller itself when compensating for errors in multi-axis linkage machining. The error adjustment range is limited by the characteristics of the controller itself and can only be fine-tuned within a limited range. Moreover, traditional CNC systems mostly rely on empirical formulas and offline compensation, which are difficult to cope with dynamic factors such as thermal errors, cutting force disturbances, and tool wear in complex multi-axis machining processes. Summary of the Invention
[0003] The purpose of this invention is to provide a process-in-the-loop CNC device and method, which adds a non-real-time process optimizer and a process prediction observer. Through the deep integration of virtual machine tool simulation and physical machine tool feedback, it effectively compensates for the comprehensive errors generated in multi-axis machining and performs real-time feedforward compensation during the machining process. It predicts, optimizes and dynamically controls the machining process in a closed loop, optimizes the machining trajectory in real time, and compensates for errors.
[0004] To achieve the above objectives, the present invention provides a process-in-the-loop numerical control device and method, including a non-real-time process optimizer, an interpolator and a position controller, a process prediction observer and a physical machine tool;
[0005] The non-real-time process optimizer uses a deep learning-based trajectory error prediction model to optimize the raw trajectory data input by the user, effectively compensating for the comprehensive errors generated during multi-axis machining.
[0006] The interpolator and position controller are used to calculate the coordinates of the midpoint of the motion trajectory and to precisely control the tool to reach the target position;
[0007] The process prediction observer uses neural network technology to construct a dynamic observer and perform real-time feedforward compensation during the processing.
[0008] Physical machine tools are used for processing operations.
[0009] This invention provides a process-in-the-loop CNC method, applied to the aforementioned process-in-the-loop CNC device, comprising the following steps:
[0010] S1. The non-real-time process optimizer preprocesses the programmed trajectory data to obtain the trajectory data stream;
[0011] S2, the trajectory data stream is input into the interpolator and position controller to control the physical machine tool to move in position;
[0012] S3. The actual movement trajectory of the physical machine tool is used as the target trajectory input into the process prediction observer of the physical machine tool and the control model of the virtual machine tool to obtain the observation error, and the trajectory error compensator is used to correct and obtain the fine-tuned periodic trajectory.
[0013] S4. Input the acquired fine-tuning cycle trajectory into the physical machine tool to control the operation of the physical machine tool.
[0014] Preferably, in S3, the target trajectory is input into the process prediction observer of the physical machine tool and the control model of the virtual machine tool to obtain the dynamic observation error. The dynamic observation error is the estimated deviation of the cutting force disturbance and the position error. The cutting force and position error are specifically as follows:
[0015] ;
[0016] ;
[0017] in, For cutting force, This is the cutting force correction factor. For cutting depth, For cutting speed, For the tool radius, Main spindle speed, To account for the overall positional error, For speed coefficient, For quality coefficient, This is the proportionality coefficient. The integral coefficient is... is the differential coefficient.
[0018] Preferably, the acquisition of the fine-tuned periodic trajectory in S3 specifically includes the following steps:
[0019] S3.1 The theoretical periodic trajectory is input into the NN neural network to obtain the control signal;
[0020] S3.2. Input control signals into the cutting force model and displacement error model to predict disturbance forces;
[0021] S3.3 After the disturbance force is evaluated, the trajectory correction optimizer is used to obtain the fine-tuned periodic trajectory.
[0022] Preferably, the specific operation of S3.1 is as follows: using a multi-layer neural network model. Fit the servo motor system of the machine tool, input the system state vector Output control commands As shown below:
[0023] ;
[0024] in, For the first Step position error, For speed error, For current error, The rate of change of position error, The rate of change of velocity error, For the first The cutting force experienced by the stepping system;
[0025] The training objective is to minimize the error between the predicted output and the ideal response, as shown below:
[0026] ;
[0027] in, For the loss function, For the first step, For the first The ideal response of the step, For neural networks in parameters Next, the The predicted output of the step, For regularization parameters, For neural networks with respect to parameters The gradient.
[0028] Preferably, the calculation formula for the cutting force model in S3.2 is as follows:
[0029] ;
[0030] The calculation formula for the displacement error model is shown below:
[0031] ;
[0032] in, This refers to the tool deformation and displacement error caused by the cutting force. The error deformation coefficient is... For the first The cutting force experienced by the step.
[0033] Preferably, in S3.3, the trajectory error is predicted based on the disturbance force assessment. The prediction formula for the trajectory error is as follows:
[0034] ;
[0035] in, The following error is predicted by the neural network model. For the first The error in the predicted trajectory of the period. For the first The current trajectory error of the period, The following error is the prediction made by the neural network.
[0036] Define trajectory input correction amount The optimization objective is to minimize the prediction error, and the calculation formula is as follows:
[0037] ;
[0038] in, The correlation matrix between the correction amount and the error. For the first The target error of the period, For regularization parameters;
[0039] Solving the above formula yields the correction compensation as follows: The fine-tuned output is ,in, This is the original control output.
[0040] Therefore, the present invention adopts the above-mentioned process-in-the-loop CNC device and method, adds a non-real-time process optimizer and a process prediction observer, and achieves effective compensation for the comprehensive error generated in the multi-axis machining process through the deep integration of virtual machine tool simulation and physical machine tool feedback, and performs real-time feedforward compensation in the machining process, predicts, optimizes and dynamically controls the machining process, optimizes the machining trajectory in real time, and compensates for errors.
[0041] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0042] Figure 1 This is a schematic diagram of the architecture of a process-in-the-loop CNC device according to the present invention;
[0043] Figure 2 This is a schematic flowchart of a process-in-the-loop CNC method according to the present invention;
[0044] Figure 3 This is a flowchart of a process-in-the-loop CNC method for obtaining a finely tuned periodic trajectory according to the present invention. Detailed Implementation
[0045] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.
[0046] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0047] Example 1
[0048] like Figure 1 As shown, the present invention provides a process-in-the-loop CNC device and method, including a non-real-time process optimizer, an interpolator and a position controller, a process prediction observer and a physical machine tool;
[0049] The non-real-time process optimizer uses a deep learning-based trajectory error prediction model to optimize the raw trajectory data input by the user, effectively compensating for the comprehensive errors generated during multi-axis machining.
[0050] The interpolator and position controller are used to calculate the coordinates of the midpoint of the motion trajectory and to precisely control the tool to reach the target position;
[0051] The process prediction observer uses neural network technology to construct a dynamic observer and perform real-time feedforward compensation during the processing.
[0052] Physical machine tools are used for processing operations.
[0053] A non-real-time process optimizer is placed before the traditional interpolator and position controller to perform process optimization on the user-input raw trajectory data. The process-in-the-loop control of the CNC machining trajectory is achieved through the non-real-time process optimizer and the real-time process prediction observer.
[0054] like Figures 2 to 3 As shown, the present invention provides a process-in-the-loop CNC method, applied to the aforementioned process-in-the-loop CNC device, comprising the following steps:
[0055] S1. The non-real-time process optimizer preprocesses the programmed trajectory data to obtain the trajectory data stream;
[0056] S2, the trajectory data stream is input into the interpolator and position controller to control the physical machine tool to move in position;
[0057] CNC interpolation is the process by which the CNC system of a computer numerical control machine tool inserts intermediate points between the start and end points of the contour to determine the tool movement trajectory through algorithms. In essence, it transforms the curve described by the part program into a polyline trajectory by densifying data points to achieve contour approximation. This function calculates the tool position in real time according to the given feed rate and contour line requirements.
[0058] Position control, speed control, and current control are the core components of a servo system for achieving high-precision motion. They work together using existing technologies to ensure the stability, accuracy, and dynamic response performance of the machining process. Position control ensures that the moving parts of the machine tool accurately reach and maintain the target position; speed control precisely adjusts the movement speed of the machine tool's moving parts to meet the feed rate requirements of the machining process; and current control directly controls the electromagnetic torque of the motor, which is fundamental to achieving precise speed and position control.
[0059] S3. The actual movement trajectory of the physical machine tool is used as the target trajectory input into the process prediction observer of the physical machine tool and the control model of the virtual machine tool to obtain the observation error, and the trajectory error compensator is used to correct and obtain the fine-tuned periodic trajectory.
[0060] The target trajectory is input into the process prediction observer of the physical machine tool and the control model of the virtual machine tool to obtain dynamic observation errors. The dynamic observation errors are the predicted deviations of cutting force disturbances and position errors. Based on the process conditions given by the user, such as machining speed, tool information, spindle speed, etc., the specific cutting force and position errors are as follows:
[0061] ;
[0062] ;
[0063] in, For cutting force, This is the cutting force correction factor. For cutting depth, For cutting speed, For the tool radius, Main spindle speed, The overall position error includes errors caused by control. For speed coefficient, For quality coefficient, This is the proportionality coefficient. The integral coefficient is... is the differential coefficient.
[0064] The acquisition of the fine-tuned periodic trajectory includes the following steps:
[0065] S3.1 The theoretical periodic trajectory is input into the NN neural network to obtain the control signal;
[0066] The specific operation is as follows: using a multi-layer neural network model. Fit the servo motor system of the machine tool, input the system state vector Output control commands As shown below:
[0067] ;
[0068] in, For the first Step position error, For speed error, For current error, The rate of change of position error, The rate of change of velocity error, For the first The cutting force experienced by the stepping system;
[0069] The training objective is to minimize the error between the predicted output and the ideal response, as shown below:
[0070] ;
[0071] in, For the loss function, For the first step, For the first The ideal response of the step, For neural networks in parameters Next, the The predicted output of the step, For regularization parameters, For neural networks with respect to parameters The gradient.
[0072] S3.2. Input control signals into the cutting force model and displacement error model to predict disturbance forces;
[0073] The calculation formula for the cutting force model is shown below:
[0074] ;
[0075] The calculation formula for the displacement error model is shown below:
[0076] ;
[0077] in, This refers to the tool deformation and displacement error caused by the cutting force. The error deformation coefficient is... For the first The cutting force experienced by the step.
[0078] S3.3 After the disturbance force is evaluated, the trajectory correction optimizer is used to obtain the fine-tuned periodic trajectory.
[0079] Based on the disturbance force assessment, the trajectory error is predicted. The prediction formula for the trajectory error is as follows:
[0080] ;
[0081] in, The following error is predicted by the neural network model. For the first The error in the predicted trajectory of the period. For the first The current trajectory error of the period, The following error is the prediction made by the neural network.
[0082] Define trajectory input correction amount The optimization objective is to minimize the prediction error, and the calculation formula is as follows:
[0083] ;
[0084] in, The correlation matrix between the correction amount and the error. For the first The target error of the period, For regularization parameters;
[0085] Solving the above formula yields the correction compensation as follows: The fine-tuned output is ,in, This is the original control output.
[0086] By simulating cutting force and position error using a control model in a virtual machine tool, the trajectory error and process can be evaluated. Through iterative large-scale computation, process optimization is achieved, providing optimized trajectory control data for subsequent control of the physical machine tool.
[0087] By applying a neural network model under virtual machine tool simulation conditions as a process prediction observer, the process is predicted. Based on the given physical machine tool and its current actual operating state, the trajectory error of the next instruction cycle is predicted, and the periodic trajectory is dynamically corrected through real-time feedforward compensation, thereby improving the multi-axis trajectory following accuracy and surface quality during machining. Simultaneously, the state and parameter data of the physical machine tool are collected and transmitted to the virtual machine tool for further iteration, improving the accuracy of the control model and achieving virtual machine tool self-adaptation.
[0088] S4. Input the acquired fine-tuning cycle trajectory into the physical machine tool to control the operation of the physical machine tool.
[0089] Therefore, the present invention adopts the above-mentioned process-in-the-loop CNC device and method, adds a non-real-time process optimizer and a process prediction observer, and achieves effective compensation for the comprehensive error generated in the multi-axis machining process through the deep integration of virtual machine tool simulation and physical machine tool feedback, and performs real-time feedforward compensation in the machining process, predicts, optimizes and dynamically controls the machining process, optimizes the machining trajectory in real time, and compensates for errors.
[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A process-in-the-loop CNC device, characterized in that: This includes non-real-time process optimizers, interpolators and position controllers, process prediction observers, and physical machine tools; The non-real-time process optimizer uses a deep learning-based trajectory error prediction model to optimize the raw trajectory data input by the user, effectively compensating for the comprehensive errors generated during multi-axis machining. The interpolator and position controller are used to calculate the coordinates of the midpoint of the motion trajectory and to precisely control the tool to reach the target position; The process prediction observer uses neural network technology to construct a dynamic observer and perform real-time feedforward compensation during the processing. Physical machine tools are used for processing operations; The CNC method using the above-mentioned process-in-the-loop CNC device includes the following steps: S1. The non-real-time process optimizer preprocesses the programmed trajectory data to obtain the trajectory data stream; S2, the trajectory data stream is input into the interpolator and position controller to control the physical machine tool to move in position; S3. The actual movement trajectory of the physical machine tool is used as the target trajectory input into the process prediction observer of the physical machine tool and the control model of the virtual machine tool to obtain the observation error, and the trajectory error compensator is used to correct and obtain the fine-tuned periodic trajectory. The acquisition of the fine-tuned periodic trajectory includes the following steps: S3.1 The theoretical periodic trajectory is input into the NN neural network to obtain the control signal; Using a multi-layer neural network model Fit the servo motor system of the machine tool, input the system state vector Output control commands As shown below: ; in, For the first Position error of the step, For speed error, For current error, The rate of change of position error, The rate of change of velocity error, For the first The cutting force experienced by the stepping system; The training objective is to minimize the error between the predicted output and the ideal response, as shown below: ; in, For the loss function, For the first step, For the first The ideal response of the step, For neural networks in parameters Next, the The predicted output of the step, For regularization parameters, For neural networks with respect to parameters The gradient; S3.
2. Input control signals into the cutting force model and displacement error model to predict disturbance forces; S3.3 After the disturbance force is evaluated, the trajectory correction optimizer is used to obtain the fine-tuned periodic trajectory; S4. Input the acquired fine-tuning cycle trajectory into the physical machine tool to control the operation of the physical machine tool.
2. The process-in-the-loop CNC device according to claim 1, characterized in that: In S3, the target trajectory is input into the process prediction observer of the physical machine tool and the control model of the virtual machine tool to obtain the dynamic observation error. The dynamic observation error is the prediction deviation of the cutting force disturbance and the position error. The cutting force and position error are specifically as follows: ; ; in, For cutting force, This is the cutting force correction factor. For cutting depth, For cutting speed, For the tool radius, Main spindle speed, To account for the overall positional error, For speed coefficient, For quality coefficient, This is the proportionality coefficient. The integral coefficient is... is the differential coefficient.
3. The process-in-the-loop CNC device according to claim 2, characterized in that: The calculation formula for the cutting force model in S3.2 is shown below: ; The calculation formula for the displacement error model is shown below: ; in, This refers to the tool deformation and displacement error caused by the cutting force. The error deformation coefficient is... For the first The cutting force experienced by the stepping system.
4. The process-in-the-loop CNC device according to claim 3, characterized in that: In S3.3, the trajectory error is predicted based on the disturbance force assessment. The prediction formula for the trajectory error is as follows: ; in, For the first The error in the predicted trajectory of the period. For the first The current trajectory error of the period, The following error is the prediction made by the neural network. Define trajectory input correction amount The optimization objective is to minimize the prediction error, and the calculation formula is as follows: ; in, The correlation matrix between the correction amount and the error. For the first The target error of the period, For regularization parameters; Solving the formula yields the correction compensation as follows: The fine-tuned output is ,in, This is the original control output.
Citation Information
Patent Citations
Robot milling track precision compensation method
CN114750146A
Control method, device and equipment of five-axis high-precision numerical control machine tool and storage medium
CN119472507A
Intelligent numerical control machine tool contour error prediction compensation system and control method thereof
CN120010393A
