Numerical control system feed-forward compensation method based on edge controller
By acquiring data from the CNC system in real time and calculating the feedforward compensation amount through the edge controller, the real-time performance and latency issues of the CNC system are solved, enabling high-precision machining and low-cost production, and promoting the intelligent upgrading of the manufacturing industry.
Patent Information
- Application Number
- CN202510949593.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-10
- Publication Date
- 2025-10-17
AI Technical Summary
The existing feedforward compensation technology of CNC systems has problems such as insufficient real-time performance, strong model dependence, lack of nonlinear compensation and high modification cost, making it difficult to achieve high-precision machining in complex industrial scenarios.
A feedforward compensation method for CNC systems based on edge controllers is adopted. The edge controller acquires machine tool instructions and actual data from the CNC system in real time, calculates the tracking error and transmits it back to the CNC system. Feedforward compensation is realized by using PLC function modules and servo drives. Combined with speed and torque feedforward algorithms, high-precision real-time compensation is achieved.
It has achieved high-precision machining with micron-level accuracy and millisecond-level response, reducing processing costs and energy consumption, promoting the green transformation and domestic substitution of the manufacturing industry, and enhancing the global industrial chain's voice.
Smart Images

Figure CN120802833A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of numerical control machine tool control, in particular to a numerical control system feedforward compensation method based on an edge controller. BACKGROUND
[0002] The feedforward function in a numerical control system is a control method that compensates before the system receives interference signals, aiming to eliminate or reduce the influence of interference on the control variable, thereby improving the performance of the control system. Feedforward control can respond more quickly to changes in the system by pre-calculating and adjusting the input to deal with known disturbances or changes, as it does not rely on feedback signals from the system output. The feedforward control function in a numerical control system is mainly used to eliminate undesirable profile deviations and improve machining quality. In particular, in places where the acceleration of shaft feed such as circular arcs and corners changes, feedforward control can eliminate following errors and improve machining precision and efficiency. In addition, feedforward control can also optimize the performance of the machine tool through speed feedforward control and torque feedforward control.
[0003] The current feedforward compensation technology of numerical control systems faces core problems such as lack of real-time performance, strong model dependence, lack of nonlinear compensation, and high modification cost, which restricts the popularization of high-precision machining in complex industrial scenarios. Especially under the trend of intelligent manufacturing and industrial internet, traditional architecture is difficult to support real-time data fusion and adaptive optimization requirements. Therefore, there is an urgent need for a high-compatibility, low-latency, and strong-adaptability feedforward compensation implementation scheme to break through the existing technical bottlenecks and promote the upgrading of manufacturing industry to high-end and intelligent. SUMMARY
[0004] The purpose of the present application is to provide a numerical control system feedforward compensation method based on an edge controller, which effectively solves the technical problems existing in the background art.
[0005] To achieve the above purpose, the present application provides the following technical solutions.
[0006] A numerical control system feedforward compensation method based on an edge controller, characterized in that it comprises the following steps: S1, the numerical control machine tool starts running, the edge controller inputs a signal, if the signal is true, the feedforward function is started, and if the signal is false, the process is directly ended; S2, based on S1, the edge controller obtains the numerical control machine tool instructions and the actual data of the numerical control machine tool in the numerical control system; S3, based on S2, the edge controller calculates the tracking error and the current feedforward compensation amount in real time according to the obtained data of the numerical control system, and transmits the message of the feedforward compensation amount back to the numerical control system; S4, based on S3, the numerical control system sends the feedforward compensation amount to the servo drive of the numerical control machine tool; S5, based on S4, complete a feedforward compensation, return to step S2.
[0007] Preferably, a PLC function module is installed in the numerical control system, and the PLC function module transmits data input from the edge controller to a feedforward channel of the servo, that is, transmits data from an X register to a corresponding F register.
[0008] Preferably, in the step S1, the specific process of signal judgment of the edge controller is as follows: S1.1, input 1 at address 4 of the FPGA_WRITE function block of the edge controller to make it true, and make the X128.0 register of the numerical control system true through EtherCAT communication between the edge controller and the numerical control system. If it is false, it indicates that the communication is abnormal, and the communication between the numerical control system and the edge controller needs to be checked. S1.2, based on S1.1, after the X128.0 register of the numerical control system is true, the Y122.0 register is true. If it is false, it indicates that the PLC function module of the numerical control system is abnormal, and the program of the PLC function module needs to be checked. S1.3, based on S1.2, after the Y122.0 register of the numerical control system is true, the base address of the FPGA_READ function block of the edge controller should be true. If it is false, it indicates that the communication between the edge controller and the numerical control system is abnormal, and the communication between the edge controller and the numerical control system needs to be checked. S1.4, based on S1.3, after the edge controller receives the signal, it means that the installed PLC function module has been started.
[0009] Preferably, in the step S2, the process that the edge controller obtains the numerical control machine tool instructions and the actual data of the numerical control machine tool in the numerical control system is as follows: The machine tool instructions and the actual data of the machine tool in the numerical control system are displayed after being combined through two groups of F registers. The program is written through the PLC function module, the numerical control machine tool coordinates are divided into direction, integer and decimal three parts, and the data is stored in three groups of Y registers. The edge controller reads the data of the three groups of Y registers through the FPGA_READ function block, and then combines the complete data for calculation.
[0010] Preferably, in the step S3, the calculation formula of the edge controller for tracking error according to the obtained data of the numerical control system is as follows: e(t) = r(t) - y(t) Wherein: e(t): tracking error (changes with time); r(t): instruction position (reference input); y(t): actual position (system output).
[0011] Preferably, in the step S3, the edge controller calculates the current feedforward compensation according to the obtained data of the numerical control system, including a speed feedforward and a torque feedforward; The speed feedforward is to compensate the control amount in advance according to the change rate of the target speed, so as to offset the inertia delay or dynamic lag of the system, thereby reducing the tracking error; The speed feedforward τ ff_vel =J*a desired +b*v desire ; wherein J is the moment of inertia, a is the acceleration, b is the damping coefficient, and v is the speed; The torque feedforward is to calculate the required compensation torque in advance and superimpose it into the control output, so that the numerical control system can quickly offset the disturbance without waiting for the error to accumulate: The torque feedforward τ ff_torque =τ load_predicted +τ friction_model +τ gravity_compensation ; Wherein τ load_predicted is the load torque, τ friction_model is the friction torque, and τ gravity_compensation is the gravity compensation torque.
[0012] Compared with the prior art, the present application has the following beneficial effects: (1) When applied to a numerical control machine tool, the edge controller of the present application obtains the machine tool instructions and the actual machine tool of the numerical control system in real time, calculates the tracking error, calculates the feedforward compensation through an algorithm, and transmits the feedforward compensation to the numerical control system. The PLC function module is installed in the numerical control system, the received feedforward compensation is transmitted to the servo feedforward channel through the function block, thereby realizing the feedforward compensation function of the numerical control system. The present application decouples the feedforward compensation algorithm from the main controller through the cooperation of edge calculation and numerical control system, and realizes high-precision real-time compensation by using the parallel computing capability of the edge module. This design not only solves the contradiction between the computing power and the delay of the traditional system, but also supports multi-source data fusion and adaptive algorithm deployment through an open architecture, providing a new path for the performance improvement of the numerical control system. The present application realizes breakthroughs in three dimensions of technical performance, economic benefit and social value: on the technical level, it breaks through the bottleneck of computing power and delay of traditional numerical control systems, achieving micron-level precision and millisecond-level response; on the economic level, it significantly reduces processing cost and energy consumption, helping enterprises to reduce costs and increase efficiency; on the social level, it promotes the green transformation and localization of the manufacturing industry, and enhances the global industrial chain discourse power. BRIEF DESCRIPTION OF DRAWINGS
[0013] Figure 1 The flowchart of the present application.
[0014] Figure 2 The flowchart of the signal judgment of the edge controller of the present application.
[0015] Figure 3 The flow chart for the edge controller of the application to acquire the data of the numerical control machine tool command and the actual data of the numerical control machine tool in the numerical control system.
[0016] Figure 4 The partial program flow chart for the edge controller of the application.
[0017] Figure 5 The partial data display illustration in the actual operation of the application. DETAILED DESCRIPTION
[0018] The application will be further described below in conjunction with the drawings and the detailed description.
[0019] In the description of the application, unless otherwise specified, the meaning of "a plurality of" is two or more; the terms "upper", "lower", "left", "right", "inner", "outer", "front end", "rear end", "head", "tail" and the like indicate the orientation or positional relationship shown in the drawings, which is only for the purpose of facilitating the description of the application and simplifying the description, and does not indicate or imply that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation on the application. In addition, the terms "first", "second", "third" and the like are only for the purpose of description and cannot be understood as indicating or implying relative importance.
[0020] In the description of the application, it should be noted that, unless otherwise specified and limited, the terms "connected", "connected" should be understood broadly, for example, it can be fixedly connected, or it can be detachably connected, or integrally connected; it can be mechanically connected, or it can be electrically connected; it can be directly connected, or it can be indirectly connected through an intermediate medium. For those skilled in the art, the specific meaning of the above terms in the application can be understood according to the specific circumstances.
[0021] As shown in Figures 1 to 2 The edge controller based numerical control system feedforward compensation method, characterized in that, comprising the following steps: S1, the numerical control machine tool starts running, the edge controller input signal, if the signal is true, the feedforward function is started, if the signal is false, it is directly ended; Specifically, the specific process of signal judgment of the edge controller is as follows: S1.1, input 1 at address 4 of the FPGA_WRITE function block of the edge controller, make it true, the edge controller communicates with the numerical control system through EtherCAT, make the X128.0 register of the numerical control system true, if it is false, it means that the communication is abnormal, the communication between the numerical control system and the edge controller needs to be checked; S1.2, based on S1.1, the X128.0 register of the numerical control system is true, then the Y122.0 register is true, if false, it indicates that the PLC function module of the numerical control system is abnormal, and the program of the PLC function module needs to be checked; S1.3, based on S1.2, after the Y122.0 register of the numerical control system is true, the FPGA_READ function block base address of the edge controller should be true, if false, it indicates that the communication is abnormal, and the communication between the edge controller and the numerical control system needs to be checked; S1.4, based on S1.3, after the edge controller receives the signal, it represents that the installed PLC function module has been started.
[0022] As shown in Figure 5 , the applicant performs real operation demonstration on the numerical control machine, and in other forms, 1 is input to the X128.0 register to enable, at this time Y122.0 is 1, indicating that the written PLC function module of the numerical control system is running normally.
[0023] Data is input to the X122.0 register and the X124.0 register, at this time the F64 and F66 registers also have data (F64 represents speed feedforward, and F66 represents torque feedforward), indicating that the installed PLC function module will transmit the input data to the feedforward channel of the servo.
[0024] S2, based on S1, the edge controller obtains the numerical control machine instruction and the actual data of the numerical control machine in the numerical control system; The PLC function module is installed in the numerical control system, and the PLC function module transmits the data input from the edge controller to the feedforward channel of the servo, i.e. transmits the data from the X register to the corresponding F register.
[0025] Specifically, the process of the edge controller obtaining the numerical control machine instruction and the actual data of the numerical control machine in the numerical control system is as follows: As shown in Figure 3 , taking the Huazhong 848D system developed by the applicant as an example, since the machine tool instruction and the machine tool actual data are usually accurate to four decimal places in millimeters, a register cannot store them alone. The machine tool instruction and the machine tool actual data in the numerical control system are displayed by merging two groups of F registers, and the program is written by the PLC function module to split the numerical control machine coordinates into direction, integer, and decimal parts, and store the data in three groups of Y registers. The edge controller reads the data of the three groups of Y registers through the FPGA_READ function block, and then merges the complete data for calculation.
[0026] As shown in Figure 4 , part of the program of the edge controller is shown, wherein: direction: direction of the machine tool instruction (or machine tool actual).
[0027] ZH: Integer part of the machine tool command (or machine tool actual).
[0028] XI: Fraction part of the machine tool command (or machine tool actual).
[0029] rl: Complete machine tool command (or machine tool actual).
[0030] S3, based on S2, the edge controller calculates the tracking error and the current feedforward compensation in real time according to the data of the numerical control system, and transmits the message of the feedforward compensation back to the numerical control system; The calculation formula of the tracking error of the edge controller according to the data of the numerical control system in real time is as follows: e(t) = r(t) - y(t) Wherein: e(t): tracking error (change with time); r(t): command position (reference input); y(t): actual position (system output).
[0031] The calculation of the current feedforward compensation of the edge controller according to the data of the numerical control system includes the speed feedforward and the torque feedforward; The speed feedforward is to compensate the control quantity in advance according to the change rate of the target speed, so as to offset the inertia delay or dynamic lag of the system, thereby reducing the tracking error; The speed feedforward τ ff_vel =J*a desired +b*v desire ; Wherein, J is the moment of inertia, a is the acceleration, b is the damping coefficient, and v is the speed; The torque feedforward is to calculate the required compensation torque in advance and superimpose it into the control output, so that the numerical control system can quickly offset the disturbance without waiting for the error accumulation: The torque feedforward τ ff_torque =τ load_predicted +τ friction_model +τ gravity_compensation ; Wherein, τ load_predicted is the load torque, τ friction_model is the friction torque, and τ gravity_compensation is the gravity compensation torque.
[0032] S4, based on S3, the numerical control system sends the feedforward compensation to the servo drive of the numerical control machine tool; S5, based on S4, complete a feedforward compensation, return to step S2.
[0033] The hardware system of the application adopts an ipc200 independently developed by the applicant as a carrier combined with a PAC technology industrial control PC.The application adopts a nationally produced PAC software and hardware platform conforming to the IEC61131-3 standard.The application adopts a Huazhong 848D bus type five-axis numerical control system independently developed by the applicant as a master controller, expands a Huazhong NCUC servo slave station and a machine tool PLC slave station through an NCUC bus, expands a Huazhong HPAC edge controller module carrying an IEC61131-3 runtime system through an EtherCAT bus, uses the edge controller module as a slave controller of the Huazhong 848D system, and realizes the collection of machine tool actual and machine tool instruction data of the numerical control system.Calculation of tracking error and feedforward compensation amount, information interaction with the 848D numerical control system through the EtherCAT bus, and realization of the feedforward compensation function of the numerical control system.
[0034] When the application is applied to a numerical control machine tool, the edge controller obtains machine tool instruction and machine tool actual of the numerical control system in real time during the movement of the shaft, calculates tracking error, calculates feedforward compensation amount through an algorithm, and transmits the feedforward compensation amount to the numerical control system.The PLC function module is installed in the numerical control system, the received feedforward compensation amount is transmitted to the feedforward channel of the servo through the function block, and the feedforward compensation function of the numerical control system is realized.The application realizes high-precision real-time compensation by decoupling the feedforward compensation algorithm from the master controller through the cooperation of edge computing and the numerical control system, and utilizing the parallel computing capability of the edge module.The design not only solves the contradiction between the computing power and the delay of the traditional system, but also supports multi-source data fusion and adaptive algorithm deployment through an open architecture, and provides a new path for the performance improvement of the numerical control system.The application realizes breakthroughs in three dimensions of technical performance, economic benefit and social value: at the technical level, the contradiction between the computing power and the delay of the traditional numerical control system is broken through, micron-level precision and millisecond-level response are achieved;at the economic level, the processing cost and energy consumption are significantly reduced, and the enterprise is helped to reduce cost and increase benefit;at the social level, the green transformation and localization of the manufacturing industry are promoted, and the global industrial chain discourse power is improved.
[0035] The above embodiments are only preferred embodiments of the application, and cannot limit the scope of the application, therefore, the modifications, equivalent changes, improvements, etc. made in the patent range of the application still belong to the scope covered by the application.
Claims
1. A feedforward compensation method for a numerical control system based on an edge controller, characterized in that: The following steps are involved: S1. The CNC machine tool starts running. The edge controller inputs a signal. If the signal is true, the feedforward function is turned on. If the signal is false, the process ends directly. S2. Based on S1, the edge controller obtains the CNC machine tool instructions and actual CNC machine tool data in the CNC system; S3. Based on S2, the edge controller calculates the tracking error and current feedforward compensation in real time according to the data obtained from the CNC system, and transmits the feedforward compensation information back to the CNC system. S4. Based on S3, the CNC system sends the feedforward compensation value to the servo drive of the CNC machine tool; S5. Based on S4, complete a feedforward compensation and return to step S2.
2. The feedforward compensation method for a CNC system based on an edge controller according to claim 1, characterized in that: The numerical control system is equipped with a PLC function module, which transmits the data input from the edge controller to the feedforward channel of the servo, that is, transmits the data from the X register to the corresponding F register.
3. The feedforward compensation method for a CNC system based on an edge controller according to claim 2, characterized in that: In step S1, the specific process of the edge controller's signal determination is as follows: S1.
1. Enter 1 at address 4 of the FPGA_WRITE function block on the edge controller to set it to true. The edge controller and the CNC system communicate via EtherCAT, and the X128.0 register of the CNC system is set to true. If it is false, it indicates a communication anomaly and the communication between the CNC system and the edge controller needs to be checked. S1.
2. Based on S1.1, if the X128.0 register of the CNC system is true, then the Y122.0 register will be true. If it is false, it means that the PLC function module of the CNC system is abnormal and the program of the PLC function module needs to be checked. S1.
3. Based on S1.2, after the Y122.0 register of the CNC system is true, the base address of the FPGA_READ function block of the edge controller should be true. If it is false, it indicates a communication abnormality. You need to check the communication between the edge controller and the CNC system. S1.
4. Based on S1.3, after the edge controller receives the signal, it indicates that the installed PLC function module has been started.
4. The feedforward compensation method for a CNC system based on an edge controller according to claim 3, characterized in that: In step S2, the process of the edge controller obtaining the CNC machine tool instructions and the actual data of the CNC machine tool in the CNC system is as follows: The machine tool instructions and actual machine tool data in the CNC system are combined and displayed through two groups of F registers. The program is written through the PLC function module, and the CNC machine tool coordinates are split into three parts: direction, integer, and decimal. The data is stored in three groups of Y registers. The edge controller reads the three groups of Y register data through the FPGA_READ function block and then combines the complete data for calculation.
5. The feedforward compensation method for a CNC system based on an edge controller according to claim 4, characterized in that: In step S3, the edge controller calculates the real-time tracking error based on the acquired data of the numerical control system using the following formula: e(t)=r(t)-y(t) in: e(t): tracking error (changing over time); r(t): command position (reference input); y(t): actual position (system output).
6. The feedforward compensation method for a CNC system based on an edge controller according to claim 4, characterized in that: In step S3, the edge controller calculates the current feedforward compensation amount including the speed feedforward amount and the torque feedforward amount according to the acquired data of the numerical control system; The speed feedforward is to compensate the control amount in advance directly according to the rate of change of the target speed to offset the inertia delay or dynamic lag of the system, thereby reducing the tracking error; The speed feedforward τ ff_vel =J*a desired +b*v desire ; Where J is the moment of inertia, a is the acceleration, b is the damping coefficient, and v is the velocity; The torque feedforward pre-calculates the required compensation torque and adds it to the control output, allowing the CNC system to quickly offset disturbances without waiting for error accumulation: The torque feedforward τ ff_torque =τ load_predicted +τ friction_model +τ gravity_compensation ; Among them, τ load_predicted is the load moment, τ friction_model is the friction torque, τ gravity_compensation is the gravity compensation torque.
Citation Information
Patent Citations
External compensation method of numerical control machine tool position related error based on position prediction
CN110045681A
Iterative learning feedforward control method of machine tool feeding system and system
CN110703693A
Control system for alumina alkali liquor blending process
CN113608560A
Power distribution network voltage control method based on multi-agent deep reinforcement learning
CN117913842A
Numerical control detection system based on edge controller
CN118466453A
Cited By
Compensation processing method based on embedded physical model driving
CN121523220A
A Compensation Machining Method Based on Embedded Physical Model
CN121523220B