Optimization method, system and device for metal component CNC machining
By employing inverse dynamics decoupling and three-dimensional compliance mapping techniques, the problems of frictional singularity and digital filtering delay during axis commutation in the servo system were solved, thereby improving the stability and accuracy of the servo system and avoiding interference from high-frequency noise to servo control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANCHANG ZHENWEI PRECISION TECH CO LTD
- Filing Date
- 2026-05-06
- Publication Date
- 2026-06-26
AI Technical Summary
Existing technologies suffer from problems such as abrupt changes in shaft commutation friction triggering computational singularities during servo mechanical decoupling, closed-loop phase lag and high-frequency noise amplification caused by digital filtering forward compensation, and servo jitter caused by the full injection of electrical background noise into the position control loop due to the deterioration of the signal-to-noise ratio during the finishing stage.
By synchronously acquiring feed axis status data and spindle speed, and combining inverse dynamics equations to extract cutting force vectors, smoothing and phase compensation operations are performed to obtain effective cutting force space vectors. In the three-dimensional workspace, an interpolation algorithm is used to obtain the compliance matrix, generate the final feedforward compensation vector, and superimpose it onto the original command position.
This solution resolves the frictional singularity interference during axis commutation in the servo system, reduces the group delay effect of the digital filter, improves the stability and accuracy of the servo system, and avoids high-frequency noise contamination of servo control.
Smart Images

Figure CN122284497A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of CNC machining control technology, specifically to optimization methods, systems, and equipment for CNC machining of metal parts. Background Technology
[0002] The aerospace and automotive manufacturing industries require the machining of high-precision metal structural components. During the cutting process, the forces between the tool and the material force the machine tool spindle and transmission components to elastically yield. This microscopic deformation directly reflects dimensional deviations in the workpiece. The CNC system must sense this stress state in real time and adjust the tool feed position coordinates in advance based on the magnitude of the force. Trajectory compensation based on mechanical observation has become a fundamental aspect of high-end CNC equipment meeting the requirements of precision manufacturing.
[0003] Current CNC trajectory compensation typically relies on data acquisition within the servo motor. This system directly reads the actual torque current of the driver to assess the force state. This solution eliminates the need for external force sensors, significantly reducing hardware costs. The machine tool's structural layout remains intact. By utilizing conventional mechanical dynamics equations to perform basic mechanical transformations on the current data, the system can obtain a general trend in contour deformation during large-mass removal machining.
[0004] The aforementioned current decoupling mechanism has a solution boundary during feed axis reversal. The frictional force conversion at the zero-crossing point of the feed axis velocity exhibits strong nonlinear characteristics. Conventional dynamic models are prone to triggering computational singularities under these conditions, leading to sudden numerical spikes in the extracted force signal. The extracted raw signal is mixed with electrical harmonics and must undergo digital low-pass filtering, which inevitably causes physical group delay in the time dimension. If the system attempts to use conventional numerical difference for time-domain forwarding, the quantization error of the underlying discrete sampling will be rapidly amplified, evolving into destructive system oscillation noise. Furthermore, after machining enters the micro-cutting stage, the cutting resistance decreases sharply. Existing technologies lack a mechanism to define signal-to-noise degradation. The weak cutting signal is completely masked by the driver's background noise. The system treats these background noises as mechanical compensation quantities and injects them in full into the position control loop, causing the servo motor to generate high-frequency micro-jitter, directly deteriorating the physical morphology of the finished surface. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a method, system, and equipment for optimizing CNC machining of metal parts. It solves the technical problems in existing technologies, such as the triggering of computational singularities due to sudden frictional changes during axis reversal in servo mechanical decoupling, closed-loop phase lag and high-frequency noise amplification caused by digital filtering forward compensation, and servo jitter caused by the full injection of electrical background noise into the position control loop due to the deterioration of the signal-to-noise ratio during the finishing stage.
[0006] To achieve the above objectives, the present invention provides the following technical solution: an optimized CNC machining method for metal parts, comprising the following steps: Simultaneously collect status data of each feed axis and the actual spindle speed; The original cutting force vectors of each feed axis are extracted from the state data by combining the inverse dynamics equations; The original cutting force vector is smoothed and phase-compensated using the actual spindle speed to obtain an effective cutting force space vector. Based on the actual encoder position in the state data, the absolute mechanical coordinates of the machine tool are obtained, and an interpolation algorithm is performed in the three-dimensional workspace compliance tensor grid to obtain the transient spatial compliance matrix. The final feedforward compensation vector is generated by combining the effective cutting force space vector with the transient spatial compliance matrix, and then superimposed onto the original command position.
[0007] Preferably, the synchronous acquisition of status data of each feed axis and the actual spindle speed includes: The multi-axis servo driver is controlled to drive the servo motor to run along a preset no-load test trajectory. During the operation of the preset no-load test trajectory, the actual torque current of each feed axis is extracted and the electrical noise floor variance is calculated according to the set position interpolation cycle. After the machine tool cutting process enters a steady state, the original command position, encoder actual position, actual feed speed, actual feed acceleration, and actual torque current are extracted synchronously in each position interpolation cycle as the state data, and the actual spindle speed fed back by the spindle encoder is extracted synchronously.
[0008] Preferably, the extraction of the original cutting force vector for each feed axis from the state data using the inverse dynamics equation includes: Based on the equivalent mechanical mass, actual feed acceleration, actual feed speed, viscous damping coefficient and nonlinear friction force, an inverse dynamic equilibrium equation is constructed to calculate the inherent impedance resistance of the electromechanical system of each feed axis; The total electromagnetic driving force is calculated from the actual torque current using the thrust constant of the servo motor. The original cutting force of each feed axis is obtained by subtracting the inherent impedance of the electromechanical system from the total electromagnetic driving force. The original cutting force components of each feed axis are combined into the original cutting force vector of the current position interpolation cycle.
[0009] Preferably, the step of performing smoothing and phase compensation calculations on the original cutting force vector using the actual spindle rotation speed to obtain an effective cutting force space vector includes: The tooth passing frequency is calculated based on the preset number of cutter teeth and the actual spindle speed. The cutoff frequency of the low-pass filter is adjusted based on the frequency of the cutting teeth, and the original input cutting force vector is smoothed to obtain a smoothed cutting force vector. The smooth cutting force vector is input into a nonlinear tracking differentiator to extract the smooth differential signal; The smoothed cutting force vector and the smoothed differential signal are subjected to a first-order Taylor expansion operation in combination with the group delay time constant of the low-pass filter, and the effective cutting force space vector that is aligned with the interpolation period of the current position in the time domain is output.
[0010] Preferably, the step of obtaining the absolute mechanical coordinates of the machine tool based on the actual encoder position in the state data, and performing an interpolation algorithm in the three-dimensional workspace compliance tensor mesh to obtain the transient spatial compliance matrix includes: Obtain a pre-established three-dimensional workspace compliance tensor mesh containing multiple three-dimensional physical coordinate nodes and their corresponding third-order tensor matrices; The absolute mechanical coordinates of the tool tip at the current moment are calculated based on the actual encoder positions of each feed axis. Extract the coordinate values of adjacent grid nodes that enclose the current absolute mechanical coordinates and the corresponding flexibility matrix elements from the three-dimensional workspace flexibility tensor grid; The mechanical mapping relationship between the coordinate values and the elements of the compliance matrix is fitted using a smoothing basis function, and the transient spatial compliance matrix corresponding to the current absolute mechanical coordinates is output.
[0011] Preferably, the step of combining the effective cutting force space vector with the transient spatial compliance matrix to generate the final feedforward compensation vector, and superimposing the final feedforward compensation vector onto the original command position, includes: The effective cutting force space vector is multiplied by the transient spatial compliance matrix to obtain the theoretical spatial deflection vector of the tool tip; The variance of the cutting force is calculated in real time for the effective cutting force sequence corresponding to each feed axis within the set sliding time window; The dynamic confidence weight is calculated by combining the calculated electrical noise floor variance and the cutting force variance. The dynamic confidence weights are used to perform scalar scaling correction on each single-axis component of the theoretical spatial deflection vector of the blade tip to obtain the actual feedforward compensation vector; After the CNC interpolator generates the original position command for the next position interpolation cycle, and before the original position command is input to the servo position closed-loop controller, the actual feedforward compensation vector is subtracted from the original position command.
[0012] Preferably, the step of constructing inverse dynamic equilibrium equations based on equivalent mechanical mass, actual feed acceleration, actual feed speed, viscous damping coefficient, and nonlinear friction force to calculate the inherent impedance resistance of the electromechanical system for each feed axis includes: Set the speed threshold to cross zero; Determine the numerical relationship between the absolute value of the actual feed rate and the zero-crossing threshold. When the absolute value of the actual feed rate is greater than or equal to the zero-crossing threshold, the nonlinear friction force of the current position interpolation cycle is calculated using a full-order nonlinear friction model. When the absolute value of the actual feed rate is less than the speed zero-crossing threshold, the update operation of the friction state is frozen, and the friction boundary value corresponding to the time node that last met the condition of being greater than or equal to the speed zero-crossing threshold before entering the reversal dead zone is assigned as the nonlinear friction force of the current position interpolation cycle. Substitute the nonlinear frictional force into the inverse dynamic equilibrium equation to calculate the inherent impedance resistance of the electromechanical system for each feed axis.
[0013] Preferably, the calculation of dynamic confidence weights by combining the calculated electrical noise floor variance and the cutting force variance includes: Set a sliding time window that includes a preset number of position interpolation cycles; Extract the preset zero-prevention normals and sensitivity adjustment coefficients; Calculate the ratio of the cutting force variance to the product of the sensitivity adjustment coefficient and the electrical noise floor variance, plus the zero-removal normal number; Perform natural exponentiation on the negative of the ratio to obtain the exponent term; The dynamic confidence weight is a constant 1 minus the exponential term.
[0014] This invention also provides a CNC machining optimization system for metal parts, comprising: The high-frequency data acquisition module is used to synchronously acquire the status data of each feed axis and the actual spindle speed; The inverse dynamics decoupling module is used to extract the original cutting force vectors of each feed axis from the state data by combining the inverse dynamics equations; The filtering and prediction module is used to perform smoothing and phase compensation operations on the original cutting force vector using the actual spindle speed to obtain an effective cutting force space vector. The spatial compliance mapping module is used to obtain the absolute mechanical coordinates of the machine tool based on the actual position of the encoder in the state data, and to perform an interpolation algorithm in the three-dimensional workspace compliance tensor grid to obtain the transient spatial compliance matrix. The confidence compensation feedforward module is used to combine the effective cutting force space vector with the transient spatial compliance matrix to generate the final feedforward compensation vector, and to superimpose the final feedforward compensation vector onto the original command position.
[0015] The present invention also provides a computer device, including: a processor and a memory, wherein the memory stores a computer program executable by the processor, and the computer program performs the method described above when executed by the processor.
[0016] The present invention also provides a storage medium storing a computer program, which is executed by a processor to perform the method described above.
[0017] This invention provides an optimized method, system, and equipment for CNC machining of metal parts. It offers the following advantages: 1. This invention employs a speed dead zone masking strategy combined with inverse dynamics equations. By setting a speed zero-crossing threshold, the system stops updating the friction force state when the feed axis enters the commutation dead zone, maintaining the friction force boundary value before entering the dead zone for calculation. This achieves the technical effect of stably stripping the inherent impedance of the electromechanical system at the servo level and continuously extracting the cutting force. Compared to the existing technology that directly substitutes a nonlinear friction model for mechanical decoupling, this invention solves the problem of friction force numerical spikes easily generated when mechanical components commutate across quadrants, leading to singularities in the decoupling model and interfering with cutting force extraction.
[0018] 2. This invention employs a dynamic frequency band filtering combined with a nonlinear tracking differentiator and Taylor series forward operation. The system adjusts the filter cutoff frequency according to the actual spindle speed, extracts the signal change rate using an integral tracking mechanism, and finally performs a first-order Taylor expansion in conjunction with the group delay parameter. This achieves the technical effect of effectively filtering out high-frequency interference and strictly aligning the position interpolation period-time phase. Compared with existing technologies that rely on fixed-frequency low-pass filtering and conventional numerical differential operators, this invention overcomes the shortcomings of the latter, which inevitably leads to closed-loop phase lag due to the characteristics of digital filtering, and the tendency of direct discrete differential to severely amplify digital quantization noise.
[0019] 3. This invention employs a technical solution that evaluates the variance of the cutting force sequence and the variance of the offline electrical noise floor to construct dynamic confidence weights. It utilizes a natural exponential model to generate single-axis scalar weights, scaling and correcting the theoretical tool tip deflection. This achieves the technical effect of smoothly degrading feedforward compensation commands during the small cutting allowance stage. Compared to existing technologies that inject the fully calculated theoretical deformation into the position loop throughout the entire process, this invention overcomes the shortcomings of existing technologies that easily confuse weak cutting signals with electrical background noise in the finishing area, causing high-frequency noise to contaminate the servo control chain and induce micro-oscillations in the machine tool. Attached Figure Description
[0020] Figure 1 This is a schematic diagram of the architecture of the optimized CNC machining equipment and system for metal parts according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the method flow according to an embodiment of the present invention; Figure 3 This is a timing diagram of the high-frequency multi-source data synchronous acquisition logic in an embodiment of the present invention; Figure 4 This is a flowchart of the inverse dynamics decoupling and velocity dead zone masking strategy according to an embodiment of the present invention; Figure 5 This is a flowchart illustrating the dynamic directional filtering and robust differential phase compensation in an embodiment of the present invention. Figure 6 This is a schematic diagram of the spatial compliance matrix interpolation and thermodynamic decoupling logic in an embodiment of the present invention. Figure 7 This is a schematic diagram of the signal-to-noise ratio confidence assessment and trajectory feedforward superposition logic in an embodiment of the present invention; Figure 8 The following is a time-series comparison diagram of the actual torque current of the feed axis and the extracted effective cutting force in an embodiment of the present invention, wherein (a) is the waveform of the actual torque current of the servo motor, and (b) is the waveform of the effective cutting force extracted after impedance stripping and filtering. Figure 9 The graph shows a comparison between the theoretical spatial deflection vector and the actual feedforward compensation vector of the cutting edge in an embodiment of the present invention. (a) is the curve of the theoretical spatial deflection vector of the cutting edge, and (b) is the curve of the actual feedforward compensation vector after dynamic confidence weighting correction. Figure 10 This is a comparison chart of servo following errors in a CNC system according to an embodiment of the present invention.
[0021] Among them, 100 is a CNC machining optimization equipment for metal parts; 110 is a numerical control device; 120 is a servo bus; 130 is a multi-axis servo driver; 140 is a servo motor; 150 is a spindle encoder; 200 is a CNC machining optimization system for metal parts; 210 is a high-frequency data acquisition module; 220 is an inverse dynamics decoupling module; 230 is a filtering and prediction module; 240 is a spatial flexibility mapping module; and 250 is a confidence compensation feedforward module. Detailed Implementation
[0022] The technical solutions in 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.
[0023] Reference Figure 1The present invention provides a metal parts CNC machining optimization equipment 100. In the physical control architecture of this embodiment, the metal parts CNC machining optimization equipment 100 can be a complete CNC machining execution environment, which includes a CNC device 110, a servo bus 120, a multi-axis servo driver 130, a servo motor 140 and a spindle encoder 150.
[0024] The CNC device 110 establishes a communication connection with the multi-axis servo driver 130 via the servo bus 120. The electrical output terminal of the multi-axis servo driver 130 is connected to the servo motor 140. The spindle encoder 150 is mounted on the machine tool spindle. The signal output terminal of the spindle encoder 150 is connected to the CNC device 110 via the servo bus 120.
[0025] From the perspective of computer control architecture, the aforementioned numerical control device 110 (or the edge computing terminal containing the numerical control device) is the core computer device for executing the optimization method of the present invention, and it contains a processor and a memory.
[0026] The CNC device 110 is equipped with a metal parts CNC machining optimization system 200. Specifically, the metal parts CNC machining optimization system 200 is stored in the memory of the CNC device 110 in the form of a computer program or executable instructions. When the computer program or executable instructions are read and run by the processor of the CNC device 110, they are logically instantiated into the following functional modules: the metal parts CNC machining optimization system 200 may include a high-frequency data acquisition module 210, an inverse dynamics decoupling module 220, a filtering and prediction module 230, a spatial compliance mapping module 240, and a confidence compensation feedforward module 250.
[0027] The high-frequency data acquisition module 210 is used to extract the status data of the servo underlying layer according to a preset position interpolation cycle. The high-frequency data acquisition module 210 synchronously acquires the original command position, actual encoder position, actual feed speed, and actual torque current of each servo motor 140 via the servo bus 120. The high-frequency data acquisition module 210 also synchronously acquires the actual spindle speed fed back by the spindle encoder 150.
[0028] The inverse dynamics decoupling module 220 receives status data transmitted by the high-frequency data acquisition module 210. The inverse dynamics decoupling module 220 executes the inverse dynamics equations with a speed dead-zone masking strategy to calculate the inherent impedance of the electromechanical system for each feed axis. The inverse dynamics decoupling module 220 subtracts the inherent impedance of the electromechanical system from the total electromagnetic torque mapped by the actual torque current to obtain the original cutting force component for each feed axis and synthesizes the original cutting force vector.
[0029] The filtering and prediction module 230 receives the original cutting force vector and the actual spindle speed. It calculates the tooth passage frequency and performs low-pass filtering on the original cutting force vector based on this frequency to obtain a smoothed cutting force vector. The module then extracts the smoothed differential signal of the smoothed cutting force vector and performs a first-order Taylor expansion for phase compensation using the filter group delay parameter, outputting the effective cutting force space vector.
[0030] The spatial compliance mapping module 240 receives the actual encoder position transmitted by the high-frequency data acquisition module 210. Based on the actual encoder positions of each servo motor 140, the spatial compliance mapping module 240 calculates the current absolute mechanical coordinates of the machine tool. Then, in a preset three-dimensional workspace compliance tensor mesh, the spatial compliance mapping module 240 performs a three-dimensional spline interpolation algorithm in conjunction with the current absolute mechanical coordinates of the machine tool to obtain the transient spatial compliance matrix.
[0031] The confidence compensation feedforward module 250 receives the effective cutting force space vector and the transient spatial compliance matrix. It multiplies the effective cutting force space vector and the transient spatial compliance matrix to calculate the theoretical tool tip deflection vector. The module calculates the dynamic confidence weight based on the cutting force variance within the sliding time window and the calibrated electrical noise floor variance. Finally, the module generates a feedforward compensation vector using the dynamic confidence weight and the theoretical tool tip deflection vector.
[0032] Reference Figure 2 This invention provides an optimized CNC machining method for metal parts, comprising the following steps: S100 performs offline noise floor calibration and synchronously collects the status data of each feed axis and the actual spindle speed during the position interpolation cycle; S200 executes a speed dead zone masking strategy and combines inverse dynamics equations to strip away the inherent impedance resistance of the electromechanical system and extract the original cutting force vector of each feed axis; S300 calculates the tooth passing frequency based on the actual spindle speed to perform dynamic direction filtering, and uses a tracking differentiator to extract smooth differential signals to perform first-order Taylor expansion, perform phase compensation calculations, and obtain the effective cutting force space vector. S400 obtains the absolute mechanical coordinates of the machine tool based on the actual position of the encoder of each feed axis, and performs a three-dimensional spline interpolation algorithm in the three-dimensional workspace compliance tensor grid to obtain the transient spatial compliance matrix; S500 calculates the theoretical spatial deflection vector of the tool tip and generates the final feedforward compensation vector by combining it with the dynamic confidence weight calculated based on the cutting force variance. The final feedforward compensation vector is then superimposed onto the original command position.
[0033] Reference Figure 3Step S100 is mainly used to establish the basic data environment and obtain the real-time data flow direction, and specifically includes the following sub-steps: S110 performs offline noise floor calibration.
[0034] In the non-cutting state of the machine tool, the high-frequency data acquisition module 210 controls the multi-axis servo drive 130 to drive the servo motor 140 along a preset no-load test trajectory. In the actual machining environment of the machine tool, due to factors such as the high-frequency switching action of the servo drive inverter and the digital quantization of the sensors, even in the no-load state without cutting resistance, the actual torque current of the servo motor 140 will still exhibit a certain degree of high-frequency random fluctuation. In order to accurately distinguish between extremely small cutting forces and electrical background noise in the subsequent compensation algorithm, it is necessary to establish a statistical benchmark for this noise floor in advance. During this no-load operation, the high-frequency data acquisition module 210 extracts the actual torque current of each feed axis according to the set position interpolation cycle. The high-frequency data acquisition module 210 records the discrete sequence of actual torque current within a specific time window and calculates the variance of the sequence, setting this variance as the electrical noise floor variance of each feed axis. Taking a three-axis machine tool as an example, the feed axes include x, y, and z axes. For a specific feed axis i, its electrical noise floor variance is calculated as follows: ; Where N is the total number of sampling points within the time window, and its value should be sufficient to cover the low-frequency fluctuation period of electrical noise. In this embodiment, the length of the time window can usually be set between 0.5 seconds and 2 seconds, and the corresponding N value is set according to the size of the position interpolation period of the CNC device 110. N is usually selected as an integer between 500 and 2000; act,i (k) represents the actual torque current during the kth position interpolation cycle; This represents the average value of the actual torque current within the time window. The high-frequency data acquisition module 210 stores the electrical noise floor variance of each feed axis in the memory of the CNC device 110, which is used as a constant reference parameter for subsequent state confidence assessment.
[0035] S120 synchronously acquires the status data of each feed axis and the actual spindle speed during the position interpolation cycle.
[0036] After the machine tool enters a steady state during cutting, the high-frequency data acquisition module 210 synchronously extracts the underlying state variables within each position interpolation cycle t via the servo bus 120. For clock synchronization mechanisms based on industrial Ethernet buses, those skilled in the art can use distributed clock alignment mechanisms to achieve microsecond-level data synchronization extraction between nodes. The underlying message synchronization principle is a well-known technology in the field and will not be elaborated here. As a preferred approach, the extracted underlying state variables may include command parameters, feedback parameters, electrical parameters, and spindle parameters.
[0037] The instruction parameters include the sequence of original position instructions issued by the CNC device 110 to each servo motor 140. Its vector expression is: ; Feedback parameters include the actual position of the encoder. Actual feed rate Compared with actual feed acceleration Their vector expressions are as follows: ; ; ; Electrical parameters include the actual torque current output from the multi-axis servo driver 130 to the servo motor 140. Its vector expression is: ; The spindle parameters are the actual spindle speed S, which is fed back in real time by the spindle encoder 150. act (t), in the above vector expressions, the subscripts x, y, z correspond to the components of the three linear motion axes (X-axis, Y-axis, Z-axis) respectively, and t is the time variable.
[0038] S130, Execution status data flow distribution across modules.
[0039] After extracting the underlying state variables, the high-frequency data acquisition module 210 establishes a data mapping link from the physical layer to the algorithm layer based on the data type. Specifically, state data including actual feed speed, actual feed acceleration, and actual torque current are directly output to the inverse dynamics decoupling module 220 for performing the stripping calculation of the inherent impedance of the electromechanical system. Simultaneously, state data including the encoder's actual position is transmitted to the spatial compliance mapping module 240 to support the module's calculation of the current machine tool's absolute mechanical coordinates; while the actual spindle speed is transmitted to the filtering and prediction module 230. Through this distribution process, the metal parts CNC machining optimization system 200 establishes a high-frequency data stream support environment in its real-time kernel for subsequent feedforward compensation.
[0040] Reference Figure 4 Step S200 is mainly used to overcome the calculation interference caused by the sudden change in friction force when the feed axis changes direction through a quadrant, and to accurately isolate the inherent impedance of the electromechanical system to extract the original cutting force. This process specifically includes the following sub-steps: S210, construct the inverse dynamic equilibrium equation of the feed axis.
[0041] In CNC machining, the total electromagnetic driving force output by the servo motor is used not only to overcome the cutting resistance between the tool and the workpiece, but also to overcome the inertial force and frictional damping force of the machine tool's feed transmission mechanism itself. Considering the energy loss and mass distribution characteristics of the electromechanical system during motion, in order to extract the cutting force characterizing the tool's stress state from the total electromagnetic force, it is usually necessary to pre-establish the inherent impedance of each motion axis's electromechanical system. The inverse dynamics decoupling module 220 constructs the resistance F of the inherent impedance of the electromechanical system for a single feed axis i (where i∈{x,y,z}). imp,i The equation for (t): ; Among them, M i B is the equivalent mechanical mass of shaft i; i F is the viscous damping coefficient of the transmission system. fric,i (t) represents the nonlinear frictional force; A act,i (t) and V act,i (t) represents the actual feed acceleration and actual feed speed extracted in the aforementioned steps, respectively. For the identification of the equivalent mechanical mass and viscous damping coefficient, those skilled in the art can use conventional parameter identification methods based on step response or swept frequency excitation. The specific identification process is well-known in the field and will not be elaborated here.
[0042] S220 executes a speed dead zone masking strategy.
[0043] In the actual operation of a machine tool feed axis, when the direction of motion reverses, i.e., when crossing the zero point, the conversion process from static friction to dynamic friction within the system exhibits strong nonlinear characteristics. Limited by the discrete sampling frequency of the CNC system, this steep change in friction caused by the Stribeck effect is difficult to capture continuously and perfectly. If calculations are performed directly based on a conventional friction model, this zero-crossing region is prone to generating computational spikes, causing singularities in the decoupling model, which may interfere with the accurate extraction of subsequent cutting forces. To address this application boundary problem, the inverse dynamics decoupling module 220 introduces a velocity dead zone masking strategy.
[0044] Inverse dynamics decoupling module 220 sets the velocity crossing the zero threshold V th Velocity crossing the zero threshold V th The value of V is typically slightly larger than the extreme value of the steady-state velocity fluctuation of the feed axis when it is stationary. In this embodiment, V th The speed can generally be set between 0.05 mm / s and 0.2 mm / s. The inverse dynamics decoupling module 220 applies a nonlinear frictional force F based on the relationship between the absolute value of the actual feed rate and the zero-crossing threshold of that rate. fric,i Dynamic update rules for (t): When |V act,i(t)|≥V th When the feed axis is determined to be in the normal motion range, the inverse dynamics decoupling module 220 uses a full-order nonlinear friction model to calculate the nonlinear friction force of the current position interpolation cycle.
[0045] When |V act,i (t)| <V th When the feed axis is determined to have entered the reversal dead zone, the inverse dynamics decoupling module 220 freezes the friction state update calculation and executes the following assignment logic: F fric,i (t)=F fric,i (t entry ); Among them, t entry For the last time the system satisfies |V before entering the current dead zone. act,i (t)|≥V th The time point of the condition. To ensure the completeness of the algorithm logic and avoid errors caused by the system being in a static state during the initialization phase due to an undefined time point, if the machine tool has not yet experienced any movement exceeding the speed zero threshold after startup, then F... fric,i The value of (t) is initialized to zero by default. Through this masking mechanism, the system maintains the frictional boundary value before entering the dead zone during the commutation phase, avoiding mechanical singularities and maintaining the continuous state of impedance calculation.
[0046] S230, extract and synthesize the three-dimensional original cutting force vector.
[0047] After calculating the inherent impedance of the electromechanical system, the inverse dynamics decoupling module 220 uses the thrust constant of the servo motor to remove the impedance component from the actual torque current. Specifically, the inverse dynamics decoupling module 220 calculates the original cutting force F of the feed axis i. raw,i (t): F raw,i (t)=K t,i I act,i (t)-F imp,i (t); Among them, K t,i Let I be the thrust constant of the servo motor for feed axis i, where i = x, y, and z correspond to the X-axis, Y-axis, and Z-axis, respectively. In practical engineering implementations, for transmission topologies using rotary motors to drive ball screws, this thrust constant is an equivalent linear thrust coefficient calculated from the motor torque constant combined with the screw lead parameters and reduction ratio. act,i (t) represents the actual torque current.
[0048] After obtaining the original cutting force components of each of the three axes, the inverse dynamics decoupling module 220 synthesizes them into the original cutting force vector of the current position interpolation cycle. : ; As a preferred approach, the inverse dynamics decoupling module 220 calculates the original cutting force vector. The output is sent to the filtering and prediction module 230 to support subsequent phase compensation and spatial deflection calculation operations.
[0049] Reference Figure 5 Step S300 primarily addresses the closed-loop phase lag paradox caused by the group delay of the digital filter and handles the discrete noise amplification boundary problem resulting from direct differentiation operations. This step specifically includes the following sub-steps: S310 performs dynamic frequency band anchoring and low-pass filtering.
[0050] The original cutting force vector sampled at the bottom layer of CNC machining typically contains high-frequency harmonics from the servo driver's pulse width modulation and interference noise generated by machine tool structural vibration. Conventional fixed cutoff frequency filters are not easy to maintain ideal filtering performance when facing machining conditions where the spindle speed changes constantly. The filtering and prediction module 230 obtains the current actual spindle speed S. act (t), combined with the preset number of tool teeth Z t Calculate the frequency f of the cutting teeth. bpf The cutting tooth's frequency characterization reflects the primary mechanical characteristic frequency band generated by the periodic entry of the cutting edge into the workpiece. The specific calculation formula is as follows: f bpf =(S act (t)×Z t ) / 60; Among them, S act (t) represents the actual spindle speed during the current position interpolation cycle, and its physical unit is set to revolutions per minute (r / min); Z t The preset number of tool teeth is used; a constant 60 is used to convert the minute-scale time to seconds to ensure that the output frequency is in standard Hertz (Hz). After obtaining the tool tooth passage frequency, the filtering and prediction module 230 uses it as a dynamic anchoring reference to adjust the cutoff frequency of the low-pass filter in real time. In this embodiment, to balance the preservation of the effective cutting force signal and the suppression of high-frequency noise, the cutoff frequency is typically set between 1.5 and 3 times the tool tooth passage frequency. The filtering and prediction module 230 uses this low-pass filter to process the input raw cutting force vector. Perform smoothing calculations to obtain the smoothed cutting force vector after filtering out high-frequency harmonics. Limited by the physical characteristics of causal digital filters, this smoothing cutting force vector... A group delay T will be generated on the time axis. d .
[0051] The S320 uses a nonlinear tracking differentiator to extract smoothed differential signals.
[0052] To address the control closed-loop phase lag caused by the aforementioned group delay, the system introduces a rate-of-change extraction mechanism for time-dimension forward compensation. In discrete digital systems, directly using conventional difference operators such as backward difference for numerical differentiation calculations can easily amplify the quantization noise introduced by discrete sampling, potentially leading to numerical divergence in the subsequent feedforward compensation system. To overcome this boundary problem in engineering applications, the filtering and prediction module 230 introduces a nonlinear tracking differentiator to smooth the cutting force vector. Process it.
[0053] The core physical principle of the nonlinear tracking differentiator lies in constructing a dynamic integral system containing a fast convergence stage. By integrating and tracking the input signal, it replaces direct numerical difference operations, thereby fundamentally cutting off the amplification path of high-frequency discrete noise. For the specific construction of its discretized state-space model, those skilled in the art can adopt a conventional structure based on the fastest discrete control synthesis function. Its convergence determination and step-size discretization calculation are well-known techniques in the field and will not be elaborated upon here. As a preferred approach, the filtering and prediction module 230 smooths the cutting force vector. The input is fed into this nonlinear tracking differentiator, where, through its internal integrator and nonlinear feedback adjustment mechanism, a smooth differential signal characterizing the trend of force vector change is safely extracted while suppressing the amplification of minute high-frequency noise. .
[0054] S330 performs a first-order Taylor expansion to perform phase compensation calculations.
[0055] After acquiring the smoothed differential signal, the filtering and prediction module 230, in conjunction with the group delay parameter present in the low-pass filter stage, performs time-domain forward calculation of the hysteresis force vector. This calculation logic is based on the first-order Taylor series expansion principle, utilizing the current state of the physical quantities and their derivatives to approximately reconstruct the original signal distribution before the delay on the time axis, thereby offsetting the inherent time delay of the digital filter. : ; Among them, T d This refers to the group delay of the low-pass filter. In specific implementations, this group delay can be pre-calibrated by averaging the amplitude-frequency group delay characteristic curve of the selected low-pass filter within the passband, or it can be approximately estimated based on the order of the digital filter and the system's discrete sampling period. Through this phase compensation operation, the filtering and prediction module 230 outputs an effective cutting force space vector aligned with the interpolation period of the current position in the time domain, without adding external physical sensors. This effective cutting force space vector will be passed to subsequent space mapping modules and used as the core reference data for calculating tool space deflection deformation.
[0056] Reference Figure 6 Step S400 is mainly used to map the nonlinear stiffness characteristics within the machine tool's working area and to distinguish the application boundaries of thermal drift phenomena during long-term machining. This process specifically includes the following sub-steps: S410, load the preset 3D workspace flexibility tensor mesh.
[0057] The stiffness of a machine tool is not constant at different workspace locations. From a mechanical structure perspective, as the feed axis moves, the overhang length of the spindle box, the point of force application of the ball screw, and the overlapping area of the guide rail slider all change. This results in the structural stiffness of the machine tool tip exhibiting a spatially nonlinear distribution characteristic. Before system operation, it is necessary to establish the mechanical benchmark of the entire machining area through offline stiffness calibration methods (such as finite element simulation analysis combined with actual measurement using a mesh force gauge). The spatial compliance mapping module 240 internally contains a three-dimensional workspace compliance tensor mesh of the machine tool [C]. grid The data structure of this three-dimensional workspace compliance tensor mesh discretizes the effective three-dimensional stroke of the machine tool into a finite number of three-dimensional physical coordinate nodes, and assigns a corresponding third-order tensor matrix to each three-dimensional physical coordinate node. This third-order tensor matrix records the proportional relationship of the microscopic elastic displacement generated in each direction when the corresponding three-dimensional physical coordinate node is subjected to external forces in three orthogonal directions.
[0058] S420 executes a three-dimensional spline interpolation algorithm to obtain the transient spatial compliance matrix.
[0059] After the machine tool enters the real-time cutting cycle, the spatial compliance mapping module 240 receives the actual encoder position transmitted from the high-frequency data acquisition module 210. Based on this, the absolute mechanical coordinates of the tool tip at the current moment are calculated. Since the actual machining trajectory is generated by CNC interpolation, it rarely coincides exactly with the offline calibrated mesh nodes. To ensure the continuity of the local mechanical mapping, the spatial compliance mapping module 240 uses the three-dimensional workspace compliance tensor mesh [C]. grid The algorithm combines the current absolute mechanical coordinates to perform a three-dimensional spline interpolation.
[0060] In practical implementation, the spatial compliance mapping module 240 uses the current absolute mechanical coordinates as a reference, extracts the coordinate values of the eight adjacent grid nodes surrounding these absolute mechanical coordinates and their corresponding compliance matrix elements, and fits the current mechanical mapping relationship using a smoothing basis function. To avoid boundary overflow and numerical divergence in the interpolation algorithm when the machine tool reaches the physical travel limit region, the spatial compliance mapping module 240 incorporates boundary limiting logic during this process: when the current absolute mechanical coordinates are detected to exceed the grid edge, the tensor data of the nearest edge node is directly called for clamping output. After the above processing, the system outputs the transient spatial compliance matrix. : ; in, Indicates the actual position of the encoder At the point where the cross compliance coefficient, i,j∈{x,y,z}, is generated due to the elastic deformation of the tool tip along the i-axis caused by the unit cutting force along the j-axis, its physical dimension is usually set to millimeters / Newtons (mm / N) or micrometers / Newtons (μm / N), and must be consistent with the dimension system of the cutting force. For the selection of mesh nodes and the setting of boundary conditions for the smoothing basis function in the three-dimensional spline interpolation algorithm, those skilled in the art can use conventional spatial surface approximation theories such as cubic B-splines to achieve this. The calculation process is well-known in this field and will not be elaborated here.
[0061] S430 defines the thermodynamic drift boundary and performs frequency domain decoupling.
[0062] When a machine tool undergoes prolonged heavy-load cutting operations, the thermodynamic drift of the machine tool structure caused by spindle cutting heat and guideway friction heat gradually alters the origin of the absolute coordinate system of the machine tool body. This thermal deformation is a macroscopically gradual error; if it is mixed into the mechanical deformation calculation, it will affect the consistency of the mapping relationship in the transient spatial compliance matrix. To ensure the applicability of the constructed feedforward compensation mechanism, the spatial compliance mapping module 240 defines the physical boundaries of the algorithm's operation through a frequency domain decoupling mechanism.
[0063] Specifically, the dynamic deformation induced by cutting forces occurs within millisecond-level position interpolation cycles, exhibiting high-frequency alternating characteristics; while the accumulation period of thermodynamic drift typically ranges from several minutes to tens of minutes. Under this mechanism, the transient spatial compliance matrix generated based on interpolation is only used to characterize the transient elastic-dynamic compliance of the machine tool body. The slowly accumulating thermal elongation error of the machine tool is monitored by an independent external thermal compensation module, which performs a reference coordinate drift zeroing operation on a minute-level time cycle. As a preferred approach, the algorithm logic of this invention focuses on handling the high-frequency dynamic structural deformation induced by alternating cutting forces. By physically separating the low-frequency, slowly varying thermodynamic drift from the high-frequency dynamic cutting force deformation in the frequency domain, the data reliability of compensation calculations in long-cycle machining is maintained.
[0064] Reference Figure 7 Step S500 is mainly used to address the noise floor interference problem during the finishing process and to implement the execution timing of the final instruction correction. This process specifically includes the following sub-steps: S510 calculates the theoretical spatial deflection vector of the tool tip.
[0065] In actual machine tool machining, the micro-elastic deformation of structural components such as the machine tool spindle, cutting tool, and feed transmission mechanism accumulates continuously due to the reaction force of the cutting force. This causes the actual spatial position of the cutting point to deviate from the ideal command position issued by the CNC system. Based on the generalized Hooke's law in multidimensional space, the confidence compensation feedforward module 250 receives the transient spatial compliance matrix output by the spatial compliance mapping module 240, and the zero-phase effective cutting force space vector output by the filtering and prediction module 230. Combining the stiffness-deformation relationship in linear elasticity, the confidence compensation feedforward module 250 calculates the spatial elastic deformation of the tool cutting point under the current state due to the force through matrix-vector multiplication, i.e., the theoretical spatial deflection vector of the tool tip. : ; In the above formula, the dimension of the effective cutting force space vector is Newton (N), the dimension of the transient spatial compliance matrix elements is millimeters per Newton (mm / N), and the dimension of the tool tip theoretical spatial deflection vector output by the matrix operation is the standard spatial displacement dimension millimeters (mm). This tool tip theoretical spatial deflection vector includes deformation components in three orthogonal directions, i.e. .
[0066] S520 evaluates dynamic confidence weights and constructs a mechanism to compensate for smooth degradation of actions.
[0067] In the finishing stage of CNC machining, as the depth of cut decreases, the actual cutting force signal generated between the tool and the workpiece weakens accordingly, sometimes even dropping to the same order of magnitude as the electrical background noise of the servo drive system. Under this condition, if the extracted force vector containing the noise floor is used for full compensation, high-frequency electrical noise may be injected back into the position loop of the CNC system, thereby causing micro-high-frequency oscillations of the servo motor and affecting the surface quality of the workpiece. To address this application boundary problem, the confidence compensation feedforward module 250 introduces a dynamic confidence assessment mechanism based on the signal-to-noise ratio.
[0068] The confidence compensation feedforward module 250 sets a sliding time window of length M. As a preferred approach, considering the millisecond-level interpolation cycle of the CNC system, M is typically set to 20 to 100 position interpolation cycles to ensure the validity of the statistical sample. The system calculates the variance of the cutting force for the effective cutting force sequence corresponding to each feed axis i within this sliding time window in real time. Combined with the electrical noise floor variance calibrated offline in step S100. The confidence compensation feedforward module 250 calculates the dynamic confidence weight W of feed axis i. i (t): ; Wherein, λ is a preset sensitivity adjustment coefficient used to balance the background noise suppression capability and the sensitivity of weak force perception. In this embodiment, the coefficient is usually taken as 1.5 to 5.0. The system is preset with a zero-prevention normal number (e.g., set to 10). -6 This is primarily used to ensure the robustness of numerical calculations and avoid division-by-zero anomalies caused by the electrical noise floor variance being exactly zero. According to this exponential weighting function, when the cutting force variance is greater than the electrical noise floor, W... i When (t) approaches 1, the system maintains the expected normal compensation action; when the cutting force variance is close to or even less than the noise floor variance, W i (t) will decay smoothly and approach 0. Through this signal-to-noise ratio evaluation, the feedforward compensation action achieves smooth degradation in the small depth of cut region or during the idle process, avoiding control command abrupt changes due to cut-in or cut-out.
[0069] S530 executes the correction and interpolation instruction injection for the feedforward compensation vector.
[0070] The confidence compensation feedforward module 250 utilizes the calculated dynamic confidence weight W i (t), the theoretical space deflection vector of the knife tip Each single-axis component is scalar scaled and corrected: ΔP comp,i (t)=W i (t)×ΔP ideal,i (t); Where the subscript i∈{x,y,z}, ΔP ideal,i (t) represents the magnitude of the theoretical deflection vector component on a single axis, ΔP comp,i (t) represents the single-axis compensation component that each feed axis actually needs to issue.
[0071] After completing the independent corrections for each axis, the system combines these three single-axis compensation components into a complete three-dimensional actual feedforward compensation vector. This offset is then injected into the interpolation command data stream of the CNC device 110 as a position offset.
[0072] In terms of specific execution timing, the confidence compensation feedforward module 250 generates the original position command for the next position interpolation cycle t+1 in the CNC interpolator. Then, and before the original position command is input to the servo position closed-loop controller, a reverse superposition operation is performed: ; in, The position command is issued after force deformation compensation correction. Since cutting forces typically force the tool tip to elastically recoil away from the workpiece, subtracting this position offset from the original position command is essentially equivalent to implementing reverse spatial position compensation in the CNC system. This causes the servo motor to drive the tool to advance an equal distance towards the workpiece to counteract the elastic recoil. Through the above-mentioned low-level superposition calculations, the system achieves a control closed loop from sensorless mechanical sensing and transient stiffness mapping to final motion trajectory correction.
[0073] The present invention also provides a computer device, including: a processor and a memory, wherein the memory stores a computer program executable by the processor, and the computer program performs the method described above when executed by the processor.
[0074] The present invention also provides a storage medium storing a computer program, which is executed by a processor to perform the method described above.
[0075] The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0076] To further illustrate the collaborative working process of the technical solution described in this invention, a typical milling scenario for a metal cavity part will be used for explanation. In this example, the machine tool executes a complete machining trajectory that includes idle tool entry, steady-state full-cut, and micro-deep finishing tool retraction.
[0077] like Figure 8 As shown, Figure 8 The upper curve (a) shows the current waveform of the actual torque current of a single-axis (e.g., x-axis) servo motor 140, acquired by the high-frequency data acquisition module 210 according to the position interpolation cycle. In the initial machining stage (0 to 1 second interval), the machine tool is in the idle feed stage, and the tool has not yet contacted the workpiece. At this time, the actual torque current contains current fluctuations caused by guide rail friction and machine tool commutation inertia. When the feed axis undergoes quadrant commutation, the system triggers a speed dead zone masking strategy to maintain the friction boundary value in the commutation interval, avoiding numerical calculation spikes during current analysis. After entering the steady-state full-cut stage (1 to 4 seconds interval), the actual torque current increases significantly and is accompanied by high-frequency pulse width modulation electrical noise. After the inverse dynamics decoupling module 220 removes the inherent impedance of the electromechanical system, and the filtering and prediction module 230 performs dynamic low-pass filtering and first-order Taylor phase compensation, the output is... Figure 8 The effective cutting force is shown in the lower curve (b). This effective cutting force eliminates the interference of electrical background noise and mechanical impedance, reflects the periodic mechanical characteristics of the cutter teeth at the moment of entry into the workpiece, and is strictly aligned with the current interpolation cycle in time phase.
[0078] like Figure 9 As shown, after the system obtains the effective cutting force, the spatial compliance mapping module 240 performs interpolation calculations in real time in the preset three-dimensional workspace compliance tensor grid based on the current absolute mechanical coordinates of the machine tool, and outputs the transient spatial compliance matrix. Figure 9 The upper curve (a) represents the theoretical spatial deflection component of the tool tip, obtained by multiplying the effective cutting force by the compliance matrix. At the end of the machining trajectory (between 4 and 6 seconds), the program enters the finishing stage with minimal depth of cut, and the actual physical cutting force decreases. At this point, the upper theoretical deflection curve, limited by the accuracy of the underlying analog signal acquisition, begins to exhibit disordered high-frequency fluctuations on the same order of magnitude as the electrical noise floor.
[0079] For this application scenario, the sliding time window mechanism of the confidence compensation feedforward module 250 intervenes. The system calculates that the cutting force variance gradually approaches the offline calibrated electrical noise floor variance, and the dynamic confidence weight begins to smoothly transition from 1 to 0. After scalar scaling correction of this weight value, the system generates... Figure 9The actual feedforward compensation vector is shown in the lower curve (b). Comparing the two sets of curves, it can be seen that in the stage where the depth of cut is extremely small and the signal-to-noise ratio deteriorates, the actual feedforward compensation command does not blindly follow the high-frequency noise to output the full amount, but achieves smooth degradation of the compensation action, ensuring the smoothness of the 130 position command sent to the multi-axis servo drive.
[0080] like Figure 10 As shown, the following error is the dynamic difference between the original command position of the CNC device 110 and the actual position of the encoder, which is an intuitive physical quantity for measuring the machining accuracy of the machine tool contour. Figure 10 The dotted lines represent the conventional machining tracking error when the CNC machining optimization system for metal parts is not enabled (200). During the steady-state stress phase, the cutting force forces the machine tool structure to elastically yield. Due to the lack of mechanical feedforward sensing, the tracking error of the servo system under conventional control increases and baseline offset occurs.
[0081] Figure 10 The solid line represents the optimized machining following error after implementing the feedforward compensation strategy of this invention. The confidence compensation feedforward module 250 superimposes the calculated actual feedforward compensation vector into the original position command of the next cycle at each position interpolation cycle. Through this underlying spatial position offset, the servo motor 140 drives the tool to advance a corresponding distance towards the workpiece side in advance, thereby physically offsetting the elastic yield deformation. The solid line data shows that the compensated optimized machining following error is constrained within a very small range near zero. This machining scenario verifies the collaborative logic of this technical solution, from multi-source data extraction, impedance decoupling, stiffness mapping to final command closed-loop correction, reducing dynamic contour errors in the metal processing process.
[0082] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. An optimized method for CNC machining of metal parts, characterized in that, Includes the following steps: Simultaneously collect status data of each feed axis and the actual spindle speed; The original cutting force vectors of each feed axis are extracted from the state data by combining the inverse dynamics equations; The original cutting force vector is smoothed and phase-compensated using the actual spindle speed to obtain an effective cutting force space vector. Based on the actual encoder position in the state data, the absolute mechanical coordinates of the machine tool are obtained, and an interpolation algorithm is performed in the three-dimensional workspace compliance tensor grid to obtain the transient spatial compliance matrix. The final feedforward compensation vector is generated by combining the effective cutting force space vector with the transient spatial compliance matrix, and then superimposed onto the original command position.
2. The CNC machining optimization method for metal parts according to claim 1, characterized in that, The synchronous acquisition of status data of each feed axis and actual spindle speed includes: The multi-axis servo driver is controlled to drive the servo motor to run along a preset no-load test trajectory. During the operation of the preset no-load test trajectory, the actual torque current of each feed axis is extracted and the electrical noise floor variance is calculated according to the set position interpolation cycle. After the machine tool cutting process enters a steady state, the original command position, encoder actual position, actual feed speed, actual feed acceleration, and actual torque current are extracted synchronously in each position interpolation cycle as the state data, and the actual spindle speed fed back by the spindle encoder is extracted synchronously.
3. The optimized CNC machining method for metal parts according to claim 2, characterized in that, The extraction of the original cutting force vectors for each feed axis from the state data by combining the inverse dynamics equations includes: Based on the equivalent mechanical mass, actual feed acceleration, actual feed speed, viscous damping coefficient and nonlinear friction force, an inverse dynamic equilibrium equation is constructed to calculate the inherent impedance resistance of the electromechanical system of each feed axis; The total electromagnetic driving force is calculated from the actual torque current using the thrust constant of the servo motor. The original cutting force of each feed axis is obtained by subtracting the inherent impedance of the electromechanical system from the total electromagnetic driving force. The original cutting force components of each feed axis are combined into the original cutting force vector of the current position interpolation cycle.
4. The optimized CNC machining method for metal parts according to claim 1, characterized in that, The step of performing smoothing and phase compensation operations on the original cutting force vector using the actual spindle speed to obtain an effective cutting force space vector includes: The tooth passing frequency is calculated based on the preset number of cutter teeth and the actual spindle speed. The cutoff frequency of the low-pass filter is adjusted based on the frequency of the cutting teeth, and the original input cutting force vector is smoothed to obtain a smoothed cutting force vector. The smooth cutting force vector is input into a nonlinear tracking differentiator to extract the smooth differential signal; The smoothed cutting force vector and the smoothed differential signal are subjected to a first-order Taylor expansion operation in combination with the group delay time constant of the low-pass filter, and the effective cutting force space vector that is aligned with the interpolation period of the current position in the time domain is output.
5. The method for optimizing CNC machining of metal parts according to claim 1, characterized in that, The process of obtaining the absolute mechanical coordinates of the machine tool based on the actual encoder position in the state data, and performing an interpolation algorithm in the three-dimensional workspace compliance tensor mesh to obtain the transient spatial compliance matrix includes: Obtain a pre-established three-dimensional workspace compliance tensor mesh containing multiple three-dimensional physical coordinate nodes and their corresponding third-order tensor matrices; The absolute mechanical coordinates of the tool tip at the current moment are calculated based on the actual encoder positions of each feed axis. Extract the coordinate values of adjacent grid nodes that enclose the current absolute mechanical coordinates and the corresponding flexibility matrix elements from the three-dimensional workspace flexibility tensor grid; The mechanical mapping relationship between the coordinate values and the elements of the compliance matrix is fitted using a smoothing basis function, and the transient spatial compliance matrix corresponding to the current absolute mechanical coordinates is output.
6. The method for optimizing CNC machining of metal parts according to claim 2, characterized in that, The step of combining the effective cutting force space vector with the transient spatial compliance matrix to generate the final feedforward compensation vector, and then superimposing the final feedforward compensation vector onto the original command position, includes: The effective cutting force space vector is multiplied by the transient spatial compliance matrix to obtain the theoretical spatial deflection vector of the tool tip; The variance of the cutting force is calculated in real time for the effective cutting force sequence corresponding to each feed axis within the set sliding time window; The dynamic confidence weight is calculated by combining the calculated electrical noise floor variance and the cutting force variance. The dynamic confidence weights are used to perform scalar scaling correction on each single-axis component of the theoretical spatial deflection vector of the blade tip to obtain the actual feedforward compensation vector; After the CNC interpolator generates the original position command for the next position interpolation cycle, and before the original position command is input to the servo position closed-loop controller, the actual feedforward compensation vector is subtracted from the original position command.
7. The method for optimizing CNC machining of metal parts according to claim 3, characterized in that, The inverse dynamic equilibrium equations are constructed based on equivalent mechanical mass, actual feed acceleration, actual feed speed, viscous damping coefficient, and nonlinear friction force to calculate the inherent impedance resistance of the electromechanical system of each feed axis, including: Set the speed threshold to cross zero; Determine the numerical relationship between the absolute value of the actual feed rate and the zero-crossing threshold. When the absolute value of the actual feed rate is greater than or equal to the zero-crossing threshold, the nonlinear friction force of the current position interpolation cycle is calculated using a full-order nonlinear friction model. When the absolute value of the actual feed rate is less than the speed zero-crossing threshold, the update operation of the friction state is frozen, and the friction boundary value corresponding to the time node that last met the condition of being greater than or equal to the speed zero-crossing threshold before entering the reversal dead zone is assigned as the nonlinear friction force of the current position interpolation cycle. Substitute the nonlinear frictional force into the inverse dynamic equilibrium equation to calculate the inherent impedance resistance of the electromechanical system for each feed axis.
8. The method for optimizing CNC machining of metal parts according to claim 6, characterized in that, The calculation of dynamic confidence weights by combining the calculated electrical noise floor variance and the cutting force variance includes: Set a sliding time window that includes a preset number of position interpolation cycles; Extract the preset zero-prevention normals and sensitivity adjustment coefficients; Calculate the ratio of the cutting force variance to the product of the sensitivity adjustment coefficient and the electrical noise floor variance, plus the zero-removal normal number; Perform natural exponentiation on the negative of the ratio to obtain the exponent term; The dynamic confidence weight is a constant 1 minus the exponential term.
9. A CNC machining optimization system for metal parts, applied to the CNC machining optimization method for metal parts according to any one of claims 1-8, characterized in that, include: The high-frequency data acquisition module is used to synchronously acquire the status data of each feed axis and the actual spindle speed; The inverse dynamics decoupling module is used to extract the original cutting force vectors of each feed axis from the state data by combining the inverse dynamics equations; The filtering and prediction module is used to perform smoothing and phase compensation operations on the original cutting force vector using the actual spindle speed to obtain an effective cutting force space vector. The spatial compliance mapping module is used to obtain the absolute mechanical coordinates of the machine tool based on the actual position of the encoder in the state data, and to perform an interpolation algorithm in the three-dimensional workspace compliance tensor grid to obtain the transient spatial compliance matrix. The confidence compensation feedforward module is used to combine the effective cutting force space vector with the transient spatial compliance matrix to generate the final feedforward compensation vector, and to superimpose the final feedforward compensation vector onto the original command position.
10. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1-8.