Numerical control energy efficiency adaptive planning method based on physical information neural network
By using the physical information neural network adaptive planning method, the problems of real-time feedback lag and insufficient model generalization in the machining of complex curved surfaces in CNC machining are solved, achieving efficient and safe machining optimization and significantly improving energy efficiency and machining efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ANHUI UNIV OF SCI & TECH
- Filing Date
- 2026-06-18
- Publication Date
- 2026-07-24
Smart Images

Figure CN122449907A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of intelligent manufacturing and CNC machining technology, and more specifically to a physical information neural network CNC energy efficiency adaptive planning method and system. Background Technology
[0002] In CNC milling of aerospace structural components and precision molds, parts often possess complex spatial curved surface features. These complex surfaces cause nonlinear changes in the instantaneous depth of cut and width during machining. Traditional processes typically set a low global feed rate based on the load limit at the workpiece's maximum cutting allowance to prevent tool chipping or breakage during sudden changes in cutting load. This conservative "static constant feed" strategy results in numerous light-load cutting zones in the part's machining trajectory, hindering the full utilization of machine tool cutting performance and increasing runtime. This objectively restricts further improvements in manufacturing process energy efficiency.
[0003] To overcome the limitations of static parameters, the industry has developed adaptive control (ACC) technology for CNC machining. For example, some existing solutions acquire monitoring signals by installing current sensors on the spindle, indirectly calculate the actual cutting force using the spindle current, and then combine this with deep learning algorithms such as reinforcement learning to output the predicted cutting force online, thereby controlling the machine tool feed in real time. However, such real-time feedback control methods based on sensors and online algorithms still face the following objective technical bottlenecks in practical industrial application:
[0004] 1. Real-time online feedback systems inevitably suffer from physical adjustment lag: Traditional online adaptive control systems heavily rely on real-time monitoring using current or force sensors installed on the machine tool. In actual machining, the entire closed-loop control chain, from sensor signal sampling, low-pass filtering, algorithm model inference, to command issuance to the CNC controller and servo motor response, has inherent physical delays. When faced with sudden changes in high-dynamic cutting loads caused by complex curved surfaces, such systems inevitably exhibit "adjustment lag." By the time the algorithm calculates and issues the optimal feed rate, the tool is often already in an overload danger zone. Therefore, such online control systems typically require additional current threshold alarm strategies for post-event safety remediation.
[0005] 2. Indirect force measurement based on spindle current has weak anti-interference capability and rigid physical parameters: Existing technologies often extract the effective value of the spindle current and combine it with the motor kinematic equations to inversely deduce the theoretical cutting force. This indirect identification method is highly susceptible to interference from electromechanical coupling noise such as transient frictional fluctuations in the machine tool guideway and thermal drift of the spindle motor, resulting in poor robustness. Furthermore, traditional mechanical models or purely data-driven state-space mappings often neglect nonlinear fluctuations caused by progressive tool wear and differences in the hardness of different batches of materials, or treat the specific cutting energy as a fixed constant. This limits the prediction accuracy of the algorithm when faced with unknown "machine tool-material-tool" combinations.
[0006] 3. Pure data-driven algorithms face the "small sample" generalization dilemma: While existing reinforcement learning or deep neural network models do not rely on trial and error on physical machine tools for internal policy updates, their prediction accuracy still highly depends on the collection and state fitting of large amounts of real-time interactive data. In actual workshop production, it is difficult to conduct large-scale cutting experiments for every new working condition to obtain sufficient training data. Under extremely small sample conditions, pure data-driven models lacking constraints from macroscopic mechanical laws (such as the sine cutting thickness law) are prone to overfitting, making it difficult to guarantee industrial-grade safety and generalization ability for extrapolation predictions.
[0007] Therefore, how to get rid of the dependence on real-time hardware sensors, eliminate the physical lag in the control link, and achieve high-fidelity cutting force prediction and adaptive optimization of feed parameters by integrating physical mechanisms under extremely small sample conditions is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0008] In view of the above problems, the present invention is proposed to provide a physical information neural network-based numerical control energy efficiency adaptive planning method to overcome or at least partially solve the above problems.
[0009] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, embodiments of the present invention provide a numerical control energy efficiency adaptive planning method based on physical information neural network, characterized in that it includes: S1. Construct an instantaneous mechanical and energy consumption model for the complex surface milling process, and establish the feed rate. The monotonically decreasing relationship between feed rate and energy consumption per unit length determines that maximizing feed rate is the optimal energy-saving solution within the safe cutting force threshold. S2. Design and hybrid training of physical information neural network, which uses spindle speed and feed rate as the mains parameters. The axial depth of cut and radial width of cut are taken as inputs, and the output is the predicted cutting force. and will be higher than cutting energy Defined as trainable parameters in a physical information neural network The physical information neural network is jointly optimized through a composite function that includes data error and physical residual. S3. Perform geometric analysis and discretization modeling on the original CNC machining program. Reconstruct the tool path through the geometric analysis engine, adaptively discretize, and perform virtual material removal simulation based on the Z-Map model. Extract the state feature matrix of each tool point on the tool path, which includes the instantaneous cutting depth and instantaneous cutting width. S4. Based on the state feature matrix of each tool point, construct a system with feed rate as the basis. To control variables in order to predict cutting forces A local optimization function with a feed rate boundary penalty term, aiming to approach a safety threshold. ; S5. Employs a warm-start strategy and an automatic differential gradient descent algorithm, based on a local optimization function. The optimal feed rate at each tool position point is solved sequentially along the tool path to obtain the global optimal feed rate sequence; S6. Perform moving average filtering on the optimal feed rate sequence and reconstruct it with the tool position coordinates into a CNC machining program containing dynamic feed instructions.
[0010] Furthermore, the instantaneous mechanics and energy consumption model in S1 specifically includes: An analytical relationship between the maximum instantaneous chip thickness and process parameters is established based on the sinusoidal chip thickness law, and an expression for the peak instantaneous cutting force is established based on the mechanical model. Establish feed rate Energy consumption per unit length expression:
[0011] in, This refers to standby power. This is the energy consumption constant term for effective cutting; Based on feed rate Based on the expression for energy consumption per unit length, it is derived that energy consumption per unit length decreases as the feed rate increases.
[0012] Furthermore, the physical residuals in S2 include: experimental domain physical residuals. and global physical residual ; A composite function that includes data error and physical residual. The expression is:
[0013] in Due to data error, W This is the weight matrix of the physical information neural network. bThis is the bias vector of the physical information neural network. The weighting coefficients for the physical residuals in the experimental domain. The weighting coefficients for the global physical residuals; Specific cutting energy Defined as trainable parameters in a physical information neural network During backpropagation, the network weights and biases are updated synchronously and automatically converge to the true specific cutting energy value under the current tool wear state and workpiece material properties.
[0014] Furthermore, the specific process of S3 is as follows: Geometric analysis is performed on the original CNC machining program to extract motion commands containing geometric information, reconstructing discrete coordinate points into continuous parametric geometric curves. P ; Parametric geometric curves P Discretize the tool position points into a series of ordered tool position points to obtain the three-dimensional spatial coordinates of the k-th tool position point in the workpiece coordinate system. ; in , This refers to the instantaneous absolute position of the tool's central axis relative to the workpiece coordinate system in the horizontal plane. This is the absolute axial height of the tool bottom surface in the workpiece coordinate system; Z-Map model initialization: The XY plane containing the workpiece coordinate system is divided into segments with a resolution of [missing information]. A two-dimensional grid, with each grid node Define a state variable This indicates the current highest Z-coordinate of the workpiece surface at that location; initially, Initial values are assigned based on the geometric dimensions of the original workpiece; Determine the tool projection domain :
[0015] in For the tool radius, For grid nodes The center coordinates; Extracting instantaneous cutting depth : Traversing the tool projection domain Calculate the workpiece surface height for all mesh nodes within the area. and The maximum difference between them is used as the instantaneous cutting depth at the current tool position. :
[0016] Extracting instantaneous cutting width : Based on tool projection domain Calculate the wrap angle between the tool side edge and the machined surface based on the mesh distribution boundary where effective material interference occurs. Then, the instantaneous radial cutting width can be solved. :
[0017] Where D is the diameter of the cutting tool; State feature matrix generation: Based on instantaneous cutting depth and instantaneous cutting width Generate a state feature vector S containing N tool positions:
[0018] Where P represents the three-dimensional spatial position coordinate vector of the tool position point in the workpiece coordinate system.
[0019] Furthermore, the virtual material removal simulation based on the Z-Map model in S3 includes: Simulates the material stripping effect caused by cutting, based on the tool projection domain at the current tool height. The grid elevation within the area is iteratively updated as the initial environmental state for calculating the next cut location. :
[0020] in This represents the initial environmental state at the current tool position.
[0021] Furthermore, the discrete coordinate points are reconstructed into continuous parametric geometric curves. P include: Extract discrete coordinate points from the original program and reconstruct them into continuous parametric geometric curves. P ; For the line segment instruction, construct the line segment starting from the line segment origin. and the endpoint of the straight segment Linear parametric equations for endpoints:
[0022] in u For normalized curve parameters, ;when u When =0, = The starting point of the corresponding straight line segment; when u When =1, , corresponds to the endpoint of the straight line segment; when hour, This indicates the midpoint on the line connecting the starting point and the ending point; For the arc segment command, extract the center coordinates. C With radius R Constructing with the central angle Parametric equations of the circular arc with variables:
[0023] in T Indicates matrix transpose; , Indicates the starting angle of the arc segment. Indicates the termination angle of the arc segment; Parametric geometric curves P Discretization into a series of ordered tool points includes: The reconstructed continuous parameterized geometric curve P Sampling is performed to generate a discrete tool position sequence for solving physical features; For straight segments, the curvature is 0, and a constant, relatively large reference step size is used. Perform equidistant sampling; For curved sections, based on the preset maximum running bow height error and the local radius of curvature of the current trajectory Dynamically calculate and adaptively adjust the sampling step size : .
[0024] Furthermore, the local optimization function in S4 with the feed rate boundary penalty term is:
[0025] in Let the local optimization objective function be the one at the k-th cutter position. This indicates that in S2, the feed rate is... The forward predicted cutting force is output in real time; This indicates the system's safe cutting force threshold; To penalize the weighting coefficient, when When the physical limit is exceeded, the loss function value will increase sharply, forcing the optimization direction to return to the feasible region; This is a boundary penalty term that constrains the feed rate within the machine tool's operating range.
[0026] Furthermore, the warm-start strategy in S5 includes: For the first tool position point on the tool path, the constant feed rate in the original CNC machining program is used as the initial value for gradient descent optimization; For each subsequent tool position, the optimal feed rate that has been solved and converged at the previous adjacent tool position is directly used as the initial value for gradient descent optimization at the current tool position. Automatic differential descent algorithms include: Local optimization function Regarding control variables gradient It can be obtained analytically using the chain rule:
[0027] Among them, control variables Let be the feed rate at the k-th tool position point. This is the output of the forward inference of the Physical Information Neural Network (PINN). For physical information neural networks to input The partial derivatives, This indicates the system's safe cutting force threshold; Let n be the known state feature vector at the k-th tool position point, and n be the machine tool spindle speed. Let be the instantaneous cutting depth at the k-th tool position point. Instantaneous cutting width at the kth tool position point; The feed rate is updated iteratively using the gradient descent method. The update formula for the t-th iteration is:
[0028] in The learning rate; By traversing all N tool positions, the optimization solution is completed, and the globally optimal feed rate sequence is obtained. .
[0029] The beneficial effects of the above-described technical solutions provided in the embodiments of the present invention include at least the following: 1. Eliminate physical adjustment lag and ensure dynamic processing safety.
[0030] Based on a geometric analysis engine and Z-Map model, this invention completes the extraction of instantaneous geometric cutting features (depth of cut, width of cut) of all toolpaths and the optimization of global feed rate offline before actual machining. The optimization results are then reconstructed into a CNC machining program (G-code). The machine only needs to operate according to this code, avoiding communication and calculation delays caused by online feedback. This greatly reduces the possibility of tool overload during the machining of complex curved surfaces due to lag.
[0031] 2. Eliminate reliance on external hardware sensors and enhance the system's anti-interference capability.
[0032] This invention obtains cutting force based on geometric Boolean operations and forward calculation using a physical information neural network. This method eliminates the need for additional high-frequency sensors and fundamentally isolates the nonlinear physical noise from the machine tool's internal electromechanical components, resulting in excellent robustness for the entire system.
[0033] 3. Overcome the bottleneck of small sample data and improve the model's extrapolation and generalization capabilities.
[0034] This invention incorporates mechanical equations such as the sinusoidal cutting thickness law as rigid physical constraints into the hybrid loss function, and uses the specific cutting energy as a trainable parameter. To further constrain the degrees of freedom of the neural network, the model can converge quickly even with limited data. Furthermore, because it is controlled by physical laws, it avoids overfitting issues when encountering new situations, unlike purely data-driven methods. In addition, during hybrid training, the model can inversely identify the hardness of the current batch of samples and the gradual wear of the tool, thus giving the model good robustness.
[0035] 4. Avoid blindly trying and finding the best solution, and ensure the certainty and efficiency of the solution.
[0036] This invention establishes a specific local programming objective function containing a penalty term for machine tool physical constraints. Based on this, it utilizes automatic differentiation in deep learning to calculate the first derivative of the feed rate. Simultaneously, considering the relatively gradual change in cutting conditions between adjacent tool positions, a "hot start" method is adopted to reduce blind exploration and oscillations caused by a large number of tool positions, thereby reducing the number of convergences required for each single point and theoretically ensuring the determinism and efficiency of the optimization process.
[0037] 5. Significant energy-saving effect.
[0038] This invention solves for the physical boundaries, transforming the safety margins retained due to excessive caution in traditional machining into useful machining allowances. It increases the material removal rate while ensuring that the instantaneous cutting force does not exceed the machine tool's physical limitations. This reduces the time the machine tool spends ineffectively, and simulation results show that it saves approximately 26% of energy. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0040] Figure 1 This is an overall flowchart of the solution provided in the embodiments of the present invention; Figure 2 This is a scatter plot comparing the accuracy of cutting force prediction provided in the embodiments of the present invention. Figure 3 The actual convergence curve of the physical parameters (specific cutting energy Kc) provided in the embodiments of the present invention; Figure 4 This is a comparison of the feed rate response between the conventional processing method and the processing method of the present invention provided in the embodiments of the present invention; Figure 5 This is a comparison chart of energy consumption between conventional processing and adaptive processing according to the present invention, as provided in the embodiments of the present invention. Detailed Implementation
[0041] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0042] This invention discloses a method for adaptive energy efficiency planning of numerical control based on physical information neural networks, such as... Figure 1 The following are included: S1. Construct an instantaneous mechanical and energy consumption model for the complex surface milling process, and establish the feed rate. The monotonically decreasing relationship between feed rate and energy consumption per unit length determines that maximizing feed rate is the optimal energy-saving solution within the safe cutting force threshold. S2. Design and hybrid training of physical information neural network, which uses spindle speed and feed rate as the mains parameters. The axial depth of cut and radial width of cut are taken as inputs, and the output is the predicted cutting force. and will be higher than cutting energy Defined as trainable parameters in a physical information neural network The physical information neural network is jointly optimized through a composite function that includes data error and physical residual. S3. Perform geometric analysis and discretization modeling on the original CNC machining program. Reconstruct the tool path through the geometric analysis engine, adaptively discretize, and perform virtual material removal simulation based on the Z-Map model. Extract the state feature matrix of each tool point on the tool path, which includes the instantaneous cutting depth and instantaneous cutting width. S4. Based on the state feature matrix of each tool point, construct a system with feed rate as the basis. To control variables in order to predict cutting forces A local optimization function with a feed rate boundary penalty term, aiming to approach a safety threshold. ; S5. Employs a warm-start strategy and an automatic differential gradient descent algorithm, based on a local optimization function. The optimal feed rate at each tool position point is solved sequentially along the tool path to obtain the global optimal feed rate sequence; S6. Perform moving average filtering on the optimal feed rate sequence and reconstruct it with the tool position coordinates into a CNC machining program containing dynamic feed instructions.
[0043] The specific implementation of this invention is as follows: Step (1) Construct an instantaneous mechanical and energy consumption model for the complex surface milling process: 1.1 Define kinematic parameters Let the diameter of the cutting tool be... D (mm), number of cutting teeth is Z The helix angle is The spindle speed is n (r / min), feed rate is axial cutting depth is (mm), radial cutting width is (mm).
[0044] 1.2 Instantaneous chip thickness modeling based on the sine law During milling, the trajectory of the cutting edge of the cutter relative to the workpiece is cycloidal, and the j-th cutter tooth ( instantaneous angle The location changes dynamically over time.
[0045] Feed per tooth f z The displacement of the workpiece along the feed direction when the tool rotates through one tooth angle.
[0046] During vertical milling, the angle of the cutting teeth Instantaneous undeformed chip thickness According to the law of sine, this can be expressed as:
[0047] 1.3
[0048] In milling, based on the motion relationship between the cutting edge of the tool and the workpiece feed direction, the process is divided into climb milling and conventional milling. The effective cutting range is determined by the entry angle. And the exit angle. Jointly defined.
[0049] The specific embodiments of this invention mainly describe the climb milling process widely used in the processing of aerospace structural components and molds. In climb milling, the cut-out angle is always... , angle of entry Due to the diameter of the cutting tool With instantaneous radial cutting width Decide:
[0050]
[0051] Calculate the maximum instantaneous chip thickness :
[0052] This formula establishes the process parameters. With microscopic cutting physical quantities The relationship between them is the core equation of the PINN physical layer.
[0053] 1.4 Physical Model of Instantaneous Cutting Force Peak Based on the mechanical model in the principle of metal cutting, the cutting force is proportional to the cutting cross-sectional area.
[0054] Define instantaneous cutting force peak value for:
[0055] in: Maximum instantaneous cutting cross-sectional area ; Specific Cutting Energy ) In particular, in this invention, Not considered a constant, existing technologies typically refer to manuals to determine this. Set as a constant (e.g., 800 for aluminum alloy), and defined as a trainable parameter to be identified in the neural network, with its initial value... Given, it is automatically corrected through backpropagation during training.
[0056] 1.5 Energy transfer function of feed servo system Establish the total power of the machine tool The mathematical model, which consists of the basic standby power Composition of effective cutting power:
[0057] in: (Standby Power): The basic power consumption required to keep the machine tool in a ready state. This includes the continuous operation of the CNC control screen, hydraulic and pneumatic systems, coolant pumps, and the holding current of the servo motors for each feed axis. This value does not change with the cutting conditions throughout the machining cycle and is typically a constant. (Cutting Power): The mechanical work done by the spindle motor and servo motor to overcome the material's yield strength and achieve chip shearing and fracture, i.e., the work done in material removal, is related to the cutting force. and cutting speed Proportional. Because Since the cutting force is approximately proportional to the feed rate, the effective power term is linearly related to the material removal rate (MRR).
[0058] Define energy consumption per unit length ( (Unit: J / mm) is used as an optimization index for evaluating machine tool energy efficiency. Its physical meaning is: the total energy consumed by the machine tool to remove one millimeter of workpiece length along the tool path. This is then compared to the feed rate. f Expanding on this:
[0059] Will Substituting the expansion into the above equation, the effective cutting energy consumption term... f He was invited there, and thus received:
[0060] in 。 For a given geometric path node, the cutting depth and cut width It has been fixed by Z-Map parsing, therefore It is expressed as a constant.
[0061] Energy consumption function relative feed rate f The first-order partial derivative is:
[0062] Because the standby power of the machine tool is always greater than zero And the feed rate must be positive. Therefore, the first derivative is always less than zero. This indicates the energy consumption per unit length. With feed rate f The value decreases as the value increases. Therefore, without exceeding the physical limits of the machine tool spindle and cutting tool (i.e., the instantaneous predictive force), the value decreases. Under the premise of ), maximize the feed rate f It is the globally theoretical optimal solution for reducing the total energy consumption of CNC machining.
[0063] Step (2) Design and Hybrid Training of Physical Information Neural Network (PINN) 2.1 Network Input and Normalization Preprocessing Define the input vector of a neural network It includes four process parameters:
[0064] In CNC machining, the dimensions of various parameters vary greatly. If the raw data is input directly without processing, it can easily cause the neural network to fall into gradient vanishing or ill-conditioned Hessian matrix during backpropagation. To eliminate gradient imbalance caused by different physical dimensions, a maximum boundary scalar normalization mapping layer is established. :
[0065] In the formula, the denominator terms are all taken as the absolute value of the maximum physical boundary allowed by the machine tool hardware or process specifications.
[0066] 2.2 Design of Physical Information Neural Network Structure The neural network used is a fully connected feedforward neural network (FNN) with a 4-32-32-1 structure. The input layer of this network consists of four neurons, receiving a preprocessed normalized process vector. The hidden layers employ a two-layer fully connected structure with 32 neurons per layer, and the hyperbolic tangent function is used as the activation function. The output layer contains one neuron, which outputs a normalized predicted cutting force. .
[0067] Forward propagation formula:
[0068] In the formula This is the weight matrix. This is the bias vector.
[0069] Denormalization layer: Maps the output back to physical space
[0070] In the formula, This is a preset scaling factor for the maximum dimensionality of the cutting force, used to map the normalized cutting force predicted by the neural network back to the actual physical force space.
[0071] 2.3 Embedding of Trainable Physical Parameter Nodes Traditional neural networks are merely "black box" mappings, unable to reflect hardness fluctuations in workpiece materials due to batch variations or progressive tool wear. This invention utilizes the specific cutting energy constant K from the metal cutting principle. cIn the network computation graph, the specific cutting energy K is not directly input. c Instead, it is defined as a trainable variable. .
[0072] Specific cutting energy The initial guess value is set to 1000 N / mm². During the backpropagation phase, the total loss function (data error + physical residual) is applied to... Trigger automatic gradient calculation to generate corrected gradient partial derivatives. The optimizer (Adam) will The network's weight matrix W and bias vector b are treated as equals and jointly iteratively updated. With the input of training samples, the parameters... It will adaptively get rid of the initial error, converge and anchor to the accurate ratio of cutting energy under the current tool wear state and the current material batch. This process is carried out before the offline look-ahead planning and variable parameter G-code generation stage, which enables the model to quickly complete the "pre-adaptive identification" of the current real material properties and tool wear state, breaking the defect of rigid parameters in traditional empirical models.
[0073] 2.4 Construction of Composite Physical Loss Function To address the poor generalization ability of models driven by small sample data, this invention employs the collocation method of physical information neural networks to generate a certain number of unlabeled collocation points within the safety envelope of the machine tool's permissible process parameters, thereby forcing the network to obey the laws of metal cutting mechanics across the entire domain.
[0074] In actual milling, dimensional effects and tool runout exist, which can lead to deviations between the theoretical equations of mechanics and the actual local cutting conditions. Introducing a single global physical constraint into neural network training can easily cause "gradient conflicts" between the theoretical equations and real experimental data. Therefore, this invention decouples the physical loss by region and constructs a composite objective function containing three sub-terms. :
[0075] In the formula: (Data error) is the mean square error between the predicted value and the actual measured value of the neural network on the real experimental data points; (Experimental domain physical residual) represents the residual between the network prediction value and the theoretical physical equation at the location of the process parameter corresponding to the actual experimental data; (Global domain physical residual) represents the residual between the network prediction and the theoretical physical equation at the global unlabeled configuration point.
[0076] By setting the decoupling weight coefficient ( Within the experimental domain, the strong constraints of physical laws are reduced, and the fit is mainly based on real experiments to compensate for microscopic nonlinear errors that cannot be expressed by mechanical theory equations. In the global domain where no working conditions are seen, the constraint weights of physical laws are strengthened to ensure that the network output follows the macroscopic trend of the sine shear thickness law and effectively prevent extrapolation divergence under small sample conditions.
[0077] Part 1: Data Errors ) Used to quantify the error between network predictions and actual experimental observations. It is expressed in the form of mean squared error (MSE).
[0078] in: This represents the total number of samples in the actual cutting experiment; For the first i The process feature input vector of the set of real experiments, i.e. ; For neural networks based on the first i The predicted cutting force is output from the forward propagation of the input group. For the first i The actual peak cutting force was obtained by a force measuring instrument in the group experiment.
[0079] Part Two: Physical Losses
[0080] This is used to force the output of the neural network to conform to the established physical model. For each input sample The network not only outputs predicted values It also utilizes the current parameters and input physical quantities Calculate theoretical physical forces:
[0081] Experimental domain physical residual ( ) represents the residual between the network-predicted value and the theoretical physical force on the coordinates of the process parameters corresponding to the actual experimental data.
[0082]
[0083] Global domain physical residuals ( The difference between the network prediction and the actual physical force is the difference at locations where there are no labeled points in the entire domain.
[0084] In the formula N c The number of unlabeled sample points is generated on the global safe operation envelope using Latin hypercube sampling (LHS). The input vector for the generated j-th unlabeled collocation is: .
[0085] Minimize the total loss function using gradient-based optimization algorithms (such as Adam). .
[0086]
[0087] During training, the optimizer performs the following dual tasks: Fitting task: Adjust W and b to give the network a certain nonlinear mapping capability and correct errors caused by factors not considered by the physical model.
[0088] The identification task is automatically adjusted. This allows it to gradually approach the actual cutting energy corresponding to the tool / material ratio from the initial estimate. Step (3) Geometric Analysis and Discretization Modeling 3.1 Data Acquisition and Preprocessing Module for CNC Programs The data acquisition module establishes a communication connection with the controller of the CNC machine tool via an industrial Ethernet network.
[0089] The edge computing unit reads the CNC program file (G-code) of the part to be processed through the communication interface. The geometry analysis engine parses the G-code line by line to obtain coordinate information, reconstructs the spatial trajectory, and obtains the conservative constant feed rate command from the original program. This instruction serves as the starting value for the first tool position in the subsequent forward optimization calculation and is also the basis for subsequent energy consumption assessment.
[0090] Preprocessing: The data cleaning module removes comment lines and blank lines from the program and extracts code blocks containing valid motion instructions (G00 / G01 / G02 / G03), coordinate data (X,Y,Z), and process parameters (S spindle speed, F feed rate).
[0091] 3.2 Trajectory Reconstruction Unit A lexical analyzer is built using the lexical analysis algorithm in a geometric parsing engine to convert scattered lines of code into continuous geometric trajectory segments. .
[0092] For the line segment instruction, construct the line segment starting from the line segment origin. and the endpoint of the straight segment Linear parametric equations for endpoints:
[0093] in u For normalized curve parameters, ;whenu When =0, , corresponding to the starting point of the straight line segment; when u When =1, , corresponds to the endpoint of the straight line segment; when hour, This indicates the midpoint on the line connecting the starting point and the ending point. For the arc segment command, extract the center coordinates. C With radius R Constructing with the central angle Parametric equations of circular arcs with variables:
[0094] in T Indicates matrix transpose; , Indicates the starting angle of the arc segment. Indicates the termination angle of the arc segment; 3.3 Adaptive Discretization Sampling Module The reconstructed continuous parameterized geometric curve Sampling is performed to generate a discrete tool position sequence for solving physical features; For straight segments, the curvature is 0, and a constant, relatively large reference step size is used. Perform equidistant sampling; For curved sections, based on the preset maximum running bow height error and the local radius of curvature of the current trajectory Dynamically calculate and adaptively adjust the sampling step size : .
[0095] Finally, a trajectory set containing N ordered tool positions is generated. ,in Let be the spatial coordinates of the k-th sampling point.
[0096] 3.4 Instantaneous Cutting Geometric Feature Extraction Based on Z-Map Model The G-code itself only contains the toolpath, not the depth of cut information. The instantaneous depth of cut at each moment needs to be calculated using geometric Boolean operations. The Z-Map model extracts cutting parameters through the following three steps: Step 1: Voxelization of the blank Input the dimensional parameters of the workpiece blank (such as length, width, and height), and generate a mesh in the XY plane (mesh resolution). Configure as needed; higher precision results in a denser mesh. Initialize each mesh node. For an unprocessed raw blank, the Z coordinates of all nodes are equal to the initial height of the blank; ultimately, a "Z-Map model of the initial blank" is formed, completing the digital modeling of the blank.
[0097] Step 2: Determine the tool projection domain And extract instantaneous cutting parameters For the kth cutter position Calculate the projection area of the tool in the XY plane. The expression is as follows:
[0098] In the formula For grid nodes XY coordinates; Extracting instantaneous cutting depth : Traversing the tool projection domain Calculate the workpiece surface height for all mesh nodes within the area. and The maximum difference between them is used as the instantaneous cutting depth at the current tool position.
[0099]
[0100] Extracting instantaneous cutting width : Based on tool projection domain Calculate the wrap angle between the tool side edge and the machined surface based on the grid distribution boundary where effective material interference occurs. Then, the instantaneous radial cutting width can be solved.
[0101]
[0102] Where D is the diameter of the cutting tool; Step 3: Material Removal and Update After extracting the cutting parameters, the height values of the Z-Map model's mesh are updated for the projected area. Change the Z-axis coordinates of all nodes within the height to their original height. Height of the bottom surface of the tool The minimum value between these values is used to simulate the process of "material removal layer by layer".
[0103]
[0104] 3.5 Generation of State Feature Matrix After traversing all tool positions, a state feature matrix is generated. S This matrix contains the coordinates of the tool position and the instantaneous depth of cut. Instantaneous cut width Spindle speed n This information is used as the input interface for the subsequent neural network and optimization controller.
[0105] In the formula P It represents the three-dimensional spatial position coordinate vector of the tool position point in the workpiece coordinate system, and through it, the optimized dynamic feed rate sequence is accurately mapped back to the original three-dimensional spatial trajectory. , This serves as the input to the Physical Information Neural Network (PINN) to calculate the instantaneous cutting force boundary at each point.
[0106] Step (4) Construction of offline look-ahead planning optimization model Read the N tool position sequence generated by discretization in step (3) sequentially. For any kth tool position on the trajectory, obtain its known machining state feature vector. Set the machine tool spindle speed n to be fixed, and the axial cutting depth... and radial cut width Calculated by a geometry simulation engine.
[0107] Define the feed rate at the k-th tool position. These are the control variables to be optimized. To prevent tool breakage and spindle overload, a safe cutting force threshold is set. Based on the physical limits of the machine tool servo system, the upper and lower bounds of the feed rate are set as follows: .
[0108] feed rate As a control variable, the predicted cutting force With the goal of approximating the safety threshold, a local loss function with a boundary penalty term is established. :
[0109] In the formula This indicates that in step (2), the feed rate is... The forward predicted cutting force is output in real time; This indicates the system's safe cutting force threshold; To penalize the weighting coefficient, when When the physical limit is exceeded, the loss function value will increase sharply, forcing the optimization direction to return to the feasible region; This is a boundary penalty term that constrains the feed rate within the machine tool's operating range.
[0110] Step (5) Solving the problem point by point based on gradient descent and hot start Based on the continuous differentiability of the Physical Information Neural Network (PINN) over its entire domain, a temporal optimization strategy of "hot start + gradient descent" is proposed to solve the local loss function constructed in step (4). This allows us to obtain the globally optimal feed rate sequence.
[0111] Hot start strategy: Because material removal is a continuous process during machining, the depth of cut between adjacent tool points k and k-1 is... Cut width The changes are gradual, and this continuity makes the optimal feed rate solution strongly correlated in time and space. Therefore, solving for the optimal feed rate at the k-th tool position is crucial. Instead of using random or fixed cold start initialization, the system directly reads the optimal solution converged at the previous cut point k-1 as the initial iteration value for the current point iteration. :
[0112] When k=1 The conservative constant feed rate in the original program .
[0113] Automatic Differential Descent Algorithm: Local Optimization Function Regarding control variables gradient It can be obtained analytically using the chain rule:
[0114] Among them, control variables Let K be the feed rate at the k-th tool position point; For physical information neural networks to input The partial derivatives; Let n be the known state feature vector at the k-th tool position point, and n be the machine tool spindle speed. Let be the instantaneous cutting depth at the k-th tool position point. Instantaneous cutting width at the kth tool position point; The feed rate is updated iteratively using the gradient descent method. The update formula for the t-th iteration is:
[0115] In the formula The learning rate; After each update, immediately apply physical limits to the machine tool to prevent exceeding the servo system's capabilities. .
[0116] By iterating through all N tool positions and performing optimization, the globally optimal feed rate sequence can be obtained. .
[0117] Step (6) Smoothing of optimization results and generation of variable parameter G-code In actual machining, if the theoretically optimal feed rate sequence obtained from step (5) is directly sent to the machine tool for execution, the servo motor may accelerate or decelerate rapidly due to the large speed difference between adjacent points, causing mechanical vibration of the machine tool. Therefore, it is necessary to perform moving average filtering on the optimal feed rate sequence and reconstruct it with the tool position coordinates into a CNC machining program containing dynamic feed instructions.
[0118] Moving Average Filter Processing: By setting a smoothing window half-width W, for the k-th point in the sequence, the smoothed safe feed rate is calculated using the arithmetic mean of its preceding and following neighboring points. :
[0119] Traditional G-code is generally a macroscopic instruction. To enable machine tools to execute feed rates that dynamically change with position, this invention employs a "micro-segment reconstruction" technique to rewrite the original code: Retrieve the discrete tool position spatial coordinate sequence generated in step (3) The smoothed feed rate sequence A one-to-one correspondence is established between the tool position coordinates. The original macroscopic motion commands are discarded, and a code generator is used to map each pair of adjacent tool position points... and Reconnect them into extremely short G01 straight micro-segments, and set the corresponding speed. It is appended as a feed command.
[0120] After reconstruction, the system finally outputs a variable-parameter G-code file containing dense micro-segments. The optimized file is then sent to the controller of the CNC system for execution.
[0121] Example 1: PINN Training and Material Physics Parameter Identification Based on Small Samples This embodiment is used to verify the fidelity of the Physical Information Neural Network (PINN) constructed in this invention for predicting the mechanics of complex cutting processes and for unknown physical parameters under small sample conditions. Its front-end adaptive recognition capability.
[0122] For 7075-T6 aluminum alloy structural components commonly used in the aerospace field, 13 sets of real-time peak cutting force measurements were obtained under different spindle speeds and feed rates. These 13 sets of small sample data were used as the training set and input into a neural network for training. The neural network is a fully connected feedforward neural network with a 4-32-32-1 topology, and the hyperbolic tangent function was selected as the activation function. In the hybrid loss function, the weighting coefficients for the physical loss term are set as follows: , The weight coefficient for the data loss term is 1. In this embodiment, the specific cutting energy is set as a trainable variable. And set its initial empirical guess value to 1000 N / mm².
[0123] Figure 3 Physical parameters (specific cutting energy) The actual convergence curve during training is shown, using the Adam optimizer to optimize the network weight matrix and trainable physical variables. Perform joint backpropagation iterations for 8000 epochs. As the number of training iterations (epochs) increases, the trainable physical parameters... The initial value rapidly decreased, then smoothly converged and stabilized at 825 N / mm², achieving adaptive identification of physical parameters. After training, the system's total loss function (Loss) stably converged to... .like Figure 2 As shown in the cutting force prediction accuracy verification figure, the cutting force predicted by the model is basically consistent with the actual measured peak force, with a mean absolute percentage error (MAPE) of 13.06%.
[0124] The above results demonstrate that, compared to conventional data-driven models that rely on large-scale datasets, this method can effectively derive the specific cutting energy parameters of materials under real-world conditions using only a small sample size (13 groups). Example 2: Validation of Forward-Looking Planning and Adaptive Energy Efficiency Control for Complex Surface Machining A virtual machining simulation environment was built for a complex curved surface part of an aerospace aluminum alloy to verify the actual effect of the invention.
[0125] Select diameter The 3-flute carbide end mill has a machining path of 100mm for straight fluting, with an axial depth of cut. The surface features are simulated by varying along the Z-axis in a Gaussian distribution.
[0126]
[0127] This equation represents the depth of cut of the part. The trend of change is To prevent spindle overload and tool breakage, a safe cutting force threshold is set. .
[0128] 1. Experimental Design The control group used the traditional constant parameter method, setting the global feed rate based on the worst-case scenario to ensure that the cutting force at the maximum depth of cut (8.0 mm) did not exceed the threshold (500 N). The calculated upper limit of the safe feed rate was 1800 mm / min. The experimental group, however, used the adaptive method of this invention, applying the hot-start gradient optimization algorithm proposed in this invention, with a safety boundary constraint of 500 N, to solve for the adaptive feed rate point-by-point along the aforementioned path.
[0129] 3. Results Analysis like Figure 4 and Figure 5 As shown, the traditional constant parameter method, to ensure safety, must use the maximum depth of cut (8.0 mm) as a benchmark and set the feed rate to 1800 mm / min throughout the entire process. Therefore, the actual load in the shallow depth of cut areas (2.5 mm) at both ends is far below 500 N, resulting in a huge "waste of machine tool performance" and a total machine tool energy consumption of 20.0 kJ. In contrast, the adaptive planning method of this invention, through its algorithm, accurately captures the machine tool load margin in the shallow depth of cut areas at both ends and automatically increases the feed rate significantly to about 4500 mm / min. In the deep cutting area in the middle, it automatically and precisely reduces the speed to about 1800 mm / min, with a total machine tool energy consumption of 14.7 kJ.
[0130] The data from this embodiment strongly demonstrates that, by leveraging the precise physical boundary sensing capabilities provided by PINN, this invention achieves a 26.6% energy saving by tapping into the speed potential of lightly loaded areas, while ensuring absolute safety during the machining process (cutting force not exceeding limits).
[0131] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0132] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for adaptive energy efficiency planning in numerical control based on physical information neural networks, characterized in that, include: S1. Construct an instantaneous mechanical and energy consumption model for the complex surface milling process, and establish the feed rate. The monotonically decreasing relationship between energy consumption per unit length and feed rate determines that maximizing feed rate is the optimal energy-saving solution within the safe cutting force threshold. S2. Design and hybrid training of physical information neural network, which uses spindle speed and feed rate as the mains parameters. The axial depth of cut and radial width of cut are taken as inputs, and the output is the predicted cutting force. and will be higher than cutting energy Defined as trainable parameters in the physical information neural network The physical information neural network is jointly optimized by a composite function that includes data error and physical residual. S3. Perform geometric analysis and discretization modeling on the original CNC machining program. Reconstruct the tool path through the geometric analysis engine, adaptively discretize, and perform virtual material removal simulation based on the Z-Map model. Extract the state feature matrix of each tool point on the tool path, which includes the instantaneous cutting depth and instantaneous cutting width. S4. Based on the state feature matrix of each tool point, construct a system with feed rate as the input. As a control variable, the predicted cutting force A local optimization function with a feed rate boundary penalty term, aiming to approach a safety threshold. ; S5. Employing a warm-start strategy and an automatic differential gradient descent algorithm, based on the aforementioned local optimization function. The optimal feed rate at each tool position point is solved sequentially along the tool path to obtain the global optimal feed rate sequence; S6. Perform moving average filtering on the global optimal feed rate sequence and reconstruct it with the tool position coordinates into a CNC machining program containing dynamic feed instructions.
2. The method as described in claim 1, characterized in that, The instantaneous mechanics and energy consumption model described in S1 specifically includes: An analytical relationship between the maximum instantaneous chip thickness and process parameters is established based on the sinusoidal chip thickness law, and an expression for the peak instantaneous cutting force is established based on the mechanical model. Establish feed rate Energy consumption per unit length expression: in This refers to standby power. This is the energy consumption constant term for effective cutting; Based on the feed rate Based on the expression for energy consumption per unit length, it is derived that energy consumption per unit length decreases as the feed rate increases.
3. The method as described in claim 1, characterized in that, The physical residuals mentioned in S2 include: experimental domain physical residuals. and global physical residual ; The composite function that includes data error and physical residual The expression is: in Due to data error, W This is the weight matrix of the physical information neural network. b This is the bias vector of the physical information neural network. The weighting coefficients for the physical residuals in the experimental domain. The weighting coefficients for the global physical residuals; The specific cutting energy Defined as trainable parameters in the physical information neural network During backpropagation, the network weights and biases are updated synchronously and automatically converge to the true specific cutting energy value under the current tool wear state and workpiece material properties.
4. The method as described in claim 1, characterized in that, The specific process of S3 is as follows: Geometric analysis is performed on the original CNC machining program to extract motion commands containing geometric information, and discrete coordinate points are reconstructed into continuous parametric geometric curves. P ; The parameterized geometric curve P Discretize the tool position points into a series of ordered tool position points to obtain the three-dimensional spatial coordinates of the k-th tool position point in the workpiece coordinate system. ; in , This refers to the instantaneous absolute position of the tool's central axis relative to the workpiece coordinate system in the horizontal plane. This is the absolute axial height of the tool bottom surface in the workpiece coordinate system; Z-Map model initialization: The XY plane containing the workpiece coordinate system is divided into segments with a resolution of [missing information]. A two-dimensional grid, with each grid node Define a state variable This indicates the current highest Z-coordinate of the workpiece surface at that location; initially, Initial values are assigned based on the geometric dimensions of the original workpiece; Determine the tool projection domain : in For the tool radius, For grid nodes The center coordinates; Extracting instantaneous cutting depth : Traversing the tool projection domain Calculate the workpiece surface height for all mesh nodes within the area. and The maximum difference between them is used as the instantaneous cutting depth at the current tool position. : Extracting instantaneous cutting width : Based on tool projection domain Calculate the wrap angle between the tool side edge and the machined surface based on the grid distribution boundary where effective material interference occurs. Then, the instantaneous radial cutting width can be solved. : Where D is the diameter of the cutting tool; State feature matrix generation: Based on the instantaneous cutting depth and the instantaneous cutting width Generate a state feature vector S containing N tool positions: Where P represents the three-dimensional spatial position coordinate vector of the tool position point in the workpiece coordinate system.
5. The method as described in claim 4, characterized in that, The virtual material removal simulation based on the Z-Map model described in S3 includes: Simulates the material stripping effect caused by cutting, based on the tool projection domain of the current tool height. The grid elevation within the area is iteratively updated as the initial environmental state for calculating the next cut location. : in This represents the initial environmental state at the current tool position.
6. The method as described in claim 4, characterized in that, The process of reconstructing discrete coordinate points into continuous parametric geometric curves P include: Extract discrete coordinate points from the original program and reconstruct them into continuous parametric geometric curves. P ; For the line segment instruction, construct the line segment starting from the line segment origin. and the endpoint of the straight segment Linear parametric equations for endpoints: in u For normalized curve parameters, ;when u When =0, , corresponding to the starting point of the straight line segment; when u When =1, , corresponds to the endpoint of the straight line segment; when hour, This indicates the midpoint on the line connecting the starting point and the ending point. For the arc segment command, extract the center coordinates. C With radius R Constructing with the central angle Parametric equations of circular arcs with variables: in T Indicates matrix transpose; , Indicates the starting angle of the arc segment. Indicates the termination angle of the arc segment; The parameterized geometric curve P Discretization into a series of ordered tool points includes: The reconstructed continuous parameterized geometric curve P Sampling is performed to generate a discrete tool position sequence for solving physical features; For straight segments, the curvature is 0, and a constant, relatively large reference step size is used. Perform equidistant sampling; For curved sections, based on the preset maximum running bow height error and the local radius of curvature of the current trajectory Dynamically calculate and adaptively adjust the sampling step size : 。 7. The method as described in claim 1, characterized in that, The local optimization function with feed rate boundary penalty term described in S4 is: in Let the local optimization objective function be the one at the k-th cutter position. This indicates that in S2, the feed rate is... The forward predicted cutting force is output in real time; This indicates the system's safe cutting force threshold; To penalize the weighting coefficient, when When the physical limit is exceeded, the loss function value will increase sharply, forcing the optimization direction to return to the feasible region; This is a boundary penalty term that constrains the feed rate within the machine tool's operating range.
8. The method as described in claim 1, characterized in that, The hot start strategy described in S5 includes: For the first tool position point on the tool path, the constant feed rate in the original CNC machining program is used as the initial value for gradient descent optimization; For each subsequent tool position, the optimal feed rate that has been solved and converged at the previous adjacent tool position is directly used as the initial value for gradient descent optimization at the current tool position. The automatic differential gradient descent algorithm includes: The local optimization function Regarding control variables gradient It can be obtained analytically using the chain rule: Among them, control variables Let be the feed rate at the k-th tool position point. This is the output of the forward inference of the Physical Information Neural Network (PINN). For physical information neural networks to input The partial derivatives, This indicates the system's safe cutting force threshold; Let n be the known state feature vector at the k-th tool position point, and n be the machine tool spindle speed. Let be the instantaneous cutting depth at the k-th tool position point. Instantaneous cutting width at the kth tool position point; The feed rate is updated iteratively using the gradient descent method. The update formula for the t-th iteration is: in The learning rate; By traversing all N tool positions, the optimization solution is completed, and the globally optimal feed rate sequence is obtained. .