# Programming of Industrial Robots Using Virtual Reality and Digital Twins
## 3 Example of Using the Programming Method
### Solution to the Problem  
The programming of a robot to perform the mould cleaning process is part of a larger task also including the construction of the station, the schematic diagram of which is shown in Figure 4. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Translational Accuracy** & \begin{tabular}{c} **Translational Accuracy** \\ **Based on Hand** \\ **Controllers** \\ \end{tabular} & \
\begin{tabular}{c} **Rotational Accuracy** \\ **Based on Goggles** \\ \end{tabular} &
\begin{tabular}{c} **Rotational Accuracy** \\ **Based on Hand** \\ **Controllers** \\ \end{tabular} \\ \hline \hline
1.66 \(\pm\) 0.74 mm & 4.36 \(\pm\) 2.91 mm & 0.34 \(\pm\) 0.38 deg & 1.13 \(\pm\) 1.23 deg \\ \hline \hline \end{tabular}  
Such system parameters are sufficient for the analyzed task.  
\end{table} 
Table 1: Oculus Rift system parameters. Figure 3: Integral steering apparatus. The individual stages of this task are as follows:  
1. Design and implementation of a robotic station with its digital twin. The station consists of an industrial, six-axis robot with a load capacity of 80 kg, compressed warm air supply system, washing liquid supply system, water and dirt suction system, drying chamber, loading and receiving station and auxiliary devices such as fencing and a safety system (Figure 5). 2. Making a digital twin casting bowl and a ceramic casting mould combined with it (Figure 1b) based on existing real objects (Figure 1a). 3. Design and implementation of a device for grasping the casting bowl together with a digital twin. The precision instrument for the robot to grasp the casting bowl is equipped with connections for supplying washing liquid and drying air and connection for extracting washing liquid, air, and dirt (Figure 6). 4. Configuration of the virtual environment consisting in placing digital twins of all of the elements in RobotStudio (Version 6.08, ABB Asea Brown Boveri Ltd., Zurych, Switzerland, 2019). 5. Connection of the VR system with RobotStudio. 6. Placing a human in the virtual environment via the VR system interface. 7. Data acquisition during virtual cleaning of the mould, which consists in the human performing typical movements of actual mould coupled with virtual mould with simultaneous tracking of movements by a sensory system integrated with VR. 8. Programming a robotic station in offline mode to perform the process of cleaning casting moulds based on the collected data. 9. Tests of the mould cleaning process. Figure 4: Schematic diagram of the building and programming of a robotic station using a VR (Virtual Reality) system. Figure 5 shows a view of a digital twin of a robotic station. The flow of information regarding the position and orientation of the bowl with the mould is shown in Figure 7.  
Figure 5: Digital twin of a robotic station: 1—Robot, 2—Drying chamber, 3—Compressor, 4—Suction device, 5—Heating ultrathemostat, 6—Loading and receiving station, 7—Safety elements. Figure 6: Device for grasping the casting bowl. Figure 7: Flow of information regarding the position and orientation of the bowl with the mould. The subsequent robot targets, consisting of position and orientation and collected during virtual cleaning are included in a program generated by RobotStudio software. The program code for the programmed task is attached in Supplementary Materials (Text file S3: Program Code). The robot targets are presented in Figure 8 in the form of square markers. They are not evenly distributed in time, their average sampling time is 0.1333 s. The robot's position and orientation coordinates (Figure 8) have been generated in virtual environment based on robot targets. These coordinates are marked with solid lines in Figure 8. Additionally, the joint coordinates corresponding to the coordinates of the position and orientation of the robot end-effector are shown in Figure 9. Coordinates presented in Figures 8 and 9 are calculated with taking into account dynamical properties of robot and they correspond to real performance in the assumed operating conditions.