A machine tool adaptive control method based on NC-Link protocol communication
By adopting a fuzzy control algorithm based on the NC-Link protocol in CNC machine tools, the feed speed is adjusted in real time to change the spindle power, which solves the problem of low adaptive machining efficiency in existing technologies and achieves constant cutting force and improved machining efficiency.
Patent Information
- Application Number
- CN202411695448.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2044-11-25
AI Technical Summary
Existing technologies make it difficult to achieve adaptive machining in CNC machine tools, especially in terms of maintaining constant cutting force and improving machining efficiency.
An external integrated adaptive machining control method for machine tools based on NC-Link protocol communication is adopted. The cutting force is estimated by using a fuzzy algorithm through the spindle current or spindle power, and the spindle power is changed by adjusting the feed speed in real time, thereby realizing adaptive control machining.
It effectively ensures constant cutting force during machining, improves machining efficiency, and realizes intelligent control and data analysis of CNC machine tools.
Smart Images

Figure CN119561969B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of numerical control machine tool processing compensation and numerical control system communication, and relates to a machine tool adaptive control method based on NC-Link protocol communication. Background Art
[0002] The NC-Link protocol is a protocol designed specifically for CNC systems and industrial automation equipment. As the manufacturing industry transitions toward intelligent and automated processes, the demand for efficient and reliable data exchange between devices continues to increase. Companies want to monitor device status in real time to improve production efficiency and utilization. With the development of the Internet and local area network technologies, TCP / IP has become the mainstream foundation for industrial communications. The NC-Link protocol is often based on this protocol, supporting efficient data transmission. To achieve interoperability between different devices and systems, the industry requires a standardized communication protocol. The NC-Link protocol is designed to be compatible with a wide range of devices, enabling equipment from different manufacturers to work together. Industry 4.0 emphasizes data collection and utilization, and the NC-Link protocol emerged in this context. Supporting data sharing between devices requires CNC systems to seamlessly connect with other intelligent devices (such as sensors and PLCs) to achieve intelligent control and data analysis. In CNC machine tools, the NC-Link protocol is widely used to enable data transmission between the machine tool and control and monitoring systems. The background technology of the NC-link communication protocol was developed under the impetus of manufacturing automation, network technology advancements, and Industry 4.0. It provides the necessary technical support for efficient and reliable communication between CNC systems and industrial equipment, and facilitates the realization of intelligent manufacturing.
[0003] Adaptive machining is an advanced manufacturing technology designed to improve the efficiency and precision of machining processes by monitoring and adjusting machining parameters in real time. As market demand evolves, the manufacturing industry is shifting towards personalized, small-batch production. Traditional fixed machining models are unable to meet the demands for flexibility and efficiency. The rise of Industry 4.0 has driven the development of intelligent manufacturing, and adaptive machining has become a key approach to achieving intelligent production. By installing various sensors (such as force sensors, temperature sensors, and vibration sensors) on machining equipment, various parameters during the machining process are monitored in real time. Using a data acquisition system, this data is transmitted to a control system for analysis to identify machining status and potential problems. Adaptive control algorithms are then applied to dynamically adjust machining parameters (such as cutting speed and feed rate) based on this real-time data to adapt to varying machining conditions. By continuously acquiring feedback, the machining process is automatically adjusted to ensure machining quality and efficiency. In the aerospace industry, adaptive machining can improve the machining accuracy and consistency of complex components. Adaptive machining is an intelligent manufacturing method that combines real-time monitoring, feedback control, and advanced computing technologies to improve machining efficiency, reduce costs, and enhance product quality. Summary of the Invention
[0004] The present invention provides an external integrated adaptive machining control method for machine tools based on NC-Link protocol communication, which ensures constant cutting force during machining and improves machining efficiency. The method uses a fuzzy algorithm to estimate the cutting force through spindle current or spindle power, and changes the spindle power by real-time regulation of feed speed, thereby achieving adaptive control machining.
[0005] A machine tool adaptive control method based on NC-Link protocol communication, characterized in that the method comprises the following specific steps:
[0006] Step 1: Connect to the CNC system through the API Server. The NC-Link adapter first establishes a TCP / IP connection with the API Server, then sends a connection request to the CNC system through the API Server. The API Server acts as an intermediary, verifying and forwarding the request. Once the connection is established, the NC-Link adapter can send various commands and data to the CNC system through the API Server, such as reading machine status and issuing machining programs. The API Server is responsible for protocol conversion and data processing, ensuring smooth communication between the NC-Link adapter and different types of CNC systems.
[0007] Step 2: Establish an MQTT client and connect to the MQTT server. The device uses the NC-link protocol interface to receive data from the device. Select a suitable MQTT library, such as PahoMQTT, Mosquitto, EMQX, etc., to enable the MQTT client to connect to the MQTT server and publish data to the specified Topic. Convert the NC-link data into a format that can be understood by the MQTT protocol (such as JSON), and publish the formatted data to the MQTT server through the MQTT client.
[0008] Step 3: Find the node parameter name in the MQTT server and create a node object; in the CNC system parameter list, find the MQTT server node parameter name corresponding to the PLC register of the machine tool spindle current or spindle power and feed speed; and create an NC-Link node object in the adaptive compensation computer;
[0009] Step 4, establish a constant power adaptive fuzzy controller through Matlab;
[0010] Setting the control rules for a fuzzy controller requires selecting an appropriate vocabulary to describe the input and output variables. By combining the concepts of large, medium, and small, and the positive and negative directions, and also adding the zero variable state, a total of seven vocabulary terms can be formed: {negative large, negative medium, negative small, zero, positive small, positive medium, positive large}. After developing the corresponding fuzzy resolution and fuzzy control strategy, the fuzzy sets of the error E and the error change EC are determined, and the fuzzy set of the control variable U can be synthesized using a fuzzy inference algorithm:
[0011] U=E×EC·R
[0012] In the formula, R is called the relationship matrix of the fuzzy algorithm.
[0013] When determining the parameters of a fuzzy controller, the domain of the input variables and the domain of the output variables must be determined before designing a specific fuzzy controller. For example, the range of variation of the spindle power and power rate of change as input quantities, and the range of variation of the feed rate as output quantity. At the same time, the proportional factor and quantization factor of the fuzzy controller must be reasonably selected. These two factors have a significant impact on the control performance of the fuzzy controller. Assuming that the basic domain of the error is set to [-x, +x], and the domain of the fuzzy set of the error is {-n, -n+1, ..., 0, ..., n-1, n}, the quantization factor k of the error can be determined using the following formula:
[0014] k=n / x
[0015] Similarly, the proportional factor l of the output control amount and the quantization factor j of the error change can also be determined according to the above method.
[0016] A two-dimensional fuzzy controller is used to realize the constant power adaptive control of the machine tool. In the control algorithm, the target cutting power P is first set, and the target cutting power P is compared with the actual spindle cutting power measured during the cutting process to obtain the error E p and error change rate C p The feed rate adjustment value ΔU obtained after the fuzzy controller processing is input into the PLC to change the feed speed, thereby realizing the intelligent control of the cutting process. This process is cyclically controlled to ensure that the spindle power of the cutting process is kept near the target cutting power P.
[0017] A fuzzy controller was constructed using MATLAB's FuzzyLogicToolbox. The membership functions for EP, Cp, and the controlled variable ΔU were edited in the MATLAB Fuzzy Logic Editor window (FISEditor). The system offers a variety of membership function types, allowing users to define their own. Because the centroid method is used to defuzzify the output, selecting "centroid" in the "Defuzzification" section of the Fuzzy Logic Editor automatically defuzzifies the output using the centroid method. In fuzzy control, fuzzy control rules are expressed as "IF...THEN..." statements and can be designed and modified using the Membership Rule Editor. Fuzzy rules modified using this editor are versatile and convenient. The process involves first automatically matching the input variables to the corresponding linguistic variables, and then selecting the corresponding output variable linguistic variables through a human-computer interactive graphical interface. This completes the construction of a fuzzy controller based on FuzzyLogicToolbox. Within this fuzzy controller, users can set inputs within the domain of the input variables to obtain corresponding output values.
[0018] Step 5: Read the machine tool and obtain the spindle current and feed speed data. The adaptive compensation computer reads the spindle current or spindle voltage of the CNC machine tool from the NC-Link node parameters corresponding to the machine tool's PLC register found in step 3. It also reads the machine tool's feed speed, uses the mechanical spindle current to determine the cutting force through a fuzzy control algorithm, and calculates the feed speed error compensation value.
[0019] Step 6: Write the adaptive control compensation value to the PLC register of the coordinate origin offset value of the CNC system; and realize the constant power adaptive compensation of the CNC machine tool based on the fuzzy control principle.
[0020] The present invention has the following beneficial effects:
[0021] The adaptive control method for machine tools based on NC-Link protocol communication provided by the present invention can realize communication between the error compensator and the numerical control system and realize adaptive processing error compensation without the need for the numerical control system manufacturer to provide a dynamic link library, which can solve the problem of limited development of error compensation software caused by dependence on dynamic link libraries; the method of communication between the adaptive compensation system and the numerical control system in the present invention has a certain universality, and the method provided by the present invention can be extended to all numerical control systems that can adapt to the NC-Link protocol. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 The flowchart of the machine tool adaptive control method based on NC-Link protocol communication.
[0023] Figure 2APIServer display diagram.
[0024] Figure 3 Fuzzy controller structure diagram. DETAILED DESCRIPTION
[0025] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention is described in detail below with reference to the accompanying drawings.
[0026] Taking the Huazhong Type 8 CNC system as an example, the implementation method of the present invention is described in detail. The system adopts a multi-core processor architecture, has high performance, openness and intelligent features, and supports key technologies such as high-speed and high-precision interpolation, intelligent servo control and multi-axis collaborative control. It is suitable for various types of high-end CNC machine tools, can control up to 8-32 axes, and has nanometer-level interpolation accuracy. The Huazhong Type 8 system integrates advanced human-computer interaction interface, intelligent functions and networking features, and supports a variety of processing technologies and advanced surface processing. The system can quickly exchange data through the NC-Link protocol to achieve real-time changes in processing parameters, efficient and precise selection of complex structure precision processing parts, and constant power adaptive control of the processing process. The complete process is as follows: Figure 1 The specific steps are as follows:
[0027] (1) Connect to the CNC system through API Server;
[0028] The NC-Link adapter first communicates with the APIServer ( Figure 2 ) establishes a TCP / IP connection, and then sends a connection request to the CNC system through the API Server. The CNC system IP is set to 192.168.12.100. In the nclink.cfg configuration file in the CNC system, server_ip is the local IP address, and the default port number is 1883.
[0029] (2) Establish an MQTT client and connect to the MQTT server;
[0030] The device uses the NC-link protocol interface to receive data from the device. Select a suitable MQTT library, such as PahoMQTT, Mosquitto, EMQX, etc., to connect the MQTT client to the MQTT server and publish data to the specified Topic. Convert the NC-link data into a format that the MQTT protocol can understand (such as JSON), and publish the formatted data to the MQTT server through the MQTT client. mqtt:url: is the URL for connecting to the MQTT server. The transport layer protocol is TCP / IP, and the IP address is the IP address of the MQTT server. The MQTT server started locally here can use 127.0.0.1. The port number is the port number of the MQTT server.
[0031] (3) Find the node parameter name in the MQTT server and create a node object;
[0032] In the CNC system parameter list, find the MQTT server node parameter name corresponding to the PLC register of the machine tool spindle current or spindle power and feed speed; establish an NC-Link node object in the adaptive compensation computer, subscribe to the "nodes / #" topic to receive all node-related messages, and then set the message handler HandleMessage to process the received messages. In the HandleMessage method, parse the received JSON format message, extract the node parameters, use the CreateOrUpdateNode method to create or update the node object according to the received parameters, store the discovered nodes in the discoveredNodes list, and provide the PrintDiscoveredNodes method to display all discovered nodes and their parameters.
[0033] (4) Establish a constant power adaptive fuzzy controller through Matlab;
[0034] The fuzzy controller is constructed with the help of MATLAB's FuzzyLogicToolbox. The centroid method is used for defuzzification of the output. Therefore, in the fuzzy logic editing window, in the "Defuzzification" option, select the "centroid" option. The system will automatically use the centroid method to complete the defuzzification of the output. The fuzzy controller structure is as follows: Figure 3 .
[0035] Create a fuzzy inference system (FIS) using amfis('Name', 'ConstantPowerAdaptiveFuzzyController'); define input variables (power error and error rate) and output variables (control output); add fuzzy sets to the input and output variables using addMF(fis, 'ControlOutput', 'trimf', [-1-10], 'Name', 'DecreaseFast'); define the expression of the fuzzy rule "IF...THEN...", which can be designed and modified using the membership rule editor; create an adaptive mechanism to adjust the output fuzzy set.
[0036] controlOutput = evalfis(fis, [normalizedError, normalizedErrorRate]); In each iteration: calculate the power error and error rate, use the fuzzy controller to calculate the control output, update the current power, and apply the adaptive mechanism to adjust the fuzzy set; display the final fuzzy system and membership function
[0037] (5) Read the machine tool and obtain the spindle current and feed speed data;
[0038] The adaptive compensation computer reads the spindle current or spindle voltage of the CNC machine tool from the NC-Link node parameters corresponding to the PLC register of the machine tool found in the third step; it also reads the machine tool feed speed, uses the mechanical spindle current to determine the cutting force through a fuzzy control algorithm, and calculates the feed speed error compensation value;
[0039] (6) Write the adaptive control compensation value to the PLC register of the coordinate origin offset value of the CNC system; realize the constant power adaptive compensation of the CNC machine tool based on the fuzzy control principle.
Claims
1. A machine tool adaptive control method based on NC-Link protocol communication, characterized in that: The specific steps are as follows: Step 1: Connect to the CNC system through the API Server. The NC-Link adapter first establishes a TCP / IP connection with the API Server, and then sends a connection request to the CNC system through the API Server. API Server acts as an intermediary layer to verify and forward requests; Once the connection is established, the NC-Link adapter sends various commands and data to the CNC system through the API Server, including reading machine tool status and issuing machining programs. The API Server is responsible for protocol conversion and data processing, ensuring that the NC-Link adapter can communicate with different types of CNC systems. Step 2: Establish an MQTT client and connect to the MQTT server. The device uses the NC-link protocol interface to receive data from the device. Select an MQTT library, including PahoMQTT, Mosquitto, and EMQX, to enable the MQTT client to connect to the MQTT server and publish data to the specified topic. Convert the NC-link data into a format understood by the MQTT protocol and publish the formatted data to the MQTT server through the MQTT client. Step 3: Find the node parameter name in the MQTT server and create a node object; in the CNC system parameter list, find the MQTT server node parameter name corresponding to the PLC register of the machine tool spindle current or spindle power and feed speed; and create an NC-Link node object in the adaptive compensation computer; Step 4, establish a constant power adaptive fuzzy controller through Matlab; Step 5: Read the machine tool and obtain the spindle current and feed speed data; The adaptive compensation computer reads the spindle current or spindle voltage of the CNC machine tool from the NC-Link node parameters corresponding to the PLC register of the machine tool found in the third step; it also reads the machine tool feed speed, uses the mechanical spindle current to determine the cutting force through a fuzzy control algorithm, and calculates the feed speed error compensation value; Step 6: Write the adaptive control compensation value to the PLC register of the coordinate origin offset value of the CNC system; Constant power adaptive compensation of CNC machine tools is realized based on fuzzy control principle.
2. The method for adaptive control of a machine tool based on NC-Link protocol communication according to claim 1, characterized in that: In step 4, the control rule setting of the fuzzy controller requires selecting an appropriate word set to describe the input and output variables; by combining the concepts of large, medium, small and positive and negative directions, and adding the state of the variable being zero, a total of seven words are formed, namely {negative large, negative medium, negative small, zero, positive small, positive medium, positive large}; after formulating the corresponding fuzzy resolution fuzzy control strategy, the fuzzy set of the error E and the fuzzy set of the error change EC are obtained, and the fuzzy set of the control variable U is synthesized using the fuzzy inference algorithm to obtain: U=E×EC·R(1) In the formula, R is called the relationship matrix of the fuzzy algorithm.
3. The method for adaptive control of a machine tool based on NC-Link protocol communication according to claim 2, characterized in that: When determining the parameters of a fuzzy controller, the domain of the input and output variables must be determined before designing the specific fuzzy controller. The range of variation of the spindle power and power change rate as input variables, and the range of variation of the feed rate as output variable, are important. The selection of the fuzzy controller's proportional factor and quantization factor significantly influences its control performance. The basic domain of error is set to [-x, +x], and the domain of the error fuzzy set is {-n, -n+1, ..., 0, ..., n-1, n}. The error quantization factor k is determined using the following formula: k=n / x(2) The proportional factor l of the output control quantity and the quantization factor j of the error change can also be determined according to the above method.
4. The method for adaptive control of a machine tool based on NC-Link protocol communication according to claim 3, characterized in that: A two-dimensional fuzzy controller is used to realize the constant power adaptive control of the machine tool. In the control algorithm, the target cutting power P is first set, and the target cutting power P is compared with the actual spindle cutting power measured during the cutting process to obtain the error E. p and error change rate C p ; It is input into the fuzzy controller for fuzzy processing. The feed rate adjustment amount ΔU obtained after processing by the fuzzy controller is input into the PLC to change the feed speed, thereby realizing intelligent control of the cutting process, and using this process loop control to ensure that the spindle power of the cutting process is kept near the target cutting power P.
5. The method for adaptive control of a machine tool based on NC-Link protocol communication according to claim 4, characterized in that: Construct a fuzzy controller with the help of MATLAB's FuzzyLogicToolbox; edit the membership functions of EP, Cp and control variable ΔU in the fuzzy logic editing window of MATLAB; The centroid method is used to defuzzify the output. In the fuzzy logic editing window, select the "centroid" option in the "Defuzzification" option. The system will automatically use the centroid method to complete the defuzzification of the output. In fuzzy control, fuzzy control rules are expressed in the form of "IF...THEN..." and are designed and modified through the membership rule editor. The fuzzy rules modified by the editor are universal and convenient. The process is as follows: First, complete the self-matching of each language variable of the input quantity, and then select the corresponding output variable language through the human-computer interactive graphical interface; the fuzzy controller based on FuzzyLogicToolbox is completed. In this fuzzy controller, the user sets the corresponding input within the domain of the input quantity to obtain the corresponding output value.
Citation Information
Patent Citations
Machine tool external comprehensive thermal error compensation method based on OPCUA protocol communication
CN116540629A
Can bus-based drive-by-wire ABS braking system and control method
WO2014059806A1