1 Motivation

Modern manufacturing systems that incorporate digital technologies - the so-called cyber-physical production systems (CPPS) - seek to interconnect the digital and real world. For better flexibility, scalability, and reconfigurability, CPPS aim to connect individual cyber-physical systems and soften the hierarchical automation pyramid to decentralized distribution of computing units [1]. Due to increased demand for customized products, the requirements on the connectivity, functionality, flexibility, and intelligence of machine tools are also increasing [2]. Consequently, CPPS lead to complex manufacturing systems that are increasingly challenging to control and understand, due to many different decentralized, connected systems (e.g., machine tools, automated guided vehicles, human-machine-interfaces, etc.) with different characteristics, functionalities, and thus different heterogenous information technologies [3].

Therefore, the concept of digital twins (DTs) enables and facilitates the operation of CPPS and is considered a prerequisite for providing model-based decision support and process control [4].

However, enhanced physical simulation of the manufacturing process, virtual models, and high connectivity of the involved sub-systems are required for full potential of DTs in manufacturing [5]. Especially for real-time monitoring, high requirements have to be met regarding the communication technology. Current wired solutions cannot achieve the required flexibility and scalability of the manufacturing systems, while wireless technologies cannot meet the required low latency and reliability in communication.

The 5G communication standard addresses these issues of insufficient flexibility, scalability, and low latency while maintaining high reliability [6]. 5G supports real-time capable, reliable, and wireless connectivity within a CPPS [7], thus providing the basis for wireless DTs with full functionality in manufacturing. However, currently no implementation of 5G-enabled DT for machine tools in manufacturing exists. Accordingly, this paper advances the authors’ preliminary work [8] by developing an architecture for 5G-enabled DTs of machine tools based on physics simulation with different functionalities such as process prediction, monitoring, control, and diagnosis. Furthermore, the detailed implementation with different hardware and software components as well as benefits and challenges of the implemented architecture are outlined.

2 State of the Art

2.1 5G Communication Standard

5G - the fifth mobile communication standard - was introduced in 2018 and is standardized by 3rd Generation Partnership Project (3GPP) [9]. The 5G standard intends to improve the most important functions of mobile networks, with specific consideration of industrial requirements. The 5G network architecture consists of a centralized radio access network (RAN) with multiple remote radio reads and aggregating base band units. In addition, a 5G core network provides different management functionalities [10]. This leads to the following beneficial performance characteristics of 5G-based wireless communication [11]:

  • Ultra-reliable low latency communication (uRLLC): user plane latency down to 1 ms and reliability of 99.9999%

  • Massive machine type communication (mMTC): high device density with up to 106 devices per km2

  • Enhanced mobile broadband (eMBB): high bandwidth and data rates up to 20 Gbit/s

In particular, low latency combined with high reliability provide the required robustness for fast and safety-critical communication within manufacturing. However, these performance characteristics conflict with each other, implying that not all extreme values (minimum latency and reliability, maximum data rate, maximum number of devices) can be achieved simultaneously. Therefore, the method of network slicing is applied to implement different network layers with different characteristics in the same 5G network. Network slicing enables maintaining different communication requirements for different use cases [12]. However, 5G networks operated by telecommunication companies usually cannot be optimized regarding the individual, use-case-dependent demands. Therefore, so-called private networks are needed. Private networks are locally limited and operated independently by the individual organization. This enables high flexibility and reconfigurability of the communication network regarding the needed requirements [13].

In the future, it is highly likely that industrial communication based on 5G will be widely implemented and needed for modern manufacturing systems [14]. 5G shows better performance characteristics in comparison to other communication technologies such as WiFi 6. Due to high quality of service by using dedicated spectrum resources, 5G is especially well suited for safety-critical, low-latency use cases [15]. Because of its high performance characteristics as well as the ongoing standardization process for further improvements, 5G bears potential to be the communication platform for industrial automation, control, and holistic interconnectivity - even of safety-critical applications – within manufacturing systems [16]. For example, different control tasks offloaded in a wireless format [17, 18], flexible 5G-enabled human-machine interfaces with augmented reality [19, 20], and Industrial Internet of Things networks for monitoring and diagnosis [21, 22] show strong application potential.

5G offers the possibility to develop a scalable and flexible framework for the implementation of DTs in manufacturing. In addition, 5G can serve as the communication platform for advanced and challenging industrial communication. In particular, 5G communication architecture is suitable for real-time capable, wireless DTs for simulation, monitoring, and control of a machine tool.

2.2 Physics Simulation in Manufacturing

Physics simulation is a widely used tool for analyzing physical phenomena in a virtual world. Physics simulation is based on a physics engine, which is a software platform containing reusable resources to compute specific physical behavior of material bodies [23]. Due to the capability to model mechanical behaviors, kinematics, collisions, and other physics-related properties, physics simulations and engines have been widely used in manufacturing engineering [24]. Especially for flexible CPPS, gaming engines have a very high potential for the simulation of manufacturing on a macro scale (non-molecular levels). Gaming engines combine physical simulation (kinematics, dynamics, collision, etc.) with graphical elements and user interaction capabilities [25].

On the level of machine tools, physics simulations as well as gaming engines have been used to study the system dynamics of machine tools. For example, prior to the start of a manufacturing task, the physics simulation can be used to simulate the procedure of human operations at a workplace [26] or the machining processes to analyze the chip formulations [27]. During the manufacturing process, physics simulation can be used to mirror the manufacturing activities for process monitoring, such as the component building process of a 3D printer [28] or machine tool motion [29]. On the level of manufacturing systems, physics simulation has been used for the analysis the performance of transportation vehicles in the material flow [30], the design and optimization of a workspace layout [31], or the validation of a manufacturing process [32].

All these works have demonstrated the benefits and potentials of physics simulations and engines in manufacturing engineering. In assessing these works, it is observed that a number of different commercial or non-commercial physics engines are available for different purposes. Moreover, in terms of the programming platform as well as the development environment, it is found that most physics engines are either suitable for C++, C#, Python, JavaScript, or Lua [25]. Nevertheless, in terms of the interdisciplinary research considering 5G-enabled DTs with real-time data transmission between physics simulation and real system, no works has been found in the literature so far.

2.3 Digital Twin in Manufacturing

To manage the complexity of CPPS, digital representations of relevant processes and involved systems are needed [33]. Therefore, DT links simulation models to real systems. By utilizing cloud-based simulation capacities, available data (sensor or physics simulation based), and high interconnectivity, DT enables model-based decision support for the real system [4].

In current research, there exist many different definitions of DTs with different delimitation criteria such as the life-cycle phase (design phase, manufacturing phase, service phase, retire phase) of the DT or the level of integration and information flow (digital model, digital shadow, digital twin) [34].

This paper follows the DT definition as a composition of digital models (physical simulation or data-driven) to process information in real-time from the real system. In this manner, the manufacturing process can be monitored and controlled in real-time and profound decision support for the real system is possible [35]. In addition, DT need autonomous and bidirectional data transmission in an adequate time frame regarding the specific use case [36].

According to the initial concept of DT, which roots in aerospace, three major functionalities can be distinguished [37]:

  • Prediction for pre-process simulation of the real system

  • Monitoring and control for prediction, analysis, and direct interaction of the real system during the process

  • Diagnosis for model-based analysis of unpredicted failures after the operation of the real system

For implementation of DTs in manufacturing systems, a connection between CPPS and DTs is needed. Therefore, digital models have to be linked to the real system utilizing physical models, real-time augmentation with data, and a reliable communication link. A recent study emphasizes that especially the data link and thus the communication system are very important for interoperability and scalability of DTs [38]. In addition - depending on the use case - there exist high requirements regarding bidirectional communication to control the real system based on the simulation-based instructions [39]. Due to low cycle times and safety criteria of machine tool control, very fast and reliable connectivity is mandatory for DTs of machine tools.

In a recent literature survey, a shift from conceptual and framework-oriented research regarding DTs towards implemented applications of DTs is identified [34]. It was highlighted that DTs can be used to simulate, analyze, and control a variety of different processes on different levels of the manufacturing system. These range from the factory planning and factory control level, to the process and machine level [34].

For simulating and planning on a factory level, Zhang et al. develop a DT-driven smart shopfloor for dynamic resource allocation [40]. Moreover, human-based production processes can be incorporated to the DT of the factory level for better optimization results regarding time and cost-efficiency [41]. Glatt et al. implement a DT based on physics simulation for optimizing material flows through the manufacturing system [4]. On the process and machine level, DT are mainly developed for monitoring, visualizing and optimizing machining processes [42,43,44]. However, not many implemented DTs with bidirectional information flow between machine tools and digital system have been reported. A brief overview of implemented DT of machine tools, is provided in [8].

Not many DT in manufacturing have been reported utilizing the potentials of 5G communication. For example, Groshev et al. developed and validated a 5G-enabled DT for the control of robotics [45]. They migrated the control of a robot arm to an edge server via 5G. In addition, 5G-enabled DT are also used for remote monitoring and operation of different robots and machines [46]. In preliminary work of the authors, an architecture for DT of machine tools with migrated computerized numerical control (CNC) to an edge server is developed for wireless real-time closed-loop control [19]. However, currently, there exist no implemented DT for machine tools that utilizes the potential of 5G communication standard. Moreover, there exists no wireless DT for latency-critical machine tool control in general. Current safety-critical and time-sensitive applications are still wired and the physical communication layer on a technological level is not sufficiently considered [47]. In a current literature review on DTs, Zeb et al. determined that edge-computing as well as 5G networks and future network technologies are needed for real-time capable, wireless DTs. However, research regarding in this area is still in its infancy [47].

In summary, existing approaches do not sufficiently address the needed data link or communication system between the digital and real world and thus neglect the associated benefits and opportunities for the design of DT. This connectivity is especially essential for DT of CNC machine tools, as fast response times are required. Current solutions cannot simultaneously allow flexibility and scalability while exploiting the full potential and functionalities of DT. Therefore, a generic architecture, and implementation of a DT of a machine tool based on physics simulation and utilizing 5G and edge computing is developed. This will involve both physics simulation and the integration of disruptive communication architectures to meet the requirements of a DT of machine tools in CPPS.

3 Modeling of the Architecture for 5G-Enabled Digital Twin

The DT is a link between the physical and virtual world in CPPS. Therefore, DTs are developed and operated in the virtual world with interdependencies of systems of the physical world. The resulting combination of the digital and real world leads to a comprehensive development project with a high degree of interdisciplinary within involved research fields [4]. To manage this complexity, the requirements for functionality, the overall architecture, and the physical model of the machine tool and its functions are outlined prior to the elaboration of the detailed DT implementation. The methodology is based on model-based systems engineering, which is used for the description of complex and multidisciplinary technical systems [48].

3.1 Objectives and Requirements

As a result of the analysis of the state of the art, our approach addresses several objectives for DT in manufacturing:

  • Prediction: The DT should allow pre-process prediction of the kinematic and dynamic behavior of the machine tool. This enables the visualization and analysis of the real system prior the actual runtime. Moreover, the verification of the correct manufacturing program and prevention of collisions of the machine tool should be realized.

  • Monitoring/Control: Monitoring and simulation of the state of the ongoing machining process are mandatory. In addition to the monitoring process, it should also be possible for the DT to control the machine tool in order to react immediately to monitored process anomalies. Therefore, direct control of the machine tool by the DT should be possible (e.g., emergency stop or change of feed overrides)

  • Diagnosis: The analysis of the behavior of the machine tool after the operation should also be integrated to the DT framework. Based on the monitored information (e.g., position deviations, vibration data or downtimes), process optimizations can be implemented. Therefore, predictive maintenance and big data analytics will be possible.

  • Flexibility: The demanded flexibility of the DT framework is manifested in two characteristics. On the one hand, the deployment of the DT should be independent of the used device and operating system. On the other hand, the implementation of different DT in the manufacturing system should be possible without high additional infrastructural efforts.

  • Comprehensibility: To increase user acceptance, the DT framework should allow easy understandability for human operators.

  • Scalability: Besides flexibility, the DT framework should enable scalability of the whole system. This allows both the addition of new DTs of different machine tools and the expansion of existing DTs of machine tools by adding new information (e.g., by sensors, actors, inputs/outputs (I/Os) of control units). This leads to the possibility of the implementation of many different DTs of different machine tools in a manufacturing system. Moreover, the possibility to expand functionalities and interconnected devices without high implementation effort is required.

  • Real-time capability and reliability: To enable the real-time adapted monitoring and control of the machine tool by the DT, a real-time capable interface for data transmission is needed. In addition, the communication has to be reliable, even for safety-critical processes.

To achieve these goals, various technological requirements have to be met. These requirements can be divided into hardware, software, and communication requirements.

On the communication side, the data transmission between physical and digital world should be completely wireless to enable flexibility and scalability. Therefore, especially for monitoring and control of safety-critical processes, a low latency below 50 ms for monitoring and remote control and below 1 ms for offloaded motion control is required [49]. In addition, high reliability (>99.9999% or <0.5 min of downtime per year) is required. Furthermore, the communications infrastructure should be scalable and flexible to enable high connectivity for devices to be integrated into the system in the future. For this purpose, a network protocol should be utilized that enables machine-to-machine communication.

On the software side, a physical model of the machine tool is needed, integrated into an appropriate physics engine for simulation of kinematics and dynamics of rigid bodies (e.g., collision, movement). The pre-process simulation should be based on the interpretation of the programmable language used in the CNC of the machine tool (G-Code). Due to the needed flexibility, the physics engine should be platform independent and enable the deployment of mobile applications (Android and iOS). Furthermore, a graphical user interface (GUI) for visualization is needed to provide the required comprehensibility and interactivity. Next to the software requirements of the physics simulation, there is also the need for a real-time capable CNC software that has all stages of the motion planning process (path planning, trajectory generation, and trajectory tracking) implemented. Another requirement for the CNC to monitor and control the machine tool by the DT is the ability to read and write I/O with open, adaptable, and expandable interfaces for the needed flexibility.

The required hardware consists of a machine tool with closed-loop motion control. The machine tool is the physical counterpart of the DT and enables the wireless transmission of the needed data for simulation and prediction. Therefore, 5G modules to enable the 5G-capability of the CNC are also required. In addition, the transfer of encoder feedback from the motors is required. Next to that, an edge server near the production site is mandatory to achieve the required low latencies and reliability. For future real-time control of machine processes, offloading of computing processes to outsourced servers is not possible. Processing on a local edge-server near the production site is needed to ensure low latencies [47]. In addition, the edge server needs powerful computing resources to enable machine learning based diagnosis of the DT and adequate responsiveness for control.

3.2 System Architecture

As shown in Fig. 1, the overall system consists of three interacting sub-systems: the digital system (1), the communication system (2), and the real system (3). This architecture represents the progression of ongoing research and is based on preliminary work by the authors about 5G-enabled DTs for closed-loop machine tool control [8].

Fig. 1.
figure 1

Architecture of the overall system.

The real system consists of the machine tool to be operated with its physical components needed for operation (motors with motion controller, spindle, limit switches, etc.). In addition, the 5G-enabled CNC is a mandatory part of the real system to ensure the wireless communication between digital and real system. The CNC needs an adaptable interface to enable the transfer of I/O values of the machine tool via 5G to an edge server. In addition, workpiece features and the G-Code is transferred via 5G from the edge server to the CNC. In the real system, there are sensors integrated to provide information for further analysis and diagnosis of the machining process. Next to the sensors, there are different possible human-machine-interfaces (HMI) and mobile devices that can be integrated via 5G. Due to the centralized MQTT broker and the 5G connection, visualization and further data processing can also occur decentralized on various devices.

The communication system consists of a 5G network and creates the link between the digital and real system. In this architecture, the 5G communication as part of the communication system is mandatory for functionality of the overall setup. 5G enables reliable, low-latency, and data-intensive interconnectivity for the different components of the system. The data flow via 5G is based on the MQTT protocol that enables high flexibility and scalability as well as machine-to-machine communication between different machines or computing units. The different I/O values are sent to the MQTT broker that is running on a virtual machine (VM 3) on the edge server. In addition, the commands computed by the DT (VM 2) on the edge server are sent to the CNC via MQTT. The detailed functionality of the interfaces is outlined in Sect. 4.

The digital system is offloaded in a wireless manner to a powerful edge server that is directly connected to the 5G core. It consists of different VMs with different types of functionalities. The first VM 1 contains supporting instances such as computer aided manufacturing (CAM). The 3D model data from the CAM software is transferred internally on the edge server to the DT on VM 2. In addition, the G-Code generated by the CAM software is sent via 5G to the 5G-enabled CNC unit. The G-Code is also sent to the DT to enable the pre-process prediction of the kinematics and dynamics of the machining processes based on G-Code. On the second VM 2 the DT for prediction, monitoring, control, and diagnosis is operated. The prediction functionality is achieved by interpreting machine specific G-Code received from VM 1. Based on this G-Code interpretation, the machining process is simulated. The simulation is based on a physics engine for simulating kinematics and dynamics. Next to the prediction mode, there is also a monitoring and control mode. The DT receives real-time data from the CNC unit via 5G. The data is transferred via the MQTT protocol that is lightweight and based on the publish and subscribe principle with a broker as intermediary. This MQTT broker is also on the edge server on VM 3. VM 3 orchestrates the entire 5G traffic of different devices connected (DT, CNC, sensors, mobile devices, HMI). The DT interprets the received I/O data from the CNC to monitor and visualize the machine tool during process. Therefore, a dynamic real-time image of the process and the involved components based on the real-time data is rendered. Another mode of the DT is the diagnosis mode. Additional sensor data, as well as data received from CNC (e.g., encoder feedback from the motors, power consumption, etc.) can be evaluated with statistical models as well as machine learning-based algorithms. A detailed description of the implementation and functionality of the DT is provided in Sect. 4.3.

3.3 Interactions and Information Flow

Based on the general model described in Sect. 3.2, the interactions and information flow between the different sub-systems - real, digital, and communication system – are outlined in the following. For better comprehensibility, the software and hardware utilized for implementing the DT is specified. However, for detailed implementation, refer to Sect. 4. All physical and digital systems of the implemented architecture are represented in an extended UML diagram (see Fig. 2). The top column of each box in this Figure describes the system affiliation and the needed specific soft- or hardware to implement the architecture. The input and output variables of the systems are represented by a “ + “ and “−” respectively, followed by a descriptive nomenclature, and, if reasonable, the file format. Furthermore, Fig. 2 illustrates the processes within the respective component to ensure further processing of the different variables and to forward them to the appropriate subsequent instance (e.g., “.publish();”). Additionally, the flow of information and utilized communication architecture between the individual sub-systems are illustrated.

The CAM system is based on Autodesk Fusion 360 (VM 1) and the MQTT broker is based on Eclipse Mosquitto (VM 3). For the prediction mode, the G-Code (.ngc) is sent within the edge server from Autodesk Fusion 360 (VM 1) to the Unity application (VM 2). In Unity, the G-Code is interpreted and visualized for predicting the kinematics and dynamics of the machine tool behavior (.predictBehavior();).

For monitoring, there exists a loop for continuous data transmission and interpretation. First, a G-Code is generated in Autodesk Fusion 360 (VM 1) that is sent via 5G to LinuxCNC. The G-Code is transferred from CAM to CNC (LinuxCNC) using the WebSocket protocol, which is based on TCP/IP to ensure no packet loss. There the machine is moved according to the G-Code and position feedbacks from the encoders of the machine tool are returned to LinuxCNC. The position data and other relevant information from the CNC unit are then sent to the MQTT Broker (VM 3: Mosquitto broker) on the edge server via 5G using the monitoring interface. The Unity application subscribes to the data (VM2: Python Subscribe) from the broker to monitor the actual machining process. Therefore, the current status and spatial position of the machine tool is visualized.

For control, the data transmission is triggered by the Unity application. When the need for action is identified by the operator, a command is triggered (e.g., emergency stop, change feed override, etc.) via a graphical interface of the DT. The information is published via 5G using MQTT protocol (VM 2: Python Publish) to the broker (VM 3) and subscribed, processed, and forwarded to LinuxCNC utilizing the action interface. LinuxCNC interprets and forwards the command to the machine tool, which is then executed. For feedback of successful outcome of control tasks, the DT receives the information of the current machine status via the continuous loop for monitoring.

Currently, the prediction and monitoring mode are two different functionalities of the DT. They will be merged in the future for automated process preparation. Moreover, data from the diagnosis function (e.g., sensor data) and automated process adjustments (e.g., automated emergency stop) are not implemented yet. However, some of the needed data is already transferred to the DT via 5G (e.g., encoder feedback).

Fig. 2.
figure 2

Extended UML diagram of information flow.

4 Implementation

In the following sub-sections, the implementation of the system is outlined. In particular, the functionality of the DT with its different modes is elaborated. It is worth mentioning, that the implementation of 5G-enabled sensors and human-machine-interfaces - as a part of the architecture - is an ongoing area of research. It should be referred to Sect. 5 for further information.

4.1 Real System

The real system consists of a three-axis gantry milling machine and the CNC control unit based on LinuxCNC. The system has been developed to meet the needed requirements, especially regarding 5G connectivity. LinuxCNC – as an open-source CNC for machine tools – enables a high degree of freedom regarding its configuration, manipulation, and connectivity. LinuxCNC allows simple definition of the hardware abstracted layer of the machine tool, allowing high flexibility in potential I/Os. It is possible to manually add virtual, software defined I/Os, which is needed for monitoring and controlling the real machine tool with the DT.

Another benefit of LinuxCNC is the presence of a dedicated Python interface [50] that allows reading, controlling, manipulating, and creating I/O signals. However, the Python interface does not provide a way to interact with the machine tool via network interface out of the box.

The developed interface to monitor and control the machine tool via network is implemented in LinuxCNC and thus also part of the real system. It consists of the aforementioned Python interface that is expanded with a MQTT publish and subscribe function. To ensure both operating modes – monitoring and control -, two interfaces are needed as can be seen in Fig. 2 (action interface and monitoring interface). One for publishing the status information of the machine tool (monitoring interface) and one for subscribing to the manual commands triggered by the DT (action interface). As a result, each of the new interfaces consist of two parts, one to for the 5G-enabled networking capabilities (MQTT publish/subscribe) and one to ensure the integration into LinuxCNC (Python interface).

The monitoring interface reads the values of different I/Os directly from LinuxCNC and sends them continuously in JavaScript Object Notation (JSON) format via 5G to the MQTT broker (VM 3). Currently, 44 different I/Os are transferred to ensure full monitoring of the ongoing machining process. Next to absolute and relative position of the axes, also the status of the limit switches, the spindle rotation speed and direction, as well as the homing status is transmitted. It is worth mentioning, that the limitation regarding the delay of the transmission speed is determined on the network side, since the publish function is performed in the sub ms range.

The control interface subscribes to pre-defined changes of I/O values that are provided by the DT. The change of I/O values triggers the respective functions (e.g., emergency stop, manual jogging), which then are interpreted and executed by LinuxCNC to control the physical machine tool. This enables the machine tool to be controlled via 5G by the DT on the edge server. Simultaneously, the change in machine tool status is captured by the monitoring interface and transmitted back to the DT, providing feedback of the control process.

4.2 Communication System

The communication system provides interconnectivity of all implemented devices and is completely based on 5G wireless technology. However, due to the absence of integrated, 5G-enabled systems for manufacturing, both software and hardware have to be adapted. The hardware structure of the system is illustrated in Fig. 3.

Fig. 3.
figure 3

Implemented communication system based on preliminary work [8].

The 5G connectivity of LinuxCNC is ensured by retrofitting 5G capability with a 5G-Gateway based on a Raspberry Pi 4B with a M2 5G-module from QuectelFootnote 1. The Raspberry Pi is operated with OpenWRT, a Linux-based operating system that was developed specifically for network routing.

On the software side, MQTT is used as a communication protocol between DT and LinuxCNC. Due to the MQTT broker as the central orchestration unit of the data transferred, the protocol with its publish and subscribe functions enables high flexibility and scalability within the manufacturing system. In addition, MQTT enables triggering of commands (e.g., machine stop) when the connection of any publishing or subscribing client is interrupted. The MQTT broker operates with quality-of-service level of 0 for fastest transmission speeds. It is worth mentioning that just one air interface is involved, which reduces the overall latency. The subscription of the data by the DT is handled edge server internal. Next to the MQTT protocol, the WebSocket protocol is utilized for transmitting the G-Code between the CAM system and LinuxCNC.

4.3 Digital System

The digital system consists of the three virtual machines: one supporting instance based on Microsoft Windows with the CAM system (VM 1: Autodesk Fusion 360), the MQTT broker running on Ubuntu (VM 3: Mosquitto Broker), and the DT with its interfaces running on Ubuntu (VM 2: Unity application). The detailed interaction and information flow of the instances involved is outlined in Sect. 3.3. In the following, the functionality of VM 1 and VM 3 will not be outlined in this paper.

The main part of the digital system is the DT that is shown in Fig. 5. It should ensure the prediction, wireless monitoring, and control, as well as the diagnosis of the real machining process. The DT is based on Unity, a gaming engine based on the C# programming language. Unity enables the required independency of the operating system, physics simulation, deployment as mobile application, and visualization of the DT. For example, due to the publish and subscribe architecture of MQTT and the 5G communication standard, the DT can also be deployed on tablets or different computers in the manufacturing system – even simultaneously. Therefore, the devices need a 5G interface and the interfaces for subscription or publishing.

The diagnosis function is currently under development. Therefore, a smartphone with 5G-capability as well as 5G-enabled IoT sensors are implemented into the process for further data analysis. Due to its flexibility and communication based on 5G, the developed architecture in Sect. 3.2 enables simple integration of different sensors and actors to the DT. Moreover, the edge server enables fast processing of data analysis algorithms and low-latency communication due to geographical proximity. However, as described in Sect. 3.3, the diagnosis function is not fully implemented yet. In the following, the implementation of the prediction, monitoring, and control components is outlined the following sections. The diagnosis function will be discussed in Sect. 5.

4.3.1 Prediction

The prediction function should simulate the behavior of the machine tool before the manufacturing process starts. The function enables the verification of the correctness of the G-Code and prevents collisions. Therefore, the machine specific G-Code (.ngc format) for the machine tool is analyzed and simulated in Unity. For the simulation environment, the spatial dimensions of the machine tool as well as the workpiece dimensions are integrated, and physical characteristics are added to the models.

The kinematic and dynamic behavior of the machine tool based on the G-Code interpretation is simulated by adding equations of motion (translational movement and acceleration). In addition, the acceleration parameters of the stepper motors and mass of the machine tool are integrated into the simulation. The process flow of the G-Code simulation is shown in Fig. 4.

Fig. 4.
figure 4

Flow chart for G-Code interpretation.

As it is depicted in this Figure, the G-Code is completely imported to the DT (Unity application) and the loop for the G-Code simulation starts. At the beginning of each loop, the interpretation of the current line of the G-Code is checked. If this is true, the new line is split into three parts with different available information. If the line is not interpretable, the simulation ends. The data required for the movement of the machine are the target positions (X,Y,Z) of each axis, the feed rates of each axis, as well as the rotation speed and direction of the spindle. This information is simulated, and the digital motion occurs. However, first the target and actual position of each axis are compared to neglect redundant calculations of the trajectories of the axes. For low computational intensity, the feed rates and spindle control inputs are directly processed for simulation. The resulting simulated digital motion of the machine tool is stopped when the target position is reached. Next to the automated stop, the operator has the ability to stop the simulation via the GUI.

4.3.2 Monitoring and Control

Fig. 5.
figure 5

DT during manufacturing process.

The monitoring and control function enables wireless anomaly detection of the manufacturing process. Encoder feedback is transferred to the DT to simulate deviations of the actual and target position. The inaccuracies can then be visualized. Furthermore, manual control such as emergency stop or jogging is enabled for direct process manipulation. In Fig. 5 the GUI of the DT, the visualized machining process, and the real process is shown. The visualization is based on the CAD model of the machine tool and the workpiece. The DT has four different operation modes (stand by, streaming, manual, G-Code) and five different viewpoints with different angles and distances to the work piece that the operator can switch through. In addition, information about the current tool can be manually added. The current position of the global coordinate system, the position of the used relative coordinate system (relative system 1 (G-Code 54) is used in Fig. 5), and the current spindle speed in rounds per minute is also displayed in the GUI. Moreover, the current values of the transmitted I/Os can be monitored in the lower half of the GUI.

For monitoring, the I/O values of the CNC unit – currently 44 different I/Os – are transferred via 5G to the DT. Each set of I/Os generates a new digital state of the machine tool that contains spatial dimensions, and different information about the system status. In addition, the target positions, actual positions, and the acceleration of the axes are transferred for further diagnosis of process accuracy. Each set of points generates the digital motion of the DT according to the information transferred via 5G. The detailed information flow is illustrated in Fig. 2.

To enable the monitoring function, the information from the real system which is published to the MQTT broker has to be subscribed and interpreted by the DT. For this, Eclipse PAHO is utilized. The data is written into a JSON format that is continuously accessed and interpreted by the DT. To simulate material removal of the work piece, mesh manipulation is integrated based on Clipper2 [51].

For control mode, commands are generated by human input via the GUI of the DT. This allows direct control of the process and direct response to process anomalies. The manual commands are published edger server internal to the MQTT broker. The transferred commands trigger the action interface of the real system, which interprets them and forwards the operation task to the CNC unit for execution. Feedback on the success of the control tasks is then provided by the monitoring function of the DT. Currently jogging and emergency stop is integrated. However, further control functions such as spindle control or starting a homing process will be implemented.

4.4 Benefits and Challenges

The benefits of the implementation of the architecture and thus the DT can be derived by addressing the requirements in Sect. 3.1 and are summarized in different categories below:

  • Manageability of system complexity: The architecture enables prediction, monitoring, control, and diagnosis of manufacturing processes. Due to this functionality, the complexity of CPPS can be managed and the operator’s understanding of manufacturing processes in an interconnected manufacturing system prior to, during, and subsequent to the process is ensured. In addition, the GUI provides an understanding of the current status of the machine as well as of the full manufacturing process, resulting in better comprehensibility for humans. For machine tools, processes can be simulated, and the G-code can be verified for correctness. Therefore, defective parts, waste, and thus costs can be reduced. Moreover, the implemented DT can be integrated into the framework of 5G-enabled HMIs (see another preliminary work of the authors [19]).

  • Flexibility and Scalability: Due to the wireless realization of the DT by utilizing 5G communication technology and the possibility for deployment as mobile applications, the architecture enables high flexibility of the manufacturing system. Different machinery or process equipment can be implemented to the DT regardless of their physical location. The resulting scalability is also facilitated by the utilization of the MQTT protocol. This allows the DT to run simultaneously on different devices (computers, tablets, smartphones) independent of the operating system, without issues regarding data integrity and availability. For the machine tool of the implemented DT, this means that it can be moved flexibly within the manufacturing system without connectivity problems and thus functional losses. Moreover, further information can be implemented easily for example by adding 5G-enabled sensors.

  • Transferability: Due to the performance characteristics of 5G, the DT is transferable for different processes. The DT of a CNC machine tool can be seen as a benchmark use case for uRLLC. The required performance characteristics for the communication technology for machine tool control are one of the highest within manufacturing systems [49]. Thus, if 5G shows sufficient performance for the developed DT, 5G also enables real-time monitoring and control of various manufacturing processes. In addition, the adaptability of the communication system enables technology transfer capability towards upcoming communication standards (5G+, 6G, etc.) due to the use of modularized network interfaces.

  • Robustness: The 5G communication standard allows reliable and fast communication. Therefore, even safety-critical processes can be offloaded to the edge server. In addition, MQTT supports the triggering of individual commands (e.g., machine stop) when the connection is interrupted.

  • Cost savings: By offloading computational units wirelessly to the edge server, space savings are realized, and less wiring infrastructure is needed. The implemented setup at our institute leads to around 56.7% less wiring infrastructure. Due to less wiring, cost savings in double-digit euro range are possible [52]. Furthermore, the centrality of the edge server and consequently the central software deployment leads to less maintenance effort and thus costs. Moreover, the prediction and diagnosis functions of the DTs for machine tools leads to cost savings due to less defective parts and less downtimes of the machine tool.

Next to the benefits of the 5G-enabled DT, there exist also challenges during implementation. Reading and manipulating I/Os requires an open CNC unit with appropriate interfaces for external control by third party programs. Currently, no manufacturer of common industrial grade CNC units delivers this capability. Reading and overwriting - especially of safety critical and motion control related I/Os - is not possible. Therefore, LinuxCNC is utilized, which is a very comprehensive CNC software. However, LinuxCNC requires a lot of machine-specific configuration and expertise for implementation.

Another issue could be the centralized MQTT broker connected to the 5G core. When scaling up the publish and subscribe operation (adding more DTs in the manufacturing system), the broker could be overloaded with traffic orchestration.

Another challenge is the complexity of the operation of a private 5G network. As shown in [19], the communication performance depends on different configurable characteristics of the 5G network. If set up correctly, 5G is a good basis for wireless DT but currently the operator needs high expertise for the integration of 5G networks into the CPPS. Furthermore, there are also high costs in the five – to low six-figure range for building, setting up and operating a private 5G network.

5 Summary and Outlook

In this paper an architecture for 5G-enabled DT for prediction, monitoring, and diagnosis is developed. The framework is implemented by developing a 5G-enabled DT of a machine tool. The DT is completely wirelessly migrated to a central high-performance edge server, which is facilitated by 5G campus networks. To simulate and control the machining process in real-time, reliable and low-latency communication is needed. 5G is the wireless communication technology that meets the strict communication requirements for DTs of machine tools and thus has potential for disruptive change of industrial communication.

This work is the first implemented use case of 5G-enabled DTs for bidirectional control of machine tools in manufacturing and extends previous research by the authors regarding this topic. The implementation demonstrates many advantages, e.g., less wiring efforts in manufacturing, centralized maintenance and management, better comprehensibility of complex CPPS as well as high scalability, flexibility and reconfigurability of the DT. In addition, the presented framework provides transferability for further DTs of different assets and expandability of the current implementation. Real-time capable DT of a machine tool can be a benchmark for uRLLC. Therefore, the architecture is suitable for the majority of processes in CPPS.

Currently, the DT of the machine tool is expanded by integrating sensor data of 5G smartphones and 5G-enabled IoT sensors. For this reason, vibration data from the workpiece is captured and machine learning algorithms are utilized for analyzing status and predicting anomalies of the machining process. The sensor data will also be implemented to the monitoring and control mode to enable better anomaly detection and inline process control. Moreover, 5G-enabled mobile HMI are implemented that operates the DT as an edge device. For diagnosis, there is also encoder feedback transferred to the DT via 5G. This enables the detection of anomalies in the machine tool movement.

Regarding performance evaluation of the overall monitoring and control system, different experiments are currently being conducted with different 5G network configurations and traffic load on the network. The end-to-end latencies, jitter and deviation will be measured between DT and CNC unit. Moreover, the benchmark use case will be further defined and evaluated, for example regarding the monitoring accuracy of the DT in comparison to a wired solution or the resulting manufactured part quality with offloaded process control. First, experiments show that the private 5G network at TU Kaiserslautern meets the requirements for monitoring and manual control with latencies below 10 ms (µ = 6.8 ms; σ = 3.6 ms with ~2600 × 44 data points sent) and low jitter (~2.5 ms). The full results with the description of the experimental design will be published in future research.