Research on Network Communication and Control Technology in CNC Machine Tools
2026-04-06 06:25:27··#1
In recent years, with the rapid development and widespread application of information technologies, represented by computers and network communications, the manufacturing industry has undergone significant changes in both concepts and technologies. The traditional mass production model, centered on relatively fixed machines and production sites and managed and controlled from top to bottom, is gradually shifting towards a human-centered, technology-based advanced manufacturing model. The concept of global manufacturing utilizes resources (equipment, knowledge, and manpower) in different locations to manufacture products needed by the market, making remote monitoring technology for machining units a crucial component. To achieve remote monitoring of machining units, the primary challenge is solving the network communication and control technology problems of CNC machine tools. This project aims to address the network communication and control technology issues of traditional, economical CNC machine tools by achieving centralized management and network communication of NC programs through a central server, thereby adapting to the development of modern advanced manufacturing technologies. 1. Requirements Analysis 1.1 Problems with Traditional Economic CNC Machine Tools Traditional economic CNC machining equipment, categorized by CNC system, mainly includes: FANUC systems (including 3T, 7M, HC-6, 6MB, etc.), AB systems, and domestic 3B wire EDM systems. Based on CNC program input/output communication interface types, they fall into three categories: one with only RS232/RS422 serial ports, another with only 8/5 unit parallel ports for paper tape readers, and a third combining the first two types of interfaces. These three types of machine tools also share the same problems: small memory capacity, unsuitable for machining complex, large-area, high-precision, and long-program parts; poor external interface capabilities, lack of DNC functionality, and inability to achieve online machining and network control. 1.2 Desired Solution Based on meeting the most basic application needs while retaining some potential for expansion and performance improvement, the goal is to improve the application environment of CNC machining technology. The following solutions are proposed: hardware modification of machine tool communication interfaces, designing corresponding communication interface boards for various machine tools; development of communication control software to realize the stand-alone communication function of each machine tool; development of other auxiliary functions (such as: extraction of machining information in CNC programs, CNC program graphical simulation, online machining of long programs, etc.) to compensate for and enhance the functions of the original CNC system; selection of network architecture and definition of communication protocols, and development of network system control software to realize centralized management and network communication of CNC programs by the central server. 2. System Structure 2.1 Network System Composition and Function The entire network system consists of a central server, network interfaces, bidirectional data converters, field servers, 1-to-N port parallel data transceivers, data receivers, and economical CNC machine tools. The central server is the central part of the entire network, and it mainly completes the overall control of servers at all levels. It adopts a background interrupt working mode, which does not require human intervention, and other tasks can be performed in the foreground. The field server acts as a client, functioning as both a CNC server and possessing powerful network communication capabilities. It receives various tasks from the central server: retrieving CNC machining program data from the central server via the network and transmitting this data to the NC file library; and feeding back the machined CNC program to the central server. It can extract corresponding CNC code from the system's NC file library, extract relevant machining part data and information, process it, and perform tasks such as graphical simulation of the NC program. Furthermore, for parts requiring long programs, the field server also completes online machining tasks for those long programs. The field server can simultaneously serve multiple CNC devices. As needed, network nodes can be set up within a certain space in the workshop (e.g., a small workspace or a small local area), with a PC serving as the field server. One server can serve multiple CNC devices using a 1-to-N port parallel data transceiver, depending on actual needs. 2.2 System Network Architecture and Communication Protocol Selection All information in the system is transmitted through the network. In the development of computer networks, the most influential network architectures are the OSI seven-layer reference model and the TCP/IP architecture model. The OSI reference model is the ISO 7498 international standard. The TCP/IP architecture is the architecture used in today's popular Internet networks. Although it is not an international standard, it occupies a very important position in computer network architecture. This is because, while the OSI architecture is theoretically more complete and its protocols at each layer are well-considered, in reality, very few commercial products fully compliant with OSI protocols have entered the market, far from meeting the needs of various users. However, products using the TCP/IP protocol have flooded the market; almost all workstations are equipped with TCP/IP, and it has become the de facto standard for computer networks, commonly referred to as the "industry standard." Therefore, in our CNC machine tool network communication system, we adopt the TCP/IP network architecture, which divides the computer network into four layers: application layer, transport layer, network layer, and network interface layer. The TCP/IP architecture defines two protocols for the transport layer: Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). UDP provides a connectionless datagram protocol where data packets are transmitted as independent packets. It does not guarantee error-free transmission, and data may be lost, duplicated, or out of order. The length of data packets is also limited by a maximum processing size (default 8192 bytes, maximum 32768 bytes), and it does not perform packet splitting and reassembly. TCP, on the other hand, is a reliable, full-duplex, byte-stream, connection-oriented protocol. Compared to UDP, TCP offers reliable transmission, error-free and non-duplicated data, and can receive data in the order it was sent. Data is a byte stream with no length limit, providing virtual circuit services and verification for reliable data transmission. Considering the characteristics of CNC machining, although UDP is more reliable when the data packet size is less than 2048 bytes, its packet service is single-packet and out-of-order. Since the system's network communication obviously cannot guarantee that all transmitted information is less than 2048 bytes, TCP must be chosen as the system's transport layer protocol. The choice of communication protocol for the application layer must consider both the characteristics of CNC machining and the requirements of real-time performance, reliability, and large data transmission volume. This system has separately developed a corresponding protocol based on the TCP/IP protocol suite, defining the specific meaning of information transmitted between application processes. 2.3 Implementation of the Communication Protocol The system protocol ensures that application threads on the client and server sides can accurately, timely, and orderly transmit information to each other, and can perform syntax analysis and interpretation of the information without errors. For network control systems, the transmitted information has its own unique meaning. The information transmitted between the client and the central server mainly includes client request information, data information, and central server status information. Client control information is divided into two types: network control information and machining control information; server status information is also divided into two types: connection status information and client status information. In the system protocol, these information all have corresponding format specifications. Client network control information is mainly used for establishing, maintaining, and releasing connections with the server. Machining control information consists of control command words and control parameters. The network communication protocol format is: "cmd, 1-byte command code, 1-byte command length, command parameters, 4-byte checksum (XC)". 'cmd' is the command introductory code, used to identify the start of the command. 'Command length' only includes the length of the command parameters and checksum. If there are no command parameters, it is 4, the checksum will be meaningless and not checked, but it must still be sent. The last 4 bytes of the transmitted data packet are the checksum. The first 3 bytes are the sum of all bytes in the packet, and the 4th byte is the XOR value of all bytes. If a data error occurs during transmission, the checksum in the 4th byte will definitely be incorrect. Therefore, monitoring the 4th byte checksum ensures the reliability of communication data. 3. Hardware Design Principles The system uses a 2/4/8-port RS422A interface card for conversion on the server side, and then uses an RS-422/RS-485 bidirectional data converter to connect to the field server. Both the 2/4/8-port RS422A interface card and the RS-422/RS-485 bidirectional data converter use industrial control standard interface boards. When the field server serves multiple CNC machine tools, a "1-to-N port parallel data transceiver" is used to distribute the data across multiple machine tools. The "data receiver" is specifically designed for machine tools with only 8/5 parallel ports on the paper tape reader (such as wire cutting machines). It facilitates communication between the machine tool and the PC and enables online processing of CNC programs. When using the data receiver, corresponding modifications are needed to the machine tool wiring: a corresponding 3B code data signal is input into the original paper tape reader's output signal line via a tri-state gate, and the stepping signal originally sent to the paper tape reader is used as the timing signal for the control system to write data. A control switch is included in the system design to select whether to use the original paper tape reader or the data receiver. 4. Software Development Principles The system software consists of two parts: the control software for the network control system and the communication software between the field server and various machine tools. The development principle of the network control system's control software: The control software for the network control system is installed in the central server. Its design principle is that the central server continuously receives and analyzes data packets such as requests, commands, and information sent from various ports. After a data packet is received, it will first verify whether the packet was transmitted incorrectly using the checksum in the packet. If an error is found, it will issue a "retransmit" command to the original client; if correct, it will perform the corresponding processing. The communication software development principle between the field server and various machine tools: For communication between various machine tools and the field server, the basic principle of software development is as follows: To transmit the CNC program to the CNC machine tool, the CNC program is first converted into EIA code or ISO code that the machine tool can recognize. Then, it is read into the field server's memory in the form of data packets, and then sent byte by byte to the CNC machine tool control system. Simultaneously, the computer continuously monitors the status register of the machine tool interface. When data is transmitted from the machine tool, the communication control software always uses a buffer from the end of its program code to the top of the conventional memory (0A0000H) as the data receiving buffer. 5. Conclusion This research solved the network communication and control technology problems of economical CNC machine tools, realizing centralized storage, management, network query, and download functions for CNC machining programs on a central server. It solved the problems of CNC program input and online machining for CNC machine tools without direct communication interfaces. Practice has proven that this system is characterized by its simplicity, ease of use, stable and reliable operation, and excellent performance. Its implementation has significantly improved the storage, management, and transmission of CNC machining programs, thereby effectively increasing actual production efficiency. It also holds significant importance and provides valuable reference for the retrofitting of similar CNC machine tools that lack remote monitoring and online operation capabilities.