Machine tool adaptive control method based on NC-Link protocol communication
Through the adaptive control method of machine tool based on NC-Link protocol communication, the fuzzy algorithm is used to monitor and adjust the cutting force in real time, which solves the problem that CNC machine tools are difficult to ensure constant cutting force during the machining process, and improves machining efficiency and accuracy.
Patent Information
- Application Number
- CN202411695448.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-11-25
AI Technical Summary
It is difficult for existing CNC machine tools to monitor and adjust cutting forces in real time during processing, resulting in difficult to ensure processing efficiency and accuracy. Especially in the face of changes in market demand and personalized and small-scale production, the traditional fixed processing model seems insufficient.
Adaptive control method of machine tools based on NC-Link protocol communication is adopted, and the cutting force magnitude is estimated by using the fuzzy algorithm to adjust the feed speed in real time to achieve adaptive control to ensure the constant cutting force during processing.
It realizes adaptive control of constant cutting force during the processing process, improves processing efficiency and accuracy, adapts to different processing conditions, and ensures improvement of product quality and efficiency.
Smart Images

Figure CN119561969A_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] NC-Link protocol is a protocol designed for CNC systems and industrial automation equipment. With the transformation of manufacturing industry to intelligence and automation, the demand for efficient and reliable data exchange between equipment is increasing. Enterprises hope to monitor the status of equipment in real time to improve production efficiency and equipment utilization. With the development of Internet and LAN technology, TCP / IP has become the mainstream basis of industrial communication. NC-link protocol is usually based on this protocol and supports efficient data transmission. In order to achieve interconnection between different equipment and systems, the industry needs standardized communication protocols. The design of NC-link protocol is to be compatible with a variety of equipment so that equipment from different manufacturers can work together. Industry 4.0 emphasizes data collection and utilization. NC-link protocol came into being in this context. It supports data sharing between equipment. CNC system needs to be able to seamlessly connect with other intelligent devices (such as sensors, PLC, etc.) to achieve intelligent control and data analysis. In CNC machine tools, NC-link protocol is widely used to realize data transmission between machine tools and control systems and monitoring systems. The background technology of the NC-link communication protocol was developed under the impetus of manufacturing automation, network technology progress and Industry 4.0. It provides the necessary technical support for efficient and reliable communication between CNC systems and industrial equipment, and helps realize intelligent manufacturing.
[0003] Adaptive machining is an advanced manufacturing technology that aims to improve the efficiency and accuracy of the machining process by real-time monitoring and adjustment of machining parameters. With the changes in market demand, the manufacturing industry has gradually transformed to personalized and small-batch production. The traditional fixed machining mode is difficult to meet the needs of flexibility and efficiency. The rise of Industry 4.0 has promoted the development of intelligent manufacturing. Adaptive machining has become an important means to achieve intelligent production. By installing various sensors (such as force sensors, temperature sensors, vibration sensors, etc.) on the processing equipment, various parameters in the machining process are monitored in real time. With the help of the data acquisition system, the real-time monitoring data is transmitted to the control system for analysis to identify the machining status and potential problems. The adaptive control algorithm is applied to dynamically adjust the machining parameters (such as cutting speed, feed rate, etc.) according to the real-time data to adapt to different machining conditions. By continuously obtaining feedback information, the machining process can be automatically adjusted to ensure machining quality and efficiency. In the field of aerospace, adaptive machining can improve the machining accuracy and consistency of complex parts. Adaptive machining is an intelligent manufacturing method that combines real-time monitoring, feedback control and advanced computing technology, aiming to improve machining efficiency, reduce costs and improve 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, so as to ensure that the cutting force is constant during machining and improve the machining efficiency. The cutting force is estimated by using a fuzzy algorithm through the spindle current or the spindle power, and the spindle power is changed by real-time regulation of the feed speed, so as to achieve 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 APIServer; the NC-Link adapter first establishes a TCP / IP connection with the APIServer, and then sends a connection request to the CNC system through the APIServer. The APIServer acts as an intermediate layer to verify and forward the request. Once the connection is established, the NC-Link adapter can send various instructions and data to the CNC system through the APIServer, such as reading the machine status, issuing processing programs, etc. The APIServer is responsible for protocol conversion and data processing to ensure 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 be able to 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.
[0008] Step 3, search for the node parameter name in the MQTT server and create a node object; in the CNC system parameter list, search for the MQTT server node parameter name corresponding to the PLC register of the machine tool spindle current or spindle power and feed speed; create an NC-Link node object in the adaptive compensation computer;
[0009] Step 4, establish a constant power adaptive fuzzy controller through Matlab;
[0010] The control rule setting of the fuzzy controller requires the selection of appropriate word sets 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 can be 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 quantity U can be obtained by fuzzy reasoning 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 the 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 change of the spindle power and power change rate as input quantities, and the range of change of the feed speed 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 great influence on the control performance of the fuzzy controller. Assuming that the basic domain of the error is set to [-x, +x], and the fuzzy set domain of the error is {-n, -n+1, ..., 0, ..., n-1, n}, the quantization factor k of the error can be determined by 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 It is input into the fuzzy controller for fuzzy processing, and the feed rate adjustment amount ΔU obtained after the fuzzy controller is processed is input into the PLC to change the feed speed, thereby realizing the intelligent control of the cutting process, and using this process cycle control to achieve the spindle power of the cutting process to be kept near the target cutting power P.
[0017] Fuzzy controller is constructed with the help of MATLAB's FuzzyLogicToolbox. In the MATLAB fuzzy logic editing window (FISEditor), the membership functions of EP, Cp and control quantity ΔU are edited. The system provides a variety of membership function types to choose from, and also allows users to define them themselves. Because the centroid method is used for the defuzzification of the output, in the fuzzy logic editing window, in the "Defuzzification" option, select the "centroid" option, and the system will automatically use the centroid method to complete the defuzzification of the output. In fuzzy control, fuzzy control rules are presented in the form of "IF...THEN...", which can be designed and modified through the membership rule editor. The fuzzy rules modified by the editor are universal and convenient. The process is: 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. At this point, the fuzzy controller based on FuzzyLogicToolbox is completed. In this fuzzy controller, users can set the corresponding input within the domain of the input quantity to obtain the corresponding output value.
[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 PLC register of the machine tool found in the third step; and reads the feed speed of the machine tool, uses the mechanical spindle current to determine the cutting force through the 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; 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 machine tool adaptive control method based on NC-Link protocol communication provided by the present invention can realize the 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, and 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 adaptive control method of machine tools based on NC-Link protocol communication is shown in Figure 2.
[0023] Figure 2APIServer display diagram.
[0024] Figure 3 Structure diagram of the fuzzy controller. DETAILED DESCRIPTION
[0025] In order to make the purpose, 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 interfaces, 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 such as 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 APIServer. The IP of the CNC system is set to 192.168.12.100, and the nclink.cfg configuration file in the CNC system: server_ip is the local IP address, and the port number defaults to 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. 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 message. 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, amfis('Name','ConstantPowerAdaptiveFuzzyController'); define input variables (power error and error change rate) and output variables (control output); add fuzzy sets to the input and output variables addMF(fis,'ControlOutput','trimf',[-1-10],'Name','DecreaseFast'); define the expression form of the fuzzy rule "IF...THEN...", which can be designed and modified through 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, 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; and reads the feed speed of the machine tool, uses the mechanical spindle current to determine the cutting force through the fuzzy control algorithm, and calculates the feed speed error compensation value;
[0039] (6) Writing the adaptive control compensation value into the PLC register of the coordinate origin offset value of the CNC system; realizing 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 APIServer; the NC-Link adapter first establishes a TCP / IP connection with the APIServer, and then sends a connection request to the CNC system through the APIServer; APIServer acts as a middle layer to verify and forward requests; After the connection is established, the NC-Link adapter sends various instructions and data to the CNC system through the API Server, including reading the machine tool status and issuing processing programs; the API Server is responsible for protocol conversion and data processing to ensure 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, EMQX, to enable the MQTT client to connect to the MQTT server, and be able to 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, search for the node parameter name in the MQTT server and create a node object; in the CNC system parameter list, search for the MQTT server node parameter name corresponding to the PLC register of the machine tool spindle current or spindle power and feed speed; 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; and reads the feed speed of the machine tool, uses the mechanical spindle current to determine the cutting force through the 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; realize the constant power adaptive compensation of the CNC machine tool based on the fuzzy control principle.
2. The method for adaptive control of machine tools based on NC-Link protocol communication according to claim 1, characterized in that: In step 4, the control rule setting of the fuzzy controller needs to select a suitable 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 quantity U is synthesized using the fuzzy reasoning algorithm: 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 machine tools based on NC-Link protocol communication according to claim 2, characterized in that: When determining the parameters of the fuzzy controller, the domain of the input variable and the domain of the output variable must be determined before designing the specific fuzzy controller; the variation range of the spindle power and power change rate as the input quantity, and the variation range of the feed speed as the output quantity; the selection of the proportional factor and quantization factor of the fuzzy controller has a great influence on the control performance of the fuzzy controller; the basic domain of the error is set to [-x, +x], the fuzzy set domain of the error is {-n, -n+1, ..., 0, ..., n-1, n}, and the quantization factor k of the error is determined by the following formula: k=n / x(2) 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.
4. The method for adaptive control of machine tools 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 cyclic 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 machine tools based on NC-Link protocol communication according to claim 4, characterized in that: Construct a fuzzy controller with the help of MATLAB's Fuzzy Logic Toolbox; edit the membership functions of EP, Cp and the control quantity ΔU in the MATLAB's fuzzy logic editing window; The centroid method is used for defuzzification of output. In the fuzzy logic editing window, in the "Defuzzification" option, select the "centroid" option, and 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: 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