Share this

Research on the Architecture of Embedded CNC Systems

2026-04-06 06:20:13 · · #1
Embedded technology has developed rapidly and is now widely used across various industries. Combining embedded technology with CNC technology has yielded numerous theoretical and applied results. However, as the complexity of machined parts increases, establishing a consistent architecture for embedded CNC systems becomes increasingly urgent. Without a universal architecture to guide the process, integrating various hardware and software modules into a CNC system would be a very arduous and error-prone task. The embedded CNC system architecture aims to provide integration rules and interface specifications for each module. Through these rules and specifications, different developers can build common modules. Using these common modules and integration rules, different embedded CNC systems can be built, from CNC systems integrated into industrial control stations, from industrial control stations to industrial control networks, and even more complex systems. An embedded CNC architecture can improve the system's flexibility, reliability, security, and openness. The National Institute for Standardization (NIST) in the United States is dedicated to establishing a reference architecture for various mechanical control systems. This paper studies the hardware and software architectures of embedded CNC systems and, based on the work done, introduces an example of such an architecture. Embedded CNC System Hardware Architecture Figure 1. Embedded CNC System Hardware Architecture An embedded CNC system must include one programmable computing unit, or multiple programmable computing units, forming a multi-CPU system. There are many types of embedded processors or controllers, with ARM, embedded x86, and MCU being commonly used. The processor is the computation and control center of the entire system, and its architecture is increasingly trending towards the RISC instruction set Harvard architecture. The programmable computing unit, several years ago referring only to a processor or microcontroller, now includes other programmable computing resources such as FPGAs. For the CNC system to interact with the operator, it must have display hardware, which can be a CRT monitor. However, embedded processors typically integrate an LCD controller, providing an interface with DSTN (Dual-Layer Super Twist Nematic) or TFT (Thin Film Transistor) displays, allowing direct driving of the LCD screen. With the widespread use of USB mobile storage devices, the platform supports and controls USB devices through a USB host controller. The processor may also integrate a USB client controller, facilitating the implementation of a USB client interface. This interface is typically used for debugging application software between the host computer and the platform. The serial port is used for communication between the host and slave computers. Some servo drive devices also provide serial port connections, allowing connection to the driver via serial. The external memory bus interface supports various external memories: SDRAM, RAM, and flash memory. SDRAM is generally chosen for RAM, while flash memory is a type of non-volatile memory that retains on-chip information even after power is off. It is used here to store CNC system programs and configuration data. The feed axis interface serves as the bridge between the CNC system and the feed servo system. For commonly used servo control systems, feed control interfaces generally include serial interfaces, pulse interfaces, analog interfaces, etc. The spindle control interface connects the CNC system and the spindle drive unit, and it consists of two parts: spindle speed control output and spindle encoder input. The PLC integrated into the CNC system is a built-in type, characterized by flexible design, compact structure, and strong specificity. It primarily handles S-codes for spindle speed, T-codes for tool functions, and M-codes for controlling spindle forward/reverse rotation, start/stop, gear shifting, coolant switching, and chuck tension. Sensor interfaces are used to detect machine tool position information and input calculations for various control algorithms. Modern manufacturing engineering requires CNC systems to be interconnected via networks to transmit commands and data, enabling parallel CNC tasks. Therefore, an Ethernet module is added to facilitate networking of the CNC system when needed. All the above functional modules are connected via a standard bus, implementing a unified bus interface specification. Some functional modules in this architecture are not essential for every embedded CNC system and can be omitted according to specific requirements. Embedded CNC System Software Architecture Figure 2: Embedded CNC System Software Architecture. The embedded CNC system software architecture is divided into two main parts: the system platform and the application software. The upper-level application software consists of two layers: the National CNC Programming Interface (NCAPI) and the user interface components, providing access to both machine tool manufacturers and users respectively. The underlying modules, excluding the PLC, are not publicly accessible. Non-system developers can access their functions via NCAPI. These modules handle interpolation tasks (coarse interpolation, fine interpolation of micro-linear segments, single-segment, skip-segment, and parallel program segment processing); PLC tasks (alarm handling, MST processing, emergency stop and reset processing, virtual axis driver programs, tool life management, and emergency event handling); position control tasks (backlash compensation, pitch compensation, limit position control, and position output); servo tasks (controlling servo output and input); and common data area management (managing control information for all resources in the system). Therefore, they must possess multi-task processing capabilities, including task creation, cancellation, scheduling, wake-up, blocking, suspending, activation, and delay handling; semaphore creation; semaphore release; and semaphore value retrieval. The upper-level software is responsible for editing and interpreting part programs, setting parameters, displaying PLC status, MDI and fault displays, machining trajectory, and machining program lines. It exchanges data with the underlying modules through shared memory, FIFO, and interrupts. The upper-level software modules include: interpreter module, MDI runtime module, program editing module, automatic machining module, parameter editing module, PLC display module, fault diagnosis module, etc. The Numerical Control Application Software Development Interface (NCAPI) provides general interface functions for different machine tools and requirements. Specific CNC systems can be easily developed on top of this, such as the Huazhong I-type milling machine CNC system and the Century Star lathe CNC system. NCAPI is consistent with the API interface provided by the original Huazhong I-type. A unified API ensures system portability and module interchangeability; the configuration functions in the system development and integration environment can achieve system performance scalability by configuring different software modules, and system performance scalability is guaranteed by replacing system hardware. Application Example Following the above hierarchical division of the embedded architecture, this paper develops an embedded CNC system based on an embedded PC and a LINUX operating system. The CPU uses an embedded PC unit, embedded into the CNC motherboard via a PC104 bus. The CNC motherboard inherits the switch interface circuit, MCP/MDI keyboard interface circuit, feed axis interface circuit, and spindle interface circuit. Each interface circuit is centrally controlled by the core FPGA chip. To meet the openness requirements of the CNC device, the CNC motherboard adopts a dual FPGA design. One FPGA chip is responsible for controlling the digital interface circuit, MCP/MDI keyboard interface circuit, spindle interface circuit, and serial port servo drive interface circuit; the other FPGA chip is responsible for controlling the pulse servo drive or stepper motor drive interface circuit and analog servo drive interface circuit. The two FPGA chips are controlled by an embedded PC via a PC/104 bus. Utilizing the flexibility of FPGA chips, different configurations of CNC devices can be constructed without changing the hardware circuit by modifying the FPGA chip firmware and flexibly combining the two FPGA chips. The operating system is a real-time operating system created by modifying the Linux kernel. Specifically, a hardware abstraction layer is embedded in the Linux operating system to take over all interrupts and hardware operations. Because Linux adopts a monolithic modular structure, tasks requiring real-time response in the CNC system are made into real-time CNC modules and embedded in the Linux kernel. These tasks include periodic tasks such as servo monitoring, PLC, and position control, as well as non-periodic tasks such as interpolation. Tool compensation, decoding, and basic network functions are packaged into a CNC application programming interface. Based on the real-time Linux software platform, the application software platform includes general-purpose API interfaces such as discrete-point I/O control API, sensor API, and position controller API. The application layer, comprising process control, human-machine interface, and system integration and configuration support environment, only requires replacing the corresponding module communication interfaces with the relevant system APIs of the real-time Linux operating system; the upper-layer application modules do not need modification. Simultaneously, the application software platform possesses good openness, allowing users to customize APIs to expand system functionality. This paper defines a custom CNC graphics library API at the application platform layer to support the graphical display function of the CNC system. Conclusion The open embedded CNC system architecture proposed in this paper, on the hardware side, uses a standard bus to shield the differences between functional components, defining different CNC hardware functions through standard signal specifications. On the software side, the embedded real-time operating system provides system interfaces for the CNC application software, shielding hardware details and providing a real-time, reliable, and multi-tasking operating environment. The overall layered software architecture makes the architecture clear and concise; modularization within each layer minimizes module coupling, resulting in excellent software reusability and facilitating CNC system function reduction and system maintenance. This ensures the openness and stability of the hardware platform, while also making software porting and design more convenient.
Read next

CATDOLL 126CM Sasha (Customer Photos)

Height: 126cm Weight: 23kg Shoulder Width: 32cm Bust/Waist/Hip: 61/58/66cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22