Method and system for calculating inertia of servo system of workbench of numerical control machine tool on line and storage medium
By collecting servo system data in real time, calculating load inertia online, and updating servo parameters, the problems of inaccurate inertia identification and poor adaptability in existing technologies are solved, thereby improving the machining accuracy and efficiency of CNC machine tools.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING COLLEGE OF INFORMATION TECH
- Filing Date
- 2026-03-12
- Publication Date
- 2026-05-15
AI Technical Summary
Existing technologies struggle to quickly and accurately identify the load inertia of the CNC machine tool table servo system and adjust servo control parameters in real time without interrupting the machining process or adding extra sensors. This results in decreased servo rigidity, increased contour errors, and reduced machining accuracy and efficiency.
By acquiring position commands, current signals, and speed signals from the servo system in real time, and combining them with pre-acquired inherent mechanical parameters, the load inertia is calculated online using dynamic equations, and the servo control parameters are updated in real time, enabling rapid and accurate identification and adaptive adjustment of inertia.
It enables automatic identification of inertia changes caused by workpiece quality variations during processing, improving equipment automation and processing efficiency, enhancing servo rigidity and processing accuracy, and reducing equipment costs and operational complexity.
Smart Images

Figure CN122044075A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of CNC servo control technology, specifically relating to a method, system, and storage medium for online calculation of the inertia of a CNC machine tool worktable servo system. Background Technology
[0002] The inertia of the servo system of a CNC machine tool table directly affects the accuracy of the speed loop and position loop gain tuning. Traditional methods involve offline trial and error or no-load acceleration and deceleration tests to first measure the total inertia of the "motor + transmission chain," and then manually inputting it into the controller. However, once workpieces of different masses are clamped, the actual inertia changes accordingly, rendering the original parameters invalid. If the control parameters of the servo drive cannot be adjusted accordingly, it will lead to a decrease in servo rigidity, an increase in contour error, and even oscillation, severely impacting machining accuracy and efficiency.
[0003] Currently, inertia identification is mostly performed offline. For example... Figure 1 As shown, existing technologies involve sending acceleration or deceleration speed or position commands to the servo system, collecting current waveforms during uniform acceleration and deceleration, and then solving for inertia using dynamic equations. This method requires interrupting the production process and is operated by technicians, making it unsuitable for real-time changes in workpiece quality during machining. When workpiece quality changes, the original servo parameters become invalid, increasing after-sales service costs for the machine tool and the burden on operators. To address this issue, several online inertia identification technologies have emerged in recent years, such as Model Reference Adaptive (MRAS) and Disturbance Observer methods. However, these methods are typically computationally complex, sensitive to model accuracy and sensor noise, have slow convergence speeds, and are prone to divergence during sudden changes in operating conditions, making them unreliable for real-time online adjustment of servo parameters. Therefore, how to quickly and accurately obtain load inertia and update servo gain in real time without adding extra sensors, relying on precise friction models, or interrupting machining, while ensuring high servo rigidity and high trajectory accuracy throughout the entire process, remains a pressing problem for the industry. Summary of the Invention
[0004] Purpose of the invention: To solve the above-mentioned technical problems, this invention provides a method, system, and storage medium for online calculation of the inertia of a CNC machine tool table servo system. This method is based on mature dynamics theory, utilizes data collected in real time during servo system operation, and obtains the load inertia quickly and accurately through analytical calculation. This inertia is then used to refresh servo control parameters in real time, thereby automatically adapting to changes in workpiece quality.
[0005] Technical solution: This invention provides a method for online calculation of the inertia of a CNC machine tool table servo system, comprising the following steps: S1: Real-time data acquisition and synchronization: During the operation of the servo system, position commands issued by the CNC system are acquired in real time. pr ( t ), Servo motor current signal detected by current sensor i ( t And the servo motor speed signal indirectly fed back by the position encoder. oh ( t The three data sets are cached using synchronized timestamps to form a real-time data sequence. S2: Offline parameter acquisition: Pre-acquire and store the inherent mechanical parameters of the servo system, including at least the viscous damping coefficient. B Static friction torque T s and load torque T l , wherein T s and T l The methods of obtaining this information include direct measurement or indirect identification through kinetic equations; S3: Real-time acceleration calculation: The position command acquired in step S1 is used to calculate the acceleration. p r ( t The input is fed into a preset filter, and the acceleration estimate of the servo system is calculated in real time. α ( t ); S4: Dynamic operating condition data filtering: Based on the speed signal acquired in step S1 oh ( t The acceleration estimate calculated in step S3 and step S3 α ( t Set speed threshold oh th and acceleration threshold α th ,in oh th >0, α th >0; in satisfying | oh ( t )∣≥ oh th And | α ( t )∣≥ α th Under these conditions, the average speed is collected over a certain runtime period. oh Average acceleration α and average current i ; S5: Online analytical calculation of inertia: Based on the complete dynamic equations of the CNC machine tool's AC servo system, using the average velocity obtained in step S4. ohAverage acceleration α and average current i The viscous damping coefficient obtained in step S2 B Static friction torque T s and load torque T l and the torque constant of the servo motor K T The real-time load inertia is calculated using the following formula. J : S6: Result Output and Application: The load inertia calculated in step S5 is... J The output is sent to the CNC system for real-time adjustment of the servo system's control parameters.
[0006] Furthermore, in step S2, the viscous damping coefficient B The sum of static friction torque and load torque T s + T l Obtain it through the following methods: The control servo system takes two uniform speed segments, with speeds of respectively and ,and > >0, the corresponding average currents collected are as follows and Referring to the formula in step S5, Based on uniform velocity state α ( t The dynamic equation of ) = 0 K T i = Wow + T s + T l Construct a system of equations: The viscous damping coefficient is obtained by solving the simultaneous equations. B The sum of static friction and load torque T s + T l .
[0007] Furthermore, for applications where the worktable is a horizontal axis, the load torque is approximately assumed to be... T l = 0, take two uniform speed segments, with speeds respectively and ,and >0, the corresponding average currents are respectively and The following dynamic equations exist: Solving the equations simultaneously yields the viscous damping coefficient B and the load torque on the horizontal axis. static friction torque
[0008]
[0009] Furthermore, in step S3, the preset filter is a second-order differential tracker with a cutoff angular frequency of... oh c Based on the integral time of the servo system speed loop T i set up.
[0010] Furthermore, the servo system's position tracking command ignores tracking errors, assuming... Given the cutoff angular frequency, in the complex frequency domain s-domain, the Laplace transform A(s) of the current acceleration α(t) of the servo system and the Laplace transform Pr(s) of the position command satisfy the following approximate relationship: In the formula, s is the complex frequency of the Laplace transform. By performing an inverse Laplace transform or discretizing the transfer function, the current acceleration estimate α(t) in the time domain can be calculated in real time.
[0011] Furthermore, in step S4, the speed threshold oh th and acceleration threshold α th The settings must ensure that the system's dynamic friction characteristics are stable during the selected dynamic operating condition period, and that the inertia term... J It dominates the dynamic equations.
[0012] Furthermore, after step S5, result filtering is also included: the load inertia J obtained from multiple consecutive calculation cycles is subjected to moving average filtering or low-pass filtering, and the smoothed inertia value is output for step S6.
[0013] This invention also provides a CNC machine tool servo system, including a CNC system, a servo driver, a servo motor, a worktable, and a position encoder. The servo driver incorporates an online inertia calculation module, which is integrated within the servo driver in the form of an FPGA or MCU and interacts with the CNC system via a high-speed parallel bus. The online inertia calculation module executes the aforementioned method to obtain the real-time value of the load inertia. The system may further include a parameter self-tuning module, which receives the load inertia output by the online inertia calculation module. J The gain parameters of the servo controller are calculated and updated in real time based on this value.
[0014] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements all the steps of the above-described method.
[0015] Beneficial effects: Compared with the prior art, the technical solution of the present invention has the following significant advantages: (1) Real-time performance and adaptability: Compared with the offline trial and error method, the present invention does not require stopping the machine to load and unload the test weight. It can automatically identify the change in inertia caused by the change in workpiece mass during the processing, saving more than 70% of auxiliary time and greatly improving the automation level and processing efficiency of the equipment. (2) Simple calculation and strong robustness: Compared with complex algorithms such as Model Reference Adaptive Method (MRAS) and Disturbance Observer Method, the present invention is directly based on the dynamic equation solution, without the need for iterative process and convergence problem, and has high real-time performance; at the same time, by screening dynamic working condition data, it is not sensitive to friction changes and measurement noise, the estimation fluctuation is small, and the calculation results are stable and reliable. (3) Low cost and easy to implement: The present invention only needs to use the existing current sensor and position encoder of the servo system for data acquisition, without adding any additional hardware, and the cost is almost zero; the algorithm structure is simple and can be implemented in FPGA or MCU with fixed-point operation, with low resource consumption (such as logic unit consumption <5%), which is convenient for direct integration and promotion on existing servo drives. (4) Significantly improved control performance: The calculation results are directly used for the self-tuning of the speed loop and position loop gains, so that the worktable maintains the optimal servo rigidity throughout the entire stroke range. Maintaining the optimal servo rigidity throughout the entire stroke improves the roundness test accuracy by more than 30%, reduces high-speed reversing impact by 20%, and significantly improves the processing quality and equipment dynamic performance. Attached Figure Description
[0016] Figure 1 For acceleration and deceleration of servo systems in existing technology q Schematic diagram of shaft current; Figure 2 This is a flowchart illustrating the method for online calculation of the inertia of a CNC machine tool table servo system in an embodiment of the present invention. Detailed Implementation
[0017] The technical solution of the present invention will be further described in detail below through specific embodiments. However, it should be noted that the following embodiments are only used to describe the content of the invention and do not constitute a limitation on the scope of protection of the present invention.
[0018] Example 1
[0019] This embodiment provides a method for online calculation of the inertia of a CNC machine tool table servo system. The specific process is as follows: Step 1: Real-time data acquisition: During normal operation of the servo system, position commands are acquired in real time through the bus interface of the CNC system. p r ( t Simultaneously, the motor current is collected at a fixed frequency (e.g., 10kHz) by a current sensor inside the servo driver. i ( t The motor speed is collected and calculated using a position encoder at the tail of the motor. oh ( t All data is tagged with a synchronization timestamp.
[0020] Step 2: Offline parameter acquisition: After the machine tool is first installed or maintained, perform an offline parameter acquisition. The inherent mechanical parameters include at least the viscous damping coefficient. B Static friction torque T s and load torque T l The worktable is made to move at two different constant speeds, namely... and ,and > >0, the corresponding average currents collected are as follows and , Based on uniform velocity state α ( t The dynamic equation of ) = 0 K T i = Wow + T s + T l Construct a system of equations:
[0021] The viscous damping coefficient is obtained by solving the simultaneous equations. B The sum of static friction and load torque Ts + T l .
[0022]
[0023] For CNC machine tools, the axis containing the worktable is generally a horizontal axis, which can be approximated as... T l = 0, take two uniform speed segments, with speeds respectively and ,and >0, the corresponding average currents are respectively and The following dynamic equations exist: The load torque of the horizontal shaft can be obtained from the above formula. T l static friction torque Ts .
[0024]
[0025] Step 3: Real-time acceleration calculation: To obtain acceleration online, this embodiment uses a second-order differential tracker to calculate the position command. p r ( t The location command acquired in step S1 is processed. p r ( t The input is fed into a preset filter, and the acceleration estimate of the servo system is calculated in real time. α ( t ); Modern CNC machine tools mostly employ bus control, resulting in high resolution of position commands, which enables real-time acceleration calculation. Because servo systems have the characteristic of tracking position commands, tracking errors are ignored, and... Given the cutoff angular frequency, in the complex frequency domain s-domain, the Laplace transform A(s) of the current acceleration α(t) of the servo system and the Laplace transform Pr(s) of the position command satisfy the following approximate relationship: In the formula, s is the complex frequency of the Laplace transform. By performing an inverse Laplace transform or discretizing the transfer function, the current acceleration estimate α(t) in the time domain can be calculated in real time.
[0026] Step 4: Dynamic operating condition data filtering: Based on the speed signal acquired in step S1 oh ( t The acceleration estimate calculated in step S3 and step S3 α ( t Set speed threshold oh thand acceleration threshold α th ,in oh th >0, α th >0; in satisfying | oh ( t )∣≥ oh th And | α ( t )∣ ≥ α th Under these conditions, the average speed is collected over a certain runtime period. oh Average acceleration α and average current i ; Step 5: Online analytical calculation of inertia: Based on the complete dynamic equations of the CNC machine tool's AC servo system, the average velocity obtained in step S4 is used... oh Average acceleration α and average current i The viscous damping coefficient obtained in step S2 B Static friction torque T s and load torque T l and the torque constant of the servo motor K T The real-time load inertia is calculated using the following formula. J :
[0027] After determining the viscous damping coefficient B Static friction torque T s , load torque T l and acceleration α ( t This allows for online inertia identification. The velocity and acceleration thresholds are set as follows: oh th and α th ,and oh th >0, α th Inertia >0 can be obtained online under the following four operating conditions. J : (1) The average velocity, average acceleration and average current of time period 1 are respectively , and ,when, , At that time, the inertia can be obtained:
[0028] (2) The average velocity, average acceleration and average current of time period 2 are respectively , and ,when , At that time, the inertia can be obtained:
[0029] (3) The average velocity, average acceleration and average current of time period 3 are respectively , and ,when , At that time, the inertia can be obtained:
[0030] (4) The average velocity, average acceleration and average current of time period 4 are respectively , and ,when , At that time, the inertia can be obtained:
[0031] Step 6: Result Output and Application: Calculate the load inertia obtained in step S5. J The parameters are sent to the CNC system's self-tuning module in real time via the bus. Based on the new inertia value, this module updates the speed loop and position loop gains of the servo driver in real time according to preset rules, thereby ensuring that the servo system maintains optimal dynamic response performance under any workpiece mass.
[0032] To improve the stability of the inertia estimate, a result filtering step can be added after step S5. For example, the results calculated M times consecutively (e.g., M = 8) can be filtered. J The value is then subjected to a moving average filter, and the filtered value is output as the final result to step S6. This effectively suppresses fluctuations in the estimated value caused by transient disturbances.
[0033] Example 2
[0034] This embodiment provides a CNC machine tool servo system that implements the above-described method. The system includes: a CNC system, a servo driver, a servo motor, a current sensor, a position encoder, an online inertia calculation module, and a parameter self-tuning module. The online inertia calculation module is integrated into the servo driver in FPGA+MCU hardware form and interacts with the CNC system via a high-speed bus (such as EtherCAT, MECHATROLINK, etc.).
[0035] The CNC system connects to the servo driver via a high-speed bus to generate and send position commands. The servo driver's control circuit consists of an FPGA and an MCU. The FPGA receives the position output from the encoder and collects the motor current. The MCU receives the position commands through the bus interface, reads the actual position and current from the FPGA, calculates the PWM wave, and outputs it to the power circuit to drive the servo motor. A current sensor is installed in the servo driver's power circuit. The position encoder provides real-time feedback on the motor's speed and position information. A rotary motor drives a ball screw through a coupling, with the ball screw nut fixed to the worktable. A linear motor is directly fixed to the worktable. A parameter self-tuning module is integrated into the CNC system, receiving the output from the online inertia calculation module. J The value is calculated, and new servo control parameters are adjusted and sent to the driver in real time accordingly.
[0036] Example 3
[0037] The difference from Example 2 is that the inertia online calculation module is integrated into the CNC system in the form of a software module. It reads the driver current and speed data through a high-speed fieldbus, and the calculation results are directly written into the CNC system memory with a delay of <0.5ms, which is suitable for high-speed drilling and tapping centers.
Claims
1. A method for online calculation of the inertia of a CNC machine tool table servo system, characterized in that, Includes the following steps: S1: Real-time data acquisition and synchronization: During the operation of the servo system, position commands issued by the CNC system are acquired in real time. p r ( t Servo motor current detected by current sensor i ( t and the servo motor speed indirectly fed back by the position encoder. ω ( t ); S2: Offline parameter acquisition: Pre-acquire and store the inherent mechanical parameters of the servo system, including the viscous damping coefficient. B Static friction torque T s and load torque T l The static friction torque T s and load torque T l The methods of obtaining this information include direct measurement or indirect identification through kinetic equations; S3: Real-time acceleration calculation: The position command acquired in step S1 is used to calculate the acceleration. p r ( t The input is fed into a preset filter, and the acceleration estimate of the servo system is calculated in real time. α ( t ); S4: Dynamic operating condition data filtering: based on the speed collected in step S1 ω ( t The acceleration estimate calculated in step S3 and step S3 α ( t Set speed threshold ω th and acceleration threshold α th ,in ω th > 0, α th > 0; in the case of | ω ( t )∣≥ ω th And | α ( t )∣≥ α th Under these conditions, the average speed is collected over a certain runtime period. ω Average acceleration α and average current i ; S5: Online analytical calculation of inertia: Based on the complete dynamic equations of the CNC machine tool's AC servo system, using the average velocity obtained in step S4. ω Average acceleration α and average current i The viscous damping coefficient obtained in step S2 B Static friction torque T s and load torque T l and the torque constant of the servo motor K T The real-time load inertia is calculated using the following formula. J : ; S6: Result Output and Application: The load inertia calculated in step S5 is... J The output is sent to the CNC system for real-time adjustment of the servo system's control parameters.
2. The method according to claim 1, characterized in that, In step S2, the viscous damping coefficient B The sum of static friction torque and load torque T s + T l Obtain it through the following methods: The control servo system takes two uniform speed segments, with speeds of respectively and ,and > >0, the corresponding average currents collected are as follows and Referring to the formula in step S5, Based on uniform velocity state α ( t The dynamic equation of ) = 0 K T i = Bω + Ts + T l Construct a system of equations: The viscous damping coefficient is obtained by solving the simultaneous equations. B The sum of static friction torque and load torque T s + T l .
3. The method according to claim 1, characterized in that, In step S2, for applications where the worktable is a horizontal axis, the load torque is approximately assumed to be... T l = 0, take two uniform speed segments, with speeds respectively and ,and >0, the corresponding average currents are respectively and Based on the dynamic equation K under uniform velocity condition α(t) = 0 T i = Bω + Ts, construct a system of equations: The viscous damping coefficient B and the static friction torque of the horizontal shaft are obtained by solving the equations simultaneously. T s .
4. The method according to claim 1, characterized in that, In step S3, the preset filter is a second-order differential tracker with a cutoff angular frequency of ω c Based on the integral time of the servo system speed loop T i set up.
5. The method according to claim 1, characterized in that, The servo system's position tracking command ignores tracking errors. ω c Given the cutoff angular frequency, in the complex frequency domain s-domain, the Laplace transform A(s) of the current acceleration α(t) of the servo system is related to the position command. p r ( t The Laplace transform Pr(s) of ) satisfies the following approximate relation: In the formula, s is the complex frequency of the Laplace transform. By performing an inverse Laplace transform or discretizing the transfer function, the current acceleration estimate α(t) in the time domain can be calculated in real time.
6. The method according to claim 1, characterized in that, In step S4, the velocity threshold ω th and acceleration threshold α th The settings must ensure that the system's dynamic friction characteristics are stable during the selected dynamic operating condition period, and that the inertia term... J It dominates the dynamic equations.
7. The method according to any one of claims 1 to 6, characterized in that, Step S5 is followed by result filtering: the load inertia obtained from multiple consecutive calculation cycles is processed. J Perform a moving average filter or a low-pass filter, and output the smoothed inertia value for step S6.
8. A CNC machine tool servo system, comprising a CNC system, a servo driver, a servo motor, a worktable, and a position encoder, characterized in that, The servo drive is equipped with an online inertia calculation module, which is integrated inside the servo drive and interacts with the CNC system through a high-speed fieldbus. The online inertia calculation module is used to execute the method of any one of claims 1 to 7 to obtain the real-time value of the load inertia.
9. The CNC machine tool servo system according to claim 8, characterized in that, It also includes a parameter self-tuning module, which is used to receive the load inertia output by the online inertia calculation module. J The gain parameters of the servo controller are calculated and updated in real time based on this value.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method for online calculation of the inertia of the CNC machine tool table servo system as described in any one of claims 1 to 7.