# A Roadmap to Integrate Digital Twins for Small and Medium-Sized Enterprises
## 2 Methodology
### Communication Framework between Digital Twin and Physical Asset  
In order to investigate the scenario experimentally and to demonstrate how all these technologies work together, the setup was designed in the following manner:  
1. Digitalise the physical asset (i.e., creating a 3D model of the asset of interest)
2. Transform and set-up storage of data
3. Extract data from CPS (i.e., such as I4.0 compatible factory floor machinery)
4. Map the physical asset Input/Output (I/O) data to the 3D model data
5. Display and analyse data in a format usable for managerial decision-making
6. Connect data bi-directionally (i.e., connection data between the physical asset and DT to flow both ways)  
With the aim of covering the aforementioned steps, a communication framework that connects the physical sensors to the database and onto our modelling application was developed, as portrayed in Figure 2.  
First, a DT model of the micro servo was created using applications within the 3 DEx-perience PLM platform to replicate the actions of its physical twin. These applications were  
Figure 2: An experimental communication framework to demonstrate data connectivity between the physical asset and digital twin model. CATIA Part Design, Assembly Design, Mechanical System Design, Functional and Logical Behaviour and Dymola Behaviour Modelling. Part Design was used to model the case, shaft and fan blades. Assembly Design was used to create the engineering connections between these parts. An engineering connection in the Mechanical Systems Design was used to create the kinematics of the assembled parts. A system model that drives the kinematic behaviour of the servo was built with Dymola Behaviour Modelling. This application used Modelica language, which is an object-oriented, equation-based language used to model the individual components of electrical circuit, dynamics and kinematics of the servo motor. An example of Modelica modelling can be seen in Figure 3.  
Modelica Editor, a function of Dymola, was used to build a customised block that read input variables and wrote present model state to different text files to be used at a later stage. The custom input block can be seen in Figure 4. Functional and Logical Design was then used to design a low-level system model, i.e., more specific to individual components of a systematic operation, of the servo by creating a flow between each Dymola block from the input source to electrical circuit to kinematics. Figure 4: Coded Modelica block for parameter reading and writing. Figure 3: Example of Modelica language modelling. XAMPP is a multiplatform package that contains MySQL among other server solution; however, the scope of this article was limited to MySQL. After XAMPP was installed on the middleware computer, Apache and MySQL were activated in the XAMPP control panel. In our experiment, two different users were created, one with read only rights for Grafana and another to write and read for Node-Red and 3 DExperience. A database named \"digitaltwin\" was created with three columns. The first was an incremental integer named \"ID\" for tracking the number of readings. The second was for the time stamp to record the date and time of the specific reading listed under \"time\". The third column was a double data type for recording the temperature under the heading \"T1\". A sample of readings can be seen in Figure 5. A similar table named \"servomodel\" was created within the same database \"digitaltwin\" for storing the DT's state. However, the third column was a VarChar data type named \"State\" which records a \"STATIONARY\" or \"RUNNING\" depending on whether the servo model is stationary or rotating, respectively. The sensor, PLC and micro servo were wired together followed by the software and coding setup. Figure 6 shows the physical setup of the RTD sensor, WAGO PLC and DF9 GMS micro servo. A breadboard with resistors in series was wired to step down the voltage from 24 V to 5 V. The PLC itself was connected via ethernet to the middleware.