Architecture Modelling and Task Scheduling of an Integrated Parallel CNC System in Docker Containers Based on Colored Petri Nets

Hongyu Jin, Yang Wang, Qian Wang, Zhen Chen, Shuhua Wang, Jun Zhang, Shanghua Hao, Hongya FuIEEE Access 2019 · DOI

In modern industrial manufacturing, Computer Numerical Control (CNC) systems serve as the critical intelligence behind precision machinery. Traditionally, these systems have been proprietary, rigid, and tied to specific hardware. As Industry 4.0 demands greater flexibility, researchers are exploring ways to move CNC logic into more portable, scalable environments. A study by Hongyu Jin and colleagues from the Harbin Institute of Technology and Foxconn proposes a novel approach: an integrated parallel CNC system built within Docker containers and modeled using Colored Petri Nets (CPN).

The Challenge: Real-Time Performance in Virtual Environments

Traditional CNC systems typically run as monolithic, serial processes on dedicated hardware. While this ensures the strict real-time performance required for precision machining, it limits the ability to leverage modern multi-core processors or to reconfigure factory lines easily.

The primary hurdle in containerizing CNC functions is jitter—the timing variance introduced by virtualization. In high-precision manufacturing, even a few milliseconds of lag in the interpolation module (which calculates tool paths) can ruin a physical part. This research addresses how to modularize CNC functions into containers without sacrificing essential real-time stability.

System Architecture and Modularization

The proposed architecture breaks down the standard CNC stack into six functional modules: G-code decoding, scheduling, discrete service, forward-looking service, interpolation, and position control. These modules operate within a centralized "NC Cluster."

Architecture of the integrated parallel CNC system, illustrating the modular services within the NC Cluster and their connection to multiple CNC machines.

By running each module in its own Docker container, the system achieves an "open" architecture where components can be updated or scaled independently. A single high-performance multi-core PC can thus act as a "central brain" for an entire cluster of machines, rather than requiring one expensive controller per machine.

Scheduling with Colored Petri Nets

To manage the complexity of these interacting containers, the authors utilized Colored Petri Nets (CPN), a mathematical modeling language used to verify concurrency and data dependencies. They compared two primary scheduling strategies:

  1. Task Dependency: A static hierarchy based on the traditional functional chain.
  2. Data Flow (The Novel Approach): A dynamic strategy that adjusts a task's priority based on the volume of data in the "ring buffers" between modules. If a downstream buffer is empty, the upstream task's priority is boosted to fill it, preventing "starvation" where a machine waits for instructions.

Communication and Real-Time Performance

To bridge the gap between the non-real-time virtual environment and the hard real-time hardware, the team developed a specialized communication module. This stack uses Shared Memory for high-speed data exchange between threads and a combination of TCP/IP and Netlink to connect the Docker environment with the physical PowerLink (real-time Ethernet) hardware.

Detailed communication stack bridging the virtual Docker environment with the physical PowerLink hardware and network card drive.

To mitigate jitter, the researchers implemented a ring buffer mechanism that "smooths out" timing variances, ensuring that the physical machine receives a steady stream of instructions despite the overhead of the containerized environment.

Key Results and Physical Validation

The system's performance was validated through both simulation and physical testing:

  • Real-Time Stability: In the test environment, the position control jitter was maintained within a tight range of [-60, 60] μs, while the underlying PowerLink driver jitter stayed within 10 μs.
  • Hardware Efficiency: The architecture successfully controlled two milling machines simultaneously from a single system.
  • Machining Quality: Physical test pieces (complex 2D shapes) showed consistent surface quality, proving that the parallel containerized approach is viable for real-world industrial use.

Future Directions

While the study proves the feasibility of containerized CNC systems, challenges remain regarding TCP latency. Future research will focus on optimizing processor and network card communication to further reduce execution cycles and exploring the maximum number of machines a single multi-core processor can reliably handle before real-time performance degrades.

Summary updated

Abstract

With the diversification of product types and the development of complex CNC system functions, reconfigurable, and extensible CNC system must be developed to meet the needs of industrial production in the new era. To optimize the original architecture between the CNC system and the machine tool, and to improve the integration level of the industrial control system, an integrated parallel CNC system which could control multiple CNC machine tools based on high performance multi-core processor is proposed in this paper. Based on the virtualize container technology, the functional modules of the CNC system, such as the interpreter module and interpolation module, operate separately on each Docker containers. The system scheduling module uniformly schedules above functional modules and caches the data generated by each module to maximize the processing efficiency and resource utilization. For the modeling of system architecture, the colored Petri nets are used to establish the models of CNC system and task scheduling. Two strategies of task scheduling which based on task dependencies and data flow are presented to determine the priority of system function threads. According to the developed test platform, the real time of the virtual system environment, real-time system environment, and the communication module of integrated CNC are analyzed. Furthermore, test results show that the proposed integrated parallel CNC system has the ability of centralized control of two machine tools synchronously.
BibTeX
@inproceedings{jin2019architecture,
  author = {Hongyu Jin and Yang Wang and Qian Wang and Zhen Chen and Shuhua Wang and Jun Zhang and Shanghua Hao and Hongya Fu},
  title = {{Architecture Modelling and Task Scheduling of an Integrated Parallel CNC System in Docker Containers Based on Colored Petri Nets}},
  booktitle = {IEEE Access},
  year = {2019},
  doi = {10.1109/access.2019.2909774},
}
Figure