Research on Network Control Technology of CNC Machine Tools
2026-04-06 05:43:18··#1
Abstract: This paper introduces a network monitoring system for CNC machine tools. The system adopts a server/client model, utilizing socket technology to develop corresponding software. Clients operate the server via the network, completing the transmission and reception of control commands, machining codes, machining status images, and information, thereby achieving remote real-time control and monitoring of the machine tool's machining process. Keywords: CNC machine tool, network control technology Introduction With the development of network technology, network control technology is attracting increasing attention. A network control system combines computer network technology and automation control technology to achieve network control. The network control system integrates machine tool technology, control technology, communication technology, detection technology, image technology, computer software technology, and network technology, enabling remote monitoring of machine tools via the Internet/Intranet, thus giving machine tools greater flexibility and controllability. Network control technology, as an emerging technology, has attracted widespread attention from many research institutions [1-3]. Various types of network control technologies are being researched and developed, some based on Web communication platforms [4-6], some using Socket technology, and others based on CORBA middleware technology, etc. This will inevitably bring about a meaningful transformation in the development of the manufacturing industry. This article introduces the network control system for CNC machine tools developed by the author. The system is developed using Windows 2000 as the development platform, with Visual C++ tools and Windows Sockets, realizing real-time monitoring of machine tools within a local area network. 1. Implementation of TCP/IP Network Communication1.1 Introduction to TCP/IP The so-called TCP/IP is just an abbreviation, referring to Internet Protocol (IP) and Transmission Control Protocol (TCP), which are two very important communication protocols in Internet technology and are applicable to communication on any set of interconnected networks. The structure of TCP/IP divides the network into four layers: application layer, transport layer, network layer, and data link layer. This merges some layers of the seven-layer transport reference model of the Open Systems Interconnection (OSI) standard established by the International Organization for Standardization (ISO). The mapping relationship between the two is shown in Figure 1. 1.2 Introduction to Windows Sockets TCP/IP-based network communication can be implemented using Windows Sockets. A socket is a general-purpose network programming interface; it is an abstraction of a communication endpoint, providing a mechanism for sending and receiving data. There are currently two types of sockets: Datagram Sockets and Stream Sockets. We use Stream Sockets because they can send data to the destination sequentially and without duplication, providing a reliable connection-oriented data transmission method. Windows Sockets provides application developers with a simple application programming interface (API), which allows applications to call its interface functions to achieve communication. Furthermore, Windows Sockets utilizes underlying network communication protocols (such as TCP/IP) and the operating system to implement the actual communication. The relationship between them is shown in Figure 2. 1.3 Usage of Streaming Sockets Streaming sockets are used in a connection-based protocol. A connection must be established before data can be transmitted or received, and data can then be read from the data stream. First, the server creates a listening socket, allocates an address to it, and calls the `listen()` function to put it in listening mode. The client, after creating its socket, allocates an address to it and calls the `connect()` function to request a connection to the server socket. Upon receiving the client's connection request, the server socket calls the `accept()` function, which creates a connection socket. Using this socket and the connection socket on the client, data can be transmitted between the server and client. After the transmission ends, both parties call the `closesocket()` function to close the socket. The usage is shown in Figure 3. 2. Implementation of the Network Control System2.1 Principle of the Network Control System The network control system software runs on the client machine, which connects to the server via a local area network (LAN). The machine tool's CNC system runs on the server. First, the server's local CNC system is started and initialized. Then, it enters network control mode, opens the listening socket, and waits for connection requests from client machines. Upon receiving a connection request, the server verifies the connection information. If the connection conditions are met, a connection is established, and both parties can send and receive information and commands. In network control mode, the server's CNC system can use a CCD to acquire real-time images and parameters of the machine tool's machining status. The images are saved in bitmap format and periodically sent to the client machine for display, and status parameters are sent to the client machine in real-time. CNC machining code can be edited in the client's remote control software, then transmitted to the server and downloaded to the PMAC to await control commands. The client sends machine tool machining control commands to the server to control the machine tool's operation, while simultaneously receiving information from the server and dynamically monitoring the machine tool's machining status. Through the remote control program, the client can also modify machine tool machining parameters online and debug the machine tool. 2.2 Network Control System Hardware Structure The network control system of the CNC machine tool adopts a modular hardware structure. The CNC system uses a "PC + NC" structure, with a Pentium 4 mainframe PC and an open multi-axis motion controller PMAC2-PCI for the NC component. The network system uses a "server + client" approach, with the CNC system running on the server and the network control software running on the client. The server and client are connected to the Intranet/Internet via network cards and communication cables. A CCD camera is installed on the CNC machine tool to monitor the machining process, and the image acquisition card captures and saves the machine tool's operation in real time. The hardware structure of this system is shown in Figure 4. 2.3 Network Control System Software Design A user-friendly human-machine interface is indispensable for any control system. This system's interface design uses split-view technology from Windows programming, dividing the CNC system's human-machine interface into two sub-windows. The left window is the image display window, enabling image monitoring of the machine tool machining process; the right window is the network control window, enabling functions such as network connection and disconnection, machining code editing and sending, machine tool machining status parameter display, and online network debugging of the machine tool. A key aspect of the software design is the network transmission of data. To ensure timely data transmission, multi-threading technology is employed, with a dedicated thread for transmitting the acquired machine tool data over the network. The system flowchart is shown in Figure 5. After the CNC code is edited on the client machine, it can be transmitted to the server all at once. The server saves the CNC code in memory and then compiles and executes it. Control commands can be transmitted from the client machine to the server at any time, and the server executes the commands immediately upon receipt. The transmission of machine tool machining images and status parameters is more complex. On the server, the CNC system acquires machining images in real time via a CCD camera, uses a timer to save the image as a bitmap file in each cycle, and then transmits the bitmap file to the client machine via the network. After receiving each bitmap file, the client machine refreshes the image display window using a timer in each cycle, ensuring the continuity of the machining image. Meanwhile, the CNC system on the server collects machine tool status parameters in real time. Using a timer, it transmits data in a specific format to the client every cycle. The client receives and analyzes the data, then updates the status parameters using the timer within a cycle. To avoid confusion between bitmap data and parameter data during transmission, an interrupt method is used on the server side. Parameter data transmission is interrupted while image data is being transmitted, and resumed only after the image data transmission is complete. This effectively solves the problem of channel occupancy during data transmission. During software operation, there is a certain lag in image display and parameter updates, which is related to the network transmission speed and the amount of data. 3. Network Control System Demonstration Figure 6 shows a demonstration of the developed network control system monitoring machine tool processing within a local area network. The experiment shows that the real-time transmission of control commands and status data is good and meets the needs of actual control; however, the image display refresh rate for processing status is slow, resulting in slightly poor real-time performance, and the image display exhibits some jumps, requiring further improvement in image display smoothness. 4. Conclusion This paper introduces a network control system for CNC machine tools. Based on the TCP/IP communication protocol, it utilizes Sockets to establish a server/client model. The host computer with the CNC system acts as the server, and the network control terminal acts as the client. By controlling and debugging the CNC machine tool through the client, the machine tool gains greater flexibility and controllability. This system allows for remote, real-time operation of the machine tool, essentially achieving the goal of dynamic debugging and monitoring of machine tool operation. It provides an efficient approach to machine tool control and debugging technology, demonstrating practicality and value. References [1] Han Jiang et al. Concept and technical content of network numerical control system. China Mechanical Engineering, 2001 (10): 1141-11441 [2] Zhang Jie et al. Remote operation and control system of intelligent numerical control machining unit. China Mechanical Engineering, 1998 (12): 753-7561 [3] Zhou Qi et al. Network-based numerical control manufacturing technology. Electromechanical Engineering, 2002, 19 (5): 57-611 [4] Jia Zhenyuan et al. Research on remote control rapid prototyping technology. Journal of Dalian University of Technology, 2001, 41 (4): 472-4761 [5] Wang Jianfeng et al. A remote monitoring system based on Internet. Manufacturing Informationization, 2002 (3): 7-91 [6] Shi Xuming et al. Application of PC-based open numerical control system in Intranet. Modular Machine Tools and Automated Manufacturing Technology, 2001, 1: 26-291