# A Five-Step Approach to Planning Data-Driven Digital Twins for Discrete Manufacturing Systems
## 4 Results and Discussion
### Step 5  
During each process, the values of the process parameters are collected and stored. Each of the three workstations and WBPFP is equipped with a separate controller (Raspberry Pi 3B+, manufactured by Sony UK Technology Centre, Pencoed, UK, with Raspbian GNU/Linux 9.6, manufactured by Raspberry Pi Foundation, Cambridge, UK) which enables a distributed control structure. Controllers are connected to the sensors in its vicinity (i.e., inductive sensors near the specific workstation, RFID reader at the specific workstation/WBPFP, machine vision system connected to the controller of workstation 3). Therefore, local data storage and analysis as well as local decision-making and control is enabled. Data is stored in a local SQLite database, data analysis and local decision-making is performed by a decision algorithm that was programmed in Python (v3.7). Controllers communicate bi-directionally through an Ethernet based network. We used the OPC UA communication protocol to transfer data between the controllers. Specifically, this means that each of the controllers is also equipped with a server and a client, which were also programmed in Python.  
The SCADA software we used in our work (myPRO software package from mySCADA Technologies), installed on the PC with simulation software (Siemens Tecnomatix Plant Simulation) that acts as a digital twin, allows establishing an OPC UA connection with the servers of each of the controllers. This means that the data in the SCADA system is aggregated directly from the process. The visualization display can be accessed from various devices (mobile phones, tablets, computer screens).  
Results are displayed for two participants, an operator and a planner. The operator has four touch screens on which the state of the assembly system can be checked (Figure 18).  
Figure 17: The digital twin of the Demo Center Smart Factory.  
The visualization shows data from sensors in the real manufacturing system combined with data coming from a digital twin. Figure 18a shows the current machine vision process. The green lights illustrate the correct operation of the device, and red lights appear in case of a malfunction. The display shows the start time, the end time and the information about the correctness of the product; there are two states: \"Product is OK\" or \"Product is NOK\". The green lights in Figure 18b,c show the same information as described in Figure 18a. Figure 18d shows the state of the WBPFF. The green rectangles show the position of the finished products in the second row of the WBPFF. Using the digital twin, the operator can check the number of tiles, base parts, and finished products in the buffers or in the warehouse and determine the optimal loading/unloading time.  
The planner can use the digital twin to improve the working process by creating a suboptimal manufacturing plan using the FI algorithm. The case study shows what the optimal manufacturing plan looks like for each scenario (as a function of time and the number of parts in the WBPFP and buffers). It allows the planner to quickly adjust the manufacturing plan before starting to manufacture the products in a real system. Another benefit of using the digital twin for the planner is the simulation of different \"what if\" scenarios. This means that in a virtual environment, the planner can check the feasibility of orders on a schedule, create a Gantt chart, check for bottlenecks, order parts to assemble a product at the right time, and more. In this way, the assembly process is better organized, time losses are reduced, and the supply of products is better determined.