Implementation of Digital Twin-based Virtual Commissioning in Machine Tool Manufacturing

Virtual commissioning is not a new concept; However, it is all the rage with the introduction of Industry 4.0, in the field of product lifecycle management, computer-aided design (CAD), computer-aided manufacturing (CAM), and within the industrial automation programming frameworks. Although, this is a very active area of research and innovation, these technologies have little implementation in the machine tool industry [11]. There is still no integrated simulation environment for virtual commissioning in the market. In this context, digitalisation is a key driver. The aim of this paper is to describe the practice of virtual commissioning in the machine tool manufacturing industry by identifying available solutions in the market and addressing the challenges faced within the machine tool sector. As a result, a digital twin based virtual commissioning solution has been developed at Danobatgroup, the leading machine tool builder in Spain, which is a step forward towards the digitalisation of machine tool manufacturing. © 2021 The Authors. Published by ELSEVIER B.V. This is an open access article under the CC BY-NC-ND license (https://creativecommons.org/licenses/by-nc-nd/4.0) Peer-review under responsibility of the scientific committee of the International Conference on Industry 4.0 and Smart Manufacturing


Introduction
Virtual commissioning has been a subject of study for the past two decades [8]. Described simply, it is the practice of using simulation technology to test system behavior with a virtual machine model before connecting it to the real system. The most extended definition refers to the real controller of the production plant and the simulated model [12], [9]. Virtual commissioning requires the cooperation of different engineering disciplines throughout the

Introduction
Virtual commissioning has been a subject of study for the past two decades [8]. Described simply, it is the practice of using simulation technology to test system behavior with a virtual machine model before connecting it to the real system. The most extended definition refers to the real controller of the production plant and the simulated model [12], [9]. Virtual commissioning requires the cooperation of different engineering disciplines throughout the production process to decrease ramp up and commissioning time and prevent time delays and commissioning problems [4].
The simulation technology currently used in digital manufacturing develops system engineering in parallel to the concept design. Consequently, verification of the manufacturing system is carried out in early design phases [4]. Thus, failures and discrepancies can be detected early, reducing the error rate, time delays and costs.
However, currently no holistic simulation tool exists, in which different simulation domains (kinematics, dynamic, logic) and the numeric controller are integrated in a single and unified platform. Companies are therefore reluctant to invest in simulation technologies for virtual commissioning, arguing that efforts to generate simulation models are not justified in terms of Return on Investment (ROI). This has become a major barrier to the establishment and adoption of virtual commissioning strategies and the advancement of digital manufacturing and Industry 4.0.
This paper describes the implementation of digital twin-based virtual commissioning in the machine tool manufacturing sector, in a company called Danobatgroup in the Basque Country, Northern Spain. This use case outlines the step taken towards digitalisation and highlights the challenges that were overcome during its realisation.

Definitions and concept clarification
This section defines the concepts relevant to the study that are closely related to each other, such as simulation, emulation, virtualisation, digital twin, and virtual commissioning. As these concepts represent a physical asset in a virtual environment, it is important that the terms be clarified.

Simulation
Simulation is defined as "the process of designing a model of a real system and conducting experiments with this model" [22]. A simulation model describes the real system behavior and facilitates evaluation of the methodology, design, development, verification, and validation for the operation of the system [22], [24]. It is mostly used to represent operations over time and to show the eventual effects of alternative conditions of actions.

Emulation
Emulation is the process of mimicking the behavior of the target system with the purpose of replacing it [7]. Emulation models test the operation of the control system under different system conditions. Most control systems are designed to operate in real time, and for this reason emulation is also intended to be executed in real time [17]. Although it has become common to use the word "emulate" in the context of software, following the most purist definition, "emulation" involves hardware, while "simulation" refers to pure software.

Virtualisation
Virtualisation is the process of creating software based or virtual version of a physical asset. Virtualisation in manufacturing is a key process for developing cyber physical production systems [3]. A virtualised version of a physical manufacturing asset encapsulates its physical capabilities, static data and dynamic data obtained from its internal and external environment [1], [16]. This is achieved by the abstraction of machine characteristics, properties, relationships and capabilities with ontology based models [14], [16]. From the perspective of the present paper, a virtualised machine tool must contain, at least, a description of its mechanics and its controller (the Programmable Logic Controller and the Computer Numerical Control system).

Digital Twin
The concept of digital twin was first presented by Grieves in 2003 as a conceptual model underlying product lifecycle management [6]. However, the term digital twin was coined by NASA in 2010 [21] and defined as "A digital twin is an integrated multi-physics, multi-scale, probabilistic simulation of a vehicle or system that uses the best available physical models, sensor updates, fleet history, etc., to mirror the life of its flying twin." The concept of the digital twin has been continuously evolving over the years and there exist a wide range of definitions. In the present study the digital twin is understood as the virtual representation of a physical asset where both counterparts are connected to each other and are dynamically updated throughout the whole life cycle, as described by [15] and [18]. A digital twin could also be considered a virtual representation of any asset definition such as product, human, process, performance, etc. [15]. Most authors agree that a digital twin is composed of three parts: the physical product, the digital/virtual product, and the connections between the two products.

Virtual Commissioning
Virtual commissioning is the practice of using virtualisation and simulation technologies that represent the physical system and/or controller of a virtual environment to validate the behavior of the automated manufacturing system. In the machine tool industry, it performs a series of collaborative verification tasks between different disciplines such as mechanical, electrical, automation, application, and process engineering among others [19].
The ultimate goal of using virtual commissioning for a machine tool builder is to perform several partial validations of machine concept design and engineering in a virtual environment, minimizing errors and improving failure detection during final integration and setup.

Virtual Commissioning Overview
There is general agreement in the literature that a machine is composed of a mechanical part and a controller. On this basis, some authors propose four possible alternatives to address machine commissioning, combining real and virtual counterparts of the mechanical system, electronics, and control [13], as illustrated in Fig. 1. In the first scenario, in which everything is real, there is no way to perform any verification until all hardware is in place, connected, and fully installed. Hardware-in-the-loop (HIL) systems then emerged as an alternative approach to reduce time delays and develop solutions to setbacks that could occur before the final commissioning phase [10]. HIL replaces the mechanical system with a model that emulates the physical behavior of the real mechanical system. The real controller is composed of a computer numerical controller (CNC) and programmable logic controller (PLC), and is used to control the virtual mechanical system. The main objective is to replace the mechanical system with its virtual version, making it available before the real mechanical system is completed. The third alternative, Reality-in-the-loop (RIL) uses the real mechanical system and replaces the controller with a simulated control system [2]. Lastly, Software in-the-loop (SIL) can be accomplished with a virtual control system and a virtual mechanical system. In this case, the whole system, including sensors, actuators, and the process, are virtual. The latter three techniques (HIL, RIL and SIL) enable verification prior to the final commissioning, and hence reduce overall time delays and costs.
The present study focusses on the implementation of virtual commissioning with HIL and SIL techniques. Both techniques are used to develop and test complex systems, however the main difference lies in the possible hardware implementations when using traditional or modern PLC/CNC controllers.
Traditionally, in HIL configurations, the controller software runs on the real controller, whereas the mechanical system model runs on a separate emulator as depicted in Fig. 2 (a). In modern controllers, HIL configurations can also be accomplished by running the controller software and the mechanical system model on the same hardware ( Fig. 2 (b)). Tests conducted by these two possible configurations are executed in real time, so that engineers can run tests and debugging procedures, just as they would in real life.
Virtual commissioning is currently moving towards the vast opportunities offered by a new generation of controllers which deliver enhanced simulation solutions. Such solutions can simulate both, the mechanical model, and the controller, in an integrated platform (see Fig. 3).

Digital twin-based Virtual Commissioning
The introduction of Industry 4.0 has generated new technologies that can be exploited to further boost the digitalisation of commissioning practices.
The digital twin technology dynamically synchronises the virtual model with its physical entities. In this way, it addresses the problem of inconsistency between models that exist in conventional virtual commissioning practices, which can reduce time and effort spent during commissioning [23]. S. Xueming et al. [25] introduced a digital twindriven approach for assembly commissioning to improve the quality and efficiency of assembly. The introduction of the digital twin technology considerably improved efficiency by reducing the assembly time to 37.5% of the conventional assembly method. Assembly quality was also found to be greatly enhanced. In another study, M. Schamp et al. [20] tested a small scale deployment of digital twin-based virtual commissioning, and the results indicated a 75% reduction in debugging time, and a 31% improvement in quality.
In the machine tool industry, W. Shen et al. [23] presented a conceptual digital twin-based virtual commissioning practice for CNC machine tools. This methodology provides a unified model through different engineering modules and a mapping strategy [23]. To date, virtual commissioning practices have been developed by coupling different models, such as automation, electronic, and kinematic models. For instance, P. Janda [11] developed a HIL solution building the digital twin of a heavy machine tool with a Siemens NX 3D mechatronic model, Simit communication bridge and Sinumerik 840D control system. On the other hand, E.A. Montero [5] developed a SIL solution using Siemens NX MCD, Simit, PLCSim advanced, and TIA Portal automation solution. Table 1 sets out some of existing virtual commissioning tools in the market, and details the technical strengths of the products offered by leading virtual commissioning solution providers.  [26] Cells, Robotic cells -Precise virtual production system -Simulates and optimises manufacturing assets with the production planning ISG Virtuos [29] Machinery -Real time control (<1ms) -Operations with controllers and field buses Simumatik 3D [30] Education, Training -Open Emulation Platform -Server-client architecture -Compatible with different PLCs -Ideal for education but also suitable for professionals Emulate3D [27] Automated material handling systems While there exists a large market of virtualisation solutions for PLCs, there is little regarding the virtualisation of CNCs, and this becomes more complicated when virtualising multiple CNCs. Machine tool manufacturers are characterised by their capability to develop and integrate Human Machine Interfaces, conversational part programming software, and smart components into their machining solutions. These machines, cells, and production lines often require more than one CNC/PLC to perform different machining activities, and thus a broad set of protocols and programming environments should be considered. The main requirements that a virtual commissioning tool must meet to respond to the machining industry needs are therefore outlined below: • R1: Simulation platform that includes virtualisation solutions for multiple CNC controllers. • R2: Simulation platform for concept design (mechanical 3D models, automation, and control) • R3: Holistic platform that integrates all simulation models (mechanical, automation, control, etc.) into a single environment or hardware, thereby enabling collaborative machine tool commissioning.
The compliance requirements of the tools highlighted above is presented in Table 2. As the table shows, the recently launched Siemens SINUMERIK ONE is the only integrated simulation solution that complies with all requirements. This solution is however limited to Siemens products, which is vendor specific. This is a major drawback as the solution does not allow to integrate components from different manufacturers.
The present paper therefore, presents a digital twin-based virtual commissioning setup that addresses these challenges and integrates multi-vendor equipment, CAMs and virtualisation tools into a single and unified platform. This solution is further described in Section 5.

Digital twin-based virtual commissioning solution of machining systems
The digital twin-based virtual commissioning has been built up to address the aforementioned requirements and respond to the market needs. To date, there is no vendor agnostic holistic solution in the market, there only exists individual vendor specific solutions. The major challenge is the integration of a broad set of vendor specific controllers and simulation technologies into a single platform. As such, the physical layer of Danobatgroup machining solutions offers process specific (i.e. milling, drilling, turning) and multi process machining tools, with a broad set of controllers from different vendors (i.e. Siemens, Heidenhain, ABB). The proposal comprises of a four-layer architecture framework, including a multi-vendor and multi-controller physical layer, and interoperable middleware, a multi-vendor cyber layer and the application layer, as described in Fig. 4. The physical layer describes two use cases for different commercial automation level machining solutions: 1-Machine level: an individual machine tool that comprises a single CNC, PLC and robot controller, and a mechanical system. The cyber layer includes the digital twin of the physical machining tools, formed by virtual vendor specific controllers and a virtual mechanical system.

Mechanical
As regards the communication interface, interoperability between all these simulation tools and physical assets is vital. However, to date there is no interoperable virtualisation tool in the market. This is a critical issue to be resolved in the machining sector. A modular and interoperable gateway (SAVVY [28]) was therefore set up as middleware, which authorizes communication between the physical and cyber layers. The SAVVY gateway facilitates information exchange through a large number of fieldbus communication protocols and modules using open standardised protocols, such as OPC UA (IIoT communication) and REST API (IoT communication).
Finally, the cloud platform storages machine data retrieved from the SAVVY gateway for further data analysis and monitoring services.

Machine level use case
The Danobatgroup FMT multitasking milling turning centre was used at the machine level. The FMT manufactures complex components by running multiple operations in a single setup. It is composed of a configurable working area and a robotic tool magazine installed in a separate enclosed area, as depicted in Fig.5. The FMT multitasking centre is composed of various controllers (Heidenhain CNC, Heidenhain PLC, ABB robot controller), the mechanical system of the working area, and the robotic tool magazine. The cyber layer therefore integrates a virtual CNC, a virtual PLC, a virtual robot controller, and a 3D simulation model, that together comprise the digital twin of the whole FMT multitasking centre. The virtual CNC/PLC used in the solution is Heidenhain iTNC640, which has its own communication protocol. An OPC UA Server was therefore created on top of the LSV II to publish and exchange data. The robot controller was developed on ABB Robotstudio, which supports OPC UA communication. Finally, to simulate the mechanical model (physical and kinematic model), Siemens NX Mechatronics Concept Designer was selected.

Cell/Production line level use case
A simplified version of the production line was used as the second use case. The simplified production line is composed of a CNC grinding machine, a gantry and its CNC controller that manages the material flow. Accordingly, the virtual layer consists of two virtual controllers developed in Sinutrain (Siemens), two PLC virtual controllers (Siemens PLCSIM Adavanced) and the 3D simulation model of the production cell in Siemens NX MCD. These virtualisation tools were setup in the same environment (see Fig.6) to simulate the whole system in a unified platform. OPC UA was used to solve the interoperability issues and data was exchanged with the use of SAVVY gateway.

Working area Robotic tool magazine
The presented digital twin-based architecture provides a holistic simulation environment where PLCs and CNC are jointly simulated with the 3D models in a collaborative environment between different engineering disciplines. This effectively fulfills all requirements defined in Section 4: • R1: an OPC UA interface was used in SAVVY Gateway, completing a fully functional machine tool simulator capable of virtualizing multiple CNC controllers (cell/production level). This proposed solution solves the interoperability issues between these diverse and independent tools and models. In addition, the following steps were taken to create the partial models of the presented two use cases: • Detailed mechanical design: ○ The 3D models of the machines were exported from CREO to Siemens NX. ○ Description of the basic physics of the mechanical model was completed by adding the information of the rigid bodies (position, orientation, mass, inertia), and the collision bodies (shape, center point, category, dimension) ○ The kinematic chain and behavior of the machine axles were added into the model. ○ Description of kinematics by defining links and joints, and restricting the motion of the bodies. ○ Linking the mechanical model and the axles defined in the virtual control system (PLC/CNC).
• Automation model: backups of the real controllers were uploaded to the simulation engines. However, some of the physical elements were decoupled as they had no meaningful information for simulation. • Numerical control model and CNC programs: backups of the standard CNC configurations were uploaded to the CNC simulation engines. • Robot controller: a trajectory, quaternions (q1, q2, q3, q4) and robot axis positions (in degrees) were specified in the virtual controller. A backup of the end effector (.step file) used in Siemens NX was also imported into the virtual station. Finally, OPC UA communication was established to send the trajectory coordinates from the virtual controller to Siemens NX simulation tool. • Application layer: The data cloud platform was configured to setup a visualisation interface of the interested machine tools for further monitoring purposes. The presented digital twin-based architecture also addresses the uncertainties and inaccuracies that arise between the models as it converges real data generated by the manufacturing systems with synthetic data generated by their digital replicas. This ensures a robust simulation environment for virtual commissioning, without disrupting the existing production system.

Discussion
One of the main challenges of the traditional machine tool manufacturing process is the dependency of each step on the previous one (design, planning, engineering, assembly, commissioning). An unexpected error in any step in the process can cause serious problems, as the whole process is delayed. Commissioning at the end of the development process is hence error prone as the system is not tested until everything is fully installed. This significantly impacts in cost and time. The inclusion of virtual commissioning is therefore essential as all functionalities can be tested at earlier stages of the development process.
Nevertheless, applying virtual commissioning only in the latter stages of the development is still a common mistake. The results of the test case presented in this study would indicate that the use of digital twin-based virtual commissioning can usher in a new era in machine tool manufacturing. Integrating the whole development process, including mechanical design, electrical planning, and automation in a unique simulation platform delivers: • Less time to market as integration permits partial validations in parallel.
• Saving in development costs as errors can be detected at a much earlier stage of the manufacturing process.
• Minimising control risks since the use of simulation allows greater planning security.
To be competitive, new tools and techniques should be further investigated to shorten time to market. This also requires methods to facilitate the early detection of machine defects, malfunctioning and mistakes in machine concept design. Early fault detection can prevent corrections in the commissioning stage by saving engineering time, material, and hence reducing costs. However, collaboration among different engineering disciplines is required when testing the system. This is most of the time challenging as each engineering discipline has been working in silos to date.
Unfortunately, machine tool builders are encountering a number of barriers when implementing virtual commissioning. For successful implementation, the following challenges need to be overcome: • Dealing with different communication protocols and programming environments.
• Time and effort to design models that are no longer reusable after the commissioning stage.
• Difficulty in quantifying the return on investment (ROI).
• High cost of licenses and related services.
• Lack of collaboration and synchronization between different engineering disciplines.

Conclusions
This paper presents a digital twin-based virtual commissioning architecture to respond to the machine tool manufacturing needs. It presents a holistic and unified platform with the capability of emulating multiple CNC controllers in real time, an open issue that existing simulation and emulation tools have not resolved yet. Furthermore, a modular and interoperable gateway is used to enable communication among vendor specific controllers and simulations models. This is enabled with the open standardised interface OPC UA, and REST API is used to communicate with the application layer. Finally, the architecture is validated with two industrial case studies at Danobatgroup, addressing virtual commissioning of machining solutions at machine level and cell/production line. The major outcome has been facilitating the integration of a broad set of simulation tools and peripherals in a single holistic platform. The implemented solution justifies the ROI in today's machine tool sector, enabling virtual commissioning of vendor independent machining solutions, and in return, reducing errors and shortening time to market.