Implementation of Communication Functions in Embedded CNC Systems
2026-04-06 06:59:21··#1
0. Introduction The market demands CNC systems for greater flexibility, adaptability, and scalability, and for miniaturization, intelligence, and networking. To address this demand, this paper proposes a networked embedded CNC system. Its central CNC unit is not a PC computer system, but an embedded control system. This embedded control system adopts an ARM+DSP structure, featuring strong computing power and low cost, improving the system's real-time performance and reliability, and realizing the miniaturization, networking, intelligence, and integration of the CNC system. Other units of the embedded CNC system, such as servo control units, PLC units, communication units, display units, and data input units, are also built on the embedded system and belong to the embedded system modules. The communication part of the embedded CNC system includes communication between the CNC main control unit and various units such as servo drives and I/O logic control, workshop-level industrial Ethernet communication, and Intranet/Internet network communication. 1. System Overall Structure This networked embedded CNC system has been successfully developed jointly by the Hubei Provincial Key Laboratory of Digital Manufacturing and the Embedded Laboratory of Wuhan University of Technology. The main control system CPU uses Samsung's S3C44B0 microcontroller, while the system's machine tool control and interpolation calculations, which require high real-time performance, are implemented by TI's 32-bit TMS320F2812 DSP chip. A U2cos11 real-time multitasking operating system is ported to the ARM core for real-time multitasking management. Its main tasks include implementing the human-machine interface for the CNC system, handling tasks such as program input, pre-compilation, trajectory calculation, speed calculation, and simulation of machined part graphics. It also provides an industrial Ethernet interface for communication with the upper-level management PC, which then connects the embedded CNC system to the Internet. The DSP handles some high-real-time machine tool signals and executes machine tool control and interpolation calculations according to the ARM's instructions. Data for interpolation (machining data) is generated in the ARM core and sent to the DSP via the CAN bus for interpolation processing. The servo unit mainly receives instructions from the ARM and DSP to control the spindle motor and feed motor. The overall system architecture is shown in Figure 1. Figure 1 Architecture of embedded CNC system [b] 2. Implementation of communication function of embedded CNC system [/b] The networking of CNC system is based on Internet technology, communication technology, CNC technology and computer technology, etc., integrating remote design, CNC programming and CNC machining, etc., to realize the networking and integration of CNC equipment such as CNC system. As the basic unit of networked manufacturing system, embedded CNC system can realize the functions of centralized control and management of equipment in manufacturing workshop, remote control, remote fault diagnosis, network manufacturing, online training, online marketing and online management, etc., so that enterprises with different CNC types can be connected globally to realize resource sharing and optimized utilization. This can not only improve the processing quality and production efficiency of products, but also respond quickly to the ever-changing market [1]. The communication function in embedded CNC system includes three aspects: communication between CNC main control unit and servo drive and I/O logic control units in CNC system, communication of workshop-level industrial Ethernet network and Intranet/Internet network communication, as shown in Figure 2. [img=324,86]http://www.icembed.com/UploadFiles/2007125101832580.gif[/img] Figure 2 Communication structure of embedded CNC system 2.1 Communication between system units The ARM, DSP and each servo unit communicate through the CAN bus. The characteristics of the CAN bus make it very suitable for building embedded CNC systems. First, the CAN bus adopts five error detection and correction measures, including Cyclic Redundancy Check, Frame Check, Acknowledgment Error Detection (ACK errors), Bus Monitoring, and Bit Stuffing, thereby achieving high reliability with an average bit error rate of less than 10-13[2]. Second, the CAN bus adopts a unique bit arbitration technology, which has higher real-time performance than CSMA/CD network (IEE802.3) and token network (IEE802.4). In addition, the CAN bus boasts a communication rate of up to 1 Mbps and a long-distance transmission range of up to 10 km. It also features a simple interface, convenient installation, and easy communication control. In embedded CNC systems, ARM, DSP, and servo units all implement the CAN bus interface, serving as nodes in the system and facilitating easy module addition, modification, and removal. The main control CPU of the embedded CNC system uses the Samsung S3C44B0 microcontroller. Since this chip does not have an integrated CAN bus protocol control and driver core, the PHILIPS SJA1000 CAN controller and 82C250 bus transceiver are selected. The SJA1000 supports the CAN 2.0A/B protocol and can easily interface with the S3C44B0. The CAN interface circuit is shown in Figure 3. The SJA1000 integrates the physical layer and data link layer functions of the CAN protocol, enabling framing of communication data. This controller features a multi-master structure, bus access priority, and hardware filtering. PCA82C250 is the interface between the CAN protocol controller and the physical bus. It can provide differential transmission and reception capabilities of the bus, and can reach 1MHz for high-speed applications and can connect 110 nodes. The machine tool control and interpolation calculation of the embedded CNC system are implemented by the DSP. The interpolation calculation hardware adopts the 32-bit TMS320F2812 chip of TI, which has a maximum frequency of 150MHz and a clock cycle of 6.67ns, which fully meets the real-time requirements of the CNC interpolation algorithm [3]. At the same time, the 2812 chip integrates the CAN bus controller, so only the 82C250 bus driver needs to be connected externally. All the protocols for data transmission and reception filtering are implemented by the CAN bus controller inside the chip. The CAN controller can be configured to access the received data and perform data transmission through the special function registers in the 2812 chip. Since the 2812 chip can complete all the functions of the data link layer and application layer of the CAN bus protocol, it can be easily connected to the CNC system based on the CAN bus. Figure 3. CAN Interface Circuit of Embedded CNC System. Considering that the servo motors in the CNC system include DC, AC, and stepper motors, the reconfigurability of the servo module is of great significance. The servo control module is also connected to the system via a CAN bus and is implemented using a DSP chip. Since a 20MHz clock frequency is sufficient for servo control, and considering cost, the system uses the TMS320F243 chip manufactured by TI as the servo CPU instead of the 2812 chip. The 243 chip is one of the TMS320 series fixed-point digital signal processors, designed specifically for digital motor control. Its instruction execution speed is 20MHz, and all instructions can be executed within a single 50ns cycle, making real-time execution of complex control algorithms possible. In addition, a CAN module is embedded in the 243 chip, so it can be easily connected to the CAN bus. 2.2 Communication of Workshop-Level Industrial Ethernet Network. The key technology for communication in workshop-level industrial Ethernet networks is the implementation of the Ethernet underlying protocol. Since the S3C44B0 chip does not integrate a TCP/IP protocol module, an external network protocol chip is required. The embedded CNC system's network port utilizes a 10M Ethernet interface chip RTL8019AS, an RJ45 network socket, and a network transformer to reduce interference. The Ethernet interface module's function and circuit structure are essentially the same as a network card used in a PC; however, the embedded CNC system does not connect to the network module via PCI/ISA plug-and-play, but directly connects to the data and address buses of the RTL8019AS Ethernet interface chip. The circuit uses the RTL8019AS's interrupt output INT0 (pin 4) connected to the S3C44B0X's EINT0 (external interrupt source 0). The RTL8019 reports its operating status via interrupts, such as successful data packet transmission, receipt of a new data packet, and error/abnormal interrupts. Upon receiving an EINT0 interrupt, the S3C44B0X enters the corresponding interrupt handler and reads the value of the RTL8019AS's internal ISR register to determine what triggered the interrupt. Due to the large size of the circuit diagram, a detailed circuit diagram is not provided here. When developing an Ethernet driver, you only need to write the data to be sent into the chip according to a certain format and start the send command. The RTL8019AS will automatically add the receive status, next page pointer, Ethernet frame length, and FCS segment, and convert the data packet into a physical frame format for transmission on the physical channel. Conversely, after receiving the physical signal, the RTL8019AS restores it to data and stores it in the chip RAM according to the specified format for the host program to use. Thus, the work of the RTL8019AS is to complete the mutual conversion between data packets and electrical signals: data packet <=> electrical signal. The RTL8019AS has a total of 32 input/output addresses with an address offset of 00H4/1FH. Among them, 16 addresses from 00H to 0FH are register addresses. The registers are divided into 4 pages PAGE04/PAGE3. Registers compatible with NE2000 only have 3 pages (Page0-Page2). To ensure that the driver is effective for all Ne2000 network cards, this system does not use the fourth page of registers. The Ethernet protocol is automatically completed by the RTL8019AS chip hardware and is transparent to the upper-layer application. The driver has three functions: chip initialization, packet reception, and packet transmission. Sending a data packet involves first storing the data packet to be sent into the network card chip's RAM via a DMA write operation, providing the starting address of the transmit buffer (TPSR0, TPSR1) and the data packet length (TBCR0, TB2CR1), and then initiating the send command. The network card chip automatically completes the transmission according to the Ethernet protocol and writes the result to the status register. Receiving a data packet uses an interrupt-driven approach. The value of the ISR register within the RTL8019AS is read to determine if a new data packet has been received. If so, the data is read from the network card chip's RAM via a DMA read operation. 2.3 Intranet/Internet Network Communication Intranet/Internet network communication refers to the communication between the enterprise's CNC system and the host computer. It connects the embedded CNC system, the upper-level management PC, and the office network via an Intranet, and then connects to the external Internet. This system integrates an enterprise's MRP system, MIS system, and office CAD/CAM system via an Intranet, facilitating convenient and rapid information exchange and control with CNC machine tools. It enables remote design and programming, followed by Ethernet transmission and sharing of part machining programs, achieving network integration of CAD/CAM/CNC. Simultaneously, the Internet connects and organizes CNC equipment distributed across different regions, field equipment maintenance engineers, equipment manufacturer maintenance engineers, and domain experts. This facilitates rapid information transmission between equipment and people, and between people themselves, forming a networked CNC equipment diagnostic and maintenance consultation system and video conferencing system. It allows for remote monitoring and fault diagnosis of CNC equipment and can also create online virtual workshops (factories) and e-commerce. The system's video-based remote service provides a coordinated working environment including multiple media such as sound, images, and text, serving as an important tool for remote collaboration. The remote monitoring module uses a CCD camera to collect real-time sound and image information from the digital equipment machining site and promptly publishes it to the network in streaming media format, providing remote monitoring users with a realistic machining environment and an immersive experience. The platform adopts a browser/server-based video conferencing monitoring system implementation scheme, as shown in Figure 4. Figure 4 shows a remote monitoring platform based on video technology using a three-tier B/S architecture. The first tier is the user layer, where users access remote services and share information through a browser. The second tier is the web server layer, which acts as a link between the browser and the database server, storing the system's functional modules and applications. The third tier is the database server layer, used to store various data required by the system. Users and manufacturers share data and information via the Internet. Local computers and remote servers are connected via the Internet, allowing local users to communicate with the remote service center server simply through a browser. This enables immediate processing of real-time information without significant latency. In practical operation, the browser transmits data from the production site to the manufacturing company's web server via the Internet. Users send control commands through functional components on the virtual control panel, and the monitoring display components on the control panel show the CNC simulation process and feedback information. When a CNC machine tool malfunctions on the production site and requires service from the manufacturing company's remote diagnostic center, the browser transmits the fault signal data to the manufacturing company's web server. The web server connects to the database, uses the diagnostic knowledge of the expert system for reasoning and diagnosis, and returns the diagnostic results to the user. [b]3. Summary and Outlook[/b] While CNC systems are developing towards precision, networking, intelligence, and integration, they are also developing towards miniaturization and embedded systems. Embedded CNC systems, which use a "tailor-made" approach to embed the required functions into the application system, represent the future direction of CNC and motion control product development. They are an ideal choice for the transition of my country's mainstream economic CNC systems from 16-bit to 32-bit. This article introduces the communication between the CNC main control unit and various units such as servo drives and I/O logic control within the embedded CNC system, the communication via workshop-level industrial Ethernet networks, and Intranet/Internet network communication, and provides the key technology implementation details. The next step is to develop a wireless network solution for embedded CNC machine tool networking applications, making the connection between the CNC system and the outside world faster, safer, and more convenient.