# Development of a Novel Open Control System Implementation Method under Industrial IoT
## 4 Case Study
### The Implementation of an Open CNC Demonstration
Therefore, the control task virtualization is designed as follows. The Interpretation task is virtualized by the docker (the most popular container engine) and deployed on a cloud platform. The dependence on it is implemented as an HTTP/HTTPS request over the network. The Look-ahead Velocity-Planning task is also containerized by the docker, but deployed on a factory-level edge platform. The dependence on it is implemented as a TCP request over a local area network. Moreover, the Interpolation task is virtualized by wasn and deployed on an actuator-level edge platform. In detail, the velocity profile, displacement, and next position computation parts of the Interpolation task are compiled into a wasm module since they are compute-intensive algorithms that do not need system calls. The other part of the Interpolation task (e.g., interactions with sensors via the I/O) is developed as the host application. Finally, the Position  
Figure 10: Graphical representation of the proposed open CNC system’s control domain. Control task migrates to each feed axis's servo driver. In other words, the position control mode of each servo driver is on. The dependence between the Interpolation task and the Position Control task is implemented via a kind of real-time communication, like EtherCAT. Since the host application of the Interpolation task and the Position Control task are independent of the tool trajectory's shape, they can remain unchanged when the open CNC demonstration is modified to process the B-spline tool trajectory. In other words, only the Interpretation container, the Look-ahead Velocity-Planning container, and the Interpolation wasn module need to be replaced. In order to schedule these tasks, an additional scheduler task is developed in this open CNC demonstration. The activities of the scheduler task are illustrated via the activity diagram presented in Figure 11. Firstly, the scheduler task reads the configuration file to construct the open CNC system and publishes the initial state. Then, it listens to events, and meanwhile, it invokes the actions of the initial state. Regarding the listening of events, if the received event is not a registered event, the scheduler task will generate an error message; otherwise, it publishes the next state and invokes corresponding actions. Regarding the invocation of actions, the topological sorting of dependences between tasks is implemented first before the sequential orchestration of tasks according to the action's name. Take the check action associated with the Prepared state as an example: the scheduler task checks the availability (or accessibility) of the Interpretation task, Look-ahead Velocity-Planning task, Interpolation task, and Position Control task in the dependent sequence, according to their addresses in the configuration file. Therefore, change the addresses of the Interpretation container, the Look-ahead Velocity Planning container, and the Interpolation wasn module in the open CNC demonstration's configuration file, and the functionality can be modified to process different tool trajectories.