# Development of a Novel Open Control System Implementation Method under Industrial IoT
## 3 Implementation of Open Control Systems Under Industrial IoT  
### A Hierarchical Semantic Model of Control Domain  
As Section 2.1 mentions, the CNC is a typical hybrid control system in industrial automation; thus, this section takes it as an example to discuss the formal description of the control domain. On the whole, the CNC's behaviors are mostly discrete ones, which mainly refer to the transitions of a machine tool's states in response to stimuli from users or the environment. Figure 4 presents a simplified state diagram of the discrete behaviors of a machine tool. There are four states, and Idle is the initial state. When a launch event happens, the machine tool state transmits from Idle to Prepared. In the Prepared state, the availability of executing the machine tool's continuous behavior is checked. If available, a success event is generated,and the machine tool state transmits to the Running state. Otherwise, the machine tool state remains in Prepared until the execution of the machine tool's continuous behavior becomes available or the sleep event happens, which transmits the machine tool state to Idle. In this sense, the priority of the sleep event is higher than the fail event and the success event. In the Running state, the machine tool executes its continuous behavior until a finish event or an error event happens. If the finish event happens, the machine tool state transmits to Idle, while if the error event happens, it transmits to Paused until either the error has been handled and a success event is generated that transmits the machine tool state back to Running, or the error cannot be handled and a fail event is generated, which transmits the machine tool state to Prepared. In modern CNCs, in order to control the movement trajectory of feed axes in light of a part program, the part program is generally processed by the following tasks:  
* The interpretation task, which translates the part program into CNC internal commands. In addition to lexical, syntactic, and semantic analysis, computation commands in the part program, such as coordinate transformation, arithmetic expression, tool compensation, and others, should be processed in the translation to obtain the practical tool trajectory. * The interpolation task, which uses internal commands to generate each feed axis's position data (and velocity data) of each interpolation period in the constraints of the machine tool's kinematics. It often executes cyclically to respond to the change in the machine tool's kinematics. * The position control task, which generally executes cyclically in each position control period to minimize the position error between the commanded position and the real position feedback by the sensors. It can be seen that the inputs of the interpolation task are the outputs of the interpretation task, and the outputs of the interpolation task are the inputs of the position control task. In other words, the interpolation task depends on the interpretation task, and the position control task depends on the interpolation task. In this sense, the continuous control domain can be described based on a dependency network model with time property, as Figure 5a presents. The position control task has a dependence on the interpolation task, and the interpolation task has a dependence on the interpretation task. The dependence relationship is transitive. Thus, the availability of the position control task depends on the availability of the interpolation task and the interpretation task. In Figure 5a, it can be seen that the interpolation task has a self-dependence labeled \(T_{1}\), which means it executes every \(T_{1}\) period. This implies a specification that the execution time of the interpolation task cannot exceed \(T_{1}\) and so does the position control task. This implies another specification that \(T_{1}\geq T_{2}\) since the position control task depends on the interpolation task. Figure 4: State diagram of machine tool’s behaviors.